diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2f88dbac --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +**/*.rs.bk +Cargo.lock \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..b4951e99 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "miniquad" +version = "0.1.0" +authors = ["not-fl3 "] +edition = "2018" + +[dependencies] +sokol_app_sys = { path = "./sokol-app-sys" } + diff --git a/examples/quad.rs b/examples/quad.rs new file mode 100644 index 00000000..083c33b9 --- /dev/null +++ b/examples/quad.rs @@ -0,0 +1,131 @@ +use miniquad::*; + +#[repr(C)] +struct Vec2 { + x: f32, + y: f32, +} +#[repr(C)] +struct Vertex { + pos: Vec2, + uv: Vec2, +} + +struct Stage { + pipeline: Pipeline, + bindings: Bindings, +} + +impl Stage { + pub fn new(ctx: &mut Context) -> Stage { + #[rustfmt::skip] + let vertices: [Vertex; 4] = [ + Vertex { pos : Vec2 { x: -0.5, y: -0.5 }, uv: Vec2 { x: 0., y: 0. } }, + Vertex { pos : Vec2 { x: 0.5, y: -0.5 }, uv: Vec2 { x: 1., y: 0. } }, + Vertex { pos : Vec2 { x: 0.5, y: 0.5 }, uv: Vec2 { x: 1., y: 1. } }, + Vertex { pos : Vec2 { x: -0.5, y: 0.5 }, uv: Vec2 { x: 0., y: 1. } }, + ]; + let vertex_buffer = + unsafe { Buffer::new(ctx, BufferType::VertexBuffer, Usage::Immutable, &vertices) }; + + let indices: [u16; 6] = [0, 1, 2, 0, 2, 3]; + let index_buffer = + unsafe { Buffer::new(ctx, BufferType::IndexBuffer, Usage::Immutable, &indices) }; + + let pixels: [u8; 4 * 4 * 4] = [ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + ]; + let texture = Texture::from_rgba8(4, 4, &pixels); + + let bindings = Bindings { + vertex_buffer: vertex_buffer, + index_buffer: index_buffer, + images: vec![texture], + }; + + let shader = Shader::new(ctx, shader::VERTEX, shader::FRAGMENT, shader::META); + + let pipeline = Pipeline::new( + ctx, + VertexLayout::new(&[ + (VertexAttribute::Custom("pos"), VertexFormat::Float2), + (VertexAttribute::Custom("uv"), VertexFormat::Float2), + ]), + shader, + ); + + Stage { pipeline, bindings } + } +} + +impl EventHandler for Stage { + fn update(&mut self, _ctx: &mut Context) {} + + fn draw(&mut self, ctx: &mut Context) { + let t = date::now(); + + ctx.begin_render_pass(); + + ctx.apply_pipeline(&self.pipeline); + ctx.apply_bindings(&self.bindings); + for i in 0..10 { + let t = t + i as f64 * 0.3; + + unsafe { + ctx.apply_uniforms(&shader::Uniforms { + offset: (t.sin() as f32 * 0.5, (t * 3.).cos() as f32 * 0.5), + }); + } + ctx.draw(6); + } + ctx.end_render_pass(); + + ctx.commit_frame(); + } +} + +fn main() { + miniquad::start(conf::Conf::default(), |ctx| Box::new(Stage::new(ctx))); +} + +mod shader { + use miniquad::*; + + pub const VERTEX: &str = r#"#version 100 + attribute vec2 pos; + attribute vec2 uv; + + uniform vec2 offset; + + varying lowp vec2 texcoord; + + void main() { + gl_Position = vec4(pos + offset, 0, 1); + texcoord = uv; + }"#; + + pub const FRAGMENT: &str = r#"#version 100 + varying lowp vec2 texcoord; + + uniform sampler2D tex; + + void main() { + gl_FragColor = texture2D(tex, texcoord); + }"#; + + pub const META: ShaderMeta = ShaderMeta { + images: &["tex"], + uniforms: UniformBlockLayout { + uniforms: &[("offset", UniformType::Float2)], + }, + }; + + #[repr(C)] + pub struct Uniforms { + pub offset: (f32, f32), + } +} diff --git a/examples/window.rs b/examples/window.rs new file mode 100644 index 00000000..2a028d9d --- /dev/null +++ b/examples/window.rs @@ -0,0 +1,12 @@ +use miniquad::*; + +struct Stage; +impl EventHandler for Stage { + fn update(&mut self, _ctx: &mut Context) {} + + fn draw(&mut self, _ctx: &mut Context) {} +} + +fn main() { + miniquad::start(conf::Conf::default(), |_| Box::new(Stage)); +} diff --git a/js/gl.js b/js/gl.js new file mode 100644 index 00000000..d7087a85 --- /dev/null +++ b/js/gl.js @@ -0,0 +1,517 @@ +// load wasm module and link with gl functions +// +// this file was made by tons of hacks from emscripten's parseTools and library_webgl +// https://github.com/emscripten-core/emscripten/blob/incoming/src/parseTools.js +// https://github.com/emscripten-core/emscripten/blob/incoming/src/library_webgl.js +// +// TODO: split to gl.js and loader.js + +const canvas = document.querySelector("#glcanvas"); +const gl = canvas.getContext("webgl2"); +if (gl === null) { + alert("Unable to initialize WebGL. Your browser or machine may not support it."); +} + +function getArray(ptr, arr, n) { + return new arr(memory.buffer, ptr, n); +} + +function UTF8ToString(ptr, len) { + let mem = new Uint8Array(memory.buffer); + string = ''; + if (len == undefined) { + while (true) { + let next = mem[ptr]; + if (next == undefined) { + console.log("is it assert in js style?"); + return; + } + if (next == 0) { + break + }; + string += String.fromCharCode(next); + ptr++; + } + } else { + for (let i = 0; i < len; i++) { + string += String.fromCharCode(mem[ptr + i]); + } + } + return string; +} +var GL = { + counter: 1, + buffers: [], + mappedBuffers: {}, + programs: [], + framebuffers: [], + renderbuffers: [], + textures: [], + uniforms: [], + shaders: [], + vaos: [], + contexts: {}, + programInfos: {}, + + getNewId: function (table) { + var ret = GL.counter++; + for (var i = table.length; i < ret; i++) { + table[i] = null; + } + return ret; + }, + + validateGLObjectID: function (objectHandleArray, objectID, callerFunctionName, objectReadableType) { + if (objectID != 0) { + if (objectHandleArray[objectID] === null) { + console.error(callerFunctionName + ' called with an already deleted ' + objectReadableType + ' ID ' + objectID + '!'); + } else if (!objectHandleArray[objectID]) { + console.error(callerFunctionName + ' called with an invalid ' + objectReadableType + ' ID ' + objectID + '!'); + } + } + }, + + getSource: function (shader, count, string, length) { + var source = ''; + for (var i = 0; i < count; ++i) { + var len = length == 0 ? undefined : getArray(length + i * 4, Uint32Array, 1)[0]; + source += UTF8ToString(getArray(string + i * 4, Uint32Array, 1)[0], len); + } + return source; + }, + populateUniformTable: function (program) { + GL.validateGLObjectID(GL.programs, program, 'populateUniformTable', 'program'); + var p = GL.programs[program]; + var ptable = GL.programInfos[program] = { + uniforms: {}, + maxUniformLength: 0, // This is eagerly computed below, since we already enumerate all uniforms anyway. + maxAttributeLength: -1, // This is lazily computed and cached, computed when/if first asked, "-1" meaning not computed yet. + maxUniformBlockNameLength: -1 // Lazily computed as well + }; + + var utable = ptable.uniforms; + // A program's uniform table maps the string name of an uniform to an integer location of that uniform. + // The global GL.uniforms map maps integer locations to WebGLUniformLocations. + var numUniforms = gl.getProgramParameter(p, 0x8B86/*GL_ACTIVE_UNIFORMS*/); + for (var i = 0; i < numUniforms; ++i) { + var u = gl.getActiveUniform(p, i); + + var name = u.name; + ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length + 1); + + // If we are dealing with an array, e.g. vec4 foo[3], strip off the array index part to canonicalize that "foo", "foo[]", + // and "foo[0]" will mean the same. Loop below will populate foo[1] and foo[2]. + if (name.slice(-1) == ']') { + name = name.slice(0, name.lastIndexOf('[')); + } + + // Optimize memory usage slightly: If we have an array of uniforms, e.g. 'vec3 colors[3];', then + // only store the string 'colors' in utable, and 'colors[0]', 'colors[1]' and 'colors[2]' will be parsed as 'colors'+i. + // Note that for the GL.uniforms table, we still need to fetch the all WebGLUniformLocations for all the indices. + var loc = gl.getUniformLocation(p, name); + if (loc) { + var id = GL.getNewId(GL.uniforms); + utable[name] = [u.size, id]; + GL.uniforms[id] = loc; + + for (var j = 1; j < u.size; ++j) { + var n = name + '[' + j + ']'; + loc = gl.getUniformLocation(p, n); + id = GL.getNewId(GL.uniforms); + + GL.uniforms[id] = loc; + } + } + } + } +} + +_glGenObject = function (n, buffers, createFunction, objectTable, functionName) { + for (var i = 0; i < n; i++) { + var buffer = gl[createFunction](); + var id = buffer && GL.getNewId(objectTable); + if (buffer) { + buffer.name = id; + objectTable[id] = buffer; + } else { + console.error("GL_INVALID_OPERATION"); + GL.recordError(0x0502 /* GL_INVALID_OPERATION */); + + alert('GL_INVALID_OPERATION in ' + functionName + ': GLctx.' + createFunction + ' returned null - most likely GL context is lost!'); + } + getArray(buffers + i * 4, Int32Array, 1)[0] = id; + } +} + + +var Module; +var wasm_exports; + + +function resize(canvas, on_resize) { + var displayWidth = canvas.clientWidth; + var displayHeight = canvas.clientHeight; + + if (canvas.width != displayWidth || + canvas.height != displayHeight) { + canvas.width = displayWidth; + canvas.height = displayHeight; + if (on_resize != undefined) + on_resize(Math.floor(displayWidth), Math.floor(displayHeight)) + } +} + +animation = function () { + resize(canvas, function (w, h) { wasm_exports.resize(w, h); }); + + wasm_exports.frame(); + window.requestAnimationFrame(animation); +} + +var emscripten_shaders_hack = false; +var start; +var importObject = { + env: { + test_log: function (ptr) { + console.log(UTF8ToString(ptr)); + }, + set_emscripten_shader_hack: function (flag) { + emscripten_shaders_hack = flag; + }, + rand: function () { + return Math.floor(Math.random() * 2147483647); + }, + time: function () { + return (Date.now() - start) / 1000.0; + }, + canvas_width: function () { + return Math.floor(canvas.width); + }, + canvas_height: function () { + return Math.floor(canvas.height); + }, + glClearDepthf: function (depth) { + gl.clearDepth(depth); + }, + glClearColor: function (r, g, b, a) { + gl.clearColor(r, g, b, a); + }, + glClear: function (mask) { + gl.clear(mask); + }, + glGenTextures: function (n, textures) { + _glGenObject(n, textures, "createTexture", GL.textures, "glGenTextures") + }, + glActiveTexture: function (texture) { + gl.activeTexture(texture) + }, + glBindTexture: function (target, texture) { + GL.validateGLObjectID(GL.textures, texture, 'glBindTexture', 'texture'); + gl.bindTexture(target, GL.textures[texture]); + }, + glTexImage2D: function (target, level, internalFormat, width, height, border, format, type, pixels) { + gl.texImage2D(target, level, internalFormat, width, height, border, format, type, + getArray(pixels, Uint8Array, width * height * 4)); + }, + glTexParameteri: function (target, pname, param) { + gl.texParameteri(target, pname, param); + }, + glUniform1fv: function (location, count, value) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniform1fv', 'location'); + console.assert((value & 3) == 0, 'Pointer to float data passed to glUniform1fv must be aligned to four bytes!'); + var view = getArray(value, Float32Array, 1); + gl.uniform1fv(GL.uniforms[location], view); + }, + glUniform2fv: function (location, count, value) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniform2fv', 'location'); + console.assert((value & 3) == 0, 'Pointer to float data passed to glUniform2fv must be aligned to four bytes!'); + var view = getArray(value, Float32Array, 2); + gl.uniform2fv(GL.uniforms[location], view); + }, + glUniform3fv: function (location, count, value) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniform3fv', 'location'); + console.assert((value & 3) == 0, 'Pointer to float data passed to glUniform3fv must be aligned to four bytes!'); + var view = getArray(value, Float32Array, 3); + gl.uniform3fv(GL.uniforms[location], view); + }, + glUniform4fv: function (location, count, value) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniform4fv', 'location'); + console.assert((value & 3) == 0, 'Pointer to float data passed to glUniform4fv must be aligned to four bytes!'); + var view = getArray(value, Float32Array, 4); + gl.uniform4fv(GL.uniforms[location], view); + }, + glBlendFunc: function (sfactor, dfactor) { + gl.blendFunc(sfactor, dfactor); + }, + glBlendEquationSeparate: function (modeRGB, modeAlpha) { + gl.blendEquationSeparate(modeRGB, modeAlpha); + }, + glDisable: function (cap) { + gl.disable(cap); + }, + glDrawElements: function (mode, count, type, indices) { + gl.drawElements(mode, count, type, indices); + }, + glUniform1f: function (location, v0) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniform1f', 'location'); + gl.uniform1f(GL.uniforms[location], v0); + }, + glUniform1i: function (location, v0) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniform1i', 'location'); + gl.uniform1i(GL.uniforms[location], v0); + }, + glGetAttribLocation: function (program, name) { + return gl.getAttribLocation(GL.programs[program], UTF8ToString(name)); + }, + glEnableVertexAttribArray: function (index) { + gl.enableVertexAttribArray(index); + }, + glDisableVertexAttribArray: function (index) { + gl.disableVertexAttribArray(index); + }, + glVertexAttribPointer: function (index, size, type, normalized, stride, ptr) { + gl.vertexAttribPointer(index, size, type, !!normalized, stride, ptr); + }, + glGetUniformLocation: function (program, name) { + GL.validateGLObjectID(GL.programs, program, 'glGetUniformLocation', 'program'); + name = UTF8ToString(name); + var arrayIndex = 0; + // If user passed an array accessor "[index]", parse the array index off the accessor. + if (name[name.length - 1] == ']') { + var leftBrace = name.lastIndexOf('['); + arrayIndex = name[leftBrace + 1] != ']' ? parseInt(name.slice(leftBrace + 1)) : 0; // "index]", parseInt will ignore the ']' at the end; but treat "foo[]" as "foo[0]" + name = name.slice(0, leftBrace); + } + + var uniformInfo = GL.programInfos[program] && GL.programInfos[program].uniforms[name]; // returns pair [ dimension_of_uniform_array, uniform_location ] + if (uniformInfo && arrayIndex >= 0 && arrayIndex < uniformInfo[0]) { // Check if user asked for an out-of-bounds element, i.e. for 'vec4 colors[3];' user could ask for 'colors[10]' which should return -1. + return uniformInfo[1] + arrayIndex; + } else { + return -1; + } + }, + glUniformMatrix4fv: function (location, count, transpose, value) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniformMatrix4fv', 'location'); + console.assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix4fv must be aligned to four bytes!'); + var view = getArray(value, Float32Array, 16); + gl.uniformMatrix4fv(GL.uniforms[location], !!transpose, view); + }, + glUseProgram: function (program) { + GL.validateGLObjectID(GL.programs, program, 'glUseProgram', 'program'); + gl.useProgram(GL.programs[program]); + }, + glUniform4fv: function (location, count, value) { + GL.validateGLObjectID(GL.uniforms, location, 'glUniformMatrix4fv', 'location'); + console.assert((value & 3) == 0, 'Pointer to float data passed to glUniformMatrix4fv must be aligned to four bytes!'); + var view = getArray(value, Float32Array, 4); + gl.uniform4fv(GL.uniforms[location], view); + }, + glGenVertexArrays: function (n, arrays) { + _glGenObject(n, arrays, 'createVertexArray', GL.vaos, 'glGenVertexArrays'); + }, + glBindVertexArray: function (vao) { + gl.bindVertexArray(GL.vaos[vao]); + }, + glGenBuffers: function (n, buffers) { + _glGenObject(n, buffers, 'createBuffer', GL.buffers, 'glGenBuffers'); + }, + glBindBuffer: function (target, buffer) { + GL.validateGLObjectID(GL.buffers, buffer, 'glBindBuffer', 'buffer'); + gl.bindBuffer(target, GL.buffers[buffer]); + }, + glBufferData: function (target, size, data, usage) { + gl.bufferData(target, data ? getArray(data, Uint8Array, size) : size, usage); + }, + glBufferSubData: function (target, offset, size, data) { + gl.bufferSubData(target, offset, data ? getArray(data, Uint8Array, size) : size); + }, + glEnable: function (cap) { + gl.enable(cap); + }, + glDepthFunc: function (func) { + gl.depthFunc(func); + }, + glBlendFuncSeparate: function (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha) { + gl.blendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + }, + glViewport: function (x, y, width, height) { + gl.viewport(x, y, width, height); + }, + glDrawArrays: function (mode, first, count) { + gl.drawArrays(mode, first, count); + }, + glCreateProgram: function () { + var id = GL.getNewId(GL.programs); + var program = gl.createProgram(); + program.name = id; + GL.programs[id] = program; + return id; + }, + glAttachShader: function (program, shader) { + GL.validateGLObjectID(GL.programs, program, 'glAttachShader', 'program'); + GL.validateGLObjectID(GL.shaders, shader, 'glAttachShader', 'shader'); + gl.attachShader(GL.programs[program], GL.shaders[shader]); + }, + glLinkProgram: function (program) { + GL.validateGLObjectID(GL.programs, program, 'glLinkProgram', 'program'); + gl.linkProgram(GL.programs[program]); + GL.populateUniformTable(program); + }, + glGetProgramiv: function (program, pname, p) { + console.assert(p); + GL.validateGLObjectID(GL.programs, program, 'glGetProgramiv', 'program'); + if (program >= GL.counter) { + console.error("GL_INVALID_VALUE in glGetProgramiv"); + return; + } + var ptable = GL.programInfos[program]; + if (!ptable) { + console.error('GL_INVALID_OPERATION in glGetProgramiv(program=' + program + ', pname=' + pname + ', p=0x' + p.toString(16) + '): The specified GL object name does not refer to a program object!'); + return; + } + if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH + console.error("unsupported operation"); + return; + } else if (pname == 0x8B87 /* GL_ACTIVE_UNIFORM_MAX_LENGTH */) { + console.error("unsupported operation"); + return; + } else if (pname == 0x8B8A /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */) { + console.error("unsupported operation"); + return; + } else if (pname == 0x8A35 /* GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */) { + console.error("unsupported operation"); + return; + } else { + getArray(p, Int32Array, 1)[0] = gl.getProgramParameter(GL.programs[program], pname); + } + }, + glCreateShader: function (shaderType) { + var id = GL.getNewId(GL.shaders); + GL.shaders[id] = gl.createShader(shaderType); + return id; + }, + glShaderSource: function (shader, count, string, length) { + GL.validateGLObjectID(GL.shaders, shader, 'glShaderSource', 'shader'); + var source = GL.getSource(shader, count, string, length); + + // https://github.com/emscripten-core/emscripten/blob/incoming/src/library_webgl.js#L2708 + if (emscripten_shaders_hack) { + source = source.replace(/#extension GL_OES_standard_derivatives : enable/g, ""); + source = source.replace(/#extension GL_EXT_shader_texture_lod : enable/g, ''); + var prelude = ''; + if (source.indexOf('gl_FragColor') != -1) { + prelude += 'out mediump vec4 GL_FragColor;\n'; + source = source.replace(/gl_FragColor/g, 'GL_FragColor'); + } + if (source.indexOf('attribute') != -1) { + source = source.replace(/attribute/g, 'in'); + source = source.replace(/varying/g, 'out'); + } else { + source = source.replace(/varying/g, 'in'); + } + + source = source.replace(/textureCubeLodEXT/g, 'textureCubeLod'); + source = source.replace(/texture2DLodEXT/g, 'texture2DLod'); + source = source.replace(/texture2DProjLodEXT/g, 'texture2DProjLod'); + source = source.replace(/texture2DGradEXT/g, 'texture2DGrad'); + source = source.replace(/texture2DProjGradEXT/g, 'texture2DProjGrad'); + source = source.replace(/textureCubeGradEXT/g, 'textureCubeGrad'); + + source = source.replace(/textureCube/g, 'texture'); + source = source.replace(/texture1D/g, 'texture'); + source = source.replace(/texture2D/g, 'texture'); + source = source.replace(/texture3D/g, 'texture'); + source = source.replace(/#version 100/g, '#version 300 es\n' + prelude); + } + + gl.shaderSource(GL.shaders[shader], source); + }, + glGetProgramInfoLog: function (program, maxLength, length, infoLog) { + GL.validateGLObjectID(GL.programs, program, 'glGetProgramInfoLog', 'program'); + var log = gl.getProgramInfoLog(GL.programs[program]); + console.assert(log !== null); + let array = getArray(infoLog, Uint8Array, maxLength); + for (var i = 0; i < maxLength; i++) { + array[i] = log.charCodeAt(i); + } + }, + glCompileShader: function (shader, count, string, length) { + GL.validateGLObjectID(GL.shaders, shader, 'glCompileShader', 'shader'); + gl.compileShader(GL.shaders[shader]); + }, + glGetShaderiv: function (shader, pname, p) { + console.assert(p); + GL.validateGLObjectID(GL.shaders, shader, 'glGetShaderiv', 'shader'); + if (pname == 0x8B84) { // GL_INFO_LOG_LENGTH + var log = gl.getShaderInfoLog(GL.shaders[shader]); + console.assert(log !== null); + + getArray(p, Int32Array, 1)[0] = log.length + 1; + + } else if (pname == 0x8B88) { // GL_SHADER_SOURCE_LENGTH + var source = gl.getShaderSource(GL.shaders[shader]); + var sourceLength = (source === null || source.length == 0) ? 0 : source.length + 1; + getArray(p, Int32Array, 1)[0] = sourceLength; + } else { + getArray(p, Int32Array, 1)[0] = gl.getShaderParameter(GL.shaders[shader], pname); + } + }, + glGetShaderInfoLog: function (shader, maxLength, length, infoLog) { + GL.validateGLObjectID(GL.shaders, shader, 'glGetShaderInfoLog', 'shader'); + var log = gl.getShaderInfoLog(GL.shaders[shader]); + console.assert(log !== null); + let array = getArray(infoLog, Uint8Array, maxLength); + for (var i = 0; i < maxLength; i++) { + array[i] = log.charCodeAt(i); + } + }, + glDeleteShader: function () { }, + init_opengl: function (ptr) { + start = Date.now(); + canvas.onmousemove = function (event) { + var x = event.clientX; + var y = event.clientY; + wasm_exports.mouse_move(Math.floor(x), Math.floor(y)); + }; + canvas.onmousedown = function (event) { + var x = event.clientX; + var y = event.clientY; + var btn = event.button; + wasm_exports.mouse_down(x, y, btn); + }; + canvas.onmouseup = function (event) { + var x = event.clientX; + var y = event.clientY; + var btn = event.button; + wasm_exports.mouse_up(x, y, btn); + }; + canvas.onkeydown = function (event) { + if (event.code == "KeyA") wasm_exports.key_down(65); + if (event.code == "KeyS") wasm_exports.key_down(83); + if (event.code == "KeyD") wasm_exports.key_down(68); + if (event.code == "KeyW") wasm_exports.key_down(87); + + }; + canvas.onkeyup = function (event) { + if (event.code == "KeyA") wasm_exports.key_up(65); + if (event.code == "KeyS") wasm_exports.key_up(83); + if (event.code == "KeyD") wasm_exports.key_up(68); + if (event.code == "KeyW") wasm_exports.key_up(87); + }; + + + window.requestAnimationFrame(animation); + } + } +}; + + +function load(wasm_path) { + WebAssembly.instantiateStreaming(fetch(wasm_path), importObject) + .then(obj => { + memory = obj.instance.exports.memory; + wasm_exports = obj.instance.exports; + + obj.instance.exports.main(); + }); +} diff --git a/js/index.html b/js/index.html new file mode 100644 index 00000000..3fe8cd49 --- /dev/null +++ b/js/index.html @@ -0,0 +1,36 @@ + + + + + + TITLE + + + + + + + + + + \ No newline at end of file diff --git a/js/quad.wasm b/js/quad.wasm new file mode 100755 index 00000000..f48cfd68 Binary files /dev/null and b/js/quad.wasm differ diff --git a/sokol-app-sys/.gitignore b/sokol-app-sys/.gitignore new file mode 100644 index 00000000..2f88dbac --- /dev/null +++ b/sokol-app-sys/.gitignore @@ -0,0 +1,3 @@ +/target +**/*.rs.bk +Cargo.lock \ No newline at end of file diff --git a/sokol-app-sys/Cargo.toml b/sokol-app-sys/Cargo.toml new file mode 100644 index 00000000..e9bdcbbe --- /dev/null +++ b/sokol-app-sys/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "sokol_app_sys" +version = "0.1.0" +authors = ["not-fl3 "] +edition = "2018" + +build = "build.rs" + +[build-dependencies] +cc = "1.0" diff --git a/sokol-app-sys/build.rs b/sokol-app-sys/build.rs new file mode 100644 index 00000000..639938d2 --- /dev/null +++ b/sokol-app-sys/build.rs @@ -0,0 +1,87 @@ +extern crate cc; + +use std::env; + +use cc::{Build, Tool}; + +fn build_new() -> (Build, Tool) { + let build = Build::new(); + let tool = build.try_get_compiler().unwrap_or_else(|e| panic!(e)); + + (build, tool) +} + +fn select_sokol_gfx_renderer(build: &mut Build) { + if cfg!(target_family = "windows") { + build.flag("-DSOKOL_GLCORE33"); + } else if cfg!(target_os = "macos") { + build.flag("-DSOKOL_METAL"); + } else { + build.flag("-DSOKOL_GLCORE33"); + } +} + +fn make_sokol(target: &str) { + let (mut build, _) = build_new(); + + let is_debug = env::var("DEBUG").ok().is_some(); + // + // include paths + // + build + .include("external/sokol"); + + build + .file("src/sokol_app.c"); + + // + // select sokol_gfx renderer + // + select_sokol_gfx_renderer(&mut build); + + // + // silence some warnings + // + build + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-function"); + + // + // x86_64-pc-windows-gnu: additional compile/link flags + // + // and remember to https://github.com/rust-lang/rust/issues/47048 + if target == "x86_64-pc-windows-gnu" { + build + .flag("-D_WIN32_WINNT=0x0601") + .flag_if_supported("-Wno-cast-function-type") + .flag_if_supported("-Wno-sign-compare") + .flag_if_supported("-Wno-unknown-pragmas"); + + println!("cargo:rustc-link-lib=gdi32"); + println!("cargo:rustc-link-lib=ole32"); + println!("cargo:rustc-link-lib=shell32"); + + } + + if is_debug { + build + .flag("-D_DEBUG") + .flag("-DSOKOL_DEBUG"); + } + + build + .compile("sokol-app-sys"); + + if target == "x86_64-unknown-linux-gnu" { + println!("cargo:rustc-link-lib=dylib=GL"); + println!("cargo:rustc-link-lib=dylib=X11"); + } +} + +fn main() { + let target = env::var("TARGET").unwrap_or_else(|e| panic!(e)); + + if target != "wasm32-unknown-unknown" { + make_sokol(&target); + } +} diff --git a/sokol-app-sys/external/sokol/.editorconfig b/sokol-app-sys/external/sokol/.editorconfig new file mode 100644 index 00000000..99d06f05 --- /dev/null +++ b/sokol-app-sys/external/sokol/.editorconfig @@ -0,0 +1,8 @@ +root=true +[**] +indent_style=space +indent_size=4 +trim_trailing_whitespace=true +insert_final_newline=true + + diff --git a/sokol-app-sys/external/sokol/.github/workflows/main.yml b/sokol-app-sys/external/sokol/.github/workflows/main.yml new file mode 100644 index 00000000..4c0fb98e --- /dev/null +++ b/sokol-app-sys/external/sokol/.github/workflows/main.yml @@ -0,0 +1,175 @@ +name: build_and_test + +on: [push, pull_request] + +jobs: + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: prepare + run: | + mkdir workspace + cd workspace + git clone https://github.com/floooh/sokol-samples + cd sokol-samples + - name: win64-vstudio-debug + run: | + cd workspace/sokol-samples + python fips build win64-vstudio-debug + - name: win64-vstudio-release + run: | + cd workspace/sokol-samples + python fips build win64-vstudio-release + - name: d3d11-win64-vstudio-debug + run: | + cd workspace/sokol-samples + python fips build d3d11-win64-vstudio-debug + - name: d3d11-win64-vstudio-release + run: | + cd workspace/sokol-samples + python fips build d3d11-win64-vstudio-release + - name: sapp-win64-vstudio-debug + run: | + cd workspace/sokol-samples + python fips build sapp-win64-vstudio-debug + - name: sapp-win64-vstudio-release + run: | + cd workspace/sokol-samples + python fips build sapp-win64-vstudio-release + - name: sapp-d3d11-win64-vstudio-debug + run: | + cd workspace/sokol-samples + python fips build sapp-d3d11-win64-vstudio-debug + - name: sapp-d3d11-win64-vstudio-release + run: | + cd workspace/sokol-samples + python fips build sapp-d3d11-win64-vstudio-release + - name: sokol-test sapp-win64-vstudio-debug + run: | + cd workspace/sokol-samples + python fips run sokol-test sapp-win64-vstudio-debug + mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: prepare + run: | + mkdir workspace + cd workspace + git clone https://github.com/floooh/sokol-samples + cd sokol-samples + - name: osx-make-debug + run: | + cd workspace/sokol-samples + python fips build osx-make-debug + - name: osx-make-release + run: | + cd workspace/sokol-samples + python fips build osx-make-release + - name: metal-osx-make-debug + run: | + cd workspace/sokol-samples + python fips build metal-osx-make-debug + - name: metal-osx-make-release + run: | + cd workspace/sokol-samples + python fips build metal-osx-make-release + - name: sapp-metal-osx-make-debug + run: | + cd workspace/sokol-samples + python fips build sapp-metal-osx-make-debug + - name: sapp-metal-osx-make-release + run: | + cd workspace/sokol-samples + python fips build sapp-metal-osx-make-release + - name: sokol-test sapp-metal-osx-make-debug + run: | + cd workspace/sokol-samples + python fips run sokol-test sapp-metal-osx-make-debug + ios: + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: prepare + run: | + mkdir workspace + cd workspace + git clone https://github.com/floooh/sokol-samples + cd sokol-samples + - name: ios-xcode-debug + run: | + cd workspace/sokol-samples + python fips build ios-xcode-debug -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + - name: ios-xcode-release + run: | + cd workspace/sokol-samples + python fips build ios-xcode-release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + - name: metal-ios-xcode-debug + run: | + cd workspace/sokol-samples + python fips build metal-ios-xcode-debug -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + - name: metal-ios-xcode-release + run: | + cd workspace/sokol-samples + python fips build metal-ios-xcode-release -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + - name: sapp-ios-xcode-debug + run: | + cd workspace/sokol-samples + python fips build sapp-ios-xcode-debug -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + - name: sapp-metal-ios-xcode-release + run: | + cd workspace/sokol-samples + python fips build sapp-metal-ios-xcode-debug -- CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: prepare + run: | + sudo apt-get update + sudo apt-get install libglu1-mesa-dev mesa-common-dev xorg-dev libasound-dev + mkdir workspace + cd workspace + git clone https://github.com/floooh/sokol-samples + cd sokol-samples + - name: linux-make-debug + run: | + cd workspace/sokol-samples + python fips build linux-make-debug + - name: linux-make-release + run: | + cd workspace/sokol-samples + python fips build linux-make-release + - name: sapp-linux-make-debug + run: | + cd workspace/sokol-samples + python fips build sapp-linux-make-debug + - name: sapp-linux-make-release + run: | + cd workspace/sokol-samples + python fips build sapp-linux-make-release + - name: sapp-linux-make-debug + run: | + cd workspace/sokol-samples + python fips run sokol-test sapp-linux-make-debug + emscripten: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: prepare + run: | + sudo apt-get install ninja-build + mkdir workspace + cd workspace + git clone https://github.com/floooh/sokol-samples + cd sokol-samples + python fips emsdk install latest + - name: sapp-webgl2-wasm-ninja-debug + run: | + cd workspace/sokol-samples + python fips build sapp-webgl2-wasm-ninja-debug + - name: sapp-webgl2-wasm-ninja-release + run: | + cd workspace/sokol-samples + python fips build sapp-webgl2-wasm-ninja-release diff --git a/sokol-app-sys/external/sokol/.gitignore b/sokol-app-sys/external/sokol/.gitignore new file mode 100644 index 00000000..3f19db91 --- /dev/null +++ b/sokol-app-sys/external/sokol/.gitignore @@ -0,0 +1,6 @@ +.vscode/ +#>fips +# this area is managed by fips, do not edit +.fips-* +*.pyc +# 1.0f) ? 0.0f : g; + sg_begin_default_pass(&pass_action, sapp_width(), sapp_height()); + sg_end_pass(); + sg_commit(); +} + +void cleanup(void) { + sg_shutdown(); +} + +sapp_desc sokol_main(int argc, char* argv[]) { + return (sapp_desc){ + .init_cb = init, + .frame_cb = frame, + .cleanup_cb = cleanup, + .width = 400, + .height = 300, + .window_title = "Clear (sokol app)", + }; +} +``` + +# sokol_audio.h + +A minimal audio-streaming API: + +- you provide a mono- or stereo-stream of 32-bit float samples which sokol_audio.h forwards into platform-specific backends +- two ways to provide the data: + 1. directly fill backend audio buffer from your callback function running in the audio thread + 2. alternatively push small packets of audio data from your main loop, + or a separate thread created by you +- platform backends: + - Windows: WASAPI + - macOS/iOS: CoreAudio + - Linux: ALSA + - emscripten: WebAudio + ScriptProcessorNode (doesn't use the emscripten-provided OpenAL or SDL Audio wrappers) + +A simple mono square-wave generator using the callback model: + +```cpp +// the sample callback, running in audio thread +static void stream_cb(float* buffer, int num_frames, int num_channels) { + assert(1 == num_channels); + static uint32_t count = 0; + for (int i = 0; i < num_frames; i++) { + buffer[i] = (count++ & (1<<3)) ? 0.5f : -0.5f; + } +} + +int main() { + // init sokol-audio with default params + saudio_setup(&(saudio_desc){ + .stream_cb = stream_cb + }); + + // run main loop + ... + + // shutdown sokol-audio + saudio_shutdown(); + return 0; +``` + +The same code using the push-model + +```cpp +#define BUF_SIZE (32) +int main() { + // init sokol-audio with default params, no callback + saudio_setup(&(saudio_desc){0}); + assert(saudio_channels() == 1); + + // a small intermediate buffer so we don't need to push + // individual samples, which would be quite inefficient + float buf[BUF_SIZE]; + int buf_pos = 0; + uint32_t count = 0; + + // push samples from main loop + bool done = false; + while (!done) { + // generate and push audio samples... + int num_frames = saudio_expect(); + for (int i = 0; i < num_frames; i++) { + // simple square wave generator + buf[buf_pos++] = (count++ & (1<<3)) ? 0.5f : -0.5f; + if (buf_pos == BUF_SIZE) { + buf_pos = 0; + saudio_push(buf, BUF_SIZE); + } + } + // handle other per-frame stuff... + ... + } + + // shutdown sokol-audio + saudio_shutdown(); + return 0; +} +``` + +# sokol_fetch.h + +Load entire files, or stream data asynchronously over HTTP (emscripten/wasm) +or the local filesystem (all native platforms). + +Simple C99 example loading a file into a static buffer: + +```c +#include "sokol_fetch.h" + +static void response_callback(const sfetch_response*); + +#define MAX_FILE_SIZE (1024*1024) +static uint8_t buffer[MAX_FILE_SIZE]; + +// application init +static void init(void) { + ... + // setup sokol-fetch with default config: + sfetch_setup(&(sfetch_desc_t){0}); + + // start loading a file into a statically allocated buffer: + sfetch_send(&(sfetch_request_t){ + .path = "hello_world.txt", + .callback = response_callback + .buffer_ptr = buffer, + .buffer_size = sizeof(buffer) + }); +} + +// per frame... +static void frame(void) { + ... + // need to call sfetch_dowork() once per frame to 'turn the gears': + sfetch_dowork(); + ... +} + +// the response callback is where the interesting stuff happens: +static void reponse_callback(const sfetch_response_t* response) { + if (response->fetched) { + // data has been loaded into the provided buffer, do something + // with the data... + const void* data = response->buffer_ptr; + uint64_t data_size = response->fetched_size; + } + // the finished flag is set both on success and failure + if (response->failed) { + // oops, something went wrong + switch (response->error_code) { + SFETCH_ERROR_FILE_NOT_FOUND: ... + SFETCH_ERROR_BUFFER_TOO_SMALL: ... + ... + } + } +} + +// application shutdown +static void shutdown(void) { + ... + sfetch_shutdown(); + ... +} +``` + +# sokol_time.h: + +Simple cross-platform time measurement: + +```c +#include "sokol_time.h" +... +/* initialize sokol_time */ +stm_setup(); + +/* take start timestamp */ +uint64_t start = stm_now(); + +...some code to measure... + +/* compute elapsed time */ +uint64_t elapsed = stm_since(start); + +/* convert to time units */ +double seconds = stm_sec(elapsed); +double milliseconds = stm_ms(elapsed); +double microseconds = stm_us(elapsed); +double nanoseconds = stm_ns(elapsed); + +/* difference between 2 time stamps */ +uint64_t start = stm_now(); +... +uint64_t end = stm_now(); +uint64_t elapsed = stm_diff(end, start); + +/* compute a 'lap time' (e.g. for fps) */ +uint64_t last_time = 0; +while (!done) { + ...render something... + double frame_time_ms = stm_ms(stm_laptime(&last_time)); +} +``` + +# sokol_args.h + +Unified argument parsing for web and native apps. Uses argc/argv on native +platforms and the URL query string on the web. + +Example URL with one arg: + +https://floooh.github.io/tiny8bit/kc85.html?type=kc85_4 + +The same as command line app: + +> kc85 type=kc85_4 + +Parsed like this: + +```c +#include "sokol_args.h" + +int main(int argc, char* argv[]) { + sargs_setup(&(sargs_desc){ .argc=argc, .argv=argv }); + if (sargs_exists("type")) { + if (sargs_equals("type", "kc85_4")) { + // start as KC85/4 + } + else if (sargs_equals("type", "kc85_3")) { + // start as KC85/3 + } + else { + // start as KC85/2 + } + } + sargs_shutdown(); + return 0; +} +``` + +See the sokol_args.h header for a more complete documentation, and the [Tiny +Emulators](https://floooh.github.io/tiny8bit/) for more interesting usage examples. + +# Overview of planned features + +A list of things I'd like to do next: + +## sokol_gfx.h planned features: + +- 2 small additions to the per-pool-slot generation counters in sokol_gfx.h: + - an sg_setup() option to disable a pool slot when it's generation + counter overflows, this makes the dangling-check for resource ids + watertight at the cost that the pool will run out of slots at some point + - instead of the 16/16-bit split in the resource ids for unique-tag vs + slot-index, only use as many bits as necessary for the slot-index + (based on the number of slots in the pool), and the remaining bits + for the unique-tag + +## sokol_app.h planned features: + +Mainly some "missing features" for desktop apps: + +- define an application icon +- change the window title on existing window +- allow to programmatically activate and deactivate fullscreen +- pointer lock +- show/hide mouse cursor +- allow to change mouse cursor image (at first only switch between system-provided standard images) + +## sokol_audio.h planned features: + +- implement an alternative WebAudio backend using Audio Worklets and WASM threads + +# Updates + +- **08-Sep-2019**: sokol_gfx.h now supports clamp-to-border texture sampling: + - the enum ```sg_wrap``` has a new member ```SG_WRAP_CLAMP_TO_BORDER``` + - there's a new enum ```sg_border_color``` + - the struct ```sg_image_desc``` has a new member ```sg_border_color border_color``` + - new feature flag in ```sg_features```: ```image_clamp_to_border``` + + Note the following caveats: + + - clamp-to-border is only supported on a subset of platforms, support can + be checked at runtime via ```sg_query_features().image_clamp_to_border``` + (D3D11, desktop-GL and macOS-Metal support clamp-to-border, + all other platforms don't) + - there are three hardwired border colors: transparent-black, + opaque-black and opaque-white (modern 3D APIs have moved away from + a freely programmable border color) + - if clamp-to-border is not supported, sampling will fall back to + clamp-to-edge without a validation warning + + Many thanks to @martincohen for suggesting the feature and providing the initial +D3D11 implementation! + +- **31-Aug-2019**: The header **sokol_gfx_cimgui.h** has been merged into +[**sokol_gfx_imgui.h**](https://github.com/floooh/sokol/blob/master/util/sokol_gfx_imgui.h). +Same idea as merging sokol_cimgui.h into sokol_imgui.h, the implementation +is now "bilingual", and can either be included into a C++ file or into a C file. +When included into a C++ file, the Dear ImGui C++ API will be called directly, +otherwise the C API bindings via cimgui.h + +- **28-Aug-2019**: The header **sokol_cimgui.h** has been merged into +[**sokol_imgui.h**](https://github.com/floooh/sokol/blob/master/util/sokol_imgui.h). +The sokol_cimgui.h header had been created to implement Dear ImGui UIs from +pure C applications, instead of having to fall back to C++ just for the UI +code. However, there was a lot of code duplication between sokol_imgui.h and +sokol_cimgui.h, so that it made more sense to merge the two headers. The C vs +C++ code path will be selected automatically: When the implementation of +sokol_imgui.h is included into a C++ source file, the Dear ImGui C++ API will +be used. Otherwise, when the implementation is included into a C source file, +the C API via cimgui.h + +- **27-Aug-2019**: [**sokol_audio.h**](https://github.com/floooh/sokol/blob/master/sokol_audio.h) + now has an OpenSLES backend for Android. Many thanks to Sepehr Taghdisian (@septag) + for the PR! + +- **26-Aug-2019**: new utility header for text rendering, and fixes in sokol_gl.h: + - a new utility header [**sokol_fontstash.h**](https://github.com/floooh/sokol/blob/master/util/sokol_fontstash.h) + which implements a renderer for [fontstash.h](https://github.com/memononen/fontstash) + on top of sokol_gl.h + - **sokol_gl.h** updates: + - Optimization: If no relevant state between two begin/end pairs has + changed, draw commands will be merged into a single sokol-gfx draw + call. This is especially useful for text- and sprite-rendering (previously, + each begin/end pair would always result in one draw call). + - Bugfix: When calling sgl_disable_texture() the previously active + texture would still remain active which could lead to rendering + artefacts. This has been fixed. + - Feature: It's now possible to provide a custom shader in the + 'desc' argument of *sgl_make_pipeline()*, as long as the shader + is "compatible" with sokol_gl.h, see the sokol_fontstash.h + header for an example. This feature isn't "advertised" in the + sokol_gl.h documentation because it's a bit brittle (for instance + if sokol_gl.h updates uniform block structures, custom shaders + would break), but it may still come in handy in some situations. + +- **20-Aug-2019**: sokol_gfx.h has a couple new query functions to inspect the + default values of resource-creation desc structures: + + ```c + sg_buffer_desc sg_query_buffer_defaults(const sg_buffer_desc* desc); + sg_image_desc sg_query_image_defaults(const sg_image_desc* desc); + sg_shader_desc sg_query_shader_defaults(const sg_shader_desc* desc); + sg_pipeline_desc sg_query_pipeline_defaults(const sg_pipeline_desc* desc); + sg_pass_desc sg_query_pass_defaults(const sg_pass_desc* desc); + ``` + These functions take a pointer to a resource creation desc struct that + may contain zero-initialized values (to indicate default values) and + return a new struct where the zero-init values have been replaced with + concrete values. This is useful to inspect the actual creation attributes + of a resource. + +- **18-Aug-2019**: + - Pixelformat and runtime capabilities modernization in sokol_gfx.h (breaking changes): + - The list of pixel formats supported in sokol_gfx.h has been modernized, + many new formats are available, and some formats have been removed. The + supported pixel formats are now identical with what WebGPU provides, + minus the SRGB formats (if SRGB conversion is needed it should be done + in the pixel shader) + - The pixel format list is now more "orthogonal": + - one, two or four color components (R, RG, RGBA) + - 8-, 16- or 32-bit component width + - unsigned-normalized (no postfix), signed-normalized (SN postfix), + unsigned-integer (UI postfix) and signed-integer (SI postfix) + and float (F postfix) component types. + - special pixel formats BGRA8 (default render target format on + Metal and D3D11), RGB10A2 and RG11B10F + - DXT compressed formats replaced with BC1 to BC7 (BC1 to BC3 + are identical to the old DXT pixel formats) + - packed 16-bit formats (like RGBA4) have been removed + - packed 24-bit formats (RGB8) have been removed + - Use the new function ```sg_query_pixelformat()``` to get detailed + runtime capability information about a pixelformat (for instance + whether it is supported at all, can be used as render target etc...). + - Use the new function ```sg_query_limits()``` to query "numeric limits" + like maximum texture dimensions for different texture types. + - The enumeration ```sg_feature``` and the function ```sg_query_feature()``` + has been replaced with the new function ```sg_query_features()```, which + returns a struct ```sg_features``` (this contains a bool for each + optional feature). + - The default pixelformat for render target images and pipeline objects + now depends on the backend: + - for GL backends, the default pixelformat stays the same: RGBA8 + - for the Metal and D3D11 backends, the default pixelformat for + render target images is now BGRA8 (the reason is because + MTKView's pixelformat was always BGRA8 but this was "hidden" + through an internal hack, and a BGRA swapchain is more efficient + than RGBA in D3D11/DXGI) + - Because of the above RGBA/BGRA change, you may see pixelformat validation + errors in existing code if the code assumes that a render target image is + always created with a default pixelformat of RGBA8. + - Changes in sokol_app.h: + - The D3D11 backend now creates the DXGI swapchain with BGRA8 pixelformat + (previously: RGBA8), this allows more efficient presentation in some + situations since no format-conversion-blit needs to happen. + +- **18-Jul-2019**: + - sokol_fetch.h has been fixed and can be used again :) + +- **11-Jul-2019**: + - Don't use sokol_fetch.h for now, the current version assumes that + it is possible to obtain the content size of a file from the + HTTP server without downloading the entire file first. Turns out + that's not possible with vanilla HTTP when the web server serves + files compressed (in that case the Content-Length is the _compressed_ + size, yet JS/WASM only has access to the uncompressed data). + Long story short, I need to go back to the drawing board :) + +- **06-Jul-2019**: + - new header [sokol_fetch.h](https://github.com/floooh/sokol/blob/master/sokol_fetch.h) for asynchronously loading data. + - make sure to carefully read the embedded documentation + for making the best use of the header + - two new samples: [simple PNG file loadng with stb_image.h](https://floooh.github.io/sokol-html5/loadpng-sapp.html) and [MPEG1 streaming with pl_mpeg.h](https://floooh.github.io/sokol-html5/plmpeg-sapp.html) + - sokol_gfx.h: increased SG_MAX_SHADERSTAGE_BUFFERS configuration + constant from 4 to 8. + +- **10-Jun-2019**: sokol_app.h now has proper "application quit handling": + - a pending quit can be intercepted, for instance to show a "Really Quit?" dialog box + - application code can now initiate a "soft quit" (interceptable) or + "hard quit" (not interceptable) + - on the web platform, the standard "Leave Site?" dialog box implemented + by browsers can be shown when the user leaves the site + - Android and iOS currently don't have any of those features (since the + operating system may decide to terminate mobile applications at any time + anyway, if similar features are added they will most likely have + similar limitations as the web platform) + For details, search for 'APPLICATION QUIT' in the sokol_app.h documentation + header: https://github.com/floooh/sokol/blob/master/sokol_app.h + + The [imgui-highdpi-sapp](https://github.com/floooh/sokol-samples/tree/master/sapp) + contains sample code for all new quit-related features. + +- **08-Jun-2019**: some new stuff in sokol_app.h: + - the ```sapp_event``` struct has a new field ```bool key_repeat``` + which is true when a keyboard event is a key-repeat (for the + event types ```SAPP_EVENTTYPE_KEY_DOWN``` and ```SAPP_EVENTTYPE_CHAR```). + Many thanks to [Scott Lembcke](https://github.com/slembcke) for + the pull request! + - a new function to poll the internal frame counter: + ```uint64_t sapp_frame_count(void)```, previously the frame counter + was only available via ```sapp_event```. + - also check out the new [event-inspector sample](https://floooh.github.io/sokol-html5/wasm/events-sapp.html) + +- **04-Jun-2019**: All sokol headers now recognize a config-define ```SOKOL_DLL``` + if sokol should be compiled into a DLL (when used with ```SOKOL_IMPL```) + or used as a DLL. On Windows, this will prepend the public function declarations + with ```__declspec(dllexport)``` or ```__declspec(dllimport)```. + +- **31-May-2019**: if you're working with emscripten and fips, please note the + following changes: + + https://github.com/floooh/fips#public-service-announcements + +- **27-May-2019**: some D3D11 updates: + - The shader-cross-compiler can now generate D3D bytecode when + running on Windows, see the [sokol-shdc docs](https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md) for more +details. + - sokol_gfx.h no longer needs to be compiled with a + SOKOL_D3D11_SHADER_COMPILER define to enable shader compilation in the + D3D11 backend. Instead, the D3D shader compiler DLL (d3dcompiler_47.dll) + will be loaded on-demand when the first HLSL shader needs to be compiled. + If an application only uses D3D shader byte code, the compiler DLL won't + be loaded into the process. + +- **24-May-2019** The shader-cross-compiler can now generate Metal byte code +for macOS or iOS when the build is running on macOS. This is enabled +automatically with the fips-integration files in [sokol-tools-bin](https://github.com/floooh/sokol-tools-bin), +see the [sokol-shdc docs](https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md) for more +details. + +- **16-May-2019** two new utility headers: *sokol_cimgui.h* and *sokol_gfx_cimgui.h*, +those are the same as their counterparts sokol_imgui.h and sokol_gfx_imgui.h, but +use the [cimgui](https://github.com/cimgui/cimgui) C-API for Dear ImGui. This +is useful if you don't want to - or cannot - use C++ for creating Dear ImGui UIs. + + Many thanks to @prime31 for contributing those! + + sokol_cimgui.h [is used +here](https://floooh.github.io/sokol-html5/wasm/cimgui-sapp.html), and +sokol_gfx_cimgui.h is used for the [debugging UI +here](https://floooh.github.io/sokol-html5/wasm/sgl-microui-sapp-ui.html) + +- **15-May-2019** there's now an optional shader-cross-compiler solution for +sokol_gfx.h: [see here for details](https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md). +This is "V1.0" with two notable features missing: + + - an include-file feature for GLSL shaders + - compilation to Metal- and D3D-bytecode (currently + only source-code generation is supported) + + The [sokol-app samples](https://floooh.github.io/sokol-html5/) have been + ported to the new shader-cross-compilation, follow the ```src``` and + ```glsl``` links on the specific sample webpages to see the C- and GLSL- + source-code. + +- **02-May-2019** sokol_gfx.h has a new function ```sg_query_backend()```, this +will return an enum ```sg_backend``` identifying the backend sokol-gfx is +currently running on, which is one of the following values: + + - SG_BACKEND_GLCORE33 + - SG_BACKEND_GLES2 + - SG_BACKEND_GLES3 + - SG_BACKEND_D3D11 + - SG_BACKEND_METAL_MACOS + - SG_BACKEND_METAL_IOS + + When compiled with SOKOL_GLES3, sg_query_backend() may return SG_BACKEND_GLES2 + when the runtime platform doesn't support GLES3/WebGL2 and had to fallback + to GLES2/WebGL2. + + When compiled with SOKOL_METAL, sg_query_backend() will return SG_BACKEND_METAL_MACOS + when the compile target is macOS, and SG_BACKEND_METAL_IOS when the target is iOS. + +- **26-Apr-2019** Small but breaking change in **sokol_gfx.h** how the vertex +layout definition in sg_pipeline_desc works: + + Vertex component names and semantics (needed by the GLES2 and D3D11 backends) have moved from ```sg_pipeline_desc``` into ```sg_shader_desc```. + + This may seem like a rather pointless small detail to change, expecially + for breaking existing code, but the whole thing will make a bit more + sense when the new shader-cross-compiler will be integrated which I'm + currently working on (here: https://github.com/floooh/sokol-tools). + + While working on getting reflection data out of the shaders (e.g. what + uniform blocks and textures the shader uses), it occurred to me that + vertex-attribute-names and -semantics are actually part of the reflection + info and belong to the shader, not to the vertex layout in the pipeline + object (which only describes how the incoming vertex data maps to + vertex-component **slots**. Instead of (optionally) mapping this + association through a name, the pipeline's vertex layout is now always + strictly defined in terms of numeric 'bind slots' for **all** sokol_gfx.h + backends. For 3D APIs where the vertex component slot isn't explicitely + defined in the shader language (GLES2/WebGL, D3D11, and optionally + GLES3/GL), the shader merely offers a lookup table how vertex-layout + slot-indices map to names/semantics (and the underlying 3D API than maps + those names back to slot indices, which shows that Metal and GL made the + right choice defining the slots right in the shader). + + Here's how the code changes (taken from the triangle-sapp.c sample): + + **OLD**: + ```c + /* create a shader */ + sg_shader shd = sg_make_shader(&(sg_shader_desc){ + .vs.source = vs_src, + .fs.source = fs_src, + }); + + /* create a pipeline object (default render states are fine for triangle) */ + pip = sg_make_pipeline(&(sg_pipeline_desc){ + /* if the vertex layout doesn't have gaps, don't need to provide strides and offsets */ + .shader = shd, + .layout = { + .attrs = { + [0] = { .name="position", .sem_name="POS", .format=SG_VERTEXFORMAT_FLOAT3 }, + [1] = { .name="color0", .sem_name="COLOR", .format=SG_VERTEXFORMAT_FLOAT4 } + } + }, + }); + ``` + + **NEW**: + ```c + /* create a shader */ + sg_shader shd = sg_make_shader(&(sg_shader_desc){ + .attrs = { + [0] = { .name="position", .sem_name="POS" }, + [1] = { .name="color0", .sem_name="COLOR" } + }, + .vs.source = vs_src, + .fs.source = fs_src, + }); + + /* create a pipeline object (default render states are fine for triangle) */ + pip = sg_make_pipeline(&(sg_pipeline_desc){ + /* if the vertex layout doesn't have gaps, don't need to provide strides and offsets */ + .shader = shd, + .layout = { + .attrs = { + [0].format=SG_VERTEXFORMAT_FLOAT3, + [1].format=SG_VERTEXFORMAT_FLOAT4 + } + }, + }); + ``` + + ```sg_shader_desc``` has a new embedded struct ```attrs``` which + contains a vertex attribute _name_ (for GLES2/WebGL) and + _sem_name/sem_index_ (for D3D11). For the Metal backend this struct is + ignored completely, and for GLES3/GL it is optional, and not required + when the vertex shader inputs are annotated with ```layout(location=N)```. + + The remaining attribute description members in ```sg_pipeline_desc``` are: + - **.format**: the format of input vertex data (this can be different + from the vertex shader's inputs when data is extended during + vertex fetch (e.g. input can be vec3 while the vertex shader + expects vec4) + - **.offset**: optional offset of the vertex component data (not needed + when the input vertex has no gaps between the components) + - **.buffer**: the vertex buffer bind slot if the vertex data is coming + from different buffers + + Also check out the various samples: + + - for GLSL (explicit slots via ```layout(location=N)```): https://github.com/floooh/sokol-samples/tree/master/glfw + - for D3D11 (semantic names/indices): https://github.com/floooh/sokol-samples/tree/master/d3d11 + - for GLES2: (vertex attribute names): https://github.com/floooh/sokol-samples/tree/master/html5 + - for Metal: (explicit slots): https://github.com/floooh/sokol-samples/tree/master/metal + - ...and all of the above combined: https://github.com/floooh/sokol-samples/tree/master/sapp + +- **19-Apr-2019** I have replaced the rather inflexible render-state handling +in **sokol_gl.h** with a *pipeline stack* (like the GL matrix stack, but with +pipeline-state-objects), along with a couple of other minor API tweaks. + + These are the new pipeline-stack functions: + ```c + sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc); + void sgl_destroy_pipeline(sgl_pipeline pip); + void sgl_default_pipeline(void); + void sgl_load_pipeline(sgl_pipeline pip); + void sgl_push_pipeline(void); + void sgl_pop_pipeline(void); + ``` + + A pipeline object is created just like in sokol_gfx.h, but without shaders, + vertex layout, pixel formats, primitive-type and sample count (these details + are filled in by the ```sgl_make_pipeline()``` wrapper function. For instance + to create a pipeline object for additive transparency: + + ```c + sgl_pipeline additive_pip = sgl_make_pipeline(&(sg_pipeline_desc){ + .blend = { + .enabled = true, + .src_factor_rgb = SG_BLENDFACTOR_ONE, + .dst_factor_rgb = SG_BLENDFACTOR_ONE + } + }); + ``` + + And to render with this, simply call ```sgl_load_pipeline()```: + + ```c + sgl_load_pipeline(additive_pip); + sgl_begin_triangles(); + ... + sgl_end(); + ``` + + Or to preserve and restore the previously active pipeline state: + + ```c + sgl_push_pipeline(); + sgl_load_pipeline(additive_pip); + sgl_begin_quads(); + ... + sgl_end(); + sgl_pop_pipeline(); + ``` + + You can also load the 'default pipeline' explicitely on the top of the + pipeline stack with ```sgl_default_pipeline()```. + + The other API change is: + + - ```sgl_state_texture(bool b)``` has been replaced with ```sgl_enable_texture()``` + and ```sgl_disable_texture()``` + + The code samples have been updated accordingly: + + - [sgl-sapp.c](https://github.com/floooh/sokol-samples/blob/master/sapp/sgl-sapp.c) + - [sgl-lines-sapp.c](https://github.com/floooh/sokol-samples/blob/master/sapp/sgl-lines-sapp.c) + - [sgl-microui-sapp.c](https://github.com/floooh/sokol-samples/blob/master/sapp/sgl-microui-sapp.c) + +- **01-Apr-2019** (not an April Fool's joke): There's a new **sokol_gl.h** +util header which implements an 'OpenGL-1.x-in-spirit' rendering API on top +of sokol_gfx.h (vertex specification via begin/end, and a matrix stack). This is +only a small subset of OpenGL 1.x, mainly intended for debug-visualization or +simple tasks like 2D UI rendering. As always, sample code is in the +[sokol-samples](https://github.com/floooh/sokol-samples) project. + +- **15-Mar-2019**: various Dear ImGui related changes: + - there's a new utility header sokol_imgui.h with a simple drop-in + renderer for Dear ImGui on top of sokol_gfx.h and sokol_app.h + (sokol_app.h is optional, and only used for input handling) + - the sokol_gfx_imgui.h debug inspection header no longer + depends on internal data structures and functions of sokol_gfx.h, as such + it is now a normal *utility header* and has been moved to the *utils* + directory + - the implementation macro for sokol_gfx_imgui.h has been changed + from SOKOL_IMPL to SOKOL_GFX_IMGUI_IMPL (so when you suddenly get + unresolved linker errors, that's the reason) + - all headers now have two preprocessor defines for the declaration + and implementation (for instance in sokol_gfx.h: SOKOL_GFX_INCLUDED + and SOKOL_GFX_IMPL_INCLUDED) these are checked in the utility-headers + to provide useful error message when dependent headers are missing + +- **05-Mar-2019**: sokol_gfx.h now has a 'trace hook' API, and I have started +implementing optional debug-inspection-UI headers on top of Dear ImGui: + - sokol_gfx.h has a new function *sg_install_trace_hooks()*, this allows + you to install a callback function for each public sokol_gfx.h function + (and a couple of error callbacks). For more details, search for "TRACE HOOKS" + in sokol_gfx.h + - when creating sokol_gfx.h resources, you can now set a 'debug label' + in the desc structure, this is ignored by sokol_gfx.h itself, but is + useful for debuggers or profilers hooking in via the new trace hooks + - likewise, two new functions *sg_push_debug_group()* and *sg_pop_debug_group()* + can be used to group related drawing functions under a name, this + is also ignored by sokol_gfx.h itself and only useful when hooking + into the API calls + - I have started a new 'subproject' in the 'imgui' directory, this will + contain a slowly growing set of optional debug-inspection-UI headers + which allow to peek under the hood of the Sokol headers. The UIs are + implemented with [Dear ImGui](https://github.com/ocornut/imgui). Again, + see the README in the 'imgui' directory and the headers in there + for details, and check out the live demos on the [Sokol Sample Webpage](https://floooh.github.io/sokol-html5/) + (click on the little UI buttons in the top right corner of each thumbnail) + +- **21-Feb-2019**: sokol_app.h and sokol_audio.h now have an alternative +set of callbacks with user_data arguments. This is useful if you don't +want or cannot store your own application state in global variables. +See the header documentation in sokol_app.h and sokol_audio.h for details, +and check out the samples *sapp/noentry-sapp.c* and *sapp/modplay-sapp.c* +in https://github.com/floooh/sokol-samples + +- **19-Feb-2019**: sokol_app.h now has an alternative mode where it doesn't +"hijack" the platform's main() function. Search for SOKOL_NO_ENTRY in +sokol_app.h for details and documentation. + +- **26-Jan-2019**: sokol_app.h now has an Android backend contributed by + [Gustav Olsson](https://github.com/gustavolsson)! + See the [sokol-samples readme](https://github.com/floooh/sokol-samples/blob/master/README.md) + for build instructions. + +- **21-Jan-2019**: sokol_gfx.h - pool-slot-generation-counters and a dummy backend: + - Resource pool slots now have a generation-counter for the resource-id + unique-tag, instead of a single counter for the whole pool. This allows + to create many more unique handles. + - sokol_gfx.h now has a dummy backend, activated by defining SOKOL_DUMMY_BACKEND + (instead of SOKOL_METAL, SOKOL_D3D11, ...), this allows to write + 'headless' tests (and there's now a sokol-gfx-test in the sokol-samples + repository which mainly tests the resource pool system) + +- **12-Jan-2019**: sokol_gfx.h - setting the pipeline state and resource +bindings now happens in separate calls, specifically: + - *sg_apply_draw_state()* has been replaced with *sg_apply_pipeline()* and + *sg_apply_bindings()* + - the *sg_draw_state* struct has been replaced with *sg_bindings* + - *sg_apply_uniform_block()* has been renamed to *sg_apply_uniforms()* + +All existing code will still work. See [this blog +post](https://floooh.github.io/2019/01/12/sokol-apply-pipeline.html) for +details. + +- **29-Oct-2018**: + - sokol_gfx.h has a new function **sg_append_buffer()** which allows to + append new data to a buffer multiple times per frame and interleave this + with draw calls. This basically implements the + D3D11_MAP_WRITE_NO_OVERWRITE update strategy for buffer objects. For + example usage, see the updated Dear ImGui samples in the [sokol_samples + repo](https://github.com/floooh/sokol-samples) + - the GL state cache in sokol_gfx.h handles buffers bindings in a + more robust way, previously it might have happened that the + buffer binding gets confused when creating buffers or updating + buffer contents in the render loop + +- **17-Oct-2018**: sokol_args.h added + +- **26-Sep-2018**: sokol_audio.h ready for prime time :) + +- **11-May-2018**: sokol_gfx.h now autodetects iOS vs MacOS in the Metal +backend during compilation using the standard define TARGET_OS_IPHONE defined +in the TargetConditionals.h system header, please replace the old +backend-selection defines SOKOL_METAL_MACOS and SOKOL_METAL_IOS with +**SOKOL_METAL** + +- **20-Apr-2018**: 3 new context-switching functions have been added +to make it possible to use sokol together with applications that +use multiple GL contexts. On D3D11 and Metal, the functions are currently +empty. See the new section ```WORKING WITH CONTEXTS``` in the sokol_gfx.h +header documentation, and the new sample [multiwindow-glfw](https://github.com/floooh/sokol-samples/blob/master/glfw/multiwindow-glfw.c) + +- **31-Jan-2018**: The vertex layout declaration in sg\_pipeline\_desc had +some fairly subtle flaws and has been changed to work like Metal or Vulkan. +The gist is that the vertex-buffer-layout properties (vertex stride, +vertex-step-rate and -step-function for instancing) is now defined in a +separate array from the vertex attributes. This removes some brittle backend +code which tries to guess the right vertex attribute slot if no attribute +names are given, and which was wrong for shader-code-generation pipelines +which reorder the vertex attributes (I stumbled over this when porting the +Oryol Gfx module over to sokol-gfx). Some code samples: + +```c +// a complete vertex layout declaration with a single input buffer +// with two vertex attributes +sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ + .layout = { + .buffers = { + [0] = { + .stride = 20, + .step_func = SG_VERTEXSTEP_PER_VERTEX, + .step_rate = 1 + } + }, + .attrs = { + [0] = { + .name = "pos", + .offset = 0, + .format = SG_VERTEXFORMAT_FLOAT3, + .buffer_index = 0 + }, + [1] = { + .name = "uv", + .offset = 12, + .format = SG_VERTEXFORMAT_FLOAT2, + .buffer_index = 0 + } + } + }, + ... +}); + +// if the vertex layout has no gaps, we can get rid of the strides and offsets: +sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ + .layout = { + .buffers = { + [0] = { + .step_func = SG_VERTEXSTEP_PER_VERTEX, + .step_rate=1 + } + }, + .attrs = { + [0] = { + .name = "pos", + .format = SG_VERTEXFORMAT_FLOAT3, + .buffer_index = 0 + }, + [1] = { + .name = "uv", + .format = SG_VERTEXFORMAT_FLOAT2, + .buffer_index = 0 + } + } + }, + ... +}); + +// we can also get rid of the other default-values, which leaves buffers[0] +// as all-defaults, so it can disappear completely: +sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ + .layout = { + .attrs = { + [0] = { .name = "pos", .format = SG_VERTEXFORMAT_FLOAT3 }, + [1] = { .name = "uv", .format = SG_VERTEXFORMAT_FLOAT2 } + } + }, + ... +}); + +// and finally on GL3.3 and Metal and we don't need the attribute names +// (on D3D11, a semantic name and index must be provided though) +sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ + .layout = { + .attrs = { + [0] = { .format = SG_VERTEXFORMAT_FLOAT3 }, + [1] = { .format = SG_VERTEXFORMAT_FLOAT2 } + } + }, + ... +}); +``` + +Please check the sample code in https://github.com/floooh/sokol-samples for +more examples! + +Enjoy! diff --git a/sokol-app-sys/external/sokol/fips.yml b/sokol-app-sys/external/sokol/fips.yml new file mode 100644 index 00000000..372d8fd5 --- /dev/null +++ b/sokol-app-sys/external/sokol/fips.yml @@ -0,0 +1,2 @@ +exports: + header-dirs: [ ".", "util" ] diff --git a/sokol-app-sys/external/sokol/sokol_app.h b/sokol-app-sys/external/sokol/sokol_app.h new file mode 100644 index 00000000..c2c3631b --- /dev/null +++ b/sokol-app-sys/external/sokol/sokol_app.h @@ -0,0 +1,7421 @@ +#ifndef SOKOL_APP_INCLUDED + +/* + sokol_app.h -- cross-platform application wrapper + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + Optionally provide the following defines with your own implementations: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_LOG(msg) - your own logging function (default: puts(msg)) + SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) + SOKOL_ABORT() - called after an unrecoverable error (default: abort()) + SOKOL_WIN32_FORCE_MAIN - define this on Win32 to use a main() entry point instead of WinMain + SOKOL_NO_ENTRY - define this if sokol_app.h shouldn't "hijack" the main() function + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + SOKOL_CALLOC - your own calloc function (default: calloc(n, s)) + SOKOL_FREE - your own free function (default: free(p)) + + Optionally define the following to force debug checks and validations + even in release mode: + + SOKOL_DEBUG - by default this is defined if _DEBUG is defined + + If sokol_app.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + Portions of the Windows and Linux GL initialization and event code have been + taken from GLFW (http://www.glfw.org/) + + iOS onscreen keyboard support 'inspired' by libgdx. + + If you use sokol_app.h together with sokol_gfx.h, include both headers + in the implementation source file, and include sokol_app.h before + sokol_gfx.h since sokol_app.h will also include the required 3D-API + headers. + + On Windows, a minimal 'GL header' and function loader is integrated which + contains just enough of GL for sokol_gfx.h. If you want to use your own + GL header-generator/loader instead, define SOKOL_WIN32_NO_GL_LOADER + before including the implementation part of sokol_app.h. + + For example code, see https://github.com/floooh/sokol-samples/tree/master/sapp + + FEATURE OVERVIEW + ================ + sokol_app.h provides a minimalistic cross-platform API which + implements the 'application-wrapper' parts of a 3D application: + + - a common application entry function + - creates a window and 3D-API context/device with a 'default framebuffer' + - makes the rendered frame visible + - provides keyboard-, mouse- and low-level touch-events + - platforms: MacOS, iOS, HTML5, Win32, Linux, Android (RaspberryPi) + - 3D-APIs: Metal, D3D11, GL3.2, GLES2, GLES3, WebGL, WebGL2 + + FEATURE/PLATFORM MATRIX + ======================= + | Windows | macOS | Linux | iOS | Android | Raspi | HTML5 + --------------------+---------+-------+-------+-------+---------+-------+------- + gl 3.x | YES | YES | YES | --- | --- | --- | --- + gles2/webgl | --- | --- | --- | YES | YES | TODO | YES + gles3/webgl2 | --- | --- | --- | YES | YES | --- | YES + metal | --- | YES | --- | YES | --- | --- | --- + d3d11 | YES | --- | --- | --- | --- | --- | --- + KEY_DOWN | YES | YES | YES | SOME | TODO | TODO | YES + KEY_UP | YES | YES | YES | SOME | TODO | TODO | YES + CHAR | YES | YES | YES | YES | TODO | TODO | YES + MOUSE_DOWN | YES | YES | YES | --- | --- | TODO | YES + MOUSE_UP | YES | YES | YES | --- | --- | TODO | YES + MOUSE_SCROLL | YES | YES | YES | --- | --- | TODO | YES + MOUSE_MOVE | YES | YES | YES | --- | --- | TODO | YES + MOUSE_ENTER | YES | YES | YES | --- | --- | TODO | YES + MOUSE_LEAVE | YES | YES | YES | --- | --- | TODO | YES + TOUCHES_BEGAN | --- | --- | --- | YES | YES | --- | YES + TOUCHES_MOVED | --- | --- | --- | YES | YES | --- | YES + TOUCHES_ENDED | --- | --- | --- | YES | YES | --- | YES + TOUCHES_CANCELLED | --- | --- | --- | YES | YES | --- | YES + RESIZED | YES | YES | YES | YES | YES | --- | YES + ICONIFIED | YES | YES | YES | --- | --- | --- | --- + RESTORED | YES | YES | YES | --- | --- | --- | --- + SUSPENDED | --- | --- | --- | YES | YES | --- | TODO + RESUMED | --- | --- | --- | YES | YES | --- | TODO + QUIT_REQUESTED | YES | YES | YES | --- | --- | TODO | --- + UPDATE_CURSOR | YES | YES | TODO | --- | --- | --- | TODO + IME | TODO | TODO? | TODO | ??? | TODO | ??? | ??? + key repeat flag | YES | YES | YES | --- | --- | TODO | YES + windowed | YES | YES | YES | --- | --- | TODO | YES + fullscreen | YES | YES | TODO | YES | YES | TODO | --- + pointer lock | TODO | TODO | TODO | --- | --- | TODO | TODO + screen keyboard | --- | --- | --- | YES | TODO | --- | YES + swap interval | YES | YES | YES | YES | TODO | TODO | YES + high-dpi | YES | YES | TODO | YES | YES | TODO | YES + + - what about bluetooth keyboard / mouse on mobile platforms? + + STEP BY STEP + ============ + --- Add a sokol_main() function to your code which returns a sapp_desc structure + with initialization parameters and callback function pointers. This + function is called very early, usually at the start of the + platform's entry function (e.g. main or WinMain). You should do as + little as possible here, since the rest of your code might be called + from another thread (this depends on the platform): + + sapp_desc sokol_main(int argc, char* argv[]) { + return (sapp_desc) { + .width = 640, + .height = 480, + .init_cb = my_init_func, + .frame_cb = my_frame_func, + .cleanup_cb = my_cleanup_func, + .event_cb = my_event_func, + ... + }; + } + + There are many more setup parameters, but these are the most important. + For a complete list search for the sapp_desc structure declaration + below. + + DO NOT call any sokol-app function from inside sokol_main(), since + sokol-app will not be initialized at this point. + + The .width and .height parameters are the preferred size of the 3D + rendering canvas. The actual size may differ from this depending on + platform and other circumstances. Also the canvas size may change at + any time (for instance when the user resizes the application window, + or rotates the mobile device). + + All provided function callbacks will be called from the same thread, + but this may be different from the thread where sokol_main() was called. + + .init_cb (void (*)(void)) + This function is called once after the application window, + 3D rendering context and swap chain have been created. The + function takes no arguments and has no return value. + .frame_cb (void (*)(void)) + This is the per-frame callback, which is usually called 60 + times per second. This is where your application would update + most of its state and perform all rendering. + .cleanup_cb (void (*)(void)) + The cleanup callback is called once right before the application + quits. + .event_cb (void (*)(const sapp_event* event)) + The event callback is mainly for input handling, but in the + future may also be used to communicate other types of events + to the application. Keep the event_cb struct member zero-initialized + if your application doesn't require event handling. + .fail_cb (void (*)(const char* msg)) + The fail callback is called when a fatal error is encountered + during start which doesn't allow the program to continue. + Providing a callback here gives you a chance to show an error message + to the user. The default behaviour is SOKOL_LOG(msg) + + As you can see, those 'standard callbacks' don't have a user_data + argument, so any data that needs to be preserved between callbacks + must live in global variables. If you're allergic to global variables + or cannot use them for other reasons, an alternative set of callbacks + can be defined in sapp_desc, together with a user_data pointer: + + .user_data (void*) + The user-data argument for the callbacks below + .init_userdata_cb (void (*)(void* user_data)) + .frame_userdata_cb (void (*)(void* user_data)) + .cleanup_userdata_cb (void (*)(void* user_data)) + .event_cb (void(*)(const sapp_event* event, void* user_data)) + .fail_cb (void(*)(const char* msg, void* user_data)) + These are the user-data versions of the callback functions. You + can mix those with the standard callbacks that don't have the + user_data argument. + + The function sapp_userdata() can be used to query the user_data + pointer provided in the sapp_desc struct. + + You can call sapp_query_desc() to get a copy of the + original sapp_desc structure. + + NOTE that there's also an alternative compile mode where sokol_app.h + doesn't "hijack" the main() function. Search below for SOKOL_NO_ENTRY. + + --- Implement the initialization callback function (init_cb), this is called + once after the rendering surface, 3D API and swap chain have been + initialized by sokol_app. All sokol-app functions can be called + from inside the initialization callback, the most useful functions + at this point are: + + int sapp_width(void) + Returns the current width of the default framebuffer, this may change + from one frame to the next. + int sapp_height(void) + Likewise, returns the current height of the default framebuffer. + + bool sapp_gles2(void) + Returns true if a GLES2 or WebGL context has been created. This + is useful when a GLES3/WebGL2 context was requested but is not + available so that sokol_app.h had to fallback to GLES2/WebGL. + + const void* sapp_metal_get_device(void) + const void* sapp_metal_get_renderpass_descriptor(void) + const void* sapp_metal_get_drawable(void) + If the Metal backend has been selected, these functions return pointers + to various Metal API objects required for rendering, otherwise + they return a null pointer. These void pointers are actually + Objective-C ids converted with an ARC __bridge cast so that + they ids can be tunnel through C code. Also note that the returned + pointers to the renderpass-descriptor and drawable may change from one + frame to the next, only the Metal device object is guaranteed to + stay the same. + + const void* sapp_macos_get_window(void) + On macOS, get the NSWindow object pointer, otherwise a null pointer. + Before being used as Objective-C object, the void* must be converted + back with an ARC __bridge cast. + + const void* sapp_ios_get_window(void) + On iOS, get the UIWindow object pointer, otherwise a null pointer. + Before being used as Objective-C object, the void* must be converted + back with an ARC __bridge cast. + + const void* sapp_win32_get_hwnd(void) + On Windows, get the window's HWND, otherwise a null pointer. The + HWND has been cast to a void pointer in order to be tunneled + through code which doesn't include Windows.h. + + const void* sapp_d3d11_get_device(void); + const void* sapp_d3d11_get_device_context(void); + const void* sapp_d3d11_get_render_target_view(void); + const void* sapp_d3d11_get_depth_stencil_view(void); + Similar to the sapp_metal_* functions, the sapp_d3d11_* functions + return pointers to D3D11 API objects required for rendering, + only if the D3D11 backend has been selected. Otherwise they + return a null pointer. Note that the returned pointers to the + render-target-view and depth-stencil-view may change from one + frame to the next! + + const void* sapp_android_get_native_activity(void); + On Android, get the native activity ANativeActivity pointer, otherwise + a null pointer. + + --- Implement the frame-callback function, this function will be called + on the same thread as the init callback, but might be on a different + thread than the sokol_main() function. Note that the size of + the rendering framebuffer might have changed since the frame callback + was called last. Call the functions sapp_width() and sapp_height() + each frame to get the current size. + + --- Optionally implement the event-callback to handle input events. + sokol-app provides the following type of input events: + - a 'virtual key' was pressed down or released + - a single text character was entered (provided as UTF-32 code point) + - a mouse button was pressed down or released (left, right, middle) + - mouse-wheel or 2D scrolling events + - the mouse was moved + - the mouse has entered or left the application window boundaries + - low-level, portable multi-touch events (began, moved, ended, cancelled) + - the application window was resized, iconified or restored + - the application was suspended or restored (on mobile platforms) + - the user or application code has asked to quit the application + + --- Implement the cleanup-callback function, this is called once + after the user quits the application (see the section + "APPLICATION QUIT" for detailed information on quitting + behaviour, and how to intercept a pending quit (for instance to show a + "Really Quit?" dialog box). Note that the cleanup-callback isn't + called on the web and mobile platforms. + + HIGH-DPI RENDERING + ================== + You can set the sapp_desc.high_dpi flag during initialization to request + a full-resolution framebuffer on HighDPI displays. The default behaviour + is sapp_desc.high_dpi=false, this means that the application will + render to a lower-resolution framebuffer on HighDPI displays and the + rendered content will be upscaled by the window system composer. + + In a HighDPI scenario, you still request the same window size during + sokol_main(), but the framebuffer sizes returned by sapp_width() + and sapp_height() will be scaled up according to the DPI scaling + ratio. You can also get a DPI scaling factor with the function + sapp_dpi_scale(). + + Here's an example on a Mac with Retina display: + + sapp_desc sokol_main() { + return (sapp_desc) { + .width = 640, + .height = 480, + .high_dpi = true, + ... + }; + } + + The functions sapp_width(), sapp_height() and sapp_dpi_scale() will + return the following values: + + sapp_width -> 1280 + sapp_height -> 960 + sapp_dpi_scale -> 2.0 + + If the high_dpi flag is false, or you're not running on a Retina display, + the values would be: + + sapp_width -> 640 + sapp_height -> 480 + sapp_dpi_scale -> 1.0 + + APPLICATION QUIT + ================ + Without special quit handling, a sokol_app.h application will exist + 'gracefully' when the user clicks the window close-button. 'Graceful + exit' means that the application-provided cleanup callback will be + called. + + This 'graceful exit' is only supported on native desktop platforms, on + the web and mobile platforms an application may be terminated at any time + by the user or browser/OS runtime environment without a chance to run + custom shutdown code. + + On the web platform, you can call the following function to let the + browser open a standard popup dialog before the user wants to leave a site: + + sapp_html5_ask_leave_site(bool ask); + + The initial state of the associated internal flag can be provided + at startup via sapp_desc.html5_ask_leave_site. + + This feature should only be used sparingly in critical situations - for + instance when the user would loose data - since popping up modal dialog + boxes is considered quite rude in the web world. Note that there's no way + to customize the content of this dialog box or run any code as a result + of the user's decision. Also note that the user must have interacted with + the site before the dialog box will appear. These are all security measures + to prevent fishing. + + On native desktop platforms, sokol_app.h provides more control over the + application-quit-process. It's possible to initiate a 'programmatic quit' + from the application code, and a quit initiated by the application user + can be intercepted (for instance to show a custom dialog box). + + This 'programmatic quit protocol' is implemented trough 3 functions + and 1 event: + + - sapp_quit(): This function simply quits the application without + giving the user a chance to intervene. Usually this might + be called when the user clicks the 'Ok' button in a 'Really Quit?' + dialog box + - sapp_request_quit(): Calling sapp_request_quit() will send the + event SAPP_EVENTTYPE_QUIT_REQUESTED to the applications event handler + callback, giving the user code a chance to intervene and cancel the + pending quit process (for instance to show a 'Really Quit?' dialog + box). If the event handler callback does nothing, the application + will be quit as usual. To prevent this, call the function + sapp_cancel_quit() from inside the event handler. + - sapp_cancel_quit(): Cancels a pending quit request, either initiated + by the user clicking the window close button, or programmatically + by calling sapp_request_quit(). The only place where calling this + function makes sense is from inside the event handler callback when + the SAPP_EVENTTYPE_QUIT_REQUESTED event has been received. + - SAPP_EVENTTYPE_QUIT_REQUESTED: this event is sent when the user + clicks the window's close button or application code calls the + sapp_request_quit() function. The event handler callback code can handle + this event by calling sapp_cancel_quit() to cancel the quit. + If the event is ignored, the application will quit as usual. + + The Dear ImGui HighDPI sample contains example code of how to + implement a 'Really Quit?' dialog box with Dear ImGui (native desktop + platforms only), and for showing the hardwired "Leave Site?" dialog box + when running on the web platform: + + https://floooh.github.io/sokol-html5/wasm/imgui-highdpi-sapp.html + + FULLSCREEN + ========== + If the sapp_desc.fullscreen flag is true, sokol-app will try to create + a fullscreen window on platforms with a 'proper' window system + (mobile devices will always use fullscreen). The implementation details + depend on the target platform, in general sokol-app will use a + 'soft approach' which doesn't interfere too much with the platform's + window system (for instance borderless fullscreen window instead of + a 'real' fullscreen mode). Such details might change over time + as sokol-app is adapted for different needs. + + The most important effect of fullscreen mode to keep in mind is that + the requested canvas width and height will be ignored for the initial + window size, calling sapp_width() and sapp_height() will instead return + the resolution of the fullscreen canvas (however the provided size + might still be used for the non-fullscreen window, in case the user can + switch back from fullscreen- to windowed-mode). + + ONSCREEN KEYBOARD + ================= + On some platforms which don't provide a physical keyboard, sokol-app + can display the platform's integrated onscreen keyboard for text + input. To request that the onscreen keyboard is shown, call + + sapp_show_keyboard(true); + + Likewise, to hide the keyboard call: + + sapp_show_keyboard(false); + + Note that on the web platform, the keyboard can only be shown from + inside an input handler. On such platforms, sapp_show_keyboard() + will only work as expected when it is called from inside the + sokol-app event callback function. When called from other places, + an internal flag will be set, and the onscreen keyboard will be + called at the next 'legal' opportunity (when the next input event + is handled). + + OPTIONAL: DON'T HIJACK main() (#define SOKOL_NO_ENTRY) + ====================================================== + In its default configuration, sokol_app.h "hijacks" the platform's + standard main() function. This was done because different platforms + have different main functions which are not compatible with + C's main() (for instance WinMain on Windows has completely different + arguments). However, this "main hijacking" posed a problem for + usage scenarios like integrating sokol_app.h with other languages than + C or C++, so an alternative SOKOL_NO_ENTRY mode has been added + in which the user code provides the platform's main function: + + - define SOKOL_NO_ENTRY before including the sokol_app.h implementation + - do *not* provide a sokol_main() function + - instead provide the standard main() function of the platform + - from the main function, call the function ```sapp_run()``` which + takes a pointer to an ```sapp_desc``` structure. + - ```sapp_run()``` takes over control and calls the provided init-, frame-, + shutdown- and event-callbacks just like in the default model, it + will only return when the application quits (or not at all on some + platforms, like emscripten) + + NOTE: SOKOL_NO_ENTRY is currently not supported on Android. + + TEMP NOTE DUMP + ============== + - onscreen keyboard support on Android requires Java :(, should we even bother? + - sapp_desc needs a bool whether to initialize depth-stencil surface + - GL context initialization needs more control (at least what GL version to initialize) + - application icon + - mouse pointer visibility(?) + - the UPDATE_CURSOR event currently behaves differently between Win32 and OSX + (Win32 sends the event each frame when the mouse moves and is inside the window + client area, OSX sends it only once when the mouse enters the client area) + - the Android implementation calls cleanup_cb() and destroys the egl context in onDestroy + at the latest but should do it earlier, in onStop, as an app is "killable" after onStop + on Android Honeycomb and later (it can't be done at the moment as the app may be started + again after onStop and the sokol lifecycle does not yet handle context teardown/bringup) + + FIXME: ERROR HANDLING (this will need an error callback function) + + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_APP_INCLUDED (1) +#include +#include + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + SAPP_MAX_TOUCHPOINTS = 8, + SAPP_MAX_MOUSEBUTTONS = 3, + SAPP_MAX_KEYCODES = 512, +}; + +typedef enum sapp_event_type { + SAPP_EVENTTYPE_INVALID, + SAPP_EVENTTYPE_KEY_DOWN, + SAPP_EVENTTYPE_KEY_UP, + SAPP_EVENTTYPE_CHAR, + SAPP_EVENTTYPE_MOUSE_DOWN, + SAPP_EVENTTYPE_MOUSE_UP, + SAPP_EVENTTYPE_MOUSE_SCROLL, + SAPP_EVENTTYPE_MOUSE_MOVE, + SAPP_EVENTTYPE_MOUSE_ENTER, + SAPP_EVENTTYPE_MOUSE_LEAVE, + SAPP_EVENTTYPE_TOUCHES_BEGAN, + SAPP_EVENTTYPE_TOUCHES_MOVED, + SAPP_EVENTTYPE_TOUCHES_ENDED, + SAPP_EVENTTYPE_TOUCHES_CANCELLED, + SAPP_EVENTTYPE_RESIZED, + SAPP_EVENTTYPE_ICONIFIED, + SAPP_EVENTTYPE_RESTORED, + SAPP_EVENTTYPE_SUSPENDED, + SAPP_EVENTTYPE_RESUMED, + SAPP_EVENTTYPE_UPDATE_CURSOR, + SAPP_EVENTTYPE_QUIT_REQUESTED, + _SAPP_EVENTTYPE_NUM, + _SAPP_EVENTTYPE_FORCE_U32 = 0x7FFFFFFF +} sapp_event_type; + +/* key codes are the same names and values as GLFW */ +typedef enum sapp_keycode { + SAPP_KEYCODE_INVALID = 0, + SAPP_KEYCODE_SPACE = 32, + SAPP_KEYCODE_APOSTROPHE = 39, /* ' */ + SAPP_KEYCODE_COMMA = 44, /* , */ + SAPP_KEYCODE_MINUS = 45, /* - */ + SAPP_KEYCODE_PERIOD = 46, /* . */ + SAPP_KEYCODE_SLASH = 47, /* / */ + SAPP_KEYCODE_0 = 48, + SAPP_KEYCODE_1 = 49, + SAPP_KEYCODE_2 = 50, + SAPP_KEYCODE_3 = 51, + SAPP_KEYCODE_4 = 52, + SAPP_KEYCODE_5 = 53, + SAPP_KEYCODE_6 = 54, + SAPP_KEYCODE_7 = 55, + SAPP_KEYCODE_8 = 56, + SAPP_KEYCODE_9 = 57, + SAPP_KEYCODE_SEMICOLON = 59, /* ; */ + SAPP_KEYCODE_EQUAL = 61, /* = */ + SAPP_KEYCODE_A = 65, + SAPP_KEYCODE_B = 66, + SAPP_KEYCODE_C = 67, + SAPP_KEYCODE_D = 68, + SAPP_KEYCODE_E = 69, + SAPP_KEYCODE_F = 70, + SAPP_KEYCODE_G = 71, + SAPP_KEYCODE_H = 72, + SAPP_KEYCODE_I = 73, + SAPP_KEYCODE_J = 74, + SAPP_KEYCODE_K = 75, + SAPP_KEYCODE_L = 76, + SAPP_KEYCODE_M = 77, + SAPP_KEYCODE_N = 78, + SAPP_KEYCODE_O = 79, + SAPP_KEYCODE_P = 80, + SAPP_KEYCODE_Q = 81, + SAPP_KEYCODE_R = 82, + SAPP_KEYCODE_S = 83, + SAPP_KEYCODE_T = 84, + SAPP_KEYCODE_U = 85, + SAPP_KEYCODE_V = 86, + SAPP_KEYCODE_W = 87, + SAPP_KEYCODE_X = 88, + SAPP_KEYCODE_Y = 89, + SAPP_KEYCODE_Z = 90, + SAPP_KEYCODE_LEFT_BRACKET = 91, /* [ */ + SAPP_KEYCODE_BACKSLASH = 92, /* \ */ + SAPP_KEYCODE_RIGHT_BRACKET = 93, /* ] */ + SAPP_KEYCODE_GRAVE_ACCENT = 96, /* ` */ + SAPP_KEYCODE_WORLD_1 = 161, /* non-US #1 */ + SAPP_KEYCODE_WORLD_2 = 162, /* non-US #2 */ + SAPP_KEYCODE_ESCAPE = 256, + SAPP_KEYCODE_ENTER = 257, + SAPP_KEYCODE_TAB = 258, + SAPP_KEYCODE_BACKSPACE = 259, + SAPP_KEYCODE_INSERT = 260, + SAPP_KEYCODE_DELETE = 261, + SAPP_KEYCODE_RIGHT = 262, + SAPP_KEYCODE_LEFT = 263, + SAPP_KEYCODE_DOWN = 264, + SAPP_KEYCODE_UP = 265, + SAPP_KEYCODE_PAGE_UP = 266, + SAPP_KEYCODE_PAGE_DOWN = 267, + SAPP_KEYCODE_HOME = 268, + SAPP_KEYCODE_END = 269, + SAPP_KEYCODE_CAPS_LOCK = 280, + SAPP_KEYCODE_SCROLL_LOCK = 281, + SAPP_KEYCODE_NUM_LOCK = 282, + SAPP_KEYCODE_PRINT_SCREEN = 283, + SAPP_KEYCODE_PAUSE = 284, + SAPP_KEYCODE_F1 = 290, + SAPP_KEYCODE_F2 = 291, + SAPP_KEYCODE_F3 = 292, + SAPP_KEYCODE_F4 = 293, + SAPP_KEYCODE_F5 = 294, + SAPP_KEYCODE_F6 = 295, + SAPP_KEYCODE_F7 = 296, + SAPP_KEYCODE_F8 = 297, + SAPP_KEYCODE_F9 = 298, + SAPP_KEYCODE_F10 = 299, + SAPP_KEYCODE_F11 = 300, + SAPP_KEYCODE_F12 = 301, + SAPP_KEYCODE_F13 = 302, + SAPP_KEYCODE_F14 = 303, + SAPP_KEYCODE_F15 = 304, + SAPP_KEYCODE_F16 = 305, + SAPP_KEYCODE_F17 = 306, + SAPP_KEYCODE_F18 = 307, + SAPP_KEYCODE_F19 = 308, + SAPP_KEYCODE_F20 = 309, + SAPP_KEYCODE_F21 = 310, + SAPP_KEYCODE_F22 = 311, + SAPP_KEYCODE_F23 = 312, + SAPP_KEYCODE_F24 = 313, + SAPP_KEYCODE_F25 = 314, + SAPP_KEYCODE_KP_0 = 320, + SAPP_KEYCODE_KP_1 = 321, + SAPP_KEYCODE_KP_2 = 322, + SAPP_KEYCODE_KP_3 = 323, + SAPP_KEYCODE_KP_4 = 324, + SAPP_KEYCODE_KP_5 = 325, + SAPP_KEYCODE_KP_6 = 326, + SAPP_KEYCODE_KP_7 = 327, + SAPP_KEYCODE_KP_8 = 328, + SAPP_KEYCODE_KP_9 = 329, + SAPP_KEYCODE_KP_DECIMAL = 330, + SAPP_KEYCODE_KP_DIVIDE = 331, + SAPP_KEYCODE_KP_MULTIPLY = 332, + SAPP_KEYCODE_KP_SUBTRACT = 333, + SAPP_KEYCODE_KP_ADD = 334, + SAPP_KEYCODE_KP_ENTER = 335, + SAPP_KEYCODE_KP_EQUAL = 336, + SAPP_KEYCODE_LEFT_SHIFT = 340, + SAPP_KEYCODE_LEFT_CONTROL = 341, + SAPP_KEYCODE_LEFT_ALT = 342, + SAPP_KEYCODE_LEFT_SUPER = 343, + SAPP_KEYCODE_RIGHT_SHIFT = 344, + SAPP_KEYCODE_RIGHT_CONTROL = 345, + SAPP_KEYCODE_RIGHT_ALT = 346, + SAPP_KEYCODE_RIGHT_SUPER = 347, + SAPP_KEYCODE_MENU = 348, +} sapp_keycode; + +typedef struct sapp_touchpoint { + uintptr_t identifier; + float pos_x; + float pos_y; + bool changed; +} sapp_touchpoint; + +typedef enum sapp_mousebutton { + SAPP_MOUSEBUTTON_INVALID = -1, + SAPP_MOUSEBUTTON_LEFT = 0, + SAPP_MOUSEBUTTON_RIGHT = 1, + SAPP_MOUSEBUTTON_MIDDLE = 2, +} sapp_mousebutton; + +enum { + SAPP_MODIFIER_SHIFT = (1<<0), + SAPP_MODIFIER_CTRL = (1<<1), + SAPP_MODIFIER_ALT = (1<<2), + SAPP_MODIFIER_SUPER = (1<<3) +}; + +typedef struct sapp_event { + uint64_t frame_count; + sapp_event_type type; + sapp_keycode key_code; + uint32_t char_code; + bool key_repeat; + uint32_t modifiers; + sapp_mousebutton mouse_button; + float mouse_x; + float mouse_y; + float scroll_x; + float scroll_y; + int num_touches; + sapp_touchpoint touches[SAPP_MAX_TOUCHPOINTS]; + int window_width; + int window_height; + int framebuffer_width; + int framebuffer_height; +} sapp_event; + +typedef struct sapp_desc { + void (*init_cb)(void); /* these are the user-provided callbacks without user data */ + void (*frame_cb)(void); + void (*cleanup_cb)(void); + void (*event_cb)(const sapp_event*); + void (*fail_cb)(const char*); + + void* user_data; /* these are the user-provided callbacks with user data */ + void (*init_userdata_cb)(void*); + void (*frame_userdata_cb)(void*); + void (*cleanup_userdata_cb)(void*); + void (*event_userdata_cb)(const sapp_event*, void*); + void (*fail_userdata_cb)(const char*, void*); + + int width; /* the preferred width of the window / canvas */ + int height; /* the preferred height of the window / canvas */ + int sample_count; /* MSAA sample count */ + int swap_interval; /* the preferred swap interval (ignored on some platforms) */ + bool high_dpi; /* whether the rendering canvas is full-resolution on HighDPI displays */ + bool fullscreen; /* whether the window should be created in fullscreen mode */ + bool alpha; /* whether the framebuffer should have an alpha channel (ignored on some platforms) */ + const char* window_title; /* the window title as UTF-8 encoded string */ + bool user_cursor; /* if true, user is expected to manage cursor image in SAPP_EVENTTYPE_UPDATE_CURSOR */ + + const char* html5_canvas_name; /* the name (id) of the HTML5 canvas element, default is "canvas" */ + bool html5_canvas_resize; /* if true, the HTML5 canvas size is set to sapp_desc.width/height, otherwise canvas size is tracked */ + bool html5_preserve_drawing_buffer; /* HTML5 only: whether to preserve default framebuffer content between frames */ + bool html5_premultiplied_alpha; /* HTML5 only: whether the rendered pixels use premultiplied alpha convention */ + bool html5_ask_leave_site; /* initial state of the internal html5_ask_leave_site flag (see sapp_html5_ask_leave_site()) */ + bool ios_keyboard_resizes_canvas; /* if true, showing the iOS keyboard shrinks the canvas */ + bool gl_force_gles2; /* if true, setup GLES2/WebGL even if GLES3/WebGL2 is available */ +} sapp_desc; + +/* user-provided functions */ +extern sapp_desc sokol_main(int argc, char* argv[]); + +/* returns true after sokol-app has been initialized */ +SOKOL_API_DECL bool sapp_isvalid(void); +/* returns the current framebuffer width in pixels */ +SOKOL_API_DECL int sapp_width(void); +/* returns the current framebuffer height in pixels */ +SOKOL_API_DECL int sapp_height(void); +/* returns true when high_dpi was requested and actually running in a high-dpi scenario */ +SOKOL_API_DECL bool sapp_high_dpi(void); +/* returns the dpi scaling factor (window pixels to framebuffer pixels) */ +SOKOL_API_DECL float sapp_dpi_scale(void); +/* show or hide the mobile device onscreen keyboard */ +SOKOL_API_DECL void sapp_show_keyboard(bool visible); +/* return true if the mobile device onscreen keyboard is currently shown */ +SOKOL_API_DECL bool sapp_keyboard_shown(void); +/* show or hide the mouse cursor */ +SOKOL_API_DECL void sapp_show_mouse(bool visible); +/* show or hide the mouse cursor */ +SOKOL_API_DECL bool sapp_mouse_shown(); +/* return the userdata pointer optionally provided in sapp_desc */ +SOKOL_API_DECL void* sapp_userdata(void); +/* return a copy of the sapp_desc structure */ +SOKOL_API_DECL sapp_desc sapp_query_desc(void); +/* initiate a "soft quit" (sends SAPP_EVENTTYPE_QUIT_REQUESTED) */ +SOKOL_API_DECL void sapp_request_quit(void); +/* cancel a pending quit (when SAPP_EVENTTYPE_QUIT_REQUESTED has been received) */ +SOKOL_API_DECL void sapp_cancel_quit(void); +/* intiate a "hard quit" (quit application without sending SAPP_EVENTTYPE_QUIT_REQUSTED) */ +SOKOL_API_DECL void sapp_quit(void); +/* get the current frame counter (for comparison with sapp_event.frame_count) */ +SOKOL_API_DECL uint64_t sapp_frame_count(void); + +/* special run-function for SOKOL_NO_ENTRY (in standard mode this is an empty stub) */ +SOKOL_API_DECL int sapp_run(const sapp_desc* desc); + +/* GL: return true when GLES2 fallback is active (to detect fallback from GLES3) */ +SOKOL_API_DECL bool sapp_gles2(void); + +/* HTML5: enable or disable the hardwired "Leave Site?" dialog box */ +SOKOL_API_DECL void sapp_html5_ask_leave_site(bool ask); + +/* Metal: get ARC-bridged pointer to Metal device object */ +SOKOL_API_DECL const void* sapp_metal_get_device(void); +/* Metal: get ARC-bridged pointer to this frame's renderpass descriptor */ +SOKOL_API_DECL const void* sapp_metal_get_renderpass_descriptor(void); +/* Metal: get ARC-bridged pointer to current drawable */ +SOKOL_API_DECL const void* sapp_metal_get_drawable(void); +/* macOS: get ARC-bridged pointer to macOS NSWindow */ +SOKOL_API_DECL const void* sapp_macos_get_window(void); +/* iOS: get ARC-bridged pointer to iOS UIWindow */ +SOKOL_API_DECL const void* sapp_ios_get_window(void); + +/* D3D11: get pointer to ID3D11Device object */ +SOKOL_API_DECL const void* sapp_d3d11_get_device(void); +/* D3D11: get pointer to ID3D11DeviceContext object */ +SOKOL_API_DECL const void* sapp_d3d11_get_device_context(void); +/* D3D11: get pointer to ID3D11RenderTargetView object */ +SOKOL_API_DECL const void* sapp_d3d11_get_render_target_view(void); +/* D3D11: get pointer to ID3D11DepthStencilView */ +SOKOL_API_DECL const void* sapp_d3d11_get_depth_stencil_view(void); +/* Win32: get the HWND window handle */ +SOKOL_API_DECL const void* sapp_win32_get_hwnd(void); + +/* Android: get native activity handle */ +SOKOL_API_DECL const void* sapp_android_get_native_activity(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif // SOKOL_APP_INCLUDED + +/*-- IMPLEMENTATION ----------------------------------------------------------*/ +#ifdef SOKOL_IMPL +#define SOKOL_APP_IMPL_INCLUDED (1) + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */ +#pragma warning(disable:4115) /* named type definition in parentheses */ +#pragma warning(disable:4054) /* 'type cast': from function pointer */ +#pragma warning(disable:4055) /* 'type cast': from data pointer */ +#pragma warning(disable:4505) /* unreferenced local function has been removed */ +#endif + +#include /* memset */ + +/* check if the config defines are alright */ +#if defined(__APPLE__) + #if !__has_feature(objc_arc) + #error "sokol_app.h requires ARC (Automatic Reference Counting) on MacOS and iOS" + #endif + #include + #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE + /* iOS */ + #if !defined(SOKOL_METAL) && !defined(SOKOL_GLES3) + #error("sokol_app.h: unknown 3D API selected for iOS, must be SOKOL_METAL or SOKOL_GLES3") + #endif + #else + /* MacOS */ + #if !defined(SOKOL_METAL) && !defined(SOKOL_GLCORE33) + #error("sokol_app.h: unknown 3D API selected for MacOS, must be SOKOL_METAL or SOKOL_GLCORE33") + #endif + #endif +#elif defined(__EMSCRIPTEN__) + /* emscripten (asm.js or wasm) */ + #if !defined(SOKOL_GLES3) && !defined(SOKOL_GLES2) + #error("sokol_app.h: unknown 3D API selected for emscripten, must be SOKOL_GLES3 or SOKOL_GLES2") + #endif +#elif defined(_WIN32) + /* Windows (D3D11 or GL) */ + #if !defined(SOKOL_D3D11) && !defined(SOKOL_GLCORE33) + #error("sokol_app.h: unknown 3D API selected for Win32, must be SOKOL_D3D11 or SOKOL_GLCORE33") + #endif +#elif defined(__ANDROID__) + /* Android */ + #if !defined(SOKOL_GLES3) && !defined(SOKOL_GLES2) + #error("sokol_app.h: unknown 3D API selected for Android, must be SOKOL_GLES3 or SOKOL_GLES2") + #endif + #if defined(SOKOL_NO_ENTRY) + #error("sokol_app.h: SOKOL_NO_ENTRY is not supported on Android") + #endif +#elif defined(__linux__) || defined(__unix__) + /* Linux */ + #if !defined(SOKOL_GLCORE33) + #error("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE33") + #endif +#else +#error "sokol_app.h: Unknown platform" +#endif + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#if !defined(SOKOL_CALLOC) || !defined(SOKOL_FREE) + #include +#endif +#if !defined(SOKOL_CALLOC) + #define SOKOL_CALLOC(n,s) calloc(n,s) +#endif +#if !defined(SOKOL_FREE) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #if defined(__ANDROID__) + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); __android_log_write(ANDROID_LOG_INFO, "SOKOL_APP", s); } + #else + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #endif + #else + #define SOKOL_LOG(s) + #endif +#endif +#ifndef SOKOL_ABORT + #include + #define SOKOL_ABORT() abort() +#endif +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif +#ifndef _SOKOL_UNUSED + #define _SOKOL_UNUSED(x) (void)(x) +#endif + +/* helper macros */ +#define _sapp_def(val, def) (((val) == 0) ? (def) : (val)) +#define _sapp_absf(a) (((a)<0.0f)?-(a):(a)) + +enum { + _SAPP_MAX_TITLE_LENGTH = 128, +}; + +typedef struct { + bool valid; + int window_width; + int window_height; + int framebuffer_width; + int framebuffer_height; + int sample_count; + int swap_interval; + float dpi_scale; + bool gles2_fallback; + bool first_frame; + bool init_called; + bool cleanup_called; + bool quit_requested; + bool quit_ordered; + const char* html5_canvas_name; + bool html5_ask_leave_site; + char window_title[_SAPP_MAX_TITLE_LENGTH]; /* UTF-8 */ + wchar_t window_title_wide[_SAPP_MAX_TITLE_LENGTH]; /* UTF-32 or UCS-2 */ + uint64_t frame_count; + float mouse_x; + float mouse_y; + bool win32_mouse_tracked; + bool onscreen_keyboard_shown; + sapp_event event; + sapp_desc desc; + sapp_keycode keycodes[SAPP_MAX_KEYCODES]; +} _sapp_state; +static _sapp_state _sapp; + +_SOKOL_PRIVATE void _sapp_fail(const char* msg) { + if (_sapp.desc.fail_cb) { + _sapp.desc.fail_cb(msg); + } + else if (_sapp.desc.fail_userdata_cb) { + _sapp.desc.fail_userdata_cb(msg, _sapp.desc.user_data); + } + else { + SOKOL_LOG(msg); + } + SOKOL_ABORT(); +} + +_SOKOL_PRIVATE void _sapp_call_init(void) { + if (_sapp.desc.init_cb) { + _sapp.desc.init_cb(); + } + else if (_sapp.desc.init_userdata_cb) { + _sapp.desc.init_userdata_cb(_sapp.desc.user_data); + } + _sapp.init_called = true; +} + +_SOKOL_PRIVATE void _sapp_call_frame(void) { + if (_sapp.init_called && !_sapp.cleanup_called) { + if (_sapp.desc.frame_cb) { + _sapp.desc.frame_cb(); + } + else if (_sapp.desc.frame_userdata_cb) { + _sapp.desc.frame_userdata_cb(_sapp.desc.user_data); + } + } +} + +_SOKOL_PRIVATE void _sapp_call_cleanup(void) { + if (!_sapp.cleanup_called) { + if (_sapp.desc.cleanup_cb) { + _sapp.desc.cleanup_cb(); + } + else if (_sapp.desc.cleanup_userdata_cb) { + _sapp.desc.cleanup_userdata_cb(_sapp.desc.user_data); + } + _sapp.cleanup_called = true; + } +} + +_SOKOL_PRIVATE void _sapp_call_event(const sapp_event* e) { + if (!_sapp.cleanup_called) { + if (_sapp.desc.event_cb) { + _sapp.desc.event_cb(e); + } + else if (_sapp.desc.event_userdata_cb) { + _sapp.desc.event_userdata_cb(e, _sapp.desc.user_data); + } + } +} + +_SOKOL_PRIVATE void _sapp_strcpy(const char* src, char* dst, int max_len) { + SOKOL_ASSERT(src && dst && (max_len > 0)); + char* const end = &(dst[max_len-1]); + char c = 0; + for (int i = 0; i < max_len; i++) { + c = *src; + if (c != 0) { + src++; + } + *dst++ = c; + } + /* truncated? */ + if (c != 0) { + *end = 0; + } +} + +_SOKOL_PRIVATE void _sapp_init_state(const sapp_desc* desc) { + memset(&_sapp, 0, sizeof(_sapp)); + _sapp.desc = *desc; + _sapp.first_frame = true; + _sapp.window_width = _sapp_def(_sapp.desc.width, 640); + _sapp.window_height = _sapp_def(_sapp.desc.height, 480); + _sapp.framebuffer_width = _sapp.window_width; + _sapp.framebuffer_height = _sapp.window_height; + _sapp.sample_count = _sapp_def(_sapp.desc.sample_count, 1); + _sapp.swap_interval = _sapp_def(_sapp.desc.swap_interval, 1); + _sapp.html5_canvas_name = _sapp_def(_sapp.desc.html5_canvas_name, "canvas"); + _sapp.html5_ask_leave_site = _sapp.desc.html5_ask_leave_site; + if (_sapp.desc.window_title) { + _sapp_strcpy(_sapp.desc.window_title, _sapp.window_title, sizeof(_sapp.window_title)); + } + else { + _sapp_strcpy("sokol_app", _sapp.window_title, sizeof(_sapp.window_title)); + } + _sapp.dpi_scale = 1.0f; +} + +_SOKOL_PRIVATE void _sapp_init_event(sapp_event_type type) { + memset(&_sapp.event, 0, sizeof(_sapp.event)); + _sapp.event.type = type; + _sapp.event.frame_count = _sapp.frame_count; + _sapp.event.mouse_button = SAPP_MOUSEBUTTON_INVALID; + _sapp.event.window_width = _sapp.window_width; + _sapp.event.window_height = _sapp.window_height; + _sapp.event.framebuffer_width = _sapp.framebuffer_width; + _sapp.event.framebuffer_height = _sapp.framebuffer_height; +} + +_SOKOL_PRIVATE bool _sapp_events_enabled(void) { + /* only send events when an event callback is set, and the init function was called */ + return (_sapp.desc.event_cb || _sapp.desc.event_userdata_cb) && _sapp.init_called; +} + +_SOKOL_PRIVATE sapp_keycode _sapp_translate_key(int scan_code) { + if ((scan_code >= 0) && (scan_code < SAPP_MAX_KEYCODES)) { + return _sapp.keycodes[scan_code]; + } + else { + return SAPP_KEYCODE_INVALID; + } +} + +_SOKOL_PRIVATE void _sapp_frame(void) { + if (_sapp.first_frame) { + _sapp.first_frame = false; + _sapp_call_init(); + } + _sapp_call_frame(); + _sapp.frame_count++; +} + +/*== MacOS/iOS ===============================================================*/ + +#if defined(__APPLE__) + +/*== MacOS ===================================================================*/ +#if defined(TARGET_OS_IPHONE) && !TARGET_OS_IPHONE + +#if defined(SOKOL_METAL) +#import +#import +#elif defined(SOKOL_GLCORE33) +#ifndef GL_SILENCE_DEPRECATION +#define GL_SILENCE_DEPRECATION +#endif +#include +#include +#endif + +@interface _sapp_macos_app_delegate : NSObject +@end +@interface _sapp_macos_window_delegate : NSObject +@end +#if defined(SOKOL_METAL) +@interface _sapp_macos_mtk_view_dlg : NSObject +@end +@interface _sapp_macos_view : MTKView +{ + NSTrackingArea* trackingArea; +} +@end +#elif defined(SOKOL_GLCORE33) +@interface _sapp_macos_view : NSOpenGLView +{ + NSTrackingArea* trackingArea; +} +- (void)timerFired:(id)sender; +- (void)prepareOpenGL; +- (void)drawRect:(NSRect)bounds; +@end +#endif + +static NSWindow* _sapp_macos_window_obj; +static _sapp_macos_window_delegate* _sapp_macos_win_dlg_obj; +static _sapp_macos_app_delegate* _sapp_macos_app_dlg_obj; +static _sapp_macos_view* _sapp_view_obj; +#if defined(SOKOL_METAL) +static _sapp_macos_mtk_view_dlg* _sapp_macos_mtk_view_dlg_obj; +static id _sapp_mtl_device_obj; +#elif defined(SOKOL_GLCORE33) +static NSOpenGLPixelFormat* _sapp_macos_glpixelformat_obj; +static NSTimer* _sapp_macos_timer_obj; +#endif +static uint32_t _sapp_macos_flags_changed_store; + +_SOKOL_PRIVATE void _sapp_macos_init_keytable(void) { + _sapp.keycodes[0x1D] = SAPP_KEYCODE_0; + _sapp.keycodes[0x12] = SAPP_KEYCODE_1; + _sapp.keycodes[0x13] = SAPP_KEYCODE_2; + _sapp.keycodes[0x14] = SAPP_KEYCODE_3; + _sapp.keycodes[0x15] = SAPP_KEYCODE_4; + _sapp.keycodes[0x17] = SAPP_KEYCODE_5; + _sapp.keycodes[0x16] = SAPP_KEYCODE_6; + _sapp.keycodes[0x1A] = SAPP_KEYCODE_7; + _sapp.keycodes[0x1C] = SAPP_KEYCODE_8; + _sapp.keycodes[0x19] = SAPP_KEYCODE_9; + _sapp.keycodes[0x00] = SAPP_KEYCODE_A; + _sapp.keycodes[0x0B] = SAPP_KEYCODE_B; + _sapp.keycodes[0x08] = SAPP_KEYCODE_C; + _sapp.keycodes[0x02] = SAPP_KEYCODE_D; + _sapp.keycodes[0x0E] = SAPP_KEYCODE_E; + _sapp.keycodes[0x03] = SAPP_KEYCODE_F; + _sapp.keycodes[0x05] = SAPP_KEYCODE_G; + _sapp.keycodes[0x04] = SAPP_KEYCODE_H; + _sapp.keycodes[0x22] = SAPP_KEYCODE_I; + _sapp.keycodes[0x26] = SAPP_KEYCODE_J; + _sapp.keycodes[0x28] = SAPP_KEYCODE_K; + _sapp.keycodes[0x25] = SAPP_KEYCODE_L; + _sapp.keycodes[0x2E] = SAPP_KEYCODE_M; + _sapp.keycodes[0x2D] = SAPP_KEYCODE_N; + _sapp.keycodes[0x1F] = SAPP_KEYCODE_O; + _sapp.keycodes[0x23] = SAPP_KEYCODE_P; + _sapp.keycodes[0x0C] = SAPP_KEYCODE_Q; + _sapp.keycodes[0x0F] = SAPP_KEYCODE_R; + _sapp.keycodes[0x01] = SAPP_KEYCODE_S; + _sapp.keycodes[0x11] = SAPP_KEYCODE_T; + _sapp.keycodes[0x20] = SAPP_KEYCODE_U; + _sapp.keycodes[0x09] = SAPP_KEYCODE_V; + _sapp.keycodes[0x0D] = SAPP_KEYCODE_W; + _sapp.keycodes[0x07] = SAPP_KEYCODE_X; + _sapp.keycodes[0x10] = SAPP_KEYCODE_Y; + _sapp.keycodes[0x06] = SAPP_KEYCODE_Z; + _sapp.keycodes[0x27] = SAPP_KEYCODE_APOSTROPHE; + _sapp.keycodes[0x2A] = SAPP_KEYCODE_BACKSLASH; + _sapp.keycodes[0x2B] = SAPP_KEYCODE_COMMA; + _sapp.keycodes[0x18] = SAPP_KEYCODE_EQUAL; + _sapp.keycodes[0x32] = SAPP_KEYCODE_GRAVE_ACCENT; + _sapp.keycodes[0x21] = SAPP_KEYCODE_LEFT_BRACKET; + _sapp.keycodes[0x1B] = SAPP_KEYCODE_MINUS; + _sapp.keycodes[0x2F] = SAPP_KEYCODE_PERIOD; + _sapp.keycodes[0x1E] = SAPP_KEYCODE_RIGHT_BRACKET; + _sapp.keycodes[0x29] = SAPP_KEYCODE_SEMICOLON; + _sapp.keycodes[0x2C] = SAPP_KEYCODE_SLASH; + _sapp.keycodes[0x0A] = SAPP_KEYCODE_WORLD_1; + _sapp.keycodes[0x33] = SAPP_KEYCODE_BACKSPACE; + _sapp.keycodes[0x39] = SAPP_KEYCODE_CAPS_LOCK; + _sapp.keycodes[0x75] = SAPP_KEYCODE_DELETE; + _sapp.keycodes[0x7D] = SAPP_KEYCODE_DOWN; + _sapp.keycodes[0x77] = SAPP_KEYCODE_END; + _sapp.keycodes[0x24] = SAPP_KEYCODE_ENTER; + _sapp.keycodes[0x35] = SAPP_KEYCODE_ESCAPE; + _sapp.keycodes[0x7A] = SAPP_KEYCODE_F1; + _sapp.keycodes[0x78] = SAPP_KEYCODE_F2; + _sapp.keycodes[0x63] = SAPP_KEYCODE_F3; + _sapp.keycodes[0x76] = SAPP_KEYCODE_F4; + _sapp.keycodes[0x60] = SAPP_KEYCODE_F5; + _sapp.keycodes[0x61] = SAPP_KEYCODE_F6; + _sapp.keycodes[0x62] = SAPP_KEYCODE_F7; + _sapp.keycodes[0x64] = SAPP_KEYCODE_F8; + _sapp.keycodes[0x65] = SAPP_KEYCODE_F9; + _sapp.keycodes[0x6D] = SAPP_KEYCODE_F10; + _sapp.keycodes[0x67] = SAPP_KEYCODE_F11; + _sapp.keycodes[0x6F] = SAPP_KEYCODE_F12; + _sapp.keycodes[0x69] = SAPP_KEYCODE_F13; + _sapp.keycodes[0x6B] = SAPP_KEYCODE_F14; + _sapp.keycodes[0x71] = SAPP_KEYCODE_F15; + _sapp.keycodes[0x6A] = SAPP_KEYCODE_F16; + _sapp.keycodes[0x40] = SAPP_KEYCODE_F17; + _sapp.keycodes[0x4F] = SAPP_KEYCODE_F18; + _sapp.keycodes[0x50] = SAPP_KEYCODE_F19; + _sapp.keycodes[0x5A] = SAPP_KEYCODE_F20; + _sapp.keycodes[0x73] = SAPP_KEYCODE_HOME; + _sapp.keycodes[0x72] = SAPP_KEYCODE_INSERT; + _sapp.keycodes[0x7B] = SAPP_KEYCODE_LEFT; + _sapp.keycodes[0x3A] = SAPP_KEYCODE_LEFT_ALT; + _sapp.keycodes[0x3B] = SAPP_KEYCODE_LEFT_CONTROL; + _sapp.keycodes[0x38] = SAPP_KEYCODE_LEFT_SHIFT; + _sapp.keycodes[0x37] = SAPP_KEYCODE_LEFT_SUPER; + _sapp.keycodes[0x6E] = SAPP_KEYCODE_MENU; + _sapp.keycodes[0x47] = SAPP_KEYCODE_NUM_LOCK; + _sapp.keycodes[0x79] = SAPP_KEYCODE_PAGE_DOWN; + _sapp.keycodes[0x74] = SAPP_KEYCODE_PAGE_UP; + _sapp.keycodes[0x7C] = SAPP_KEYCODE_RIGHT; + _sapp.keycodes[0x3D] = SAPP_KEYCODE_RIGHT_ALT; + _sapp.keycodes[0x3E] = SAPP_KEYCODE_RIGHT_CONTROL; + _sapp.keycodes[0x3C] = SAPP_KEYCODE_RIGHT_SHIFT; + _sapp.keycodes[0x36] = SAPP_KEYCODE_RIGHT_SUPER; + _sapp.keycodes[0x31] = SAPP_KEYCODE_SPACE; + _sapp.keycodes[0x30] = SAPP_KEYCODE_TAB; + _sapp.keycodes[0x7E] = SAPP_KEYCODE_UP; + _sapp.keycodes[0x52] = SAPP_KEYCODE_KP_0; + _sapp.keycodes[0x53] = SAPP_KEYCODE_KP_1; + _sapp.keycodes[0x54] = SAPP_KEYCODE_KP_2; + _sapp.keycodes[0x55] = SAPP_KEYCODE_KP_3; + _sapp.keycodes[0x56] = SAPP_KEYCODE_KP_4; + _sapp.keycodes[0x57] = SAPP_KEYCODE_KP_5; + _sapp.keycodes[0x58] = SAPP_KEYCODE_KP_6; + _sapp.keycodes[0x59] = SAPP_KEYCODE_KP_7; + _sapp.keycodes[0x5B] = SAPP_KEYCODE_KP_8; + _sapp.keycodes[0x5C] = SAPP_KEYCODE_KP_9; + _sapp.keycodes[0x45] = SAPP_KEYCODE_KP_ADD; + _sapp.keycodes[0x41] = SAPP_KEYCODE_KP_DECIMAL; + _sapp.keycodes[0x4B] = SAPP_KEYCODE_KP_DIVIDE; + _sapp.keycodes[0x4C] = SAPP_KEYCODE_KP_ENTER; + _sapp.keycodes[0x51] = SAPP_KEYCODE_KP_EQUAL; + _sapp.keycodes[0x43] = SAPP_KEYCODE_KP_MULTIPLY; + _sapp.keycodes[0x4E] = SAPP_KEYCODE_KP_SUBTRACT; +} + +_SOKOL_PRIVATE void _sapp_run(const sapp_desc* desc) { + _sapp_init_state(desc); + _sapp_macos_init_keytable(); + [NSApplication sharedApplication]; + NSApp.activationPolicy = NSApplicationActivationPolicyRegular; + _sapp_macos_app_dlg_obj = [[_sapp_macos_app_delegate alloc] init]; + NSApp.delegate = _sapp_macos_app_dlg_obj; + [NSApp activateIgnoringOtherApps:YES]; + [NSApp run]; +} + +/* MacOS entry function */ +#if !defined(SOKOL_NO_ENTRY) +int main(int argc, char* argv[]) { + sapp_desc desc = sokol_main(argc, argv); + _sapp_run(&desc); + return 0; +} +#endif /* SOKOL_NO_ENTRY */ + +_SOKOL_PRIVATE void _sapp_macos_update_dimensions(void) { + #if defined(SOKOL_METAL) + const CGSize fb_size = [_sapp_view_obj drawableSize]; + _sapp.framebuffer_width = fb_size.width; + _sapp.framebuffer_height = fb_size.height; + #elif defined(SOKOL_GLCORE33) + const NSRect fb_rect = [_sapp_view_obj convertRectToBacking:[_sapp_view_obj frame]]; + _sapp.framebuffer_width = fb_rect.size.width; + _sapp.framebuffer_height = fb_rect.size.height; + #endif + const NSRect bounds = [_sapp_view_obj bounds]; + _sapp.window_width = bounds.size.width; + _sapp.window_height = bounds.size.height; + SOKOL_ASSERT((_sapp.framebuffer_width > 0) && (_sapp.framebuffer_height > 0)); + _sapp.dpi_scale = (float)_sapp.framebuffer_width / (float)_sapp.window_width; +} + +_SOKOL_PRIVATE void _sapp_macos_frame(void) { + const NSPoint mouse_pos = [_sapp_macos_window_obj mouseLocationOutsideOfEventStream]; + _sapp.mouse_x = mouse_pos.x * _sapp.dpi_scale; + _sapp.mouse_y = _sapp.framebuffer_height - (mouse_pos.y * _sapp.dpi_scale) - 1; + _sapp_frame(); + if (_sapp.quit_requested || _sapp.quit_ordered) { + [_sapp_macos_window_obj performClose:nil]; + } +} + +@implementation _sapp_macos_app_delegate +- (void)applicationDidFinishLaunching:(NSNotification*)aNotification { + if (_sapp.desc.fullscreen) { + NSRect screen_rect = NSScreen.mainScreen.frame; + _sapp.window_width = screen_rect.size.width; + _sapp.window_height = screen_rect.size.height; + if (_sapp.desc.high_dpi) { + _sapp.framebuffer_width = 2 * _sapp.window_width; + _sapp.framebuffer_height = 2 * _sapp.window_height; + } + else { + _sapp.framebuffer_width = _sapp.window_width; + _sapp.framebuffer_height = _sapp.window_height; + } + _sapp.dpi_scale = (float)_sapp.framebuffer_width / (float) _sapp.window_width; + } + const NSUInteger style = + NSWindowStyleMaskTitled | + NSWindowStyleMaskClosable | + NSWindowStyleMaskMiniaturizable | + NSWindowStyleMaskResizable; + NSRect window_rect = NSMakeRect(0, 0, _sapp.window_width, _sapp.window_height); + _sapp_macos_window_obj = [[NSWindow alloc] + initWithContentRect:window_rect + styleMask:style + backing:NSBackingStoreBuffered + defer:NO]; + _sapp_macos_window_obj.title = [NSString stringWithUTF8String:_sapp.window_title]; + _sapp_macos_window_obj.acceptsMouseMovedEvents = YES; + _sapp_macos_window_obj.restorable = YES; + _sapp_macos_win_dlg_obj = [[_sapp_macos_window_delegate alloc] init]; + _sapp_macos_window_obj.delegate = _sapp_macos_win_dlg_obj; + #if defined(SOKOL_METAL) + _sapp_mtl_device_obj = MTLCreateSystemDefaultDevice(); + _sapp_macos_mtk_view_dlg_obj = [[_sapp_macos_mtk_view_dlg alloc] init]; + _sapp_view_obj = [[_sapp_macos_view alloc] init]; + [_sapp_view_obj updateTrackingAreas]; + _sapp_view_obj.preferredFramesPerSecond = 60 / _sapp.swap_interval; + _sapp_view_obj.delegate = _sapp_macos_mtk_view_dlg_obj; + _sapp_view_obj.device = _sapp_mtl_device_obj; + _sapp_view_obj.colorPixelFormat = MTLPixelFormatBGRA8Unorm; + _sapp_view_obj.depthStencilPixelFormat = MTLPixelFormatDepth32Float_Stencil8; + _sapp_view_obj.sampleCount = _sapp.sample_count; + _sapp_macos_window_obj.contentView = _sapp_view_obj; + [_sapp_macos_window_obj makeFirstResponder:_sapp_view_obj]; + if (!_sapp.desc.high_dpi) { + CGSize drawable_size = { (CGFloat) _sapp.framebuffer_width, (CGFloat) _sapp.framebuffer_height }; + _sapp_view_obj.drawableSize = drawable_size; + } + _sapp_macos_update_dimensions(); + _sapp_view_obj.layer.magnificationFilter = kCAFilterNearest; + #elif defined(SOKOL_GLCORE33) + NSOpenGLPixelFormatAttribute attrs[32]; + int i = 0; + attrs[i++] = NSOpenGLPFAAccelerated; + attrs[i++] = NSOpenGLPFADoubleBuffer; + attrs[i++] = NSOpenGLPFAOpenGLProfile; attrs[i++] = NSOpenGLProfileVersion3_2Core; + attrs[i++] = NSOpenGLPFAColorSize; attrs[i++] = 24; + attrs[i++] = NSOpenGLPFAAlphaSize; attrs[i++] = 8; + attrs[i++] = NSOpenGLPFADepthSize; attrs[i++] = 24; + attrs[i++] = NSOpenGLPFAStencilSize; attrs[i++] = 8; + if (_sapp.sample_count > 1) { + attrs[i++] = NSOpenGLPFAMultisample; + attrs[i++] = NSOpenGLPFASampleBuffers; attrs[i++] = 1; + attrs[i++] = NSOpenGLPFASamples; attrs[i++] = _sapp.sample_count; + } + else { + attrs[i++] = NSOpenGLPFASampleBuffers; attrs[i++] = 0; + } + attrs[i++] = 0; + _sapp_macos_glpixelformat_obj = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs]; + SOKOL_ASSERT(_sapp_macos_glpixelformat_obj != nil); + + _sapp_view_obj = [[_sapp_macos_view alloc] + initWithFrame:window_rect + pixelFormat:_sapp_macos_glpixelformat_obj]; + [_sapp_view_obj updateTrackingAreas]; + if (_sapp.desc.high_dpi) { + [_sapp_view_obj setWantsBestResolutionOpenGLSurface:YES]; + } + else { + [_sapp_view_obj setWantsBestResolutionOpenGLSurface:NO]; + } + + _sapp_macos_window_obj.contentView = _sapp_view_obj; + [_sapp_macos_window_obj makeFirstResponder:_sapp_view_obj]; + + _sapp_macos_timer_obj = [NSTimer timerWithTimeInterval:0.001 + target:_sapp_view_obj + selector:@selector(timerFired:) + userInfo:nil + repeats:YES]; + [[NSRunLoop currentRunLoop] addTimer:_sapp_macos_timer_obj forMode:NSDefaultRunLoopMode]; + #endif + _sapp.valid = true; + if (_sapp.desc.fullscreen) { + /* on GL, this already toggles a rendered frame, so set the valid flag before */ + [_sapp_macos_window_obj toggleFullScreen:self]; + } + else { + [_sapp_macos_window_obj center]; + } + [_sapp_macos_window_obj makeKeyAndOrderFront:nil]; +} + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender { + return YES; +} +@end + +_SOKOL_PRIVATE uint32_t _sapp_macos_mod(NSEventModifierFlags f) { + uint32_t m = 0; + if (f & NSEventModifierFlagShift) { + m |= SAPP_MODIFIER_SHIFT; + } + if (f & NSEventModifierFlagControl) { + m |= SAPP_MODIFIER_CTRL; + } + if (f & NSEventModifierFlagOption) { + m |= SAPP_MODIFIER_ALT; + } + if (f & NSEventModifierFlagCommand) { + m |= SAPP_MODIFIER_SUPER; + } + return m; +} + +_SOKOL_PRIVATE void _sapp_macos_mouse_event(sapp_event_type type, sapp_mousebutton btn, uint32_t mod) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp.event.mouse_button = btn; + _sapp.event.modifiers = mod; + _sapp.event.mouse_x = _sapp.mouse_x; + _sapp.event.mouse_y = _sapp.mouse_y; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_macos_key_event(sapp_event_type type, sapp_keycode key, bool repeat, uint32_t mod) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp.event.key_code = key; + _sapp.event.key_repeat = repeat; + _sapp.event.modifiers = mod; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_macos_app_event(sapp_event_type type) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp_call_event(&_sapp.event); + } +} + +@implementation _sapp_macos_window_delegate +- (BOOL)windowShouldClose:(id)sender { + /* only give user-code a chance to intervene when sapp_quit() wasn't already called */ + if (!_sapp.quit_ordered) { + /* if window should be closed and event handling is enabled, give user code + a chance to intervene via sapp_cancel_quit() + */ + _sapp.quit_requested = true; + _sapp_macos_app_event(SAPP_EVENTTYPE_QUIT_REQUESTED); + /* user code hasn't intervened, quit the app */ + if (_sapp.quit_requested) { + _sapp.quit_ordered = true; + } + } + if (_sapp.quit_ordered) { + _sapp_call_cleanup(); + return YES; + } + else { + return NO; + } +} + +- (void)windowDidResize:(NSNotification*)notification { + _sapp_macos_update_dimensions(); + _sapp_macos_app_event(SAPP_EVENTTYPE_RESIZED); +} + +- (void)windowDidMiniaturize:(NSNotification*)notification { + _sapp_macos_app_event(SAPP_EVENTTYPE_ICONIFIED); +} + +- (void)windowDidDeminiaturize:(NSNotification*)notification { + _sapp_macos_app_event(SAPP_EVENTTYPE_RESTORED); +} +@end + +#if defined(SOKOL_METAL) +@implementation _sapp_macos_mtk_view_dlg +- (void)drawInMTKView:(MTKView*)view { + @autoreleasepool { + _sapp_macos_frame(); + } +} +- (void)mtkView:(MTKView*)view drawableSizeWillChange:(CGSize)size { + /* this is required by the protocol, but we can't do anything useful here */ +} +@end +#endif + +@implementation _sapp_macos_view +#if defined(SOKOL_GLCORE33) +- (void)timerFired:(id)sender { + [self setNeedsDisplay:YES]; +} +- (void)prepareOpenGL { + [super prepareOpenGL]; + GLint swapInt = 1; + NSOpenGLContext* ctx = [_sapp_view_obj openGLContext]; + [ctx setValues:&swapInt forParameter:NSOpenGLContextParameterSwapInterval]; + [ctx makeCurrentContext]; +} +- (void)drawRect:(NSRect)bound { + _sapp_macos_frame(); + [[_sapp_view_obj openGLContext] flushBuffer]; +} +#endif + +- (BOOL)isOpaque { + return YES; +} +- (BOOL)canBecomeKey { + return YES; +} +- (BOOL)acceptsFirstResponder { + return YES; +} +- (void)updateTrackingAreas { + if (trackingArea != nil) { + [self removeTrackingArea:trackingArea]; + trackingArea = nil; + } + const NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited | + NSTrackingActiveInKeyWindow | + NSTrackingEnabledDuringMouseDrag | + NSTrackingCursorUpdate | + NSTrackingInVisibleRect | + NSTrackingAssumeInside; + trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] options:options owner:self userInfo:nil]; + [self addTrackingArea:trackingArea]; + [super updateTrackingAreas]; +} +- (void)mouseEntered:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_ENTER, SAPP_MOUSEBUTTON_INVALID, _sapp_macos_mod(event.modifierFlags)); +} +- (void)mouseExited:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_LEAVE, SAPP_MOUSEBUTTON_INVALID, _sapp_macos_mod(event.modifierFlags)); +} +- (void)mouseDown:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, SAPP_MOUSEBUTTON_LEFT, _sapp_macos_mod(event.modifierFlags)); +} +- (void)mouseUp:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_LEFT, _sapp_macos_mod(event.modifierFlags)); +} +- (void)rightMouseDown:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, SAPP_MOUSEBUTTON_RIGHT, _sapp_macos_mod(event.modifierFlags)); +} +- (void)rightMouseUp:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_RIGHT, _sapp_macos_mod(event.modifierFlags)); +} +- (void)mouseMoved:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID , _sapp_macos_mod(event.modifierFlags)); +} +- (void)mouseDragged:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID , _sapp_macos_mod(event.modifierFlags)); +} +- (void)rightMouseDragged:(NSEvent*)event { + _sapp_macos_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID, _sapp_macos_mod(event.modifierFlags)); +} +- (void)scrollWheel:(NSEvent*)event { + if (_sapp_events_enabled()) { + float dx = (float) event.scrollingDeltaX; + float dy = (float) event.scrollingDeltaY; + if (event.hasPreciseScrollingDeltas) { + dx *= 0.1; + dy *= 0.1; + } + if ((_sapp_absf(dx) > 0.0f) || (_sapp_absf(dy) > 0.0f)) { + _sapp_init_event(SAPP_EVENTTYPE_MOUSE_SCROLL); + _sapp.event.modifiers = _sapp_macos_mod(event.modifierFlags); + _sapp.event.mouse_x = _sapp.mouse_x; + _sapp.event.mouse_y = _sapp.mouse_y; + _sapp.event.scroll_x = dx; + _sapp.event.scroll_y = dy; + _sapp_call_event(&_sapp.event); + } + } +} +- (void)keyDown:(NSEvent*)event { + if (_sapp_events_enabled()) { + const uint32_t mods = _sapp_macos_mod(event.modifierFlags); + _sapp_macos_key_event(SAPP_EVENTTYPE_KEY_DOWN, _sapp_translate_key(event.keyCode), event.isARepeat, mods); + const NSString* chars = event.characters; + const NSUInteger len = chars.length; + if (len > 0) { + _sapp_init_event(SAPP_EVENTTYPE_CHAR); + _sapp.event.modifiers = mods; + for (NSUInteger i = 0; i < len; i++) { + const unichar codepoint = [chars characterAtIndex:i]; + if ((codepoint & 0xFF00) == 0xF700) { + continue; + } + _sapp.event.char_code = codepoint; + _sapp.event.key_repeat = event.isARepeat; + _sapp_call_event(&_sapp.event); + } + } + } +} +- (void)keyUp:(NSEvent*)event { + _sapp_macos_key_event(SAPP_EVENTTYPE_KEY_UP, + _sapp_translate_key(event.keyCode), + event.isARepeat, + _sapp_macos_mod(event.modifierFlags)); +} +- (void)flagsChanged:(NSEvent*)event { + const uint32_t old_f = _sapp_macos_flags_changed_store; + const uint32_t new_f = event.modifierFlags; + _sapp_macos_flags_changed_store = new_f; + sapp_keycode key_code = SAPP_KEYCODE_INVALID; + bool down = false; + if ((new_f ^ old_f) & NSEventModifierFlagShift) { + key_code = SAPP_KEYCODE_LEFT_SHIFT; + down = 0 != (new_f & NSEventModifierFlagShift); + } + if ((new_f ^ old_f) & NSEventModifierFlagControl) { + key_code = SAPP_KEYCODE_LEFT_CONTROL; + down = 0 != (new_f & NSEventModifierFlagControl); + } + if ((new_f ^ old_f) & NSEventModifierFlagOption) { + key_code = SAPP_KEYCODE_LEFT_ALT; + down = 0 != (new_f & NSEventModifierFlagOption); + } + if ((new_f ^ old_f) & NSEventModifierFlagCommand) { + key_code = SAPP_KEYCODE_LEFT_SUPER; + down = 0 != (new_f & NSEventModifierFlagCommand); + } + if (key_code != SAPP_KEYCODE_INVALID) { + _sapp_macos_key_event(down ? SAPP_EVENTTYPE_KEY_DOWN : SAPP_EVENTTYPE_KEY_UP, + key_code, + false, + _sapp_macos_mod(event.modifierFlags)); + } +} +- (void)cursorUpdate:(NSEvent*)event { + if (_sapp.desc.user_cursor) { + _sapp_macos_app_event(SAPP_EVENTTYPE_UPDATE_CURSOR); + } +} +@end + +#endif /* MacOS */ + +/*== iOS =====================================================================*/ +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#import +#if defined(SOKOL_METAL) +#import +#import +#else +#import +#include +#include +#endif + +@interface _sapp_app_delegate : NSObject +@end +@interface _sapp_textfield_dlg : NSObject +- (void)keyboardWasShown:(NSNotification*)notif; +- (void)keyboardWillBeHidden:(NSNotification*)notif; +- (void)keyboardDidChangeFrame:(NSNotification*)notif; +@end +#if defined(SOKOL_METAL) +@interface _sapp_ios_mtk_view_dlg : NSObject +@end +@interface _sapp_ios_view : MTKView; +@end +#else +@interface _sapp_ios_glk_view_dlg : NSObject +@end +@interface _sapp_ios_view : GLKView +@end +#endif + +static bool _sapp_ios_suspended; +static UIWindow* _sapp_ios_window_obj; +static _sapp_ios_view* _sapp_view_obj; +static UITextField* _sapp_ios_textfield_obj; +static _sapp_textfield_dlg* _sapp_ios_textfield_dlg_obj; +#if defined(SOKOL_METAL) +static _sapp_ios_mtk_view_dlg* _sapp_ios_mtk_view_dlg_obj; +static UIViewController* _sapp_ios_view_ctrl_obj; +static id _sapp_mtl_device_obj; +#else +static EAGLContext* _sapp_ios_eagl_ctx_obj; +static _sapp_ios_glk_view_dlg* _sapp_ios_glk_view_dlg_obj; +static GLKViewController* _sapp_ios_view_ctrl_obj; +#endif + +_SOKOL_PRIVATE void _sapp_run(const sapp_desc* desc) { + _sapp_init_state(desc); + static int argc = 1; + static char* argv[] = { (char*)"sokol_app" }; + UIApplicationMain(argc, argv, nil, NSStringFromClass([_sapp_app_delegate class])); +} + +/* iOS entry function */ +#if !defined(SOKOL_NO_ENTRY) +int main(int argc, char* argv[]) { + sapp_desc desc = sokol_main(argc, argv); + _sapp_run(&desc); + return 0; +} +#endif /* SOKOL_NO_ENTRY */ + +_SOKOL_PRIVATE void _sapp_ios_app_event(sapp_event_type type) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_ios_update_dimensions(void) { + CGRect screen_rect = UIScreen.mainScreen.bounds; + _sapp.window_width = (int) screen_rect.size.width; + _sapp.window_height = (int) screen_rect.size.height; + int cur_fb_width, cur_fb_height; + #if defined(SOKOL_METAL) + const CGSize fb_size = _sapp_view_obj.drawableSize; + cur_fb_width = (int) fb_size.width; + cur_fb_height = (int) fb_size.height; + #else + cur_fb_width = (int) _sapp_view_obj.drawableWidth; + cur_fb_height = (int) _sapp_view_obj.drawableHeight; + #endif + const bool dim_changed = + (_sapp.framebuffer_width != cur_fb_width) || + (_sapp.framebuffer_height != cur_fb_height); + _sapp.framebuffer_width = cur_fb_width; + _sapp.framebuffer_height = cur_fb_height; + SOKOL_ASSERT((_sapp.framebuffer_width > 0) && (_sapp.framebuffer_height > 0)); + _sapp.dpi_scale = (float)_sapp.framebuffer_width / (float) _sapp.window_width; + if (dim_changed) { + _sapp_ios_app_event(SAPP_EVENTTYPE_RESIZED); + } +} + +_SOKOL_PRIVATE void _sapp_ios_frame(void) { + _sapp_ios_update_dimensions(); + _sapp_frame(); +} + +_SOKOL_PRIVATE void _sapp_ios_show_keyboard(bool shown) { + /* if not happened yet, create an invisible text field */ + if (nil == _sapp_ios_textfield_obj) { + _sapp_ios_textfield_dlg_obj = [[_sapp_textfield_dlg alloc] init]; + _sapp_ios_textfield_obj = [[UITextField alloc] initWithFrame:CGRectMake(10, 10, 100, 50)]; + _sapp_ios_textfield_obj.keyboardType = UIKeyboardTypeDefault; + _sapp_ios_textfield_obj.returnKeyType = UIReturnKeyDefault; + _sapp_ios_textfield_obj.autocapitalizationType = UITextAutocapitalizationTypeNone; + _sapp_ios_textfield_obj.autocorrectionType = UITextAutocorrectionTypeNo; + _sapp_ios_textfield_obj.spellCheckingType = UITextSpellCheckingTypeNo; + _sapp_ios_textfield_obj.hidden = YES; + _sapp_ios_textfield_obj.text = @"x"; + _sapp_ios_textfield_obj.delegate = _sapp_ios_textfield_dlg_obj; + [_sapp_ios_view_ctrl_obj.view addSubview:_sapp_ios_textfield_obj]; + + [[NSNotificationCenter defaultCenter] addObserver:_sapp_ios_textfield_dlg_obj + selector:@selector(keyboardWasShown:) + name:UIKeyboardDidShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:_sapp_ios_textfield_dlg_obj + selector:@selector(keyboardWillBeHidden:) + name:UIKeyboardWillHideNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:_sapp_ios_textfield_dlg_obj + selector:@selector(keyboardDidChangeFrame:) + name:UIKeyboardDidChangeFrameNotification object:nil]; + } + if (shown) { + /* setting the text field as first responder brings up the onscreen keyboard */ + [_sapp_ios_textfield_obj becomeFirstResponder]; + } + else { + [_sapp_ios_textfield_obj resignFirstResponder]; + } +} + +@implementation _sapp_app_delegate +- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { + CGRect screen_rect = UIScreen.mainScreen.bounds; + _sapp_ios_window_obj = [[UIWindow alloc] initWithFrame:screen_rect]; + _sapp.window_width = screen_rect.size.width; + _sapp.window_height = screen_rect.size.height; + if (_sapp.desc.high_dpi) { + _sapp.framebuffer_width = 2 * _sapp.window_width; + _sapp.framebuffer_height = 2 * _sapp.window_height; + } + else { + _sapp.framebuffer_width = _sapp.window_width; + _sapp.framebuffer_height = _sapp.window_height; + } + _sapp.dpi_scale = (float)_sapp.framebuffer_width / (float) _sapp.window_width; + #if defined(SOKOL_METAL) + _sapp_mtl_device_obj = MTLCreateSystemDefaultDevice(); + _sapp_ios_mtk_view_dlg_obj = [[_sapp_ios_mtk_view_dlg alloc] init]; + _sapp_view_obj = [[_sapp_ios_view alloc] init]; + _sapp_view_obj.preferredFramesPerSecond = 60 / _sapp.swap_interval; + _sapp_view_obj.delegate = _sapp_ios_mtk_view_dlg_obj; + _sapp_view_obj.device = _sapp_mtl_device_obj; + _sapp_view_obj.colorPixelFormat = MTLPixelFormatBGRA8Unorm; + _sapp_view_obj.depthStencilPixelFormat = MTLPixelFormatDepth32Float_Stencil8; + _sapp_view_obj.sampleCount = _sapp.sample_count; + if (_sapp.desc.high_dpi) { + _sapp_view_obj.contentScaleFactor = 2.0; + } + else { + _sapp_view_obj.contentScaleFactor = 1.0; + } + _sapp_view_obj.userInteractionEnabled = YES; + _sapp_view_obj.multipleTouchEnabled = YES; + [_sapp_ios_window_obj addSubview:_sapp_view_obj]; + _sapp_ios_view_ctrl_obj = [[UIViewController alloc] init]; + _sapp_ios_view_ctrl_obj.view = _sapp_view_obj; + _sapp_ios_window_obj.rootViewController = _sapp_ios_view_ctrl_obj; + #else + if (_sapp.desc.gl_force_gles2) { + _sapp_ios_eagl_ctx_obj = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + _sapp.gles2_fallback = true; + } + else { + _sapp_ios_eagl_ctx_obj = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]; + if (_sapp_ios_eagl_ctx_obj == nil) { + _sapp_ios_eagl_ctx_obj = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + _sapp.gles2_fallback = true; + } + } + _sapp_ios_glk_view_dlg_obj = [[_sapp_ios_glk_view_dlg alloc] init]; + _sapp_view_obj = [[_sapp_ios_view alloc] initWithFrame:screen_rect]; + _sapp_view_obj.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888; + _sapp_view_obj.drawableDepthFormat = GLKViewDrawableDepthFormat24; + _sapp_view_obj.drawableStencilFormat = GLKViewDrawableStencilFormatNone; + _sapp_view_obj.drawableMultisample = GLKViewDrawableMultisampleNone; /* FIXME */ + _sapp_view_obj.context = _sapp_ios_eagl_ctx_obj; + _sapp_view_obj.delegate = _sapp_ios_glk_view_dlg_obj; + _sapp_view_obj.enableSetNeedsDisplay = NO; + _sapp_view_obj.userInteractionEnabled = YES; + _sapp_view_obj.multipleTouchEnabled = YES; + if (_sapp.desc.high_dpi) { + _sapp_view_obj.contentScaleFactor = 2.0; + } + else { + _sapp_view_obj.contentScaleFactor = 1.0; + } + [_sapp_ios_window_obj addSubview:_sapp_view_obj]; + _sapp_ios_view_ctrl_obj = [[GLKViewController alloc] init]; + _sapp_ios_view_ctrl_obj.view = _sapp_view_obj; + _sapp_ios_view_ctrl_obj.preferredFramesPerSecond = 60 / _sapp.swap_interval; + _sapp_ios_window_obj.rootViewController = _sapp_ios_view_ctrl_obj; + #endif + [_sapp_ios_window_obj makeKeyAndVisible]; + + _sapp.valid = true; + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + if (!_sapp_ios_suspended) { + _sapp_ios_suspended = true; + _sapp_ios_app_event(SAPP_EVENTTYPE_SUSPENDED); + } +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + if (_sapp_ios_suspended) { + _sapp_ios_suspended = false; + _sapp_ios_app_event(SAPP_EVENTTYPE_RESUMED); + } +} +@end + +@implementation _sapp_textfield_dlg +- (void)keyboardWasShown:(NSNotification*)notif { + _sapp.onscreen_keyboard_shown = true; + /* query the keyboard's size, and modify the content view's size */ + if (_sapp.desc.ios_keyboard_resizes_canvas) { + NSDictionary* info = notif.userInfo; + CGFloat kbd_h = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size.height; + CGRect view_frame = UIScreen.mainScreen.bounds; + view_frame.size.height -= kbd_h; + _sapp_view_obj.frame = view_frame; + } +} +- (void)keyboardWillBeHidden:(NSNotification*)notif { + _sapp.onscreen_keyboard_shown = false; + if (_sapp.desc.ios_keyboard_resizes_canvas) { + _sapp_view_obj.frame = UIScreen.mainScreen.bounds; + } +} +- (void)keyboardDidChangeFrame:(NSNotification*)notif { + /* this is for the case when the screen rotation changes while the keyboard is open */ + if (_sapp.onscreen_keyboard_shown && _sapp.desc.ios_keyboard_resizes_canvas) { + NSDictionary* info = notif.userInfo; + CGFloat kbd_h = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size.height; + CGRect view_frame = UIScreen.mainScreen.bounds; + view_frame.size.height -= kbd_h; + _sapp_view_obj.frame = view_frame; + } +} +- (BOOL)textField:(UITextField*)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)string { + if (_sapp_events_enabled()) { + const NSUInteger len = string.length; + if (len > 0) { + for (NSUInteger i = 0; i < len; i++) { + unichar c = [string characterAtIndex:i]; + if (c >= 32) { + /* ignore surrogates for now */ + if ((c < 0xD800) || (c > 0xDFFF)) { + _sapp_init_event(SAPP_EVENTTYPE_CHAR); + _sapp.event.char_code = c; + _sapp_call_event(&_sapp.event); + } + } + if (c <= 32) { + sapp_keycode k = SAPP_KEYCODE_INVALID; + switch (c) { + case 10: k = SAPP_KEYCODE_ENTER; break; + case 32: k = SAPP_KEYCODE_SPACE; break; + default: break; + } + if (k != SAPP_KEYCODE_INVALID) { + _sapp_init_event(SAPP_EVENTTYPE_KEY_DOWN); + _sapp.event.key_code = k; + _sapp_call_event(&_sapp.event); + _sapp_init_event(SAPP_EVENTTYPE_KEY_UP); + _sapp.event.key_code = k; + _sapp_call_event(&_sapp.event); + } + } + } + } + else { + /* this was a backspace */ + _sapp_init_event(SAPP_EVENTTYPE_KEY_DOWN); + _sapp.event.key_code = SAPP_KEYCODE_BACKSPACE; + _sapp_call_event(&_sapp.event); + _sapp_init_event(SAPP_EVENTTYPE_KEY_UP); + _sapp.event.key_code = SAPP_KEYCODE_BACKSPACE; + _sapp_call_event(&_sapp.event); + } + } + return NO; +} +@end + +#if defined(SOKOL_METAL) +@implementation _sapp_ios_mtk_view_dlg +- (void)drawInMTKView:(MTKView*)view { + @autoreleasepool { + _sapp_ios_frame(); + } +} + +- (void)mtkView:(MTKView*)view drawableSizeWillChange:(CGSize)size { + /* this is required by the protocol, but we can't do anything useful here */ +} +@end +#else +@implementation _sapp_ios_glk_view_dlg +- (void)glkView:(GLKView*)view drawInRect:(CGRect)rect { + @autoreleasepool { + _sapp_ios_frame(); + } +} +@end +#endif + +_SOKOL_PRIVATE void _sapp_ios_touch_event(sapp_event_type type, NSSet* touches, UIEvent* event) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + NSEnumerator* enumerator = event.allTouches.objectEnumerator; + UITouch* ios_touch; + while ((ios_touch = [enumerator nextObject])) { + if ((_sapp.event.num_touches + 1) < SAPP_MAX_TOUCHPOINTS) { + CGPoint ios_pos = [ios_touch locationInView:_sapp_view_obj]; + sapp_touchpoint* cur_point = &_sapp.event.touches[_sapp.event.num_touches++]; + cur_point->identifier = (uintptr_t) ios_touch; + cur_point->pos_x = ios_pos.x * _sapp.dpi_scale; + cur_point->pos_y = ios_pos.y * _sapp.dpi_scale; + cur_point->changed = [touches containsObject:ios_touch]; + } + } + if (_sapp.event.num_touches > 0) { + _sapp_call_event(&_sapp.event); + } + } +} + +@implementation _sapp_ios_view +- (BOOL) isOpaque { + return YES; +} +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event { + _sapp_ios_touch_event(SAPP_EVENTTYPE_TOUCHES_BEGAN, touches, event); +} +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent*)event { + _sapp_ios_touch_event(SAPP_EVENTTYPE_TOUCHES_MOVED, touches, event); +} +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent*)event { + _sapp_ios_touch_event(SAPP_EVENTTYPE_TOUCHES_ENDED, touches, event); +} +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent*)event { + _sapp_ios_touch_event(SAPP_EVENTTYPE_TOUCHES_CANCELLED, touches, event); +} +@end +#endif /* TARGET_OS_IPHONE */ + +#endif /* __APPLE__ */ + +/*== EMSCRIPTEN ==============================================================*/ +#if defined(__EMSCRIPTEN__) +#if defined(SOKOL_GLES3) +#include +#else +#ifndef GL_EXT_PROTOTYPES +#define GL_GLEXT_PROTOTYPES +#endif +#include +#include +#endif +#include +#include + +static bool _sapp_emsc_input_created; +static bool _sapp_emsc_wants_show_keyboard; +static bool _sapp_emsc_wants_hide_keyboard; + +/* this function is called from a JS event handler when the user hides + the onscreen keyboard pressing the 'dismiss keyboard key' +*/ +#ifdef __cplusplus +extern "C" { +#endif +EMSCRIPTEN_KEEPALIVE void _sapp_emsc_notify_keyboard_hidden(void) { + _sapp.onscreen_keyboard_shown = false; +} +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/* Javascript helper functions for mobile virtual keyboard input */ +EM_JS(void, sapp_js_create_textfield, (void), { + var _sapp_inp = document.createElement("input"); + _sapp_inp.type = "text"; + _sapp_inp.id = "_sokol_app_input_element"; + _sapp_inp.autocapitalize = "none"; + _sapp_inp.addEventListener("focusout", function(_sapp_event) { + __sapp_emsc_notify_keyboard_hidden() + + }); + document.body.append(_sapp_inp); +}); + +EM_JS(void, sapp_js_focus_textfield, (void), { + document.getElementById("_sokol_app_input_element").focus(); +}); + +EM_JS(void, sapp_js_unfocus_textfield, (void), { + document.getElementById("_sokol_app_input_element").blur(); +}); + +/* https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload */ +EMSCRIPTEN_KEEPALIVE int _sapp_html5_get_ask_leave_site(void) { + return _sapp.html5_ask_leave_site ? 1 : 0; +} + +EM_JS(void, sapp_js_hook_beforeunload, (void), { + window.addEventListener('beforeunload', function(_sapp_event) { + if (__sapp_html5_get_ask_leave_site() != 0) { + _sapp_event.preventDefault(); + _sapp_event.returnValue = ' '; + } + }); +}); + +/* called from the emscripten event handler to update the keyboard visibility + state, this must happen from an JS input event handler, otherwise + the request will be ignored by the browser +*/ +_SOKOL_PRIVATE void _sapp_emsc_update_keyboard_state(void) { + if (_sapp_emsc_wants_show_keyboard) { + /* create input text field on demand */ + if (!_sapp_emsc_input_created) { + _sapp_emsc_input_created = true; + sapp_js_create_textfield(); + } + /* focus the text input field, this will bring up the keyboard */ + _sapp.onscreen_keyboard_shown = true; + _sapp_emsc_wants_show_keyboard = false; + sapp_js_focus_textfield(); + } + if (_sapp_emsc_wants_hide_keyboard) { + /* unfocus the text input field */ + if (_sapp_emsc_input_created) { + _sapp.onscreen_keyboard_shown = false; + _sapp_emsc_wants_hide_keyboard = false; + sapp_js_unfocus_textfield(); + } + } +} + +/* actually showing the onscreen keyboard must be initiated from a JS + input event handler, so we'll just keep track of the desired + state, and the actual state change will happen with the next input event +*/ +_SOKOL_PRIVATE void _sapp_emsc_show_keyboard(bool show) { + if (show) { + _sapp_emsc_wants_show_keyboard = true; + } + else { + _sapp_emsc_wants_hide_keyboard = true; + } +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_size_changed(int event_type, const EmscriptenUiEvent* ui_event, void* user_data) { + double w, h; + emscripten_get_element_css_size(_sapp.html5_canvas_name, &w, &h); + /* The above method might report zero when toggling HTML5 fullscreen, + in that case use the window's inner width reported by the + emscripten event. This works ok when toggling *into* fullscreen + but doesn't properly restore the previous canvas size when switching + back from fullscreen. + + In general, due to the HTML5's fullscreen API's flaky nature it is + recommended to use 'soft fullscreen' (stretching the WebGL canvas + over the browser windows client rect) with a CSS definition like this: + + position: absolute; + top: 0px; + left: 0px; + margin: 0px; + border: 0; + width: 100%; + height: 100%; + overflow: hidden; + display: block; + */ + if (w < 1.0) { + w = ui_event->windowInnerWidth; + } + else { + _sapp.window_width = (int) w; + } + if (h < 1.0) { + h = ui_event->windowInnerHeight; + } + else { + _sapp.window_height = (int) h; + } + if (_sapp.desc.high_dpi) { + _sapp.dpi_scale = emscripten_get_device_pixel_ratio(); + } + _sapp.framebuffer_width = (int) (w * _sapp.dpi_scale); + _sapp.framebuffer_height = (int) (h * _sapp.dpi_scale); + SOKOL_ASSERT((_sapp.framebuffer_width > 0) && (_sapp.framebuffer_height > 0)); + emscripten_set_canvas_element_size(_sapp.html5_canvas_name, _sapp.framebuffer_width, _sapp.framebuffer_height); + if (_sapp_events_enabled()) { + _sapp_init_event(SAPP_EVENTTYPE_RESIZED); + _sapp_call_event(&_sapp.event); + } + return true; +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_frame(double time, void* userData) { + _SOKOL_UNUSED(time); + _SOKOL_UNUSED(userData); + _sapp_frame(); + return EM_TRUE; +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_context_cb(int emsc_type, const void* reserved, void* user_data) { + sapp_event_type type; + switch (emsc_type) { + case EMSCRIPTEN_EVENT_WEBGLCONTEXTLOST: type = SAPP_EVENTTYPE_SUSPENDED; break; + case EMSCRIPTEN_EVENT_WEBGLCONTEXTRESTORED: type = SAPP_EVENTTYPE_RESUMED; break; + default: type = SAPP_EVENTTYPE_INVALID; break; + } + if (_sapp_events_enabled() && (SAPP_EVENTTYPE_INVALID != type)) { + _sapp_init_event(type); + _sapp_call_event(&_sapp.event); + } + return true; +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_mouse_cb(int emsc_type, const EmscriptenMouseEvent* emsc_event, void* user_data) { + _sapp.mouse_x = (emsc_event->targetX * _sapp.dpi_scale); + _sapp.mouse_y = (emsc_event->targetY * _sapp.dpi_scale); + if (_sapp_events_enabled() && (emsc_event->button >= 0) && (emsc_event->button < SAPP_MAX_MOUSEBUTTONS)) { + sapp_event_type type; + bool is_button_event = false; + switch (emsc_type) { + case EMSCRIPTEN_EVENT_MOUSEDOWN: + type = SAPP_EVENTTYPE_MOUSE_DOWN; + is_button_event = true; + break; + case EMSCRIPTEN_EVENT_MOUSEUP: + type = SAPP_EVENTTYPE_MOUSE_UP; + is_button_event = true; + break; + case EMSCRIPTEN_EVENT_MOUSEMOVE: + type = SAPP_EVENTTYPE_MOUSE_MOVE; + break; + case EMSCRIPTEN_EVENT_MOUSEENTER: + type = SAPP_EVENTTYPE_MOUSE_ENTER; + break; + case EMSCRIPTEN_EVENT_MOUSELEAVE: + type = SAPP_EVENTTYPE_MOUSE_LEAVE; + break; + default: + type = SAPP_EVENTTYPE_INVALID; + break; + } + if (type != SAPP_EVENTTYPE_INVALID) { + _sapp_init_event(type); + if (emsc_event->ctrlKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_CTRL; + } + if (emsc_event->shiftKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SHIFT; + } + if (emsc_event->altKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_ALT; + } + if (emsc_event->metaKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SUPER; + } + if (is_button_event) { + switch (emsc_event->button) { + case 0: _sapp.event.mouse_button = SAPP_MOUSEBUTTON_LEFT; break; + case 1: _sapp.event.mouse_button = SAPP_MOUSEBUTTON_MIDDLE; break; + case 2: _sapp.event.mouse_button = SAPP_MOUSEBUTTON_RIGHT; break; + default: _sapp.event.mouse_button = (sapp_mousebutton)emsc_event->button; break; + } + } + else { + _sapp.event.mouse_button = SAPP_MOUSEBUTTON_INVALID; + } + _sapp.event.mouse_x = _sapp.mouse_x; + _sapp.event.mouse_y = _sapp.mouse_y; + _sapp_call_event(&_sapp.event); + } + } + _sapp_emsc_update_keyboard_state(); + return true; +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_wheel_cb(int emsc_type, const EmscriptenWheelEvent* emsc_event, void* user_data) { + if (_sapp_events_enabled()) { + _sapp_init_event(SAPP_EVENTTYPE_MOUSE_SCROLL); + if (emsc_event->mouse.ctrlKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_CTRL; + } + if (emsc_event->mouse.shiftKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SHIFT; + } + if (emsc_event->mouse.altKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_ALT; + } + if (emsc_event->mouse.metaKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SUPER; + } + _sapp.event.scroll_x = -0.1 * (float)emsc_event->deltaX; + _sapp.event.scroll_y = -0.1 * (float)emsc_event->deltaY; + _sapp_call_event(&_sapp.event); + } + _sapp_emsc_update_keyboard_state(); + return true; +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_key_cb(int emsc_type, const EmscriptenKeyboardEvent* emsc_event, void* user_data) { + bool retval = true; + if (_sapp_events_enabled()) { + sapp_event_type type; + switch (emsc_type) { + case EMSCRIPTEN_EVENT_KEYDOWN: + type = SAPP_EVENTTYPE_KEY_DOWN; + break; + case EMSCRIPTEN_EVENT_KEYUP: + type = SAPP_EVENTTYPE_KEY_UP; + break; + case EMSCRIPTEN_EVENT_KEYPRESS: + type = SAPP_EVENTTYPE_CHAR; + break; + default: + type = SAPP_EVENTTYPE_INVALID; + break; + } + if (type != SAPP_EVENTTYPE_INVALID) { + _sapp_init_event(type); + _sapp.event.key_repeat = emsc_event->repeat; + if (emsc_event->ctrlKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_CTRL; + } + if (emsc_event->shiftKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SHIFT; + } + if (emsc_event->altKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_ALT; + } + if (emsc_event->metaKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SUPER; + } + if (type == SAPP_EVENTTYPE_CHAR) { + _sapp.event.char_code = emsc_event->charCode; + } + else { + _sapp.event.key_code = _sapp_translate_key(emsc_event->keyCode); + /* only forward a certain key ranges to the browser */ + switch (_sapp.event.key_code) { + case SAPP_KEYCODE_WORLD_1: + case SAPP_KEYCODE_WORLD_2: + case SAPP_KEYCODE_ESCAPE: + case SAPP_KEYCODE_ENTER: + case SAPP_KEYCODE_TAB: + case SAPP_KEYCODE_BACKSPACE: + case SAPP_KEYCODE_INSERT: + case SAPP_KEYCODE_DELETE: + case SAPP_KEYCODE_RIGHT: + case SAPP_KEYCODE_LEFT: + case SAPP_KEYCODE_DOWN: + case SAPP_KEYCODE_UP: + case SAPP_KEYCODE_PAGE_UP: + case SAPP_KEYCODE_PAGE_DOWN: + case SAPP_KEYCODE_HOME: + case SAPP_KEYCODE_END: + case SAPP_KEYCODE_CAPS_LOCK: + case SAPP_KEYCODE_SCROLL_LOCK: + case SAPP_KEYCODE_NUM_LOCK: + case SAPP_KEYCODE_PRINT_SCREEN: + case SAPP_KEYCODE_PAUSE: + case SAPP_KEYCODE_F1: + case SAPP_KEYCODE_F2: + case SAPP_KEYCODE_F3: + case SAPP_KEYCODE_F4: + case SAPP_KEYCODE_F5: + case SAPP_KEYCODE_F6: + case SAPP_KEYCODE_F7: + case SAPP_KEYCODE_F8: + case SAPP_KEYCODE_F9: + case SAPP_KEYCODE_F10: + case SAPP_KEYCODE_F11: + case SAPP_KEYCODE_F12: + case SAPP_KEYCODE_F13: + case SAPP_KEYCODE_F14: + case SAPP_KEYCODE_F15: + case SAPP_KEYCODE_F16: + case SAPP_KEYCODE_F17: + case SAPP_KEYCODE_F18: + case SAPP_KEYCODE_F19: + case SAPP_KEYCODE_F20: + case SAPP_KEYCODE_F21: + case SAPP_KEYCODE_F22: + case SAPP_KEYCODE_F23: + case SAPP_KEYCODE_F24: + case SAPP_KEYCODE_F25: + case SAPP_KEYCODE_LEFT_SHIFT: + case SAPP_KEYCODE_LEFT_CONTROL: + case SAPP_KEYCODE_LEFT_ALT: + case SAPP_KEYCODE_LEFT_SUPER: + case SAPP_KEYCODE_RIGHT_SHIFT: + case SAPP_KEYCODE_RIGHT_CONTROL: + case SAPP_KEYCODE_RIGHT_ALT: + case SAPP_KEYCODE_RIGHT_SUPER: + case SAPP_KEYCODE_MENU: + /* consume the event */ + break; + default: + /* forward key to browser */ + retval = false; + break; + } + } + _sapp_call_event(&_sapp.event); + } + } + _sapp_emsc_update_keyboard_state(); + return retval; +} + +_SOKOL_PRIVATE EM_BOOL _sapp_emsc_touch_cb(int emsc_type, const EmscriptenTouchEvent* emsc_event, void* user_data) { + bool retval = true; + if (_sapp_events_enabled()) { + sapp_event_type type; + switch (emsc_type) { + case EMSCRIPTEN_EVENT_TOUCHSTART: + type = SAPP_EVENTTYPE_TOUCHES_BEGAN; + break; + case EMSCRIPTEN_EVENT_TOUCHMOVE: + type = SAPP_EVENTTYPE_TOUCHES_MOVED; + break; + case EMSCRIPTEN_EVENT_TOUCHEND: + type = SAPP_EVENTTYPE_TOUCHES_ENDED; + break; + case EMSCRIPTEN_EVENT_TOUCHCANCEL: + type = SAPP_EVENTTYPE_TOUCHES_CANCELLED; + break; + default: + type = SAPP_EVENTTYPE_INVALID; + retval = false; + break; + } + if (type != SAPP_EVENTTYPE_INVALID) { + _sapp_init_event(type); + if (emsc_event->ctrlKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_CTRL; + } + if (emsc_event->shiftKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SHIFT; + } + if (emsc_event->altKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_ALT; + } + if (emsc_event->metaKey) { + _sapp.event.modifiers |= SAPP_MODIFIER_SUPER; + } + _sapp.event.num_touches = emsc_event->numTouches; + if (_sapp.event.num_touches > SAPP_MAX_TOUCHPOINTS) { + _sapp.event.num_touches = SAPP_MAX_TOUCHPOINTS; + } + for (int i = 0; i < _sapp.event.num_touches; i++) { + const EmscriptenTouchPoint* src = &emsc_event->touches[i]; + sapp_touchpoint* dst = &_sapp.event.touches[i]; + dst->identifier = src->identifier; + dst->pos_x = src->targetX * _sapp.dpi_scale; + dst->pos_y = src->targetY * _sapp.dpi_scale; + dst->changed = src->isChanged; + } + _sapp_call_event(&_sapp.event); + } + } + _sapp_emsc_update_keyboard_state(); + return retval; +} + +_SOKOL_PRIVATE void _sapp_emsc_init_keytable(void) { + _sapp.keycodes[8] = SAPP_KEYCODE_BACKSPACE; + _sapp.keycodes[9] = SAPP_KEYCODE_TAB; + _sapp.keycodes[13] = SAPP_KEYCODE_ENTER; + _sapp.keycodes[16] = SAPP_KEYCODE_LEFT_SHIFT; + _sapp.keycodes[17] = SAPP_KEYCODE_LEFT_CONTROL; + _sapp.keycodes[18] = SAPP_KEYCODE_LEFT_ALT; + _sapp.keycodes[19] = SAPP_KEYCODE_PAUSE; + _sapp.keycodes[27] = SAPP_KEYCODE_ESCAPE; + _sapp.keycodes[32] = SAPP_KEYCODE_SPACE; + _sapp.keycodes[33] = SAPP_KEYCODE_PAGE_UP; + _sapp.keycodes[34] = SAPP_KEYCODE_PAGE_DOWN; + _sapp.keycodes[35] = SAPP_KEYCODE_END; + _sapp.keycodes[36] = SAPP_KEYCODE_HOME; + _sapp.keycodes[37] = SAPP_KEYCODE_LEFT; + _sapp.keycodes[38] = SAPP_KEYCODE_UP; + _sapp.keycodes[39] = SAPP_KEYCODE_RIGHT; + _sapp.keycodes[40] = SAPP_KEYCODE_DOWN; + _sapp.keycodes[45] = SAPP_KEYCODE_INSERT; + _sapp.keycodes[46] = SAPP_KEYCODE_DELETE; + _sapp.keycodes[48] = SAPP_KEYCODE_0; + _sapp.keycodes[49] = SAPP_KEYCODE_1; + _sapp.keycodes[50] = SAPP_KEYCODE_2; + _sapp.keycodes[51] = SAPP_KEYCODE_3; + _sapp.keycodes[52] = SAPP_KEYCODE_4; + _sapp.keycodes[53] = SAPP_KEYCODE_5; + _sapp.keycodes[54] = SAPP_KEYCODE_6; + _sapp.keycodes[55] = SAPP_KEYCODE_7; + _sapp.keycodes[56] = SAPP_KEYCODE_8; + _sapp.keycodes[57] = SAPP_KEYCODE_9; + _sapp.keycodes[59] = SAPP_KEYCODE_SEMICOLON; + _sapp.keycodes[64] = SAPP_KEYCODE_EQUAL; + _sapp.keycodes[65] = SAPP_KEYCODE_A; + _sapp.keycodes[66] = SAPP_KEYCODE_B; + _sapp.keycodes[67] = SAPP_KEYCODE_C; + _sapp.keycodes[68] = SAPP_KEYCODE_D; + _sapp.keycodes[69] = SAPP_KEYCODE_E; + _sapp.keycodes[70] = SAPP_KEYCODE_F; + _sapp.keycodes[71] = SAPP_KEYCODE_G; + _sapp.keycodes[72] = SAPP_KEYCODE_H; + _sapp.keycodes[73] = SAPP_KEYCODE_I; + _sapp.keycodes[74] = SAPP_KEYCODE_J; + _sapp.keycodes[75] = SAPP_KEYCODE_K; + _sapp.keycodes[76] = SAPP_KEYCODE_L; + _sapp.keycodes[77] = SAPP_KEYCODE_M; + _sapp.keycodes[78] = SAPP_KEYCODE_N; + _sapp.keycodes[79] = SAPP_KEYCODE_O; + _sapp.keycodes[80] = SAPP_KEYCODE_P; + _sapp.keycodes[81] = SAPP_KEYCODE_Q; + _sapp.keycodes[82] = SAPP_KEYCODE_R; + _sapp.keycodes[83] = SAPP_KEYCODE_S; + _sapp.keycodes[84] = SAPP_KEYCODE_T; + _sapp.keycodes[85] = SAPP_KEYCODE_U; + _sapp.keycodes[86] = SAPP_KEYCODE_V; + _sapp.keycodes[87] = SAPP_KEYCODE_W; + _sapp.keycodes[88] = SAPP_KEYCODE_X; + _sapp.keycodes[89] = SAPP_KEYCODE_Y; + _sapp.keycodes[90] = SAPP_KEYCODE_Z; + _sapp.keycodes[91] = SAPP_KEYCODE_LEFT_SUPER; + _sapp.keycodes[93] = SAPP_KEYCODE_MENU; + _sapp.keycodes[96] = SAPP_KEYCODE_KP_0; + _sapp.keycodes[97] = SAPP_KEYCODE_KP_1; + _sapp.keycodes[98] = SAPP_KEYCODE_KP_2; + _sapp.keycodes[99] = SAPP_KEYCODE_KP_3; + _sapp.keycodes[100] = SAPP_KEYCODE_KP_4; + _sapp.keycodes[101] = SAPP_KEYCODE_KP_5; + _sapp.keycodes[102] = SAPP_KEYCODE_KP_6; + _sapp.keycodes[103] = SAPP_KEYCODE_KP_7; + _sapp.keycodes[104] = SAPP_KEYCODE_KP_8; + _sapp.keycodes[105] = SAPP_KEYCODE_KP_9; + _sapp.keycodes[106] = SAPP_KEYCODE_KP_MULTIPLY; + _sapp.keycodes[107] = SAPP_KEYCODE_KP_ADD; + _sapp.keycodes[109] = SAPP_KEYCODE_KP_SUBTRACT; + _sapp.keycodes[110] = SAPP_KEYCODE_KP_DECIMAL; + _sapp.keycodes[111] = SAPP_KEYCODE_KP_DIVIDE; + _sapp.keycodes[112] = SAPP_KEYCODE_F1; + _sapp.keycodes[113] = SAPP_KEYCODE_F2; + _sapp.keycodes[114] = SAPP_KEYCODE_F3; + _sapp.keycodes[115] = SAPP_KEYCODE_F4; + _sapp.keycodes[116] = SAPP_KEYCODE_F5; + _sapp.keycodes[117] = SAPP_KEYCODE_F6; + _sapp.keycodes[118] = SAPP_KEYCODE_F7; + _sapp.keycodes[119] = SAPP_KEYCODE_F8; + _sapp.keycodes[120] = SAPP_KEYCODE_F9; + _sapp.keycodes[121] = SAPP_KEYCODE_F10; + _sapp.keycodes[122] = SAPP_KEYCODE_F11; + _sapp.keycodes[123] = SAPP_KEYCODE_F12; + _sapp.keycodes[144] = SAPP_KEYCODE_NUM_LOCK; + _sapp.keycodes[145] = SAPP_KEYCODE_SCROLL_LOCK; + _sapp.keycodes[173] = SAPP_KEYCODE_MINUS; + _sapp.keycodes[186] = SAPP_KEYCODE_SEMICOLON; + _sapp.keycodes[187] = SAPP_KEYCODE_EQUAL; + _sapp.keycodes[188] = SAPP_KEYCODE_COMMA; + _sapp.keycodes[189] = SAPP_KEYCODE_MINUS; + _sapp.keycodes[190] = SAPP_KEYCODE_PERIOD; + _sapp.keycodes[191] = SAPP_KEYCODE_SLASH; + _sapp.keycodes[192] = SAPP_KEYCODE_GRAVE_ACCENT; + _sapp.keycodes[219] = SAPP_KEYCODE_LEFT_BRACKET; + _sapp.keycodes[220] = SAPP_KEYCODE_BACKSLASH; + _sapp.keycodes[221] = SAPP_KEYCODE_RIGHT_BRACKET; + _sapp.keycodes[222] = SAPP_KEYCODE_APOSTROPHE; + _sapp.keycodes[224] = SAPP_KEYCODE_LEFT_SUPER; +} + +_SOKOL_PRIVATE void _sapp_run(const sapp_desc* desc) { + _sapp_init_state(desc); + _sapp_emsc_init_keytable(); + double w, h; + if (_sapp.desc.html5_canvas_resize) { + w = (double) _sapp.desc.width; + h = (double) _sapp.desc.height; + } + else { + emscripten_get_element_css_size(_sapp.html5_canvas_name, &w, &h); + emscripten_set_resize_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, false, _sapp_emsc_size_changed); + } + if (_sapp.desc.high_dpi) { + _sapp.dpi_scale = emscripten_get_device_pixel_ratio(); + } + _sapp.window_width = (int) w; + _sapp.window_height = (int) h; + _sapp.framebuffer_width = (int) (w * _sapp.dpi_scale); + _sapp.framebuffer_height = (int) (h * _sapp.dpi_scale); + emscripten_set_canvas_element_size(_sapp.html5_canvas_name, _sapp.framebuffer_width, _sapp.framebuffer_height); + + EmscriptenWebGLContextAttributes attrs; + emscripten_webgl_init_context_attributes(&attrs); + attrs.alpha = _sapp.desc.alpha; + attrs.depth = true; + attrs.stencil = true; + attrs.antialias = _sapp.sample_count > 1; + attrs.premultipliedAlpha = _sapp.desc.html5_premultiplied_alpha; + attrs.preserveDrawingBuffer = _sapp.desc.html5_preserve_drawing_buffer; + attrs.enableExtensionsByDefault = true; + #if defined(SOKOL_GLES3) + if (_sapp.desc.gl_force_gles2) { + attrs.majorVersion = 1; + _sapp.gles2_fallback = true; + } + else { + attrs.majorVersion = 2; + } + #endif + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context(_sapp.html5_canvas_name, &attrs); + if (!ctx) { + attrs.majorVersion = 1; + ctx = emscripten_webgl_create_context(_sapp.html5_canvas_name, &attrs); + _sapp.gles2_fallback = true; + } + emscripten_webgl_make_context_current(ctx); + + /* some WebGL extension are not enabled automatically by emscripten */ + emscripten_webgl_enable_extension(ctx, "WEBKIT_WEBGL_compressed_texture_pvrtc"); + + _sapp.valid = true; + emscripten_set_mousedown_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_mouse_cb); + emscripten_set_mouseup_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_mouse_cb); + emscripten_set_mousemove_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_mouse_cb); + emscripten_set_mouseenter_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_mouse_cb); + emscripten_set_mouseleave_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_mouse_cb); + emscripten_set_wheel_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_wheel_cb); + emscripten_set_keydown_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, true, _sapp_emsc_key_cb); + emscripten_set_keyup_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, true, _sapp_emsc_key_cb); + emscripten_set_keypress_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, true, _sapp_emsc_key_cb); + emscripten_set_touchstart_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_touch_cb); + emscripten_set_touchmove_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_touch_cb); + emscripten_set_touchend_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_touch_cb); + emscripten_set_touchcancel_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_touch_cb); + emscripten_set_webglcontextlost_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_context_cb); + emscripten_set_webglcontextrestored_callback(_sapp.html5_canvas_name, 0, true, _sapp_emsc_context_cb); + emscripten_request_animation_frame_loop(_sapp_emsc_frame, 0); + + sapp_js_hook_beforeunload(); +} + +#if !defined(SOKOL_NO_ENTRY) +int main(int argc, char* argv[]) { + sapp_desc desc = sokol_main(argc, argv); + _sapp_run(&desc); + return 0; +} +#endif /* SOKOL_NO_ENTRY */ +#endif /* __EMSCRIPTEN__ */ + +/*== MISC GL SUPPORT FUNCTIONS ================================================*/ +#if defined(SOKOL_GLCORE33) +typedef struct { + int red_bits; + int green_bits; + int blue_bits; + int alpha_bits; + int depth_bits; + int stencil_bits; + int samples; + bool doublebuffer; + uintptr_t handle; +} _sapp_gl_fbconfig; + +_SOKOL_PRIVATE void _sapp_gl_init_fbconfig(_sapp_gl_fbconfig* fbconfig) { + memset(fbconfig, 0, sizeof(_sapp_gl_fbconfig)); + /* -1 means "don't care" */ + fbconfig->red_bits = -1; + fbconfig->green_bits = -1; + fbconfig->blue_bits = -1; + fbconfig->alpha_bits = -1; + fbconfig->depth_bits = -1; + fbconfig->stencil_bits = -1; + fbconfig->samples = -1; +} + +_SOKOL_PRIVATE const _sapp_gl_fbconfig* _sapp_gl_choose_fbconfig(const _sapp_gl_fbconfig* desired, const _sapp_gl_fbconfig* alternatives, unsigned int count) { + unsigned int i; + unsigned int missing, least_missing = 1000000; + unsigned int color_diff, least_color_diff = 10000000; + unsigned int extra_diff, least_extra_diff = 10000000; + const _sapp_gl_fbconfig* current; + const _sapp_gl_fbconfig* closest = NULL; + for (i = 0; i < count; i++) { + current = alternatives + i; + if (desired->doublebuffer != current->doublebuffer) { + continue; + } + missing = 0; + if (desired->alpha_bits > 0 && current->alpha_bits == 0) { + missing++; + } + if (desired->depth_bits > 0 && current->depth_bits == 0) { + missing++; + } + if (desired->stencil_bits > 0 && current->stencil_bits == 0) { + missing++; + } + if (desired->samples > 0 && current->samples == 0) { + /* Technically, several multisampling buffers could be + involved, but that's a lower level implementation detail and + not important to us here, so we count them as one + */ + missing++; + } + + /* These polynomials make many small channel size differences matter + less than one large channel size difference + Calculate color channel size difference value + */ + color_diff = 0; + if (desired->red_bits != -1) { + color_diff += (desired->red_bits - current->red_bits) * (desired->red_bits - current->red_bits); + } + if (desired->green_bits != -1) { + color_diff += (desired->green_bits - current->green_bits) * (desired->green_bits - current->green_bits); + } + if (desired->blue_bits != -1) { + color_diff += (desired->blue_bits - current->blue_bits) * (desired->blue_bits - current->blue_bits); + } + + /* Calculate non-color channel size difference value */ + extra_diff = 0; + if (desired->alpha_bits != -1) { + extra_diff += (desired->alpha_bits - current->alpha_bits) * (desired->alpha_bits - current->alpha_bits); + } + if (desired->depth_bits != -1) { + extra_diff += (desired->depth_bits - current->depth_bits) * (desired->depth_bits - current->depth_bits); + } + if (desired->stencil_bits != -1) { + extra_diff += (desired->stencil_bits - current->stencil_bits) * (desired->stencil_bits - current->stencil_bits); + } + if (desired->samples != -1) { + extra_diff += (desired->samples - current->samples) * (desired->samples - current->samples); + } + + /* Figure out if the current one is better than the best one found so far + Least number of missing buffers is the most important heuristic, + then color buffer size match and lastly size match for other buffers + */ + if (missing < least_missing) { + closest = current; + } + else if (missing == least_missing) { + if ((color_diff < least_color_diff) || + (color_diff == least_color_diff && extra_diff < least_extra_diff)) + { + closest = current; + } + } + if (current == closest) { + least_missing = missing; + least_color_diff = color_diff; + least_extra_diff = extra_diff; + } + } + return closest; +} +#endif + +/*== WINDOWS ==================================================================*/ +#if defined(_WIN32) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +#include +#include +#pragma comment (lib, "Shell32.lib") + +#if defined(SOKOL_D3D11) +#ifndef D3D11_NO_HELPERS +#define D3D11_NO_HELPERS +#endif +#ifndef CINTERFACE +#define CINTERFACE +#endif +#ifndef COBJMACROS +#define COBJMACROS +#endif +#include +#include +#include +#if (defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) +#pragma comment (lib, "WindowsApp.lib") +#else +#pragma comment (lib, "user32.lib") +#pragma comment (lib, "dxgi.lib") +#pragma comment (lib, "d3d11.lib") +#pragma comment (lib, "dxguid.lib") +#endif +#endif + +/* see https://github.com/floooh/sokol/issues/138 */ +#ifndef WM_MOUSEHWHEEL +#define WM_MOUSEHWHEEL (0x020E) +#endif + +#ifndef DPI_ENUMS_DECLARED +typedef enum PROCESS_DPI_AWARENESS +{ + PROCESS_DPI_UNAWARE = 0, + PROCESS_SYSTEM_DPI_AWARE = 1, + PROCESS_PER_MONITOR_DPI_AWARE = 2 +} PROCESS_DPI_AWARENESS; +typedef enum MONITOR_DPI_TYPE { + MDT_EFFECTIVE_DPI = 0, + MDT_ANGULAR_DPI = 1, + MDT_RAW_DPI = 2, + MDT_DEFAULT = MDT_EFFECTIVE_DPI +} MONITOR_DPI_TYPE; +#endif /*DPI_ENUMS_DECLARED*/ + +static HWND _sapp_win32_hwnd; +static HDC _sapp_win32_dc; +static bool _sapp_win32_in_create_window; +static bool _sapp_win32_dpi_aware; +static float _sapp_win32_content_scale; +static float _sapp_win32_window_scale; +static float _sapp_win32_mouse_scale; +static bool _sapp_win32_iconified; +typedef BOOL(WINAPI * SETPROCESSDPIAWARE_T)(void); +typedef HRESULT(WINAPI * SETPROCESSDPIAWARENESS_T)(PROCESS_DPI_AWARENESS); +typedef HRESULT(WINAPI * GETDPIFORMONITOR_T)(HMONITOR, MONITOR_DPI_TYPE, UINT*, UINT*); +static SETPROCESSDPIAWARE_T _sapp_win32_setprocessdpiaware; +static SETPROCESSDPIAWARENESS_T _sapp_win32_setprocessdpiawareness; +static GETDPIFORMONITOR_T _sapp_win32_getdpiformonitor; +#if defined(SOKOL_D3D11) +static ID3D11Device* _sapp_d3d11_device; +static ID3D11DeviceContext* _sapp_d3d11_device_context; +static DXGI_SWAP_CHAIN_DESC _sapp_dxgi_swap_chain_desc; +static IDXGISwapChain* _sapp_dxgi_swap_chain; +static ID3D11Texture2D* _sapp_d3d11_rt; +static ID3D11RenderTargetView* _sapp_d3d11_rtv; +static ID3D11Texture2D* _sapp_d3d11_ds; +static ID3D11DepthStencilView* _sapp_d3d11_dsv; +#endif +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_TYPE_RGBA_ARB 0x202b +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201a +#define WGL_ALPHA_BITS_ARB 0x201b +#define WGL_ALPHA_SHIFT_ARB 0x201c +#define WGL_ACCUM_BITS_ARB 0x201d +#define WGL_ACCUM_RED_BITS_ARB 0x201e +#define WGL_ACCUM_GREEN_BITS_ARB 0x201f +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_STEREO_ARB 0x2012 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_SAMPLES_ARB 0x2042 +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20a9 +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 +#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 +#define WGL_COLORSPACE_EXT 0x309d +#define WGL_COLORSPACE_SRGB_EXT 0x3089 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC)(int); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC,int,int,UINT,const int*,int*); +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void); +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC); +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC,HGLRC,const int*); +typedef HGLRC (WINAPI * PFN_wglCreateContext)(HDC); +typedef BOOL (WINAPI * PFN_wglDeleteContext)(HGLRC); +typedef PROC (WINAPI * PFN_wglGetProcAddress)(LPCSTR); +typedef HDC (WINAPI * PFN_wglGetCurrentDC)(void); +typedef BOOL (WINAPI * PFN_wglMakeCurrent)(HDC,HGLRC); +static HINSTANCE _sapp_opengl32; +static HGLRC _sapp_gl_ctx; +static PFN_wglCreateContext _sapp_wglCreateContext; +static PFN_wglDeleteContext _sapp_wglDeleteContext; +static PFN_wglGetProcAddress _sapp_wglGetProcAddress; +static PFN_wglGetCurrentDC _sapp_wglGetCurrentDC; +static PFN_wglMakeCurrent _sapp_wglMakeCurrent; +static PFNWGLSWAPINTERVALEXTPROC _sapp_SwapIntervalEXT; +static PFNWGLGETPIXELFORMATATTRIBIVARBPROC _sapp_GetPixelFormatAttribivARB; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _sapp_GetExtensionsStringEXT; +static PFNWGLGETEXTENSIONSSTRINGARBPROC _sapp_GetExtensionsStringARB; +static PFNWGLCREATECONTEXTATTRIBSARBPROC _sapp_CreateContextAttribsARB; +static bool _sapp_ext_swap_control; +static bool _sapp_arb_multisample; +static bool _sapp_arb_pixel_format; +static bool _sapp_arb_create_context; +static bool _sapp_arb_create_context_profile; +static HWND _sapp_win32_msg_hwnd; +static HDC _sapp_win32_msg_dc; + +/* NOTE: the optional GL loader only contains the GL constants and functions required for sokol_gfx.h, if you need +more, you'll need to use you own gl header-generator/loader +*/ +#if !defined(SOKOL_WIN32_NO_GL_LOADER) +#if defined(SOKOL_GLCORE33) +#define __gl_h_ 1 +#define __gl32_h_ 1 +#define __gl31_h_ 1 +#define __GL_H__ 1 +#define __glext_h_ 1 +#define __GLEXT_H_ 1 +#define __gltypes_h_ 1 +#define __glcorearb_h_ 1 +#define __gl_glcorearb_h_ 1 +#define GL_APIENTRY APIENTRY + +typedef unsigned int GLenum; +typedef unsigned int GLuint; +typedef int GLsizei; +typedef char GLchar; +typedef ptrdiff_t GLintptr; +typedef signed long long int GLsizeiptr; +typedef double GLclampd; +typedef unsigned short GLushort; +typedef unsigned char GLubyte; +typedef unsigned char GLboolean; +typedef uint64_t GLuint64; +typedef double GLdouble; +typedef unsigned short GLhalf; +typedef float GLclampf; +typedef unsigned int GLbitfield; +typedef signed char GLbyte; +typedef short GLshort; +typedef void GLvoid; +typedef int64_t GLint64; +typedef float GLfloat; +typedef struct __GLsync * GLsync; +typedef int GLint; +#define GL_INT_2_10_10_10_REV 0x8D9F +#define GL_R32F 0x822E +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_R16F 0x822D +#define GL_COLOR_ATTACHMENT22 0x8CF6 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_NUM_EXTENSIONS 0x821D +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_INCR 0x1E02 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_STATIC_DRAW 0x88E4 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONSTANT_COLOR 0x8001 +#define GL_DECR_WRAP 0x8508 +#define GL_R8 0x8229 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_SHORT 0x1402 +#define GL_DEPTH_TEST 0x0B71 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_LINK_STATUS 0x8B82 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_RGBA16F 0x881A +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STREAM_DRAW 0x88E0 +#define GL_ONE 1 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA8 0x8058 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_RGBA4 0x8056 +#define GL_RGB8 0x8051 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_STENCIL 0x1802 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_DEPTH 0x1801 +#define GL_FRONT 0x0404 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_REPEAT 0x2901 +#define GL_RGBA 0x1908 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_DECR 0x1E03 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_FLOAT 0x1406 +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_COLOR 0x1800 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TRIANGLES 0x0004 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_NONE 0 +#define GL_SRC_COLOR 0x0300 +#define GL_BYTE 0x1400 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_LINE_STRIP 0x0003 +#define GL_TEXTURE_3D 0x806F +#define GL_CW 0x0900 +#define GL_LINEAR 0x2601 +#define GL_RENDERBUFFER 0x8D41 +#define GL_GEQUAL 0x0206 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_RGBA32F 0x8814 +#define GL_BLEND 0x0BE2 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_EXTENSIONS 0x1F03 +#define GL_NO_ERROR 0 +#define GL_REPLACE 0x1E01 +#define GL_KEEP 0x1E00 +#define GL_CCW 0x0901 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_RGB 0x1907 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_FALSE 0 +#define GL_ZERO 0 +#define GL_CULL_FACE 0x0B44 +#define GL_INVERT 0x150A +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_NEAREST 0x2600 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_LEQUAL 0x0203 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DITHER 0x0BD0 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_EQUAL 0x0202 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RGB5 0x8050 +#define GL_LINES 0x0001 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_SRC_ALPHA 0x0302 +#define GL_INCR_WRAP 0x8507 +#define GL_LESS 0x0201 +#define GL_MULTISAMPLE 0x809D +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_BACK 0x0405 +#define GL_ALWAYS 0x0207 +#define GL_FUNC_ADD 0x8006 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_NOTEQUAL 0x0205 +#define GL_DST_COLOR 0x0306 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_RED 0x1903 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_DST_ALPHA 0x0304 +#define GL_RGB5_A1 0x8057 +#define GL_GREATER 0x0204 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_TRUE 1 +#define GL_NEVER 0x0200 +#define GL_POINTS 0x0000 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#define GL_RGBA_INTEGER 0x8D99 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_RGBA16 0x805B +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE_BORDER_COLOR 0x1004 + +#define GL_TEXTURE_2D 0x0DE1 + +typedef void (GL_APIENTRY *PFN_glCreateTextures)(GLenum target, GLsizei n, GLuint *textures); +static PFN_glCreateTextures _sapp_glCreateTextures; +void glCreateTextures(GLenum target, GLsizei n, GLuint *textures) { + _sapp_glCreateTextures(target, n, textures); +} + +typedef void (GL_APIENTRY *PFN_glCreateBuffers)(GLsizei n, GLuint *buffers); +static PFN_glCreateBuffers _sapp_glCreateBuffers; +void glCreateBuffers(GLsizei n, GLuint *buffers) { + _sapp_glCreateBuffers(n, buffers); +} + + +typedef void (GL_APIENTRY *PFN_glBindVertexArray)(GLuint array); +static PFN_glBindVertexArray _sapp_glBindVertexArray; +void glBindVertexArray(GLuint array) { + _sapp_glBindVertexArray(array); +} +typedef void (GL_APIENTRY *PFN_glFramebufferTextureLayer)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +static PFN_glFramebufferTextureLayer _sapp_glFramebufferTextureLayer; +typedef void (GL_APIENTRY *PFN_glGenFramebuffers)(GLsizei n, GLuint * framebuffers); +static PFN_glGenFramebuffers _sapp_glGenFramebuffers; +void glGenFramebuffers(GLsizei n, GLuint * framebuffers) { + _sapp_glGenFramebuffers(n, framebuffers); +} +typedef void (GL_APIENTRY *PFN_glBindFramebuffer)(GLenum target, GLuint framebuffer); +static PFN_glBindFramebuffer _sapp_glBindFramebuffer; +void glBindFramebuffer(GLenum target, GLuint framebuffer) { + _sapp_glBindFramebuffer(target, framebuffer); +} +typedef void (GL_APIENTRY *PFN_glBindRenderbuffer)(GLenum target, GLuint renderbuffer); +static PFN_glBindRenderbuffer _sapp_glBindRenderbuffer; +typedef const GLubyte * (GL_APIENTRY *PFN_glGetStringi)(GLenum name, GLuint index); +static PFN_glGetStringi _sapp_glGetStringi; +typedef void (GL_APIENTRY *PFN_glClearBufferfi)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +static PFN_glClearBufferfi _sapp_glClearBufferfi; +typedef void (GL_APIENTRY *PFN_glClearBufferfv)(GLenum buffer, GLint drawbuffer, const GLfloat * value); +static PFN_glClearBufferfv _sapp_glClearBufferfv; +typedef void (GL_APIENTRY *PFN_glClearBufferuiv)(GLenum buffer, GLint drawbuffer, const GLuint * value); +static PFN_glClearBufferuiv _sapp_glClearBufferuiv; +typedef void (GL_APIENTRY *PFN_glDeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers); +static PFN_glDeleteRenderbuffers _sapp_glDeleteRenderbuffers; +typedef void (GL_APIENTRY *PFN_glUniform4fv)(GLint location, GLsizei count, const GLfloat * value); +static PFN_glUniform4fv _sapp_glUniform4fv; +void glUniform4fv(GLint location, GLsizei count, const GLfloat * value) { + _sapp_glUniform4fv(location, count, value); +} +typedef void (GL_APIENTRY *PFN_glUniform2fv)(GLint location, GLsizei count, const GLfloat * value); +static PFN_glUniform2fv _sapp_glUniform2fv; +void glUniform2fv(GLint location, GLsizei count, const GLfloat * value) { + _sapp_glUniform2fv(location, count, value); +} +typedef void (GL_APIENTRY *PFN_glUseProgram)(GLuint program); +static PFN_glUseProgram _sapp_glUseProgram; +void glUseProgram(GLuint program) { + _sapp_glUseProgram(program); +} +typedef void (GL_APIENTRY *PFN_glShaderSource)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length); +static PFN_glShaderSource _sapp_glShaderSource; +void glShaderSource(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length) { + _sapp_glShaderSource(shader, count, string, length); +} +typedef void (GL_APIENTRY *PFN_glLinkProgram)(GLuint program); +static PFN_glLinkProgram _sapp_glLinkProgram; +void glLinkProgram(GLuint program) { + _sapp_glLinkProgram(program); +} +typedef GLint (GL_APIENTRY *PFN_glGetUniformLocation)(GLuint program, const GLchar * name); +static PFN_glGetUniformLocation _sapp_glGetUniformLocation; +GLint glGetUniformLocation(GLuint program, const GLchar * name) { + return _sapp_glGetUniformLocation(program, name); +} +typedef void (GL_APIENTRY *PFN_glGetShaderiv)(GLuint shader, GLenum pname, GLint * params); +static PFN_glGetShaderiv _sapp_glGetShaderiv; +void glGetShaderiv(GLuint shader, GLenum pname, GLint * params) { + _sapp_glGetShaderiv(shader, pname, params); +} +typedef void (GL_APIENTRY *PFN_glGetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +static PFN_glGetProgramInfoLog _sapp_glGetProgramInfoLog; +void glGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog) { + _sapp_glGetProgramInfoLog(program, bufSize, length, infoLog); +} +typedef GLint (GL_APIENTRY *PFN_glGetAttribLocation)(GLuint program, const GLchar * name); +static PFN_glGetAttribLocation _sapp_glGetAttribLocation; +GLint glGetAttribLocation(GLuint program, const GLchar * name) { + return _sapp_glGetAttribLocation(program, name); +} +typedef void (GL_APIENTRY *PFN_glDisableVertexAttribArray)(GLuint index); +static PFN_glDisableVertexAttribArray _sapp_glDisableVertexAttribArray; +void glDisableVertexAttribArray(GLuint index) { + _sapp_glDisableVertexAttribArray(index); +} +typedef void (GL_APIENTRY *PFN_glDeleteShader)(GLuint shader); +static PFN_glDeleteShader _sapp_glDeleteShader; +void glDeleteShader(GLuint shader) { + _sapp_glDeleteShader(shader); +} +typedef void (GL_APIENTRY *PFN_glDeleteProgram)(GLuint program); +static PFN_glDeleteProgram _sapp_glDeleteProgram; +typedef void (GL_APIENTRY *PFN_glCompileShader)(GLuint shader); +static PFN_glCompileShader _sapp_glCompileShader; +void glCompileShader(GLuint shader) { + _sapp_glCompileShader(shader); +} +typedef void (GL_APIENTRY *PFN_glStencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); +static PFN_glStencilFuncSeparate _sapp_glStencilFuncSeparate; +typedef void (GL_APIENTRY *PFN_glStencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +static PFN_glStencilOpSeparate _sapp_glStencilOpSeparate; +typedef void (GL_APIENTRY *PFN_glRenderbufferStorageMultisample)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +static PFN_glRenderbufferStorageMultisample _sapp_glRenderbufferStorageMultisample; +typedef void (GL_APIENTRY *PFN_glDrawBuffers)(GLsizei n, const GLenum * bufs); +static PFN_glDrawBuffers _sapp_glDrawBuffers; +typedef void (GL_APIENTRY *PFN_glVertexAttribDivisor)(GLuint index, GLuint divisor); +static PFN_glVertexAttribDivisor _sapp_glVertexAttribDivisor; +typedef void (GL_APIENTRY *PFN_glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data); +static PFN_glBufferSubData _sapp_glBufferSubData; +void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void * data) { + _sapp_glBufferSubData(target, offset, size, data); +} +typedef void (GL_APIENTRY *PFN_glGenBuffers)(GLsizei n, GLuint * buffers); +static PFN_glGenBuffers _sapp_glGenBuffers; +void glGenBuffers(GLsizei n, GLuint * buffers) { + _sapp_glGenBuffers(n, buffers); +} +typedef GLenum (GL_APIENTRY *PFN_glCheckFramebufferStatus)(GLenum target); +static PFN_glCheckFramebufferStatus _sapp_glCheckFramebufferStatus; +typedef void (GL_APIENTRY *PFN_glFramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +static PFN_glFramebufferRenderbuffer _sapp_glFramebufferRenderbuffer; +typedef void (GL_APIENTRY *PFN_glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data); +static PFN_glCompressedTexImage2D _sapp_glCompressedTexImage2D; +typedef void (GL_APIENTRY *PFN_glCompressedTexImage3D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data); +static PFN_glCompressedTexImage3D _sapp_glCompressedTexImage3D; +typedef void (GL_APIENTRY *PFN_glActiveTexture)(GLenum texture); +static PFN_glActiveTexture _sapp_glActiveTexture; +void glActiveTexture(GLenum texture) { + _sapp_glActiveTexture(texture); +} +typedef void (GL_APIENTRY *PFN_glTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels); +static PFN_glTexSubImage3D _sapp_glTexSubImage3D; +typedef void (GL_APIENTRY *PFN_glUniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); +static PFN_glUniformMatrix4fv _sapp_glUniformMatrix4fv; +void glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) { + _sapp_glUniformMatrix4fv(location, count, transpose, value); +} +typedef void (GL_APIENTRY *PFN_glRenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +static PFN_glRenderbufferStorage _sapp_glRenderbufferStorage; +typedef void (GL_APIENTRY *PFN_glGenTextures)(GLsizei n, GLuint * textures); +static PFN_glGenTextures _sapp_glGenTextures; +void glGenTextures(GLsizei n, GLuint * textures) { + _sapp_glGenTextures(n, textures); +} +typedef void (GL_APIENTRY *PFN_glPolygonOffset)(GLfloat factor, GLfloat units); +static PFN_glPolygonOffset _sapp_glPolygonOffset; +typedef void (GL_APIENTRY *PFN_glDrawElements)(GLenum mode, GLsizei count, GLenum type, const void * indices); +static PFN_glDrawElements _sapp_glDrawElements; +void glDrawElements(GLenum mode, GLsizei count, GLenum type, const void * indices) { + _sapp_glDrawElements(mode, count, type, indices); +} +typedef void (GL_APIENTRY *PFN_glDeleteFramebuffers)(GLsizei n, const GLuint * framebuffers); +static PFN_glDeleteFramebuffers _sapp_glDeleteFramebuffers; +typedef void (GL_APIENTRY *PFN_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); +static PFN_glBlendEquationSeparate _sapp_glBlendEquationSeparate; +typedef void (GL_APIENTRY *PFN_glBlendEquationSeparate)(GLenum modeRGB, GLenum modeAlpha); +void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) { + _sapp_glBlendEquationSeparate(modeRGB, modeAlpha); +} +static PFN_glBlendEquationSeparate _sapp_glBlendEquationSeparate; +typedef void (GL_APIENTRY *PFN_glDeleteTextures)(GLsizei n, const GLuint * textures); +static PFN_glDeleteTextures _sapp_glDeleteTextures; +typedef void (GL_APIENTRY *PFN_glGetProgramiv)(GLuint program, GLenum pname, GLint * params); +static PFN_glGetProgramiv _sapp_glGetProgramiv; +void glGetProgramiv(GLuint program, GLenum pname, GLint * params) { + _sapp_glGetProgramiv(program, pname, params); +} +typedef void (GL_APIENTRY *PFN_glBindTexture)(GLenum target, GLuint texture); +static PFN_glBindTexture _sapp_glBindTexture; +void glBindTexture(GLenum target, GLuint texture) { + _sapp_glBindTexture(target, texture); +} +typedef void (GL_APIENTRY *PFN_glTexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels); +static PFN_glTexImage3D _sapp_glTexImage3D; +typedef GLuint (GL_APIENTRY *PFN_glCreateShader)(GLenum type); +static PFN_glCreateShader _sapp_glCreateShader; +GLuint glCreateShader(GLenum type) { + return _sapp_glCreateShader(type); +} +typedef void (GL_APIENTRY *PFN_glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels); +static PFN_glTexSubImage2D _sapp_glTexSubImage2D; +typedef void (GL_APIENTRY *PFN_glClearDepth)(GLdouble depth); +static PFN_glClearDepth _sapp_glClearDepth; +void glClearDepth(GLdouble depth) { + _sapp_glClearDepth(depth); +} +typedef void (GL_APIENTRY *PFN_glClearDepthf)(GLfloat depth); +static PFN_glClearDepthf _sapp_glClearDepthf; +void glClearDepthf(GLfloat depth) { + _sapp_glClearDepthf(depth); +} +typedef void (GL_APIENTRY *PFN_glFramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +static PFN_glFramebufferTexture2D _sapp_glFramebufferTexture2D; +void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { + _sapp_glFramebufferTexture2D(target, attachment, textarget, texture, level); +} +typedef GLuint (GL_APIENTRY *PFN_glCreateProgram)(); +static PFN_glCreateProgram _sapp_glCreateProgram; +GLuint glCreateProgram() { + return _sapp_glCreateProgram(); +} +typedef void (GL_APIENTRY *PFN_glViewport)(GLint x, GLint y, GLsizei width, GLsizei height); +static PFN_glViewport _sapp_glViewport; +void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) { + _sapp_glViewport(x, y, width, height); +} +typedef void (GL_APIENTRY *PFN_glDeleteBuffers)(GLsizei n, const GLuint * buffers); +static PFN_glDeleteBuffers _sapp_glDeleteBuffers; +typedef void (GL_APIENTRY *PFN_glDrawArrays)(GLenum mode, GLint first, GLsizei count); +static PFN_glDrawArrays _sapp_glDrawArrays; +void glDrawArrays(GLenum mode, GLint first, GLsizei count) { + _sapp_glDrawArrays(mode, first, count); +} + +typedef void (GL_APIENTRY *PFN_glDrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount); +static PFN_glDrawElementsInstanced _sapp_glDrawElementsInstanced; +typedef void (GL_APIENTRY *PFN_glVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer); +static PFN_glVertexAttribPointer _sapp_glVertexAttribPointer; +void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer) { + _sapp_glVertexAttribPointer(index, size, type, normalized, stride, pointer); +} +typedef void (GL_APIENTRY *PFN_glUniform1i)(GLint location, GLint v0); +static PFN_glUniform1i _sapp_glUniform1i; +void glUniform1i(GLint location, GLint v0) { + _sapp_glUniform1i(location, v0); +} +typedef void (GL_APIENTRY *PFN_glDisable)(GLenum cap); +static PFN_glDisable _sapp_glDisable; +void glDisable(GLenum cap) { + _sapp_glDisable(cap); +} +typedef void (GL_APIENTRY *PFN_glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +static PFN_glColorMask _sapp_glColorMask; +typedef void (GL_APIENTRY *PFN_glBindBuffer)(GLenum target, GLuint buffer); +static PFN_glBindBuffer _sapp_glBindBuffer; +void glBindBuffer(GLenum target, GLuint buffer) { + _sapp_glBindBuffer(target, buffer); +} + +typedef void (GL_APIENTRY *PFN_glDeleteVertexArrays)(GLsizei n, const GLuint * arrays); +static PFN_glDeleteVertexArrays _sapp_glDeleteVertexArrays; +typedef void (GL_APIENTRY *PFN_glDepthMask)(GLboolean flag); +static PFN_glDepthMask _sapp_glDepthMask; +typedef void (GL_APIENTRY *PFN_glDrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +static PFN_glDrawArraysInstanced _sapp_glDrawArraysInstanced; +typedef void (GL_APIENTRY *PFN_glClearStencil)(GLint s); +static PFN_glClearStencil _sapp_glClearStencil; +void glClearStencil(GLint s) { + _sapp_glClearStencil(s); +} +typedef void (GL_APIENTRY *PFN_glScissor)(GLint x, GLint y, GLsizei width, GLsizei height); +static PFN_glScissor _sapp_glScissor; +typedef void (GL_APIENTRY *PFN_glUniform3fv)(GLint location, GLsizei count, const GLfloat * value); +static PFN_glUniform3fv _sapp_glUniform3fv; +void glUniform3fv(GLint location, GLsizei count, const GLfloat * value) { + _sapp_glUniform3fv(location, count, value); +} +typedef void (GL_APIENTRY *PFN_glGenRenderbuffers)(GLsizei n, GLuint * renderbuffers); +static PFN_glGenRenderbuffers _sapp_glGenRenderbuffers; +typedef void (GL_APIENTRY *PFN_glBufferData)(GLenum target, GLsizeiptr size, const void * data, GLenum usage); +static PFN_glBufferData _sapp_glBufferData; +void glBufferData(GLenum target, GLsizeiptr size, const void * data, GLenum usage) { + _sapp_glBufferData(target, size, data, usage); +} + +typedef void (GL_APIENTRY *PFN_glBlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +static PFN_glBlendFuncSeparate _sapp_glBlendFuncSeparate; +void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { + _sapp_glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); +} +typedef void (GL_APIENTRY *PFN_glTexParameteri)(GLenum target, GLenum pname, GLint param); +static PFN_glTexParameteri _sapp_glTexParameteri; +void glTexParameteri(GLenum target, GLenum pname, GLint param) { + _sapp_glTexParameteri(target, pname, param); +} +typedef void (GL_APIENTRY *PFN_glGetIntegerv)(GLenum pname, GLint * data); +static PFN_glGetIntegerv _sapp_glGetIntegerv; +void glGetIntegerv(GLenum pname, GLint * data) { + _sapp_glGetIntegerv(pname, data); +} +typedef void (GL_APIENTRY *PFN_glEnable)(GLenum cap); +static PFN_glEnable _sapp_glEnable; +void glEnable(GLenum cap) { + _sapp_glEnable(cap); +} +typedef void (GL_APIENTRY *PFN_glBlitFramebuffer)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +static PFN_glBlitFramebuffer _sapp_glBlitFramebuffer; +typedef void (GL_APIENTRY *PFN_glStencilMask)(GLuint mask); +static PFN_glStencilMask _sapp_glStencilMask; +typedef void (GL_APIENTRY *PFN_glAttachShader)(GLuint program, GLuint shader); +static PFN_glAttachShader _sapp_glAttachShader; +void glAttachShader(GLuint program, GLuint shader) { + _sapp_glAttachShader(program, shader); +} +typedef GLenum (GL_APIENTRY *PFN_glGetError)(); +static PFN_glGetError _sapp_glGetError; +typedef void (GL_APIENTRY *PFN_glClearColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +static PFN_glClearColor _sapp_glClearColor; +void glClearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { + _sapp_glClearColor(red, green, blue, alpha); +} +typedef void (GL_APIENTRY *PFN_glBlendColor)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +static PFN_glBlendColor _sapp_glBlendColor; +typedef void (GL_APIENTRY *PFN_glTexParameterf)(GLenum target, GLenum pname, GLfloat param); +static PFN_glTexParameterf _sapp_glTexParameterf; +typedef void (GL_APIENTRY *PFN_glTexParameterfv)(GLenum target, GLenum pname, GLfloat* params); +static PFN_glTexParameterfv _sapp_glTexParameterfv; +typedef void (GL_APIENTRY *PFN_glGetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); +static PFN_glGetShaderInfoLog _sapp_glGetShaderInfoLog; +void glGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog) { + _sapp_glGetShaderInfoLog(shader, bufSize, length, infoLog); +} +typedef void (GL_APIENTRY *PFN_glDepthFunc)(GLenum func); +static PFN_glDepthFunc _sapp_glDepthFunc; +void glDepthFunc(GLenum func) { + _sapp_glDepthFunc(func); +} +typedef void (GL_APIENTRY *PFN_glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass); +static PFN_glStencilOp _sapp_glStencilOp; +typedef void (GL_APIENTRY *PFN_glStencilFunc)(GLenum func, GLint ref, GLuint mask); +static PFN_glStencilFunc _sapp_glStencilFunc; +typedef void (GL_APIENTRY *PFN_glEnableVertexAttribArray)(GLuint index); +static PFN_glEnableVertexAttribArray _sapp_glEnableVertexAttribArray; +void glEnableVertexAttribArray(GLuint index) { + _sapp_glEnableVertexAttribArray(index); +} +typedef void (GL_APIENTRY *PFN_glBlendFunc)(GLenum sfactor, GLenum dfactor); +static PFN_glBlendFunc _sapp_glBlendFunc; +void glBlendFunc(GLenum sfactor, GLenum dfactor) { + _sapp_glBlendFunc(sfactor, dfactor); +} +typedef void (GL_APIENTRY *PFN_glUniform1fv)(GLint location, GLsizei count, const GLfloat * value); +static PFN_glUniform1fv _sapp_glUniform1fv; +void glUniform1fv(GLint location, GLsizei count, const GLfloat * value) { + _sapp_glUniform1fv(location, count, value); +} +typedef void (GL_APIENTRY *PFN_glUniform1f)(GLint location, GLfloat value); +static PFN_glUniform1f _sapp_glUniform1f; +void glUniform1f(GLint location, GLfloat value) { + _sapp_glUniform1f(location, value); +} +typedef void (GL_APIENTRY *PFN_glReadBuffer)(GLenum src); +static PFN_glReadBuffer _sapp_glReadBuffer; +typedef void (GL_APIENTRY *PFN_glClear)(GLbitfield mask); +static PFN_glClear _sapp_glClear; +void glClear(GLbitfield mask) { + _sapp_glClear(mask); +} +typedef void (GL_APIENTRY *PFN_glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels); +static PFN_glTexImage2D _sapp_glTexImage2D; +void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels) { + _sapp_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); +} +typedef void (GL_APIENTRY *PFN_glGenVertexArrays)(GLsizei n, GLuint * arrays); +static PFN_glGenVertexArrays _sapp_glGenVertexArrays; +void glGenVertexArrays(GLsizei n, GLuint * arrays) { + _sapp_glGenVertexArrays(n, arrays); +} +typedef void (GL_APIENTRY *PFN_glFrontFace)(GLenum mode); +static PFN_glFrontFace _sapp_glFrontFace; +typedef void (GL_APIENTRY *PFN_glCullFace)(GLenum mode); +static PFN_glCullFace _sapp_glCullFace; + +_SOKOL_PRIVATE void* _sapp_win32_glgetprocaddr(const char* name) { + void* proc_addr = (void*) _sapp_wglGetProcAddress(name); + if (0 == proc_addr) { + proc_addr = (void*) GetProcAddress(_sapp_opengl32, name); + } + SOKOL_ASSERT(proc_addr); + return proc_addr; +} + +#define _SAPP_GLPROC(name) _sapp_ ## name = (PFN_ ## name) _sapp_win32_glgetprocaddr(#name) + +_SOKOL_PRIVATE void _sapp_win32_gl_loadfuncs(void) { + SOKOL_ASSERT(_sapp_wglGetProcAddress); + SOKOL_ASSERT(_sapp_opengl32); + + _SAPP_GLPROC(glCreateTextures); + _SAPP_GLPROC(glCreateBuffers); + _SAPP_GLPROC(glBindVertexArray); + _SAPP_GLPROC(glFramebufferTextureLayer); + _SAPP_GLPROC(glGenFramebuffers); + _SAPP_GLPROC(glBindFramebuffer); + _SAPP_GLPROC(glBindRenderbuffer); + _SAPP_GLPROC(glGetStringi); + _SAPP_GLPROC(glClearBufferfi); + _SAPP_GLPROC(glClearBufferfv); + _SAPP_GLPROC(glClearBufferuiv); + _SAPP_GLPROC(glDeleteRenderbuffers); + _SAPP_GLPROC(glUniform4fv); + _SAPP_GLPROC(glUniform2fv); + _SAPP_GLPROC(glUseProgram); + _SAPP_GLPROC(glShaderSource); + _SAPP_GLPROC(glLinkProgram); + _SAPP_GLPROC(glGetUniformLocation); + _SAPP_GLPROC(glGetShaderiv); + _SAPP_GLPROC(glGetProgramInfoLog); + _SAPP_GLPROC(glGetAttribLocation); + _SAPP_GLPROC(glDisableVertexAttribArray); + _SAPP_GLPROC(glDeleteShader); + _SAPP_GLPROC(glDeleteProgram); + _SAPP_GLPROC(glCompileShader); + _SAPP_GLPROC(glStencilFuncSeparate); + _SAPP_GLPROC(glStencilOpSeparate); + _SAPP_GLPROC(glRenderbufferStorageMultisample); + _SAPP_GLPROC(glDrawBuffers); + _SAPP_GLPROC(glVertexAttribDivisor); + _SAPP_GLPROC(glBufferSubData); + _SAPP_GLPROC(glGenBuffers); + _SAPP_GLPROC(glCheckFramebufferStatus); + _SAPP_GLPROC(glFramebufferRenderbuffer); + _SAPP_GLPROC(glCompressedTexImage2D); + _SAPP_GLPROC(glCompressedTexImage3D); + _SAPP_GLPROC(glActiveTexture); + _SAPP_GLPROC(glTexSubImage3D); + _SAPP_GLPROC(glUniformMatrix4fv); + _SAPP_GLPROC(glRenderbufferStorage); + _SAPP_GLPROC(glGenTextures); + _SAPP_GLPROC(glPolygonOffset); + _SAPP_GLPROC(glDrawElements); + _SAPP_GLPROC(glDeleteFramebuffers); + _SAPP_GLPROC(glBlendEquationSeparate); + _SAPP_GLPROC(glDeleteTextures); + _SAPP_GLPROC(glGetProgramiv); + _SAPP_GLPROC(glBindTexture); + _SAPP_GLPROC(glTexImage3D); + _SAPP_GLPROC(glCreateShader); + _SAPP_GLPROC(glTexSubImage2D); + _SAPP_GLPROC(glClearDepth); + _SAPP_GLPROC(glClearDepthf); + _SAPP_GLPROC(glFramebufferTexture2D); + _SAPP_GLPROC(glCreateProgram); + _SAPP_GLPROC(glViewport); + _SAPP_GLPROC(glDeleteBuffers); + _SAPP_GLPROC(glDrawArrays); + _SAPP_GLPROC(glDrawElementsInstanced); + _SAPP_GLPROC(glVertexAttribPointer); + _SAPP_GLPROC(glUniform1i); + _SAPP_GLPROC(glDisable); + _SAPP_GLPROC(glColorMask); + _SAPP_GLPROC(glBindBuffer); + _SAPP_GLPROC(glDeleteVertexArrays); + _SAPP_GLPROC(glDepthMask); + _SAPP_GLPROC(glDrawArraysInstanced); + _SAPP_GLPROC(glClearStencil); + _SAPP_GLPROC(glScissor); + _SAPP_GLPROC(glUniform3fv); + _SAPP_GLPROC(glGenRenderbuffers); + _SAPP_GLPROC(glBufferData); + _SAPP_GLPROC(glBlendFuncSeparate); + _SAPP_GLPROC(glTexParameteri); + _SAPP_GLPROC(glGetIntegerv); + _SAPP_GLPROC(glEnable); + _SAPP_GLPROC(glBlitFramebuffer); + _SAPP_GLPROC(glStencilMask); + _SAPP_GLPROC(glAttachShader); + _SAPP_GLPROC(glGetError); + _SAPP_GLPROC(glClearColor); + _SAPP_GLPROC(glBlendColor); + _SAPP_GLPROC(glTexParameterf); + _SAPP_GLPROC(glTexParameterfv); + _SAPP_GLPROC(glGetShaderInfoLog); + _SAPP_GLPROC(glDepthFunc); + _SAPP_GLPROC(glStencilOp); + _SAPP_GLPROC(glStencilFunc); + _SAPP_GLPROC(glEnableVertexAttribArray); + _SAPP_GLPROC(glBlendFunc); + _SAPP_GLPROC(glUniform1f); + _SAPP_GLPROC(glUniform1fv); + _SAPP_GLPROC(glReadBuffer); + _SAPP_GLPROC(glClear); + _SAPP_GLPROC(glTexImage2D); + _SAPP_GLPROC(glGenVertexArrays); + _SAPP_GLPROC(glFrontFace); + _SAPP_GLPROC(glCullFace); +} +#define glBindVertexArray _sapp_glBindVertexArray +#define glFramebufferTextureLayer _sapp_glFramebufferTextureLayer +#define glGenFramebuffers _sapp_glGenFramebuffers +#define glBindFramebuffer _sapp_glBindFramebuffer +#define glBindRenderbuffer _sapp_glBindRenderbuffer +#define glGetStringi _sapp_glGetStringi +#define glClearBufferfi _sapp_glClearBufferfi +#define glClearBufferfv _sapp_glClearBufferfv +#define glClearBufferuiv _sapp_glClearBufferuiv +#define glDeleteRenderbuffers _sapp_glDeleteRenderbuffers +#define glUniform4fv _sapp_glUniform4fv +#define glUniform2fv _sapp_glUniform2fv +#define glUseProgram _sapp_glUseProgram +#define glShaderSource _sapp_glShaderSource +#define glLinkProgram _sapp_glLinkProgram +#define glGetUniformLocation _sapp_glGetUniformLocation +#define glGetShaderiv _sapp_glGetShaderiv +#define glGetProgramInfoLog _sapp_glGetProgramInfoLog +#define glGetAttribLocation _sapp_glGetAttribLocation +#define glDisableVertexAttribArray _sapp_glDisableVertexAttribArray +#define glDeleteShader _sapp_glDeleteShader +#define glDeleteProgram _sapp_glDeleteProgram +#define glCompileShader _sapp_glCompileShader +#define glStencilFuncSeparate _sapp_glStencilFuncSeparate +#define glStencilOpSeparate _sapp_glStencilOpSeparate +#define glRenderbufferStorageMultisample _sapp_glRenderbufferStorageMultisample +#define glDrawBuffers _sapp_glDrawBuffers +#define glVertexAttribDivisor _sapp_glVertexAttribDivisor +#define glBufferSubData _sapp_glBufferSubData +#define glGenBuffers _sapp_glGenBuffers +#define glCheckFramebufferStatus _sapp_glCheckFramebufferStatus +#define glFramebufferRenderbuffer _sapp_glFramebufferRenderbuffer +#define glCompressedTexImage2D _sapp_glCompressedTexImage2D +#define glCompressedTexImage3D _sapp_glCompressedTexImage3D +#define glActiveTexture _sapp_glActiveTexture +#define glTexSubImage3D _sapp_glTexSubImage3D +#define glUniformMatrix4fv _sapp_glUniformMatrix4fv +#define glRenderbufferStorage _sapp_glRenderbufferStorage +#define glGenTextures _sapp_glGenTextures +#define glPolygonOffset _sapp_glPolygonOffset +#define glDrawElements _sapp_glDrawElements +#define glDeleteFramebuffers _sapp_glDeleteFramebuffers +#define glBlendEquationSeparate _sapp_glBlendEquationSeparate +#define glDeleteTextures _sapp_glDeleteTextures +#define glGetProgramiv _sapp_glGetProgramiv +#define glBindTexture _sapp_glBindTexture +#define glTexImage3D _sapp_glTexImage3D +#define glCreateShader _sapp_glCreateShader +#define glTexSubImage2D _sapp_glTexSubImage2D +#define glClearDepth _sapp_glClearDepth +#define glFramebufferTexture2D _sapp_glFramebufferTexture2D +#define glCreateProgram _sapp_glCreateProgram +#define glViewport _sapp_glViewport +#define glDeleteBuffers _sapp_glDeleteBuffers +#define glDrawArrays _sapp_glDrawArrays +#define glDrawElementsInstanced _sapp_glDrawElementsInstanced +#define glVertexAttribPointer _sapp_glVertexAttribPointer +#define glUniform1i _sapp_glUniform1i +#define glDisable _sapp_glDisable +#define glColorMask _sapp_glColorMask +#define glBindBuffer _sapp_glBindBuffer +#define glDeleteVertexArrays _sapp_glDeleteVertexArrays +#define glDepthMask _sapp_glDepthMask +#define glDrawArraysInstanced _sapp_glDrawArraysInstanced +#define glClearStencil _sapp_glClearStencil +#define glScissor _sapp_glScissor +#define glUniform3fv _sapp_glUniform3fv +#define glGenRenderbuffers _sapp_glGenRenderbuffers +#define glBufferData _sapp_glBufferData +#define glBlendFuncSeparate _sapp_glBlendFuncSeparate +#define glTexParameteri _sapp_glTexParameteri +#define glGetIntegerv _sapp_glGetIntegerv +#define glEnable _sapp_glEnable +#define glBlitFramebuffer _sapp_glBlitFramebuffer +#define glStencilMask _sapp_glStencilMask +#define glAttachShader _sapp_glAttachShader +#define glGetError _sapp_glGetError +#define glClearColor _sapp_glClearColor +#define glBlendColor _sapp_glBlendColor +#define glTexParameterf _sapp_glTexParameterf +#define glTexParameterfv _sapp_glTexParameterfv +#define glGetShaderInfoLog _sapp_glGetShaderInfoLog +#define glDepthFunc _sapp_glDepthFunc +#define glStencilOp _sapp_glStencilOp +#define glStencilFunc _sapp_glStencilFunc +#define glEnableVertexAttribArray _sapp_glEnableVertexAttribArray +#define glBlendFunc _sapp_glBlendFunc +#define glUniform1fv _sapp_glUniform1fv +#define glReadBuffer _sapp_glReadBuffer +#define glClear _sapp_glClear +#define glTexImage2D _sapp_glTexImage2D +#define glGenVertexArrays _sapp_glGenVertexArrays +#define glFrontFace _sapp_glFrontFace +#define glCullFace _sapp_glCullFace + +#endif /* SOKOL_WIN32_NO_GL_LOADER */ + +#endif /* SOKOL_GLCORE33 */ + +#if defined(SOKOL_D3D11) +#define _SAPP_SAFE_RELEASE(class, obj) if (obj) { class##_Release(obj); obj=0; } +_SOKOL_PRIVATE void _sapp_d3d11_create_device_and_swapchain(void) { + DXGI_SWAP_CHAIN_DESC* sc_desc = &_sapp_dxgi_swap_chain_desc; + sc_desc->BufferDesc.Width = _sapp.framebuffer_width; + sc_desc->BufferDesc.Height = _sapp.framebuffer_height; + sc_desc->BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + sc_desc->BufferDesc.RefreshRate.Numerator = 60; + sc_desc->BufferDesc.RefreshRate.Denominator = 1; + sc_desc->OutputWindow = _sapp_win32_hwnd; + sc_desc->Windowed = true; + sc_desc->SwapEffect = DXGI_SWAP_EFFECT_DISCARD; + sc_desc->BufferCount = 1; + sc_desc->SampleDesc.Count = _sapp.sample_count; + sc_desc->SampleDesc.Quality = _sapp.sample_count > 1 ? D3D11_STANDARD_MULTISAMPLE_PATTERN : 0; + sc_desc->BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + int create_flags = D3D11_CREATE_DEVICE_SINGLETHREADED | D3D11_CREATE_DEVICE_BGRA_SUPPORT; + #if defined(SOKOL_DEBUG) + create_flags |= D3D11_CREATE_DEVICE_DEBUG; + #endif + D3D_FEATURE_LEVEL feature_level; + HRESULT hr = D3D11CreateDeviceAndSwapChain( + NULL, /* pAdapter (use default) */ + D3D_DRIVER_TYPE_HARDWARE, /* DriverType */ + NULL, /* Software */ + create_flags, /* Flags */ + NULL, /* pFeatureLevels */ + 0, /* FeatureLevels */ + D3D11_SDK_VERSION, /* SDKVersion */ + sc_desc, /* pSwapChainDesc */ + &_sapp_dxgi_swap_chain, /* ppSwapChain */ + &_sapp_d3d11_device, /* ppDevice */ + &feature_level, /* pFeatureLevel */ + &_sapp_d3d11_device_context); /* ppImmediateContext */ + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_dxgi_swap_chain && _sapp_d3d11_device && _sapp_d3d11_device_context); +} + +_SOKOL_PRIVATE void _sapp_d3d11_destroy_device_and_swapchain(void) { + _SAPP_SAFE_RELEASE(IDXGISwapChain, _sapp_dxgi_swap_chain); + _SAPP_SAFE_RELEASE(ID3D11DeviceContext, _sapp_d3d11_device_context); + _SAPP_SAFE_RELEASE(ID3D11Device, _sapp_d3d11_device); +} + +_SOKOL_PRIVATE void _sapp_d3d11_create_default_render_target(void) { + HRESULT hr; + #ifdef __cplusplus + hr = IDXGISwapChain_GetBuffer(_sapp_dxgi_swap_chain, 0, IID_ID3D11Texture2D, (void**)&_sapp_d3d11_rt); + #else + hr = IDXGISwapChain_GetBuffer(_sapp_dxgi_swap_chain, 0, &IID_ID3D11Texture2D, (void**)&_sapp_d3d11_rt); + #endif + SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_d3d11_rt); + hr = ID3D11Device_CreateRenderTargetView(_sapp_d3d11_device, (ID3D11Resource*)_sapp_d3d11_rt, NULL, &_sapp_d3d11_rtv); + SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_d3d11_rtv); + D3D11_TEXTURE2D_DESC ds_desc; + memset(&ds_desc, 0, sizeof(ds_desc)); + ds_desc.Width = _sapp.framebuffer_width; + ds_desc.Height = _sapp.framebuffer_height; + ds_desc.MipLevels = 1; + ds_desc.ArraySize = 1; + ds_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + ds_desc.SampleDesc = _sapp_dxgi_swap_chain_desc.SampleDesc; + ds_desc.Usage = D3D11_USAGE_DEFAULT; + ds_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + hr = ID3D11Device_CreateTexture2D(_sapp_d3d11_device, &ds_desc, NULL, &_sapp_d3d11_ds); + SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_d3d11_ds); + D3D11_DEPTH_STENCIL_VIEW_DESC dsv_desc; + memset(&dsv_desc, 0, sizeof(dsv_desc)); + dsv_desc.Format = ds_desc.Format; + dsv_desc.ViewDimension = _sapp.sample_count > 1 ? D3D11_DSV_DIMENSION_TEXTURE2DMS : D3D11_DSV_DIMENSION_TEXTURE2D; + hr = ID3D11Device_CreateDepthStencilView(_sapp_d3d11_device, (ID3D11Resource*)_sapp_d3d11_ds, &dsv_desc, &_sapp_d3d11_dsv); + SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_d3d11_dsv); +} + +_SOKOL_PRIVATE void _sapp_d3d11_destroy_default_render_target(void) { + _SAPP_SAFE_RELEASE(ID3D11Texture2D, _sapp_d3d11_rt); + _SAPP_SAFE_RELEASE(ID3D11RenderTargetView, _sapp_d3d11_rtv); + _SAPP_SAFE_RELEASE(ID3D11Texture2D, _sapp_d3d11_ds); + _SAPP_SAFE_RELEASE(ID3D11DepthStencilView, _sapp_d3d11_dsv); +} + +_SOKOL_PRIVATE void _sapp_d3d11_resize_default_render_target(void) { + if (_sapp_dxgi_swap_chain) { + _sapp_d3d11_destroy_default_render_target(); + IDXGISwapChain_ResizeBuffers(_sapp_dxgi_swap_chain, 1, _sapp.framebuffer_width, _sapp.framebuffer_height, DXGI_FORMAT_B8G8R8A8_UNORM, 0); + _sapp_d3d11_create_default_render_target(); + } +} +#endif + +#if defined(SOKOL_GLCORE33) +_SOKOL_PRIVATE void _sapp_wgl_init(void) { + _sapp_opengl32 = LoadLibraryA("opengl32.dll"); + if (!_sapp_opengl32) { + _sapp_fail("Failed to load opengl32.dll\n"); + } + SOKOL_ASSERT(_sapp_opengl32); + _sapp_wglCreateContext = (PFN_wglCreateContext) GetProcAddress(_sapp_opengl32, "wglCreateContext"); + SOKOL_ASSERT(_sapp_wglCreateContext); + _sapp_wglDeleteContext = (PFN_wglDeleteContext) GetProcAddress(_sapp_opengl32, "wglDeleteContext"); + SOKOL_ASSERT(_sapp_wglDeleteContext); + _sapp_wglGetProcAddress = (PFN_wglGetProcAddress) GetProcAddress(_sapp_opengl32, "wglGetProcAddress"); + SOKOL_ASSERT(_sapp_wglGetProcAddress); + _sapp_wglGetCurrentDC = (PFN_wglGetCurrentDC) GetProcAddress(_sapp_opengl32, "wglGetCurrentDC"); + SOKOL_ASSERT(_sapp_wglGetCurrentDC); + _sapp_wglMakeCurrent = (PFN_wglMakeCurrent) GetProcAddress(_sapp_opengl32, "wglMakeCurrent"); + SOKOL_ASSERT(_sapp_wglMakeCurrent); + + _sapp_win32_msg_hwnd = CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, + L"SOKOLAPP", + L"sokol-app message window", + WS_CLIPSIBLINGS|WS_CLIPCHILDREN, + 0, 0, 1, 1, + NULL, NULL, + GetModuleHandleW(NULL), + NULL); + if (!_sapp_win32_msg_hwnd) { + _sapp_fail("Win32: failed to create helper window!\n"); + } + ShowWindow(_sapp_win32_msg_hwnd, SW_HIDE); + MSG msg; + while (PeekMessageW(&msg, _sapp_win32_msg_hwnd, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + _sapp_win32_msg_dc = GetDC(_sapp_win32_msg_hwnd); + if (!_sapp_win32_msg_dc) { + _sapp_fail("Win32: failed to obtain helper window DC!\n"); + } +} + +_SOKOL_PRIVATE void _sapp_wgl_shutdown(void) { + SOKOL_ASSERT(_sapp_opengl32 && _sapp_win32_msg_hwnd); + DestroyWindow(_sapp_win32_msg_hwnd); _sapp_win32_msg_hwnd = 0; + FreeLibrary(_sapp_opengl32); _sapp_opengl32 = 0; +} + +_SOKOL_PRIVATE bool _sapp_wgl_has_ext(const char* ext, const char* extensions) { + SOKOL_ASSERT(ext && extensions); + const char* start = extensions; + while (true) { + const char* where = strstr(start, ext); + if (!where) { + return false; + } + const char* terminator = where + strlen(ext); + if ((where == start) || (*(where - 1) == ' ')) { + if (*terminator == ' ' || *terminator == '\0') { + break; + } + } + start = terminator; + } + return true; +} + +_SOKOL_PRIVATE bool _sapp_wgl_ext_supported(const char* ext) { + SOKOL_ASSERT(ext); + if (_sapp_GetExtensionsStringEXT) { + const char* extensions = _sapp_GetExtensionsStringEXT(); + if (extensions) { + if (_sapp_wgl_has_ext(ext, extensions)) { + return true; + } + } + } + if (_sapp_GetExtensionsStringARB) { + const char* extensions = _sapp_GetExtensionsStringARB(_sapp_wglGetCurrentDC()); + if (extensions) { + if (_sapp_wgl_has_ext(ext, extensions)) { + return true; + } + } + } + return false; +} + +_SOKOL_PRIVATE void _sapp_wgl_load_extensions(void) { + SOKOL_ASSERT(_sapp_win32_msg_dc); + PIXELFORMATDESCRIPTOR pfd; + memset(&pfd, 0, sizeof(pfd)); + pfd.nSize = sizeof(pfd); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.cColorBits = 24; + if (!SetPixelFormat(_sapp_win32_msg_dc, ChoosePixelFormat(_sapp_win32_msg_dc, &pfd), &pfd)) { + _sapp_fail("WGL: failed to set pixel format for dummy context\n"); + } + HGLRC rc = _sapp_wglCreateContext(_sapp_win32_msg_dc); + if (!rc) { + _sapp_fail("WGL: Failed to create dummy context\n"); + } + if (!_sapp_wglMakeCurrent(_sapp_win32_msg_dc, rc)) { + _sapp_fail("WGL: Failed to make context current\n"); + } + _sapp_GetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) _sapp_wglGetProcAddress("wglGetExtensionsStringEXT"); + _sapp_GetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC) _sapp_wglGetProcAddress("wglGetExtensionsStringARB"); + _sapp_CreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) _sapp_wglGetProcAddress("wglCreateContextAttribsARB"); + _sapp_SwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) _sapp_wglGetProcAddress("wglSwapIntervalEXT"); + _sapp_GetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC) _sapp_wglGetProcAddress("wglGetPixelFormatAttribivARB"); + _sapp_arb_multisample = _sapp_wgl_ext_supported("WGL_ARB_multisample"); + _sapp_arb_create_context = _sapp_wgl_ext_supported("WGL_ARB_create_context"); + _sapp_arb_create_context_profile = _sapp_wgl_ext_supported("WGL_ARB_create_context_profile"); + _sapp_ext_swap_control = _sapp_wgl_ext_supported("WGL_EXT_swap_control"); + _sapp_arb_pixel_format = _sapp_wgl_ext_supported("WGL_ARB_pixel_format"); + _sapp_wglMakeCurrent(_sapp_win32_msg_dc, 0); + _sapp_wglDeleteContext(rc); +} + +_SOKOL_PRIVATE int _sapp_wgl_attrib(int pixel_format, int attrib) { + SOKOL_ASSERT(_sapp_arb_pixel_format); + int value = 0; + if (!_sapp_GetPixelFormatAttribivARB(_sapp_win32_dc, pixel_format, 0, 1, &attrib, &value)) { + _sapp_fail("WGL: Failed to retrieve pixel format attribute\n"); + } + return value; +} + +_SOKOL_PRIVATE int _sapp_wgl_find_pixel_format(void) { + SOKOL_ASSERT(_sapp_win32_dc); + SOKOL_ASSERT(_sapp_arb_pixel_format); + const _sapp_gl_fbconfig* closest; + + int native_count = _sapp_wgl_attrib(1, WGL_NUMBER_PIXEL_FORMATS_ARB); + _sapp_gl_fbconfig* usable_configs = (_sapp_gl_fbconfig*) SOKOL_CALLOC(native_count, sizeof(_sapp_gl_fbconfig)); + int usable_count = 0; + for (int i = 0; i < native_count; i++) { + const int n = i + 1; + _sapp_gl_fbconfig* u = usable_configs + usable_count; + _sapp_gl_init_fbconfig(u); + if (!_sapp_wgl_attrib(n, WGL_SUPPORT_OPENGL_ARB) || !_sapp_wgl_attrib(n, WGL_DRAW_TO_WINDOW_ARB)) { + continue; + } + if (_sapp_wgl_attrib(n, WGL_PIXEL_TYPE_ARB) != WGL_TYPE_RGBA_ARB) { + continue; + } + if (_sapp_wgl_attrib(n, WGL_ACCELERATION_ARB) == WGL_NO_ACCELERATION_ARB) { + continue; + } + u->red_bits = _sapp_wgl_attrib(n, WGL_RED_BITS_ARB); + u->green_bits = _sapp_wgl_attrib(n, WGL_GREEN_BITS_ARB); + u->blue_bits = _sapp_wgl_attrib(n, WGL_BLUE_BITS_ARB); + u->alpha_bits = _sapp_wgl_attrib(n, WGL_ALPHA_BITS_ARB); + u->depth_bits = _sapp_wgl_attrib(n, WGL_DEPTH_BITS_ARB); + u->stencil_bits = _sapp_wgl_attrib(n, WGL_STENCIL_BITS_ARB); + if (_sapp_wgl_attrib(n, WGL_DOUBLE_BUFFER_ARB)) { + u->doublebuffer = true; + } + if (_sapp_arb_multisample) { + u->samples = _sapp_wgl_attrib(n, WGL_SAMPLES_ARB); + } + u->handle = n; + usable_count++; + } + SOKOL_ASSERT(usable_count > 0); + _sapp_gl_fbconfig desired; + _sapp_gl_init_fbconfig(&desired); + desired.red_bits = 8; + desired.green_bits = 8; + desired.blue_bits = 8; + desired.alpha_bits = 8; + desired.depth_bits = 24; + desired.stencil_bits = 8; + desired.doublebuffer = true; + desired.samples = _sapp.sample_count > 1 ? _sapp.sample_count : 0; + closest = _sapp_gl_choose_fbconfig(&desired, usable_configs, usable_count); + int pixel_format = 0; + if (closest) { + pixel_format = (int) closest->handle; + } + SOKOL_FREE(usable_configs); + return pixel_format; +} + +_SOKOL_PRIVATE void _sapp_wgl_create_context(void) { + int pixel_format = _sapp_wgl_find_pixel_format(); + if (0 == pixel_format) { + _sapp_fail("WGL: Didn't find matching pixel format.\n"); + } + PIXELFORMATDESCRIPTOR pfd; + if (!DescribePixelFormat(_sapp_win32_dc, pixel_format, sizeof(pfd), &pfd)) { + _sapp_fail("WGL: Failed to retrieve PFD for selected pixel format!\n"); + } + if (!SetPixelFormat(_sapp_win32_dc, pixel_format, &pfd)) { + _sapp_fail("WGL: Failed to set selected pixel format!\n"); + } + if (!_sapp_arb_create_context) { + _sapp_fail("WGL: ARB_create_context required!\n"); + } + if (!_sapp_arb_create_context_profile) { + _sapp_fail("WGL: ARB_create_context_profile required!\n"); + } + const int attrs[] = { + WGL_CONTEXT_MAJOR_VERSION_ARB, 3, + WGL_CONTEXT_MINOR_VERSION_ARB, 3, + WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB, + 0, 0 + }; + _sapp_gl_ctx = _sapp_CreateContextAttribsARB(_sapp_win32_dc, 0, attrs); + if (!_sapp_gl_ctx) { + const DWORD err = GetLastError(); + if (err == (0xc0070000 | ERROR_INVALID_VERSION_ARB)) { + _sapp_fail("WGL: Driver does not support OpenGL version 3.3\n"); + } + else if (err == (0xc0070000 | ERROR_INVALID_PROFILE_ARB)) { + _sapp_fail("WGL: Driver does not support the requested OpenGL profile"); + } + else if (err == (0xc0070000 | ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB)) { + _sapp_fail("WGL: The share context is not compatible with the requested context"); + } + else { + _sapp_fail("WGL: Failed to create OpenGL context"); + } + } + _sapp_wglMakeCurrent(_sapp_win32_dc, _sapp_gl_ctx); + if (_sapp_ext_swap_control) { + /* FIXME: DwmIsCompositionEnabled() (see GLFW) */ + _sapp_SwapIntervalEXT(_sapp.swap_interval); + } +} + +_SOKOL_PRIVATE void _sapp_wgl_destroy_context(void) { + SOKOL_ASSERT(_sapp_gl_ctx); + _sapp_wglDeleteContext(_sapp_gl_ctx); + _sapp_gl_ctx = 0; +} + +_SOKOL_PRIVATE void _sapp_wgl_swap_buffers(void) { + SOKOL_ASSERT(_sapp_win32_dc); + /* FIXME: DwmIsCompositionEnabled? (see GLFW) */ + SwapBuffers(_sapp_win32_dc); +} +#endif + +_SOKOL_PRIVATE bool _sapp_win32_utf8_to_wide(const char* src, wchar_t* dst, int dst_num_bytes) { + SOKOL_ASSERT(src && dst && (dst_num_bytes > 1)); + memset(dst, 0, dst_num_bytes); + const int dst_chars = dst_num_bytes / sizeof(wchar_t); + const int dst_needed = MultiByteToWideChar(CP_UTF8, 0, src, -1, 0, 0); + if ((dst_needed > 0) && (dst_needed < dst_chars)) { + MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, dst_chars); + return true; + } + else { + /* input string doesn't fit into destination buffer */ + return false; + } +} + +_SOKOL_PRIVATE void _sapp_win32_show_mouse(bool shown) { + ShowCursor((BOOL)shown); +} + +_SOKOL_PRIVATE bool _sapp_win32_mouse_shown(void) { + CURSORINFO cursor_info; + memset(&cursor_info, 0, sizeof(CURSORINFO)); + cursor_info.cbSize = sizeof(CURSORINFO); + GetCursorInfo(&cursor_info); + return (cursor_info.flags & CURSOR_SHOWING) != 0; +} + +_SOKOL_PRIVATE void _sapp_win32_init_keytable(void) { + /* same as GLFW */ + _sapp.keycodes[0x00B] = SAPP_KEYCODE_0; + _sapp.keycodes[0x002] = SAPP_KEYCODE_1; + _sapp.keycodes[0x003] = SAPP_KEYCODE_2; + _sapp.keycodes[0x004] = SAPP_KEYCODE_3; + _sapp.keycodes[0x005] = SAPP_KEYCODE_4; + _sapp.keycodes[0x006] = SAPP_KEYCODE_5; + _sapp.keycodes[0x007] = SAPP_KEYCODE_6; + _sapp.keycodes[0x008] = SAPP_KEYCODE_7; + _sapp.keycodes[0x009] = SAPP_KEYCODE_8; + _sapp.keycodes[0x00A] = SAPP_KEYCODE_9; + _sapp.keycodes[0x01E] = SAPP_KEYCODE_A; + _sapp.keycodes[0x030] = SAPP_KEYCODE_B; + _sapp.keycodes[0x02E] = SAPP_KEYCODE_C; + _sapp.keycodes[0x020] = SAPP_KEYCODE_D; + _sapp.keycodes[0x012] = SAPP_KEYCODE_E; + _sapp.keycodes[0x021] = SAPP_KEYCODE_F; + _sapp.keycodes[0x022] = SAPP_KEYCODE_G; + _sapp.keycodes[0x023] = SAPP_KEYCODE_H; + _sapp.keycodes[0x017] = SAPP_KEYCODE_I; + _sapp.keycodes[0x024] = SAPP_KEYCODE_J; + _sapp.keycodes[0x025] = SAPP_KEYCODE_K; + _sapp.keycodes[0x026] = SAPP_KEYCODE_L; + _sapp.keycodes[0x032] = SAPP_KEYCODE_M; + _sapp.keycodes[0x031] = SAPP_KEYCODE_N; + _sapp.keycodes[0x018] = SAPP_KEYCODE_O; + _sapp.keycodes[0x019] = SAPP_KEYCODE_P; + _sapp.keycodes[0x010] = SAPP_KEYCODE_Q; + _sapp.keycodes[0x013] = SAPP_KEYCODE_R; + _sapp.keycodes[0x01F] = SAPP_KEYCODE_S; + _sapp.keycodes[0x014] = SAPP_KEYCODE_T; + _sapp.keycodes[0x016] = SAPP_KEYCODE_U; + _sapp.keycodes[0x02F] = SAPP_KEYCODE_V; + _sapp.keycodes[0x011] = SAPP_KEYCODE_W; + _sapp.keycodes[0x02D] = SAPP_KEYCODE_X; + _sapp.keycodes[0x015] = SAPP_KEYCODE_Y; + _sapp.keycodes[0x02C] = SAPP_KEYCODE_Z; + _sapp.keycodes[0x028] = SAPP_KEYCODE_APOSTROPHE; + _sapp.keycodes[0x02B] = SAPP_KEYCODE_BACKSLASH; + _sapp.keycodes[0x033] = SAPP_KEYCODE_COMMA; + _sapp.keycodes[0x00D] = SAPP_KEYCODE_EQUAL; + _sapp.keycodes[0x029] = SAPP_KEYCODE_GRAVE_ACCENT; + _sapp.keycodes[0x01A] = SAPP_KEYCODE_LEFT_BRACKET; + _sapp.keycodes[0x00C] = SAPP_KEYCODE_MINUS; + _sapp.keycodes[0x034] = SAPP_KEYCODE_PERIOD; + _sapp.keycodes[0x01B] = SAPP_KEYCODE_RIGHT_BRACKET; + _sapp.keycodes[0x027] = SAPP_KEYCODE_SEMICOLON; + _sapp.keycodes[0x035] = SAPP_KEYCODE_SLASH; + _sapp.keycodes[0x056] = SAPP_KEYCODE_WORLD_2; + _sapp.keycodes[0x00E] = SAPP_KEYCODE_BACKSPACE; + _sapp.keycodes[0x153] = SAPP_KEYCODE_DELETE; + _sapp.keycodes[0x14F] = SAPP_KEYCODE_END; + _sapp.keycodes[0x01C] = SAPP_KEYCODE_ENTER; + _sapp.keycodes[0x001] = SAPP_KEYCODE_ESCAPE; + _sapp.keycodes[0x147] = SAPP_KEYCODE_HOME; + _sapp.keycodes[0x152] = SAPP_KEYCODE_INSERT; + _sapp.keycodes[0x15D] = SAPP_KEYCODE_MENU; + _sapp.keycodes[0x151] = SAPP_KEYCODE_PAGE_DOWN; + _sapp.keycodes[0x149] = SAPP_KEYCODE_PAGE_UP; + _sapp.keycodes[0x045] = SAPP_KEYCODE_PAUSE; + _sapp.keycodes[0x146] = SAPP_KEYCODE_PAUSE; + _sapp.keycodes[0x039] = SAPP_KEYCODE_SPACE; + _sapp.keycodes[0x00F] = SAPP_KEYCODE_TAB; + _sapp.keycodes[0x03A] = SAPP_KEYCODE_CAPS_LOCK; + _sapp.keycodes[0x145] = SAPP_KEYCODE_NUM_LOCK; + _sapp.keycodes[0x046] = SAPP_KEYCODE_SCROLL_LOCK; + _sapp.keycodes[0x03B] = SAPP_KEYCODE_F1; + _sapp.keycodes[0x03C] = SAPP_KEYCODE_F2; + _sapp.keycodes[0x03D] = SAPP_KEYCODE_F3; + _sapp.keycodes[0x03E] = SAPP_KEYCODE_F4; + _sapp.keycodes[0x03F] = SAPP_KEYCODE_F5; + _sapp.keycodes[0x040] = SAPP_KEYCODE_F6; + _sapp.keycodes[0x041] = SAPP_KEYCODE_F7; + _sapp.keycodes[0x042] = SAPP_KEYCODE_F8; + _sapp.keycodes[0x043] = SAPP_KEYCODE_F9; + _sapp.keycodes[0x044] = SAPP_KEYCODE_F10; + _sapp.keycodes[0x057] = SAPP_KEYCODE_F11; + _sapp.keycodes[0x058] = SAPP_KEYCODE_F12; + _sapp.keycodes[0x064] = SAPP_KEYCODE_F13; + _sapp.keycodes[0x065] = SAPP_KEYCODE_F14; + _sapp.keycodes[0x066] = SAPP_KEYCODE_F15; + _sapp.keycodes[0x067] = SAPP_KEYCODE_F16; + _sapp.keycodes[0x068] = SAPP_KEYCODE_F17; + _sapp.keycodes[0x069] = SAPP_KEYCODE_F18; + _sapp.keycodes[0x06A] = SAPP_KEYCODE_F19; + _sapp.keycodes[0x06B] = SAPP_KEYCODE_F20; + _sapp.keycodes[0x06C] = SAPP_KEYCODE_F21; + _sapp.keycodes[0x06D] = SAPP_KEYCODE_F22; + _sapp.keycodes[0x06E] = SAPP_KEYCODE_F23; + _sapp.keycodes[0x076] = SAPP_KEYCODE_F24; + _sapp.keycodes[0x038] = SAPP_KEYCODE_LEFT_ALT; + _sapp.keycodes[0x01D] = SAPP_KEYCODE_LEFT_CONTROL; + _sapp.keycodes[0x02A] = SAPP_KEYCODE_LEFT_SHIFT; + _sapp.keycodes[0x15B] = SAPP_KEYCODE_LEFT_SUPER; + _sapp.keycodes[0x137] = SAPP_KEYCODE_PRINT_SCREEN; + _sapp.keycodes[0x138] = SAPP_KEYCODE_RIGHT_ALT; + _sapp.keycodes[0x11D] = SAPP_KEYCODE_RIGHT_CONTROL; + _sapp.keycodes[0x036] = SAPP_KEYCODE_RIGHT_SHIFT; + _sapp.keycodes[0x15C] = SAPP_KEYCODE_RIGHT_SUPER; + _sapp.keycodes[0x150] = SAPP_KEYCODE_DOWN; + _sapp.keycodes[0x14B] = SAPP_KEYCODE_LEFT; + _sapp.keycodes[0x14D] = SAPP_KEYCODE_RIGHT; + _sapp.keycodes[0x148] = SAPP_KEYCODE_UP; + _sapp.keycodes[0x052] = SAPP_KEYCODE_KP_0; + _sapp.keycodes[0x04F] = SAPP_KEYCODE_KP_1; + _sapp.keycodes[0x050] = SAPP_KEYCODE_KP_2; + _sapp.keycodes[0x051] = SAPP_KEYCODE_KP_3; + _sapp.keycodes[0x04B] = SAPP_KEYCODE_KP_4; + _sapp.keycodes[0x04C] = SAPP_KEYCODE_KP_5; + _sapp.keycodes[0x04D] = SAPP_KEYCODE_KP_6; + _sapp.keycodes[0x047] = SAPP_KEYCODE_KP_7; + _sapp.keycodes[0x048] = SAPP_KEYCODE_KP_8; + _sapp.keycodes[0x049] = SAPP_KEYCODE_KP_9; + _sapp.keycodes[0x04E] = SAPP_KEYCODE_KP_ADD; + _sapp.keycodes[0x053] = SAPP_KEYCODE_KP_DECIMAL; + _sapp.keycodes[0x135] = SAPP_KEYCODE_KP_DIVIDE; + _sapp.keycodes[0x11C] = SAPP_KEYCODE_KP_ENTER; + _sapp.keycodes[0x037] = SAPP_KEYCODE_KP_MULTIPLY; + _sapp.keycodes[0x04A] = SAPP_KEYCODE_KP_SUBTRACT; +} + +/* updates current window and framebuffer size from the window's client rect, returns true if size has changed */ +_SOKOL_PRIVATE bool _sapp_win32_update_dimensions(void) { + RECT rect; + if (GetClientRect(_sapp_win32_hwnd, &rect)) { + _sapp.window_width = (int)((float)(rect.right - rect.left) / _sapp_win32_window_scale); + _sapp.window_height = (int)((float)(rect.bottom - rect.top) / _sapp_win32_window_scale); + const int fb_width = (int)((float)_sapp.window_width * _sapp_win32_content_scale); + const int fb_height = (int)((float)_sapp.window_height * _sapp_win32_content_scale); + if ((fb_width != _sapp.framebuffer_width) || (fb_height != _sapp.framebuffer_height)) { + _sapp.framebuffer_width = (int)((float)_sapp.window_width * _sapp_win32_content_scale); + _sapp.framebuffer_height = (int)((float)_sapp.window_height * _sapp_win32_content_scale); + /* prevent a framebuffer size of 0 when window is minimized */ + if (_sapp.framebuffer_width == 0) { + _sapp.framebuffer_width = 1; + } + if (_sapp.framebuffer_height == 0) { + _sapp.framebuffer_height = 1; + } + return true; + } + } + else { + _sapp.window_width = _sapp.window_height = 1; + _sapp.framebuffer_width = _sapp.framebuffer_height = 1; + } + return false; +} + +_SOKOL_PRIVATE uint32_t _sapp_win32_mods(void) { + uint32_t mods = 0; + if (GetKeyState(VK_SHIFT) & (1<<31)) { + mods |= SAPP_MODIFIER_SHIFT; + } + if (GetKeyState(VK_CONTROL) & (1<<31)) { + mods |= SAPP_MODIFIER_CTRL; + } + if (GetKeyState(VK_MENU) & (1<<31)) { + mods |= SAPP_MODIFIER_ALT; + } + if ((GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) & (1<<31)) { + mods |= SAPP_MODIFIER_SUPER; + } + return mods; +} + +_SOKOL_PRIVATE void _sapp_win32_mouse_event(sapp_event_type type, sapp_mousebutton btn) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp.event.modifiers = _sapp_win32_mods(); + _sapp.event.mouse_button = btn; + _sapp.event.mouse_x = _sapp.mouse_x; + _sapp.event.mouse_y = _sapp.mouse_y; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_win32_scroll_event(float x, float y) { + if (_sapp_events_enabled()) { + _sapp_init_event(SAPP_EVENTTYPE_MOUSE_SCROLL); + _sapp.event.modifiers = _sapp_win32_mods(); + _sapp.event.scroll_x = -x / 30.0f; + _sapp.event.scroll_y = y / 30.0f; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_win32_key_event(sapp_event_type type, int vk, bool repeat) { + if (_sapp_events_enabled() && (vk < SAPP_MAX_KEYCODES)) { + _sapp_init_event(type); + _sapp.event.modifiers = _sapp_win32_mods(); + _sapp.event.key_code = _sapp.keycodes[vk]; + _sapp.event.key_repeat = repeat; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_win32_char_event(uint32_t c, bool repeat) { + if (_sapp_events_enabled() && (c >= 32)) { + _sapp_init_event(SAPP_EVENTTYPE_CHAR); + _sapp.event.modifiers = _sapp_win32_mods(); + _sapp.event.char_code = c; + _sapp.event.key_repeat = repeat; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_win32_app_event(sapp_event_type type) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE LRESULT CALLBACK _sapp_win32_wndproc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + /* FIXME: refresh rendering during resize with a WM_TIMER event */ + if (!_sapp_win32_in_create_window) { + switch (uMsg) { + case WM_CLOSE: + /* only give user a chance to intervene when sapp_quit() wasn't already called */ + if (!_sapp.quit_ordered) { + /* if window should be closed and event handling is enabled, give user code + a change to intervene via sapp_cancel_quit() + */ + _sapp.quit_requested = true; + _sapp_win32_app_event(SAPP_EVENTTYPE_QUIT_REQUESTED); + /* if user code hasn't intervened, quit the app */ + if (_sapp.quit_requested) { + _sapp.quit_ordered = true; + } + } + if (_sapp.quit_ordered) { + PostQuitMessage(0); + } + return 0; + case WM_SYSCOMMAND: + switch (wParam & 0xFFF0) { + case SC_SCREENSAVE: + case SC_MONITORPOWER: + if (_sapp.desc.fullscreen) { + /* disable screen saver and blanking in fullscreen mode */ + return 0; + } + break; + case SC_KEYMENU: + /* user trying to access menu via ALT */ + return 0; + } + break; + case WM_ERASEBKGND: + return 1; + case WM_SIZE: + { + const bool iconified = wParam == SIZE_MINIMIZED; + if (iconified != _sapp_win32_iconified) { + _sapp_win32_iconified = iconified; + if (iconified) { + _sapp_win32_app_event(SAPP_EVENTTYPE_ICONIFIED); + } + else { + _sapp_win32_app_event(SAPP_EVENTTYPE_RESTORED); + } + } + } + break; + case WM_SETCURSOR: + if (_sapp.desc.user_cursor) { + if (LOWORD(lParam) == HTCLIENT) { + _sapp_win32_app_event(SAPP_EVENTTYPE_UPDATE_CURSOR); + return 1; + } + } + break; + case WM_LBUTTONDOWN: + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, SAPP_MOUSEBUTTON_LEFT); + break; + case WM_RBUTTONDOWN: + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, SAPP_MOUSEBUTTON_RIGHT); + break; + case WM_MBUTTONDOWN: + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, SAPP_MOUSEBUTTON_MIDDLE); + break; + case WM_LBUTTONUP: + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_LEFT); + break; + case WM_RBUTTONUP: + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_RIGHT); + break; + case WM_MBUTTONUP: + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, SAPP_MOUSEBUTTON_MIDDLE); + break; + case WM_MOUSEMOVE: + _sapp.mouse_x = (float)GET_X_LPARAM(lParam) * _sapp_win32_mouse_scale; + _sapp.mouse_y = (float)GET_Y_LPARAM(lParam) * _sapp_win32_mouse_scale; + if (!_sapp.win32_mouse_tracked) { + _sapp.win32_mouse_tracked = true; + TRACKMOUSEEVENT tme; + memset(&tme, 0, sizeof(tme)); + tme.cbSize = sizeof(tme); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = _sapp_win32_hwnd; + TrackMouseEvent(&tme); + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_ENTER, SAPP_MOUSEBUTTON_INVALID); + } + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID); + break; + case WM_MOUSELEAVE: + _sapp.win32_mouse_tracked = false; + _sapp_win32_mouse_event(SAPP_EVENTTYPE_MOUSE_LEAVE, SAPP_MOUSEBUTTON_INVALID); + break; + case WM_MOUSEWHEEL: + _sapp_win32_scroll_event(0.0f, (float)((SHORT)HIWORD(wParam))); + break; + case WM_MOUSEHWHEEL: + _sapp_win32_scroll_event((float)((SHORT)HIWORD(wParam)), 0.0f); + break; + case WM_CHAR: + _sapp_win32_char_event((uint32_t)wParam, !!(lParam&0x40000000)); + break; + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + _sapp_win32_key_event(SAPP_EVENTTYPE_KEY_DOWN, (int)(HIWORD(lParam)&0x1FF), !!(lParam&0x40000000)); + break; + case WM_KEYUP: + case WM_SYSKEYUP: + _sapp_win32_key_event(SAPP_EVENTTYPE_KEY_UP, (int)(HIWORD(lParam)&0x1FF), false); + break; + default: + break; + } + } + return DefWindowProcW(hWnd, uMsg, wParam, lParam); +} + +_SOKOL_PRIVATE void _sapp_win32_create_window(void) { + WNDCLASSW wndclassw; + memset(&wndclassw, 0, sizeof(wndclassw)); + wndclassw.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; + wndclassw.lpfnWndProc = (WNDPROC) _sapp_win32_wndproc; + wndclassw.hInstance = GetModuleHandleW(NULL); + wndclassw.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclassw.hIcon = LoadIcon(NULL, IDI_WINLOGO); + wndclassw.lpszClassName = L"SOKOLAPP"; + RegisterClassW(&wndclassw); + + DWORD win_style; + const DWORD win_ex_style = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; + RECT rect = { 0, 0, 0, 0 }; + if (_sapp.desc.fullscreen) { + win_style = WS_POPUP | WS_SYSMENU | WS_VISIBLE; + rect.right = GetSystemMetrics(SM_CXSCREEN); + rect.bottom = GetSystemMetrics(SM_CYSCREEN); + } + else { + win_style = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX; + rect.right = (int) ((float)_sapp.window_width * _sapp_win32_window_scale); + rect.bottom = (int) ((float)_sapp.window_height * _sapp_win32_window_scale); + } + AdjustWindowRectEx(&rect, win_style, FALSE, win_ex_style); + const int win_width = rect.right - rect.left; + const int win_height = rect.bottom - rect.top; + _sapp_win32_in_create_window = true; + _sapp_win32_hwnd = CreateWindowExW( + win_ex_style, /* dwExStyle */ + L"SOKOLAPP", /* lpClassName */ + _sapp.window_title_wide, /* lpWindowName */ + win_style, /* dwStyle */ + CW_USEDEFAULT, /* X */ + CW_USEDEFAULT, /* Y */ + win_width, /* nWidth */ + win_height, /* nHeight */ + NULL, /* hWndParent */ + NULL, /* hMenu */ + GetModuleHandle(NULL), /* hInstance */ + NULL); /* lParam */ + ShowWindow(_sapp_win32_hwnd, SW_SHOW); + _sapp_win32_in_create_window = false; + _sapp_win32_dc = GetDC(_sapp_win32_hwnd); + SOKOL_ASSERT(_sapp_win32_dc); + _sapp_win32_update_dimensions(); +} + +_SOKOL_PRIVATE void _sapp_win32_destroy_window(void) { + DestroyWindow(_sapp_win32_hwnd); _sapp_win32_hwnd = 0; + UnregisterClassW(L"SOKOLAPP", GetModuleHandleW(NULL)); +} + +_SOKOL_PRIVATE void _sapp_win32_init_dpi(void) { + SOKOL_ASSERT(0 == _sapp_win32_setprocessdpiaware); + SOKOL_ASSERT(0 == _sapp_win32_setprocessdpiawareness); + SOKOL_ASSERT(0 == _sapp_win32_getdpiformonitor); + HINSTANCE user32 = LoadLibraryA("user32.dll"); + if (user32) { + _sapp_win32_setprocessdpiaware = (SETPROCESSDPIAWARE_T) GetProcAddress(user32, "SetProcessDPIAware"); + } + HINSTANCE shcore = LoadLibraryA("shcore.dll"); + if (shcore) { + _sapp_win32_setprocessdpiawareness = (SETPROCESSDPIAWARENESS_T) GetProcAddress(shcore, "SetProcessDpiAwareness"); + _sapp_win32_getdpiformonitor = (GETDPIFORMONITOR_T) GetProcAddress(shcore, "GetDpiForMonitor"); + } + if (_sapp_win32_setprocessdpiawareness) { + /* if the app didn't request HighDPI rendering, let Windows do the upscaling */ + PROCESS_DPI_AWARENESS process_dpi_awareness = PROCESS_SYSTEM_DPI_AWARE; + _sapp_win32_dpi_aware = true; + if (!_sapp.desc.high_dpi) { + process_dpi_awareness = PROCESS_DPI_UNAWARE; + _sapp_win32_dpi_aware = false; + } + _sapp_win32_setprocessdpiawareness(process_dpi_awareness); + } + else if (_sapp_win32_setprocessdpiaware) { + _sapp_win32_setprocessdpiaware(); + _sapp_win32_dpi_aware = true; + } + /* get dpi scale factor for main monitor */ + if (_sapp_win32_getdpiformonitor && _sapp_win32_dpi_aware) { + POINT pt = { 1, 1 }; + HMONITOR hm = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); + UINT dpix, dpiy; + HRESULT hr = _sapp_win32_getdpiformonitor(hm, MDT_EFFECTIVE_DPI, &dpix, &dpiy); + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr)); + /* clamp window scale to an integer factor */ + _sapp_win32_window_scale = (float)dpix / 96.0f; + } + else { + _sapp_win32_window_scale = 1.0f; + } + if (_sapp.desc.high_dpi) { + _sapp_win32_content_scale = _sapp_win32_window_scale; + _sapp_win32_mouse_scale = 1.0f; + } + else { + _sapp_win32_content_scale = 1.0f; + _sapp_win32_mouse_scale = 1.0f / _sapp_win32_window_scale; + } + _sapp.dpi_scale = _sapp_win32_content_scale; + if (user32) { + FreeLibrary(user32); + } + if (shcore) { + FreeLibrary(shcore); + } +} + +_SOKOL_PRIVATE void _sapp_run(const sapp_desc* desc) { + _sapp_init_state(desc); + _sapp_win32_init_keytable(); + _sapp_win32_utf8_to_wide(_sapp.window_title, _sapp.window_title_wide, sizeof(_sapp.window_title_wide)); + _sapp_win32_init_dpi(); + _sapp_win32_create_window(); + #if defined(SOKOL_D3D11) + _sapp_d3d11_create_device_and_swapchain(); + _sapp_d3d11_create_default_render_target(); + #endif + #if defined(SOKOL_GLCORE33) + _sapp_wgl_init(); + _sapp_wgl_load_extensions(); + _sapp_wgl_create_context(); + #if !defined(SOKOL_WIN32_NO_GL_LOADER) + _sapp_win32_gl_loadfuncs(); + #endif + #endif + _sapp.valid = true; + + bool done = false; + while (!(done || _sapp.quit_ordered)) { + MSG msg; + while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { + if (WM_QUIT == msg.message) { + done = true; + continue; + } + else { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + _sapp_frame(); + #if defined(SOKOL_D3D11) + IDXGISwapChain_Present(_sapp_dxgi_swap_chain, _sapp.swap_interval, 0); + if (IsIconic(_sapp_win32_hwnd)) { + Sleep(16 * _sapp.swap_interval); + } + #endif + #if defined(SOKOL_GLCORE33) + _sapp_wgl_swap_buffers(); + #endif + /* check for window resized, this cannot happen in WM_SIZE as it explodes memory usage */ + if (_sapp_win32_update_dimensions()) { + #if defined(SOKOL_D3D11) + _sapp_d3d11_resize_default_render_target(); + #endif + _sapp_win32_app_event(SAPP_EVENTTYPE_RESIZED); + } + if (_sapp.quit_requested) { + PostMessage(_sapp_win32_hwnd, WM_CLOSE, 0, 0); + } + } + _sapp_call_cleanup(); + + #if defined(SOKOL_D3D11) + _sapp_d3d11_destroy_default_render_target(); + _sapp_d3d11_destroy_device_and_swapchain(); + #else + _sapp_wgl_destroy_context(); + _sapp_wgl_shutdown(); + #endif + _sapp_win32_destroy_window(); +} + +static char** _sapp_win32_command_line_to_utf8_argv(LPWSTR w_command_line, int* o_argc) { + int argc = 0; + char** argv; + char* args; + + LPWSTR* w_argv = CommandLineToArgvW(w_command_line, &argc); + if (w_argv == NULL) { + _sapp_fail("Win32: failed to parse command line"); + } else { + size_t size = wcslen(w_command_line) * 4; + argv = (char**) SOKOL_CALLOC(1, (argc + 1) * sizeof(char*) + size); + args = (char*)&argv[argc + 1]; + int n; + for (int i = 0; i < argc; ++i) { + n = WideCharToMultiByte(CP_UTF8, 0, w_argv[i], -1, args, (int)size, NULL, NULL); + if (n == 0) { + _sapp_fail("Win32: failed to convert all arguments to utf8"); + break; + } + argv[i] = args; + size -= n; + args += n; + } + LocalFree(w_argv); + } + *o_argc = argc; + return argv; +} + +#if !defined(SOKOL_NO_ENTRY) +#if defined(SOKOL_WIN32_FORCE_MAIN) +int main(int argc, char* argv[]) { + sapp_desc desc = sokol_main(argc, argv); + _sapp_run(&desc); + return 0; +} +#else +int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) { + _SOKOL_UNUSED(hInstance); + _SOKOL_UNUSED(hPrevInstance); + _SOKOL_UNUSED(lpCmdLine); + _SOKOL_UNUSED(nCmdShow); + int argc_utf8 = 0; + char** argv_utf8 = _sapp_win32_command_line_to_utf8_argv(GetCommandLineW(), &argc_utf8); + sapp_desc desc = sokol_main(argc_utf8, argv_utf8); + _sapp_run(&desc); + SOKOL_FREE(argv_utf8); + return 0; +} +#endif /* SOKOL_WIN32_FORCE_MAIN */ +#endif /* SOKOL_NO_ENTRY */ +#undef _SAPP_SAFE_RELEASE +#endif /* WINDOWS */ + +/*== Android ================================================================*/ +#if defined(__ANDROID__) +#include +#include +#include +#include + +#include +#if defined(SOKOL_GLES3) + #include +#else + #ifndef GL_EXT_PROTOTYPES + #define GL_GLEXT_PROTOTYPES + #endif + #include + #include +#endif + +typedef struct { + pthread_t thread; + pthread_mutex_t mutex; + pthread_cond_t cond; + int read_from_main_fd; + int write_from_main_fd; +} _sapp_android_pt_t; + +typedef struct { + ANativeWindow* window; + AInputQueue* input; +} _sapp_android_resources_t; + +typedef enum { + _SOKOL_ANDROID_MSG_CREATE, + _SOKOL_ANDROID_MSG_RESUME, + _SOKOL_ANDROID_MSG_PAUSE, + _SOKOL_ANDROID_MSG_FOCUS, + _SOKOL_ANDROID_MSG_NO_FOCUS, + _SOKOL_ANDROID_MSG_SET_NATIVE_WINDOW, + _SOKOL_ANDROID_MSG_SET_INPUT_QUEUE, + _SOKOL_ANDROID_MSG_DESTROY, +} _sapp_android_msg_t; + +typedef struct { + ANativeActivity* activity; + _sapp_android_pt_t pt; + _sapp_android_resources_t pending; + _sapp_android_resources_t current; + ALooper* looper; + bool is_thread_started; + bool is_thread_stopping; + bool is_thread_stopped; + bool has_created; + bool has_resumed; + bool has_focus; + EGLConfig config; + EGLDisplay display; + EGLContext context; + EGLSurface surface; +} _sapp_android_state_t; + +static _sapp_android_state_t _sapp_android_state; + +/* android loop thread */ +_SOKOL_PRIVATE bool _sapp_android_init_egl(void) { + _sapp_android_state_t* state = &_sapp_android_state; + SOKOL_ASSERT(state->display == EGL_NO_DISPLAY); + SOKOL_ASSERT(state->context == EGL_NO_CONTEXT); + + EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); + if (display == EGL_NO_DISPLAY) { + return false; + } + if (eglInitialize(display, NULL, NULL) == EGL_FALSE) { + return false; + } + + EGLint alpha_size = _sapp.desc.alpha ? 8 : 0; + const EGLint cfg_attributes[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, alpha_size, + EGL_DEPTH_SIZE, 16, + EGL_STENCIL_SIZE, 0, + EGL_NONE, + }; + EGLConfig available_cfgs[32]; + EGLint cfg_count; + eglChooseConfig(display, cfg_attributes, available_cfgs, 32, &cfg_count); + SOKOL_ASSERT(cfg_count > 0); + SOKOL_ASSERT(cfg_count <= 32); + + /* find config with 8-bit rgb buffer if available, ndk sample does not trust egl spec */ + EGLConfig config; + bool exact_cfg_found = false; + for (int i = 0; i < cfg_count; ++i) { + EGLConfig c = available_cfgs[i]; + EGLint r, g, b, a, d; + if (eglGetConfigAttrib(display, c, EGL_RED_SIZE, &r) == EGL_TRUE && + eglGetConfigAttrib(display, c, EGL_GREEN_SIZE, &g) == EGL_TRUE && + eglGetConfigAttrib(display, c, EGL_BLUE_SIZE, &b) == EGL_TRUE && + eglGetConfigAttrib(display, c, EGL_ALPHA_SIZE, &a) == EGL_TRUE && + eglGetConfigAttrib(display, c, EGL_DEPTH_SIZE, &d) == EGL_TRUE && + r == 8 && g == 8 && b == 8 && (alpha_size == 0 || a == alpha_size) && d == 16) { + exact_cfg_found = true; + config = c; + break; + } + } + if (!exact_cfg_found) { + config = available_cfgs[0]; + } + + EGLint ctx_attributes[] = { + #if defined(SOKOL_GLES3) + EGL_CONTEXT_CLIENT_VERSION, _sapp.desc.gl_force_gles2 ? 2 : 3, + #else + EGL_CONTEXT_CLIENT_VERSION, 2, + #endif + EGL_NONE, + }; + EGLContext context = eglCreateContext(display, config, EGL_NO_CONTEXT, ctx_attributes); + if (context == EGL_NO_CONTEXT) { + return false; + } + + state->config = config; + state->display = display; + state->context = context; + return true; +} + +_SOKOL_PRIVATE void _sapp_android_cleanup_egl(void) { + _sapp_android_state_t* state = &_sapp_android_state; + if (state->display != EGL_NO_DISPLAY) { + eglMakeCurrent(state->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + if (state->surface != EGL_NO_SURFACE) { + SOKOL_LOG("Destroying egl surface"); + eglDestroySurface(state->display, state->surface); + state->surface = EGL_NO_SURFACE; + } + if (state->context != EGL_NO_CONTEXT) { + SOKOL_LOG("Destroying egl context"); + eglDestroyContext(state->display, state->context); + state->context = EGL_NO_CONTEXT; + } + SOKOL_LOG("Terminating egl display"); + eglTerminate(state->display); + state->display = EGL_NO_DISPLAY; + } +} + +_SOKOL_PRIVATE bool _sapp_android_init_egl_surface(ANativeWindow* window) { + _sapp_android_state_t* state = &_sapp_android_state; + SOKOL_ASSERT(state->display != EGL_NO_DISPLAY); + SOKOL_ASSERT(state->context != EGL_NO_CONTEXT); + SOKOL_ASSERT(state->surface == EGL_NO_SURFACE); + SOKOL_ASSERT(window); + + /* TODO: set window flags */ + /* ANativeActivity_setWindowFlags(activity, AWINDOW_FLAG_KEEP_SCREEN_ON, 0); */ + + /* create egl surface and make it current */ + EGLSurface surface = eglCreateWindowSurface(state->display, state->config, window, NULL); + if (surface == EGL_NO_SURFACE) { + return false; + } + if (eglMakeCurrent(state->display, surface, surface, state->context) == EGL_FALSE) { + return false; + } + state->surface = surface; + return true; +} + +_SOKOL_PRIVATE void _sapp_android_cleanup_egl_surface(void) { + _sapp_android_state_t* state = &_sapp_android_state; + if (state->display == EGL_NO_DISPLAY) { + return; + } + eglMakeCurrent(state->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + if (state->surface != EGL_NO_SURFACE) { + eglDestroySurface(state->display, state->surface); + state->surface = EGL_NO_SURFACE; + } +} + +_SOKOL_PRIVATE void _sapp_android_app_event(sapp_event_type type) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + SOKOL_LOG("event_cb()"); + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_android_update_dimensions(ANativeWindow* window, bool force_update) { + _sapp_android_state_t* state = &_sapp_android_state; + SOKOL_ASSERT(state->display != EGL_NO_DISPLAY); + SOKOL_ASSERT(state->context != EGL_NO_CONTEXT); + SOKOL_ASSERT(state->surface != EGL_NO_SURFACE); + SOKOL_ASSERT(window); + + const int32_t win_w = ANativeWindow_getWidth(window); + const int32_t win_h = ANativeWindow_getHeight(window); + SOKOL_ASSERT(win_w >= 0 && win_h >= 0); + const bool win_changed = (win_w != _sapp.window_width) || (win_h != _sapp.window_height); + _sapp.window_width = win_w; + _sapp.window_height = win_h; + if (win_changed || force_update) { + if (!_sapp.desc.high_dpi) { + const int32_t buf_w = win_w / 2; + const int32_t buf_h = win_h / 2; + EGLint format; + EGLBoolean egl_result = eglGetConfigAttrib(state->display, state->config, EGL_NATIVE_VISUAL_ID, &format); + SOKOL_ASSERT(egl_result == EGL_TRUE); + /* NOTE: calling ANativeWindow_setBuffersGeometry() with the same dimensions + as the ANativeWindow size results in weird display artefacts, that's + why it's only called when the buffer geometry is different from + the window size + */ + int32_t result = ANativeWindow_setBuffersGeometry(window, buf_w, buf_h, format); + SOKOL_ASSERT(result == 0); + } + } + + /* query surface size */ + EGLint fb_w, fb_h; + EGLBoolean egl_result_w = eglQuerySurface(state->display, state->surface, EGL_WIDTH, &fb_w); + EGLBoolean egl_result_h = eglQuerySurface(state->display, state->surface, EGL_HEIGHT, &fb_h); + SOKOL_ASSERT(egl_result_w == EGL_TRUE); + SOKOL_ASSERT(egl_result_h == EGL_TRUE); + const bool fb_changed = (fb_w != _sapp.framebuffer_width) || (fb_h != _sapp.framebuffer_height); + _sapp.framebuffer_width = fb_w; + _sapp.framebuffer_height = fb_h; + _sapp.dpi_scale = (float)_sapp.framebuffer_width / (float)_sapp.window_width; + if (win_changed || fb_changed || force_update) { + if (!_sapp.first_frame) { + SOKOL_LOG("SAPP_EVENTTYPE_RESIZED"); + _sapp_android_app_event(SAPP_EVENTTYPE_RESIZED); + } + } +} + +_SOKOL_PRIVATE void _sapp_android_cleanup(void) { + _sapp_android_state_t* state = &_sapp_android_state; + SOKOL_LOG("Cleaning up"); + if (state->surface != EGL_NO_SURFACE) { + /* egl context is bound, cleanup gracefully */ + if (_sapp.init_called && !_sapp.cleanup_called) { + SOKOL_LOG("cleanup_cb()"); + _sapp_call_cleanup(); + } + } + /* always try to cleanup by destroying egl context */ + _sapp_android_cleanup_egl(); +} + +_SOKOL_PRIVATE void _sapp_android_shutdown(void) { + /* try to cleanup while we still have a surface and can call cleanup_cb() */ + _sapp_android_cleanup(); + /* request exit */ + ANativeActivity_finish(_sapp_android_state.activity); +} + +_SOKOL_PRIVATE void _sapp_android_frame(void) { + _sapp_android_state_t* state = &_sapp_android_state; + SOKOL_ASSERT(state->display != EGL_NO_DISPLAY); + SOKOL_ASSERT(state->context != EGL_NO_CONTEXT); + SOKOL_ASSERT(state->surface != EGL_NO_SURFACE); + _sapp_android_update_dimensions(state->current.window, false); + _sapp_frame(); + eglSwapBuffers(state->display, _sapp_android_state.surface); +} + +_SOKOL_PRIVATE bool _sapp_android_touch_event(const AInputEvent* e) { + if (AInputEvent_getType(e) != AINPUT_EVENT_TYPE_MOTION) { + return false; + } + if (!_sapp_events_enabled()) { + return false; + } + int32_t action_idx = AMotionEvent_getAction(e); + int32_t action = action_idx & AMOTION_EVENT_ACTION_MASK; + sapp_event_type type = SAPP_EVENTTYPE_INVALID; + switch (action) { + case AMOTION_EVENT_ACTION_DOWN: + SOKOL_LOG("Touch: down"); + case AMOTION_EVENT_ACTION_POINTER_DOWN: + SOKOL_LOG("Touch: ptr down"); + type = SAPP_EVENTTYPE_TOUCHES_BEGAN; + break; + case AMOTION_EVENT_ACTION_MOVE: + type = SAPP_EVENTTYPE_TOUCHES_MOVED; + break; + case AMOTION_EVENT_ACTION_UP: + SOKOL_LOG("Touch: up"); + case AMOTION_EVENT_ACTION_POINTER_UP: + SOKOL_LOG("Touch: ptr up"); + type = SAPP_EVENTTYPE_TOUCHES_ENDED; + break; + case AMOTION_EVENT_ACTION_CANCEL: + SOKOL_LOG("Touch: cancel"); + type = SAPP_EVENTTYPE_TOUCHES_CANCELLED; + break; + default: + break; + } + if (type == SAPP_EVENTTYPE_INVALID) { + return false; + } + int32_t idx = action_idx >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; + _sapp_init_event(type); + _sapp.event.num_touches = AMotionEvent_getPointerCount(e); + if (_sapp.event.num_touches > SAPP_MAX_TOUCHPOINTS) { + _sapp.event.num_touches = SAPP_MAX_TOUCHPOINTS; + } + for (int32_t i = 0; i < _sapp.event.num_touches; i++) { + sapp_touchpoint* dst = &_sapp.event.touches[i]; + dst->identifier = AMotionEvent_getPointerId(e, i); + dst->pos_x = (AMotionEvent_getRawX(e, i) / _sapp.window_width) * _sapp.framebuffer_width; + dst->pos_y = (AMotionEvent_getRawY(e, i) / _sapp.window_height) * _sapp.framebuffer_height; + + if (action == AMOTION_EVENT_ACTION_POINTER_DOWN || + action == AMOTION_EVENT_ACTION_POINTER_UP) { + dst->changed = i == idx; + } else { + dst->changed = true; + } + } + _sapp_call_event(&_sapp.event); + return true; +} + +_SOKOL_PRIVATE bool _sapp_android_key_event(const AInputEvent* e) { + if (AInputEvent_getType(e) != AINPUT_EVENT_TYPE_KEY) { + return false; + } + if (AKeyEvent_getKeyCode(e) == AKEYCODE_BACK) { + /* FIXME: this should be hooked into a "really quit?" mechanism + so the app can ask the user for confirmation, this is currently + generally missing in sokol_app.h + */ + _sapp_android_shutdown(); + return true; + } + return false; +} + +_SOKOL_PRIVATE int _sapp_android_input_cb(int fd, int events, void* data) { + if ((events & ALOOPER_EVENT_INPUT) == 0) { + SOKOL_LOG("_sapp_android_input_cb() encountered unsupported event"); + return 1; + } + _sapp_android_state_t* state = &_sapp_android_state;; + SOKOL_ASSERT(state->current.input); + AInputEvent* event = NULL; + while (AInputQueue_getEvent(state->current.input, &event) >= 0) { + if (AInputQueue_preDispatchEvent(state->current.input, event) != 0) { + continue; + } + int32_t handled = 0; + if (_sapp_android_touch_event(event) || _sapp_android_key_event(event)) { + handled = 1; + } + AInputQueue_finishEvent(state->current.input, event, handled); + } + return 1; +} + +_SOKOL_PRIVATE int _sapp_android_main_cb(int fd, int events, void* data) { + if ((events & ALOOPER_EVENT_INPUT) == 0) { + SOKOL_LOG("_sapp_android_main_cb() encountered unsupported event"); + return 1; + } + _sapp_android_state_t* state = &_sapp_android_state; + + _sapp_android_msg_t msg; + if (read(fd, &msg, sizeof(msg)) != sizeof(msg)) { + SOKOL_LOG("Could not write to read_from_main_fd"); + return 1; + } + + pthread_mutex_lock(&state->pt.mutex); + switch (msg) { + case _SOKOL_ANDROID_MSG_CREATE: + { + SOKOL_LOG("MSG_CREATE"); + SOKOL_ASSERT(!_sapp.valid); + bool result = _sapp_android_init_egl(); + SOKOL_ASSERT(result); + _sapp.valid = true; + state->has_created = true; + } + break; + case _SOKOL_ANDROID_MSG_RESUME: + SOKOL_LOG("MSG_RESUME"); + state->has_resumed = true; + _sapp_android_app_event(SAPP_EVENTTYPE_RESUMED); + break; + case _SOKOL_ANDROID_MSG_PAUSE: + SOKOL_LOG("MSG_PAUSE"); + state->has_resumed = false; + _sapp_android_app_event(SAPP_EVENTTYPE_SUSPENDED); + break; + case _SOKOL_ANDROID_MSG_FOCUS: + SOKOL_LOG("MSG_FOCUS"); + state->has_focus = true; + break; + case _SOKOL_ANDROID_MSG_NO_FOCUS: + SOKOL_LOG("MSG_NO_FOCUS"); + state->has_focus = false; + break; + case _SOKOL_ANDROID_MSG_SET_NATIVE_WINDOW: + SOKOL_LOG("MSG_SET_NATIVE_WINDOW"); + if (state->current.window != state->pending.window) { + if (state->current.window != NULL) { + _sapp_android_cleanup_egl_surface(); + } + if (state->pending.window != NULL) { + SOKOL_LOG("Creating egl surface ..."); + if (_sapp_android_init_egl_surface(state->pending.window)) { + SOKOL_LOG("... ok!"); + _sapp_android_update_dimensions(state->pending.window, true); + } else { + SOKOL_LOG("... failed!"); + _sapp_android_shutdown(); + } + } + } + state->current.window = state->pending.window; + break; + case _SOKOL_ANDROID_MSG_SET_INPUT_QUEUE: + SOKOL_LOG("MSG_SET_INPUT_QUEUE"); + if (state->current.input != state->pending.input) { + if (state->current.input != NULL) { + AInputQueue_detachLooper(state->current.input); + } + if (state->pending.input != NULL) { + AInputQueue_attachLooper( + state->pending.input, + state->looper, + ALOOPER_POLL_CALLBACK, + _sapp_android_input_cb, + NULL); /* data */ + } + } + state->current.input = state->pending.input; + break; + case _SOKOL_ANDROID_MSG_DESTROY: + SOKOL_LOG("MSG_DESTROY"); + _sapp_android_cleanup(); + _sapp.valid = false; + state->is_thread_stopping = true; + break; + default: + SOKOL_LOG("Unknown msg type received"); + break; + } + pthread_cond_broadcast(&state->pt.cond); /* signal "received" */ + pthread_mutex_unlock(&state->pt.mutex); + return 1; +} + +_SOKOL_PRIVATE bool _sapp_android_should_update(void) { + bool is_in_front = _sapp_android_state.has_resumed && _sapp_android_state.has_focus; + bool has_surface = _sapp_android_state.surface != EGL_NO_SURFACE; + return is_in_front && has_surface; +} + +_SOKOL_PRIVATE void _sapp_android_show_keyboard(bool shown) { + SOKOL_ASSERT(_sapp.valid); + /* This seems to be broken in the NDK, but there is (a very cumbersome) workaround... */ + if (shown) { + SOKOL_LOG("Showing keyboard"); + ANativeActivity_showSoftInput(_sapp_android_state.activity, ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED); + } else { + SOKOL_LOG("Hiding keyboard"); + ANativeActivity_hideSoftInput(_sapp_android_state.activity, ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS); + } +} + +_SOKOL_PRIVATE void* _sapp_android_loop(void* obj) { + SOKOL_LOG("Loop thread started"); + _sapp_android_state_t* state = (_sapp_android_state_t*)obj; + + state->looper = ALooper_prepare(0 /* or ALOOPER_PREPARE_ALLOW_NON_CALLBACKS*/); + ALooper_addFd(state->looper, + state->pt.read_from_main_fd, + ALOOPER_POLL_CALLBACK, + ALOOPER_EVENT_INPUT, + _sapp_android_main_cb, + NULL); /* data */ + + /* signal start to main thread */ + pthread_mutex_lock(&state->pt.mutex); + state->is_thread_started = true; + pthread_cond_broadcast(&state->pt.cond); + pthread_mutex_unlock(&state->pt.mutex); + + /* main loop */ + while (!state->is_thread_stopping) { + /* sokol frame */ + if (_sapp_android_should_update()) { + _sapp_android_frame(); + } + + /* process all events (or stop early if app is requested to quit) */ + bool process_events = true; + while (process_events && !state->is_thread_stopping) { + bool block_until_event = !state->is_thread_stopping && !_sapp_android_should_update(); + process_events = ALooper_pollOnce(block_until_event ? -1 : 0, NULL, NULL, NULL) == ALOOPER_POLL_CALLBACK; + } + } + + /* cleanup thread */ + if (state->current.input != NULL) { + AInputQueue_detachLooper(state->current.input); + } + + /* the following causes heap corruption on exit, why?? + ALooper_removeFd(state->looper, state->pt.read_from_main_fd); + ALooper_release(state->looper);*/ + + /* signal "destroyed" */ + pthread_mutex_lock(&state->pt.mutex); + state->is_thread_stopped = true; + pthread_cond_broadcast(&state->pt.cond); + pthread_mutex_unlock(&state->pt.mutex); + SOKOL_LOG("Loop thread done"); + return NULL; +} + +/* android main/ui thread */ +_SOKOL_PRIVATE void _sapp_android_msg(_sapp_android_state_t* state, _sapp_android_msg_t msg) { + if (write(state->pt.write_from_main_fd, &msg, sizeof(msg)) != sizeof(msg)) { + SOKOL_LOG("Could not write to write_from_main_fd"); + } +} + +_SOKOL_PRIVATE void _sapp_android_on_start(ANativeActivity* activity) { + SOKOL_LOG("NativeActivity onStart()"); +} + +_SOKOL_PRIVATE void _sapp_android_on_resume(ANativeActivity* activity) { + SOKOL_LOG("NativeActivity onResume()"); + _sapp_android_msg(&_sapp_android_state, _SOKOL_ANDROID_MSG_RESUME); +} + +_SOKOL_PRIVATE void* _sapp_android_on_save_instance_state(ANativeActivity* activity, size_t* out_size) { + SOKOL_LOG("NativeActivity onSaveInstanceState()"); + *out_size = 0; + return NULL; +} + +_SOKOL_PRIVATE void _sapp_android_on_window_focus_changed(ANativeActivity* activity, int has_focus) { + SOKOL_LOG("NativeActivity onWindowFocusChanged()"); + if (has_focus) { + _sapp_android_msg(&_sapp_android_state, _SOKOL_ANDROID_MSG_FOCUS); + } else { + _sapp_android_msg(&_sapp_android_state, _SOKOL_ANDROID_MSG_NO_FOCUS); + } +} + +_SOKOL_PRIVATE void _sapp_android_on_pause(ANativeActivity* activity) { + SOKOL_LOG("NativeActivity onPause()"); + _sapp_android_msg(&_sapp_android_state, _SOKOL_ANDROID_MSG_PAUSE); +} + +_SOKOL_PRIVATE void _sapp_android_on_stop(ANativeActivity* activity) { + SOKOL_LOG("NativeActivity onStop()"); +} + +_SOKOL_PRIVATE void _sapp_android_msg_set_native_window(_sapp_android_state_t* state, ANativeWindow* window) { + pthread_mutex_lock(&state->pt.mutex); + state->pending.window = window; + _sapp_android_msg(state, _SOKOL_ANDROID_MSG_SET_NATIVE_WINDOW); + while (state->current.window != window) { + pthread_cond_wait(&state->pt.cond, &state->pt.mutex); + } + pthread_mutex_unlock(&state->pt.mutex); +} + +_SOKOL_PRIVATE void _sapp_android_on_native_window_created(ANativeActivity* activity, ANativeWindow* window) { + SOKOL_LOG("NativeActivity onNativeWindowCreated()"); + _sapp_android_msg_set_native_window(&_sapp_android_state, window); +} + +_SOKOL_PRIVATE void _sapp_android_on_native_window_destroyed(ANativeActivity* activity, ANativeWindow* window) { + SOKOL_LOG("NativeActivity onNativeWindowDestroyed()"); + _sapp_android_msg_set_native_window(&_sapp_android_state, NULL); +} + +_SOKOL_PRIVATE void _sapp_android_msg_set_input_queue(_sapp_android_state_t* state, AInputQueue* input) { + pthread_mutex_lock(&state->pt.mutex); + state->pending.input = input; + _sapp_android_msg(state, _SOKOL_ANDROID_MSG_SET_INPUT_QUEUE); + while (state->current.input != input) { + pthread_cond_wait(&state->pt.cond, &state->pt.mutex); + } + pthread_mutex_unlock(&state->pt.mutex); +} + +_SOKOL_PRIVATE void _sapp_android_on_input_queue_created(ANativeActivity* activity, AInputQueue* queue) { + SOKOL_LOG("NativeActivity onInputQueueCreated()"); + _sapp_android_msg_set_input_queue(&_sapp_android_state, queue); +} + +_SOKOL_PRIVATE void _sapp_android_on_input_queue_destroyed(ANativeActivity* activity, AInputQueue* queue) { + SOKOL_LOG("NativeActivity onInputQueueDestroyed()"); + _sapp_android_msg_set_input_queue(&_sapp_android_state, NULL); +} + +_SOKOL_PRIVATE void _sapp_android_on_config_changed(ANativeActivity* activity) { + SOKOL_LOG("NativeActivity onConfigurationChanged()"); + /* see android:configChanges in manifest */ +} + +_SOKOL_PRIVATE void _sapp_android_on_low_memory(ANativeActivity* activity) { + SOKOL_LOG("NativeActivity onLowMemory()"); +} + +_SOKOL_PRIVATE void _sapp_android_on_destroy(ANativeActivity* activity) { + /* + * For some reason even an empty app using nativeactivity.h will crash (WIN DEATH) + * on my device (Moto X 2nd gen) when the app is removed from the task view + * (TaskStackView: onTaskViewDismissed). + * + * However, if ANativeActivity_finish() is explicitly called from for example + * _sapp_android_on_stop(), the crash disappears. Is this a bug in NativeActivity? + */ + SOKOL_LOG("NativeActivity onDestroy()"); + _sapp_android_state_t* state = &_sapp_android_state; + + /* send destroy msg */ + pthread_mutex_lock(&state->pt.mutex); + _sapp_android_msg(state, _SOKOL_ANDROID_MSG_DESTROY); + while (!_sapp_android_state.is_thread_stopped) { + pthread_cond_wait(&state->pt.cond, &state->pt.mutex); + } + pthread_mutex_unlock(&state->pt.mutex); + + /* clean up main thread */ + pthread_cond_destroy(&state->pt.cond); + pthread_mutex_destroy(&state->pt.mutex); + + close(state->pt.read_from_main_fd); + close(state->pt.write_from_main_fd); + + SOKOL_LOG("NativeActivity done"); + + /* this is a bit naughty, but causes a clean restart of the app (static globals are reset) */ + exit(0); +} + +JNIEXPORT +void ANativeActivity_onCreate(ANativeActivity* activity, void* saved_state, size_t saved_state_size) { + SOKOL_LOG("NativeActivity onCreate()"); + + sapp_desc desc = sokol_main(0, NULL); + _sapp_init_state(&desc); + + /* start loop thread */ + _sapp_android_state = (_sapp_android_state_t){0}; + _sapp_android_state_t* state = &_sapp_android_state; + + state->activity = activity; + + int pipe_fd[2]; + if (pipe(pipe_fd) != 0) { + SOKOL_LOG("Could not create thread pipe"); + return; + } + state->pt.read_from_main_fd = pipe_fd[0]; + state->pt.write_from_main_fd = pipe_fd[1]; + + pthread_mutex_init(&state->pt.mutex, NULL); + pthread_cond_init(&state->pt.cond, NULL); + + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_create(&state->pt.thread, &attr, _sapp_android_loop, state); + pthread_attr_destroy(&attr); + + /* wait until main loop has started */ + pthread_mutex_lock(&state->pt.mutex); + while (!state->is_thread_started) { + pthread_cond_wait(&state->pt.cond, &state->pt.mutex); + } + pthread_mutex_unlock(&state->pt.mutex); + + /* send create msg */ + pthread_mutex_lock(&state->pt.mutex); + _sapp_android_msg(state, _SOKOL_ANDROID_MSG_CREATE); + while (!state->has_created) { + pthread_cond_wait(&state->pt.cond, &state->pt.mutex); + } + pthread_mutex_unlock(&state->pt.mutex); + + /* register for callbacks */ + activity->instance = state; + activity->callbacks->onStart = _sapp_android_on_start; + activity->callbacks->onResume = _sapp_android_on_resume; + activity->callbacks->onSaveInstanceState = _sapp_android_on_save_instance_state; + activity->callbacks->onWindowFocusChanged = _sapp_android_on_window_focus_changed; + activity->callbacks->onPause = _sapp_android_on_pause; + activity->callbacks->onStop = _sapp_android_on_stop; + activity->callbacks->onDestroy = _sapp_android_on_destroy; + activity->callbacks->onNativeWindowCreated = _sapp_android_on_native_window_created; + /* activity->callbacks->onNativeWindowResized = _sapp_android_on_native_window_resized; */ + /* activity->callbacks->onNativeWindowRedrawNeeded = _sapp_android_on_native_window_redraw_needed; */ + activity->callbacks->onNativeWindowDestroyed = _sapp_android_on_native_window_destroyed; + activity->callbacks->onInputQueueCreated = _sapp_android_on_input_queue_created; + activity->callbacks->onInputQueueDestroyed = _sapp_android_on_input_queue_destroyed; + /* activity->callbacks->onContentRectChanged = _sapp_android_on_content_rect_changed; */ + activity->callbacks->onConfigurationChanged = _sapp_android_on_config_changed; + activity->callbacks->onLowMemory = _sapp_android_on_low_memory; + + SOKOL_LOG("NativeActivity successfully created"); +} + +#endif /* Android */ + +/*== LINUX ==================================================================*/ +#if (defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) +#define GL_GLEXT_PROTOTYPES +#include +#include +#include +#include +#include +#include /* CARD32 */ +#include +#include /* dlopen, dlsym, dlclose */ +#include /* LONG_MAX */ + +#define GLX_VENDOR 1 +#define GLX_RGBA_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_SAMPLES 0x186a1 +#define GLX_VISUAL_ID 0x800b + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20b2 +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 +#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 + +typedef XID GLXWindow; +typedef XID GLXDrawable; +typedef struct __GLXFBConfig* GLXFBConfig; +typedef struct __GLXcontext* GLXContext; +typedef void (*__GLXextproc)(void); + +typedef int (*PFNGLXGETFBCONFIGATTRIBPROC)(Display*,GLXFBConfig,int,int*); +typedef const char* (*PFNGLXGETCLIENTSTRINGPROC)(Display*,int); +typedef Bool (*PFNGLXQUERYEXTENSIONPROC)(Display*,int*,int*); +typedef Bool (*PFNGLXQUERYVERSIONPROC)(Display*,int*,int*); +typedef void (*PFNGLXDESTROYCONTEXTPROC)(Display*,GLXContext); +typedef Bool (*PFNGLXMAKECURRENTPROC)(Display*,GLXDrawable,GLXContext); +typedef void (*PFNGLXSWAPBUFFERSPROC)(Display*,GLXDrawable); +typedef const char* (*PFNGLXQUERYEXTENSIONSSTRINGPROC)(Display*,int); +typedef GLXFBConfig* (*PFNGLXGETFBCONFIGSPROC)(Display*,int,int*); +typedef GLXContext (*PFNGLXCREATENEWCONTEXTPROC)(Display*,GLXFBConfig,int,GLXContext,Bool); +typedef __GLXextproc (* PFNGLXGETPROCADDRESSPROC)(const GLubyte *procName); +typedef void (*PFNGLXSWAPINTERVALEXTPROC)(Display*,GLXDrawable,int); +typedef XVisualInfo* (*PFNGLXGETVISUALFROMFBCONFIGPROC)(Display*,GLXFBConfig); +typedef GLXWindow (*PFNGLXCREATEWINDOWPROC)(Display*,GLXFBConfig,Window,const int*); +typedef void (*PFNGLXDESTROYWINDOWPROC)(Display*,GLXWindow); + +typedef int (*PFNGLXSWAPINTERVALMESAPROC)(int); +typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display*,GLXFBConfig,GLXContext,Bool,const int*); + +static Display* _sapp_x11_display; +static int _sapp_x11_screen; +static Window _sapp_x11_root; +static Colormap _sapp_x11_colormap; +static Window _sapp_x11_window; +static float _sapp_x11_dpi; +static int _sapp_x11_window_state; +static unsigned char _sapp_x11_error_code; +static void* _sapp_glx_libgl; +static int _sapp_glx_major; +static int _sapp_glx_minor; +static int _sapp_glx_eventbase; +static int _sapp_glx_errorbase; +static GLXContext _sapp_glx_ctx; +static GLXWindow _sapp_glx_window; +static Atom _sapp_x11_UTF8_STRING; +static Atom _sapp_x11_WM_PROTOCOLS; +static Atom _sapp_x11_WM_DELETE_WINDOW; +static Atom _sapp_x11_WM_STATE; +static Atom _sapp_x11_NET_WM_NAME; +static Atom _sapp_x11_NET_WM_ICON_NAME; +// GLX 1.3 functions +static PFNGLXGETFBCONFIGSPROC _sapp_glx_GetFBConfigs; +static PFNGLXGETFBCONFIGATTRIBPROC _sapp_glx_GetFBConfigAttrib; +static PFNGLXGETCLIENTSTRINGPROC _sapp_glx_GetClientString; +static PFNGLXQUERYEXTENSIONPROC _sapp_glx_QueryExtension; +static PFNGLXQUERYVERSIONPROC _sapp_glx_QueryVersion; +static PFNGLXDESTROYCONTEXTPROC _sapp_glx_DestroyContext; +static PFNGLXMAKECURRENTPROC _sapp_glx_MakeCurrent; +static PFNGLXSWAPBUFFERSPROC _sapp_glx_SwapBuffers; +static PFNGLXQUERYEXTENSIONSSTRINGPROC _sapp_glx_QueryExtensionsString; +static PFNGLXCREATENEWCONTEXTPROC _sapp_glx_CreateNewContext; +static PFNGLXGETVISUALFROMFBCONFIGPROC _sapp_glx_GetVisualFromFBConfig; +static PFNGLXCREATEWINDOWPROC _sapp_glx_CreateWindow; +static PFNGLXDESTROYWINDOWPROC _sapp_glx_DestroyWindow; + +// GLX 1.4 and extension functions +static PFNGLXGETPROCADDRESSPROC _sapp_glx_GetProcAddress; +static PFNGLXGETPROCADDRESSPROC _sapp_glx_GetProcAddressARB; +static PFNGLXSWAPINTERVALEXTPROC _sapp_glx_SwapIntervalEXT; +static PFNGLXSWAPINTERVALMESAPROC _sapp_glx_SwapIntervalMESA; +static PFNGLXCREATECONTEXTATTRIBSARBPROC _sapp_glx_CreateContextAttribsARB; +static bool _sapp_glx_EXT_swap_control; +static bool _sapp_glx_MESA_swap_control; +static bool _sapp_glx_ARB_multisample; +static bool _sapp_glx_ARB_framebuffer_sRGB; +static bool _sapp_glx_EXT_framebuffer_sRGB; +static bool _sapp_glx_ARB_create_context; +static bool _sapp_glx_ARB_create_context_profile; + +/* see GLFW's xkb_unicode.c */ +static const struct _sapp_x11_codepair { + uint16_t keysym; + uint16_t ucs; +} _sapp_x11_keysymtab[] = { + { 0x01a1, 0x0104 }, + { 0x01a2, 0x02d8 }, + { 0x01a3, 0x0141 }, + { 0x01a5, 0x013d }, + { 0x01a6, 0x015a }, + { 0x01a9, 0x0160 }, + { 0x01aa, 0x015e }, + { 0x01ab, 0x0164 }, + { 0x01ac, 0x0179 }, + { 0x01ae, 0x017d }, + { 0x01af, 0x017b }, + { 0x01b1, 0x0105 }, + { 0x01b2, 0x02db }, + { 0x01b3, 0x0142 }, + { 0x01b5, 0x013e }, + { 0x01b6, 0x015b }, + { 0x01b7, 0x02c7 }, + { 0x01b9, 0x0161 }, + { 0x01ba, 0x015f }, + { 0x01bb, 0x0165 }, + { 0x01bc, 0x017a }, + { 0x01bd, 0x02dd }, + { 0x01be, 0x017e }, + { 0x01bf, 0x017c }, + { 0x01c0, 0x0154 }, + { 0x01c3, 0x0102 }, + { 0x01c5, 0x0139 }, + { 0x01c6, 0x0106 }, + { 0x01c8, 0x010c }, + { 0x01ca, 0x0118 }, + { 0x01cc, 0x011a }, + { 0x01cf, 0x010e }, + { 0x01d0, 0x0110 }, + { 0x01d1, 0x0143 }, + { 0x01d2, 0x0147 }, + { 0x01d5, 0x0150 }, + { 0x01d8, 0x0158 }, + { 0x01d9, 0x016e }, + { 0x01db, 0x0170 }, + { 0x01de, 0x0162 }, + { 0x01e0, 0x0155 }, + { 0x01e3, 0x0103 }, + { 0x01e5, 0x013a }, + { 0x01e6, 0x0107 }, + { 0x01e8, 0x010d }, + { 0x01ea, 0x0119 }, + { 0x01ec, 0x011b }, + { 0x01ef, 0x010f }, + { 0x01f0, 0x0111 }, + { 0x01f1, 0x0144 }, + { 0x01f2, 0x0148 }, + { 0x01f5, 0x0151 }, + { 0x01f8, 0x0159 }, + { 0x01f9, 0x016f }, + { 0x01fb, 0x0171 }, + { 0x01fe, 0x0163 }, + { 0x01ff, 0x02d9 }, + { 0x02a1, 0x0126 }, + { 0x02a6, 0x0124 }, + { 0x02a9, 0x0130 }, + { 0x02ab, 0x011e }, + { 0x02ac, 0x0134 }, + { 0x02b1, 0x0127 }, + { 0x02b6, 0x0125 }, + { 0x02b9, 0x0131 }, + { 0x02bb, 0x011f }, + { 0x02bc, 0x0135 }, + { 0x02c5, 0x010a }, + { 0x02c6, 0x0108 }, + { 0x02d5, 0x0120 }, + { 0x02d8, 0x011c }, + { 0x02dd, 0x016c }, + { 0x02de, 0x015c }, + { 0x02e5, 0x010b }, + { 0x02e6, 0x0109 }, + { 0x02f5, 0x0121 }, + { 0x02f8, 0x011d }, + { 0x02fd, 0x016d }, + { 0x02fe, 0x015d }, + { 0x03a2, 0x0138 }, + { 0x03a3, 0x0156 }, + { 0x03a5, 0x0128 }, + { 0x03a6, 0x013b }, + { 0x03aa, 0x0112 }, + { 0x03ab, 0x0122 }, + { 0x03ac, 0x0166 }, + { 0x03b3, 0x0157 }, + { 0x03b5, 0x0129 }, + { 0x03b6, 0x013c }, + { 0x03ba, 0x0113 }, + { 0x03bb, 0x0123 }, + { 0x03bc, 0x0167 }, + { 0x03bd, 0x014a }, + { 0x03bf, 0x014b }, + { 0x03c0, 0x0100 }, + { 0x03c7, 0x012e }, + { 0x03cc, 0x0116 }, + { 0x03cf, 0x012a }, + { 0x03d1, 0x0145 }, + { 0x03d2, 0x014c }, + { 0x03d3, 0x0136 }, + { 0x03d9, 0x0172 }, + { 0x03dd, 0x0168 }, + { 0x03de, 0x016a }, + { 0x03e0, 0x0101 }, + { 0x03e7, 0x012f }, + { 0x03ec, 0x0117 }, + { 0x03ef, 0x012b }, + { 0x03f1, 0x0146 }, + { 0x03f2, 0x014d }, + { 0x03f3, 0x0137 }, + { 0x03f9, 0x0173 }, + { 0x03fd, 0x0169 }, + { 0x03fe, 0x016b }, + { 0x047e, 0x203e }, + { 0x04a1, 0x3002 }, + { 0x04a2, 0x300c }, + { 0x04a3, 0x300d }, + { 0x04a4, 0x3001 }, + { 0x04a5, 0x30fb }, + { 0x04a6, 0x30f2 }, + { 0x04a7, 0x30a1 }, + { 0x04a8, 0x30a3 }, + { 0x04a9, 0x30a5 }, + { 0x04aa, 0x30a7 }, + { 0x04ab, 0x30a9 }, + { 0x04ac, 0x30e3 }, + { 0x04ad, 0x30e5 }, + { 0x04ae, 0x30e7 }, + { 0x04af, 0x30c3 }, + { 0x04b0, 0x30fc }, + { 0x04b1, 0x30a2 }, + { 0x04b2, 0x30a4 }, + { 0x04b3, 0x30a6 }, + { 0x04b4, 0x30a8 }, + { 0x04b5, 0x30aa }, + { 0x04b6, 0x30ab }, + { 0x04b7, 0x30ad }, + { 0x04b8, 0x30af }, + { 0x04b9, 0x30b1 }, + { 0x04ba, 0x30b3 }, + { 0x04bb, 0x30b5 }, + { 0x04bc, 0x30b7 }, + { 0x04bd, 0x30b9 }, + { 0x04be, 0x30bb }, + { 0x04bf, 0x30bd }, + { 0x04c0, 0x30bf }, + { 0x04c1, 0x30c1 }, + { 0x04c2, 0x30c4 }, + { 0x04c3, 0x30c6 }, + { 0x04c4, 0x30c8 }, + { 0x04c5, 0x30ca }, + { 0x04c6, 0x30cb }, + { 0x04c7, 0x30cc }, + { 0x04c8, 0x30cd }, + { 0x04c9, 0x30ce }, + { 0x04ca, 0x30cf }, + { 0x04cb, 0x30d2 }, + { 0x04cc, 0x30d5 }, + { 0x04cd, 0x30d8 }, + { 0x04ce, 0x30db }, + { 0x04cf, 0x30de }, + { 0x04d0, 0x30df }, + { 0x04d1, 0x30e0 }, + { 0x04d2, 0x30e1 }, + { 0x04d3, 0x30e2 }, + { 0x04d4, 0x30e4 }, + { 0x04d5, 0x30e6 }, + { 0x04d6, 0x30e8 }, + { 0x04d7, 0x30e9 }, + { 0x04d8, 0x30ea }, + { 0x04d9, 0x30eb }, + { 0x04da, 0x30ec }, + { 0x04db, 0x30ed }, + { 0x04dc, 0x30ef }, + { 0x04dd, 0x30f3 }, + { 0x04de, 0x309b }, + { 0x04df, 0x309c }, + { 0x05ac, 0x060c }, + { 0x05bb, 0x061b }, + { 0x05bf, 0x061f }, + { 0x05c1, 0x0621 }, + { 0x05c2, 0x0622 }, + { 0x05c3, 0x0623 }, + { 0x05c4, 0x0624 }, + { 0x05c5, 0x0625 }, + { 0x05c6, 0x0626 }, + { 0x05c7, 0x0627 }, + { 0x05c8, 0x0628 }, + { 0x05c9, 0x0629 }, + { 0x05ca, 0x062a }, + { 0x05cb, 0x062b }, + { 0x05cc, 0x062c }, + { 0x05cd, 0x062d }, + { 0x05ce, 0x062e }, + { 0x05cf, 0x062f }, + { 0x05d0, 0x0630 }, + { 0x05d1, 0x0631 }, + { 0x05d2, 0x0632 }, + { 0x05d3, 0x0633 }, + { 0x05d4, 0x0634 }, + { 0x05d5, 0x0635 }, + { 0x05d6, 0x0636 }, + { 0x05d7, 0x0637 }, + { 0x05d8, 0x0638 }, + { 0x05d9, 0x0639 }, + { 0x05da, 0x063a }, + { 0x05e0, 0x0640 }, + { 0x05e1, 0x0641 }, + { 0x05e2, 0x0642 }, + { 0x05e3, 0x0643 }, + { 0x05e4, 0x0644 }, + { 0x05e5, 0x0645 }, + { 0x05e6, 0x0646 }, + { 0x05e7, 0x0647 }, + { 0x05e8, 0x0648 }, + { 0x05e9, 0x0649 }, + { 0x05ea, 0x064a }, + { 0x05eb, 0x064b }, + { 0x05ec, 0x064c }, + { 0x05ed, 0x064d }, + { 0x05ee, 0x064e }, + { 0x05ef, 0x064f }, + { 0x05f0, 0x0650 }, + { 0x05f1, 0x0651 }, + { 0x05f2, 0x0652 }, + { 0x06a1, 0x0452 }, + { 0x06a2, 0x0453 }, + { 0x06a3, 0x0451 }, + { 0x06a4, 0x0454 }, + { 0x06a5, 0x0455 }, + { 0x06a6, 0x0456 }, + { 0x06a7, 0x0457 }, + { 0x06a8, 0x0458 }, + { 0x06a9, 0x0459 }, + { 0x06aa, 0x045a }, + { 0x06ab, 0x045b }, + { 0x06ac, 0x045c }, + { 0x06ae, 0x045e }, + { 0x06af, 0x045f }, + { 0x06b0, 0x2116 }, + { 0x06b1, 0x0402 }, + { 0x06b2, 0x0403 }, + { 0x06b3, 0x0401 }, + { 0x06b4, 0x0404 }, + { 0x06b5, 0x0405 }, + { 0x06b6, 0x0406 }, + { 0x06b7, 0x0407 }, + { 0x06b8, 0x0408 }, + { 0x06b9, 0x0409 }, + { 0x06ba, 0x040a }, + { 0x06bb, 0x040b }, + { 0x06bc, 0x040c }, + { 0x06be, 0x040e }, + { 0x06bf, 0x040f }, + { 0x06c0, 0x044e }, + { 0x06c1, 0x0430 }, + { 0x06c2, 0x0431 }, + { 0x06c3, 0x0446 }, + { 0x06c4, 0x0434 }, + { 0x06c5, 0x0435 }, + { 0x06c6, 0x0444 }, + { 0x06c7, 0x0433 }, + { 0x06c8, 0x0445 }, + { 0x06c9, 0x0438 }, + { 0x06ca, 0x0439 }, + { 0x06cb, 0x043a }, + { 0x06cc, 0x043b }, + { 0x06cd, 0x043c }, + { 0x06ce, 0x043d }, + { 0x06cf, 0x043e }, + { 0x06d0, 0x043f }, + { 0x06d1, 0x044f }, + { 0x06d2, 0x0440 }, + { 0x06d3, 0x0441 }, + { 0x06d4, 0x0442 }, + { 0x06d5, 0x0443 }, + { 0x06d6, 0x0436 }, + { 0x06d7, 0x0432 }, + { 0x06d8, 0x044c }, + { 0x06d9, 0x044b }, + { 0x06da, 0x0437 }, + { 0x06db, 0x0448 }, + { 0x06dc, 0x044d }, + { 0x06dd, 0x0449 }, + { 0x06de, 0x0447 }, + { 0x06df, 0x044a }, + { 0x06e0, 0x042e }, + { 0x06e1, 0x0410 }, + { 0x06e2, 0x0411 }, + { 0x06e3, 0x0426 }, + { 0x06e4, 0x0414 }, + { 0x06e5, 0x0415 }, + { 0x06e6, 0x0424 }, + { 0x06e7, 0x0413 }, + { 0x06e8, 0x0425 }, + { 0x06e9, 0x0418 }, + { 0x06ea, 0x0419 }, + { 0x06eb, 0x041a }, + { 0x06ec, 0x041b }, + { 0x06ed, 0x041c }, + { 0x06ee, 0x041d }, + { 0x06ef, 0x041e }, + { 0x06f0, 0x041f }, + { 0x06f1, 0x042f }, + { 0x06f2, 0x0420 }, + { 0x06f3, 0x0421 }, + { 0x06f4, 0x0422 }, + { 0x06f5, 0x0423 }, + { 0x06f6, 0x0416 }, + { 0x06f7, 0x0412 }, + { 0x06f8, 0x042c }, + { 0x06f9, 0x042b }, + { 0x06fa, 0x0417 }, + { 0x06fb, 0x0428 }, + { 0x06fc, 0x042d }, + { 0x06fd, 0x0429 }, + { 0x06fe, 0x0427 }, + { 0x06ff, 0x042a }, + { 0x07a1, 0x0386 }, + { 0x07a2, 0x0388 }, + { 0x07a3, 0x0389 }, + { 0x07a4, 0x038a }, + { 0x07a5, 0x03aa }, + { 0x07a7, 0x038c }, + { 0x07a8, 0x038e }, + { 0x07a9, 0x03ab }, + { 0x07ab, 0x038f }, + { 0x07ae, 0x0385 }, + { 0x07af, 0x2015 }, + { 0x07b1, 0x03ac }, + { 0x07b2, 0x03ad }, + { 0x07b3, 0x03ae }, + { 0x07b4, 0x03af }, + { 0x07b5, 0x03ca }, + { 0x07b6, 0x0390 }, + { 0x07b7, 0x03cc }, + { 0x07b8, 0x03cd }, + { 0x07b9, 0x03cb }, + { 0x07ba, 0x03b0 }, + { 0x07bb, 0x03ce }, + { 0x07c1, 0x0391 }, + { 0x07c2, 0x0392 }, + { 0x07c3, 0x0393 }, + { 0x07c4, 0x0394 }, + { 0x07c5, 0x0395 }, + { 0x07c6, 0x0396 }, + { 0x07c7, 0x0397 }, + { 0x07c8, 0x0398 }, + { 0x07c9, 0x0399 }, + { 0x07ca, 0x039a }, + { 0x07cb, 0x039b }, + { 0x07cc, 0x039c }, + { 0x07cd, 0x039d }, + { 0x07ce, 0x039e }, + { 0x07cf, 0x039f }, + { 0x07d0, 0x03a0 }, + { 0x07d1, 0x03a1 }, + { 0x07d2, 0x03a3 }, + { 0x07d4, 0x03a4 }, + { 0x07d5, 0x03a5 }, + { 0x07d6, 0x03a6 }, + { 0x07d7, 0x03a7 }, + { 0x07d8, 0x03a8 }, + { 0x07d9, 0x03a9 }, + { 0x07e1, 0x03b1 }, + { 0x07e2, 0x03b2 }, + { 0x07e3, 0x03b3 }, + { 0x07e4, 0x03b4 }, + { 0x07e5, 0x03b5 }, + { 0x07e6, 0x03b6 }, + { 0x07e7, 0x03b7 }, + { 0x07e8, 0x03b8 }, + { 0x07e9, 0x03b9 }, + { 0x07ea, 0x03ba }, + { 0x07eb, 0x03bb }, + { 0x07ec, 0x03bc }, + { 0x07ed, 0x03bd }, + { 0x07ee, 0x03be }, + { 0x07ef, 0x03bf }, + { 0x07f0, 0x03c0 }, + { 0x07f1, 0x03c1 }, + { 0x07f2, 0x03c3 }, + { 0x07f3, 0x03c2 }, + { 0x07f4, 0x03c4 }, + { 0x07f5, 0x03c5 }, + { 0x07f6, 0x03c6 }, + { 0x07f7, 0x03c7 }, + { 0x07f8, 0x03c8 }, + { 0x07f9, 0x03c9 }, + { 0x08a1, 0x23b7 }, + { 0x08a2, 0x250c }, + { 0x08a3, 0x2500 }, + { 0x08a4, 0x2320 }, + { 0x08a5, 0x2321 }, + { 0x08a6, 0x2502 }, + { 0x08a7, 0x23a1 }, + { 0x08a8, 0x23a3 }, + { 0x08a9, 0x23a4 }, + { 0x08aa, 0x23a6 }, + { 0x08ab, 0x239b }, + { 0x08ac, 0x239d }, + { 0x08ad, 0x239e }, + { 0x08ae, 0x23a0 }, + { 0x08af, 0x23a8 }, + { 0x08b0, 0x23ac }, + { 0x08bc, 0x2264 }, + { 0x08bd, 0x2260 }, + { 0x08be, 0x2265 }, + { 0x08bf, 0x222b }, + { 0x08c0, 0x2234 }, + { 0x08c1, 0x221d }, + { 0x08c2, 0x221e }, + { 0x08c5, 0x2207 }, + { 0x08c8, 0x223c }, + { 0x08c9, 0x2243 }, + { 0x08cd, 0x21d4 }, + { 0x08ce, 0x21d2 }, + { 0x08cf, 0x2261 }, + { 0x08d6, 0x221a }, + { 0x08da, 0x2282 }, + { 0x08db, 0x2283 }, + { 0x08dc, 0x2229 }, + { 0x08dd, 0x222a }, + { 0x08de, 0x2227 }, + { 0x08df, 0x2228 }, + { 0x08ef, 0x2202 }, + { 0x08f6, 0x0192 }, + { 0x08fb, 0x2190 }, + { 0x08fc, 0x2191 }, + { 0x08fd, 0x2192 }, + { 0x08fe, 0x2193 }, + { 0x09e0, 0x25c6 }, + { 0x09e1, 0x2592 }, + { 0x09e2, 0x2409 }, + { 0x09e3, 0x240c }, + { 0x09e4, 0x240d }, + { 0x09e5, 0x240a }, + { 0x09e8, 0x2424 }, + { 0x09e9, 0x240b }, + { 0x09ea, 0x2518 }, + { 0x09eb, 0x2510 }, + { 0x09ec, 0x250c }, + { 0x09ed, 0x2514 }, + { 0x09ee, 0x253c }, + { 0x09ef, 0x23ba }, + { 0x09f0, 0x23bb }, + { 0x09f1, 0x2500 }, + { 0x09f2, 0x23bc }, + { 0x09f3, 0x23bd }, + { 0x09f4, 0x251c }, + { 0x09f5, 0x2524 }, + { 0x09f6, 0x2534 }, + { 0x09f7, 0x252c }, + { 0x09f8, 0x2502 }, + { 0x0aa1, 0x2003 }, + { 0x0aa2, 0x2002 }, + { 0x0aa3, 0x2004 }, + { 0x0aa4, 0x2005 }, + { 0x0aa5, 0x2007 }, + { 0x0aa6, 0x2008 }, + { 0x0aa7, 0x2009 }, + { 0x0aa8, 0x200a }, + { 0x0aa9, 0x2014 }, + { 0x0aaa, 0x2013 }, + { 0x0aae, 0x2026 }, + { 0x0aaf, 0x2025 }, + { 0x0ab0, 0x2153 }, + { 0x0ab1, 0x2154 }, + { 0x0ab2, 0x2155 }, + { 0x0ab3, 0x2156 }, + { 0x0ab4, 0x2157 }, + { 0x0ab5, 0x2158 }, + { 0x0ab6, 0x2159 }, + { 0x0ab7, 0x215a }, + { 0x0ab8, 0x2105 }, + { 0x0abb, 0x2012 }, + { 0x0abc, 0x2329 }, + { 0x0abe, 0x232a }, + { 0x0ac3, 0x215b }, + { 0x0ac4, 0x215c }, + { 0x0ac5, 0x215d }, + { 0x0ac6, 0x215e }, + { 0x0ac9, 0x2122 }, + { 0x0aca, 0x2613 }, + { 0x0acc, 0x25c1 }, + { 0x0acd, 0x25b7 }, + { 0x0ace, 0x25cb }, + { 0x0acf, 0x25af }, + { 0x0ad0, 0x2018 }, + { 0x0ad1, 0x2019 }, + { 0x0ad2, 0x201c }, + { 0x0ad3, 0x201d }, + { 0x0ad4, 0x211e }, + { 0x0ad6, 0x2032 }, + { 0x0ad7, 0x2033 }, + { 0x0ad9, 0x271d }, + { 0x0adb, 0x25ac }, + { 0x0adc, 0x25c0 }, + { 0x0add, 0x25b6 }, + { 0x0ade, 0x25cf }, + { 0x0adf, 0x25ae }, + { 0x0ae0, 0x25e6 }, + { 0x0ae1, 0x25ab }, + { 0x0ae2, 0x25ad }, + { 0x0ae3, 0x25b3 }, + { 0x0ae4, 0x25bd }, + { 0x0ae5, 0x2606 }, + { 0x0ae6, 0x2022 }, + { 0x0ae7, 0x25aa }, + { 0x0ae8, 0x25b2 }, + { 0x0ae9, 0x25bc }, + { 0x0aea, 0x261c }, + { 0x0aeb, 0x261e }, + { 0x0aec, 0x2663 }, + { 0x0aed, 0x2666 }, + { 0x0aee, 0x2665 }, + { 0x0af0, 0x2720 }, + { 0x0af1, 0x2020 }, + { 0x0af2, 0x2021 }, + { 0x0af3, 0x2713 }, + { 0x0af4, 0x2717 }, + { 0x0af5, 0x266f }, + { 0x0af6, 0x266d }, + { 0x0af7, 0x2642 }, + { 0x0af8, 0x2640 }, + { 0x0af9, 0x260e }, + { 0x0afa, 0x2315 }, + { 0x0afb, 0x2117 }, + { 0x0afc, 0x2038 }, + { 0x0afd, 0x201a }, + { 0x0afe, 0x201e }, + { 0x0ba3, 0x003c }, + { 0x0ba6, 0x003e }, + { 0x0ba8, 0x2228 }, + { 0x0ba9, 0x2227 }, + { 0x0bc0, 0x00af }, + { 0x0bc2, 0x22a5 }, + { 0x0bc3, 0x2229 }, + { 0x0bc4, 0x230a }, + { 0x0bc6, 0x005f }, + { 0x0bca, 0x2218 }, + { 0x0bcc, 0x2395 }, + { 0x0bce, 0x22a4 }, + { 0x0bcf, 0x25cb }, + { 0x0bd3, 0x2308 }, + { 0x0bd6, 0x222a }, + { 0x0bd8, 0x2283 }, + { 0x0bda, 0x2282 }, + { 0x0bdc, 0x22a2 }, + { 0x0bfc, 0x22a3 }, + { 0x0cdf, 0x2017 }, + { 0x0ce0, 0x05d0 }, + { 0x0ce1, 0x05d1 }, + { 0x0ce2, 0x05d2 }, + { 0x0ce3, 0x05d3 }, + { 0x0ce4, 0x05d4 }, + { 0x0ce5, 0x05d5 }, + { 0x0ce6, 0x05d6 }, + { 0x0ce7, 0x05d7 }, + { 0x0ce8, 0x05d8 }, + { 0x0ce9, 0x05d9 }, + { 0x0cea, 0x05da }, + { 0x0ceb, 0x05db }, + { 0x0cec, 0x05dc }, + { 0x0ced, 0x05dd }, + { 0x0cee, 0x05de }, + { 0x0cef, 0x05df }, + { 0x0cf0, 0x05e0 }, + { 0x0cf1, 0x05e1 }, + { 0x0cf2, 0x05e2 }, + { 0x0cf3, 0x05e3 }, + { 0x0cf4, 0x05e4 }, + { 0x0cf5, 0x05e5 }, + { 0x0cf6, 0x05e6 }, + { 0x0cf7, 0x05e7 }, + { 0x0cf8, 0x05e8 }, + { 0x0cf9, 0x05e9 }, + { 0x0cfa, 0x05ea }, + { 0x0da1, 0x0e01 }, + { 0x0da2, 0x0e02 }, + { 0x0da3, 0x0e03 }, + { 0x0da4, 0x0e04 }, + { 0x0da5, 0x0e05 }, + { 0x0da6, 0x0e06 }, + { 0x0da7, 0x0e07 }, + { 0x0da8, 0x0e08 }, + { 0x0da9, 0x0e09 }, + { 0x0daa, 0x0e0a }, + { 0x0dab, 0x0e0b }, + { 0x0dac, 0x0e0c }, + { 0x0dad, 0x0e0d }, + { 0x0dae, 0x0e0e }, + { 0x0daf, 0x0e0f }, + { 0x0db0, 0x0e10 }, + { 0x0db1, 0x0e11 }, + { 0x0db2, 0x0e12 }, + { 0x0db3, 0x0e13 }, + { 0x0db4, 0x0e14 }, + { 0x0db5, 0x0e15 }, + { 0x0db6, 0x0e16 }, + { 0x0db7, 0x0e17 }, + { 0x0db8, 0x0e18 }, + { 0x0db9, 0x0e19 }, + { 0x0dba, 0x0e1a }, + { 0x0dbb, 0x0e1b }, + { 0x0dbc, 0x0e1c }, + { 0x0dbd, 0x0e1d }, + { 0x0dbe, 0x0e1e }, + { 0x0dbf, 0x0e1f }, + { 0x0dc0, 0x0e20 }, + { 0x0dc1, 0x0e21 }, + { 0x0dc2, 0x0e22 }, + { 0x0dc3, 0x0e23 }, + { 0x0dc4, 0x0e24 }, + { 0x0dc5, 0x0e25 }, + { 0x0dc6, 0x0e26 }, + { 0x0dc7, 0x0e27 }, + { 0x0dc8, 0x0e28 }, + { 0x0dc9, 0x0e29 }, + { 0x0dca, 0x0e2a }, + { 0x0dcb, 0x0e2b }, + { 0x0dcc, 0x0e2c }, + { 0x0dcd, 0x0e2d }, + { 0x0dce, 0x0e2e }, + { 0x0dcf, 0x0e2f }, + { 0x0dd0, 0x0e30 }, + { 0x0dd1, 0x0e31 }, + { 0x0dd2, 0x0e32 }, + { 0x0dd3, 0x0e33 }, + { 0x0dd4, 0x0e34 }, + { 0x0dd5, 0x0e35 }, + { 0x0dd6, 0x0e36 }, + { 0x0dd7, 0x0e37 }, + { 0x0dd8, 0x0e38 }, + { 0x0dd9, 0x0e39 }, + { 0x0dda, 0x0e3a }, + { 0x0ddf, 0x0e3f }, + { 0x0de0, 0x0e40 }, + { 0x0de1, 0x0e41 }, + { 0x0de2, 0x0e42 }, + { 0x0de3, 0x0e43 }, + { 0x0de4, 0x0e44 }, + { 0x0de5, 0x0e45 }, + { 0x0de6, 0x0e46 }, + { 0x0de7, 0x0e47 }, + { 0x0de8, 0x0e48 }, + { 0x0de9, 0x0e49 }, + { 0x0dea, 0x0e4a }, + { 0x0deb, 0x0e4b }, + { 0x0dec, 0x0e4c }, + { 0x0ded, 0x0e4d }, + { 0x0df0, 0x0e50 }, + { 0x0df1, 0x0e51 }, + { 0x0df2, 0x0e52 }, + { 0x0df3, 0x0e53 }, + { 0x0df4, 0x0e54 }, + { 0x0df5, 0x0e55 }, + { 0x0df6, 0x0e56 }, + { 0x0df7, 0x0e57 }, + { 0x0df8, 0x0e58 }, + { 0x0df9, 0x0e59 }, + { 0x0ea1, 0x3131 }, + { 0x0ea2, 0x3132 }, + { 0x0ea3, 0x3133 }, + { 0x0ea4, 0x3134 }, + { 0x0ea5, 0x3135 }, + { 0x0ea6, 0x3136 }, + { 0x0ea7, 0x3137 }, + { 0x0ea8, 0x3138 }, + { 0x0ea9, 0x3139 }, + { 0x0eaa, 0x313a }, + { 0x0eab, 0x313b }, + { 0x0eac, 0x313c }, + { 0x0ead, 0x313d }, + { 0x0eae, 0x313e }, + { 0x0eaf, 0x313f }, + { 0x0eb0, 0x3140 }, + { 0x0eb1, 0x3141 }, + { 0x0eb2, 0x3142 }, + { 0x0eb3, 0x3143 }, + { 0x0eb4, 0x3144 }, + { 0x0eb5, 0x3145 }, + { 0x0eb6, 0x3146 }, + { 0x0eb7, 0x3147 }, + { 0x0eb8, 0x3148 }, + { 0x0eb9, 0x3149 }, + { 0x0eba, 0x314a }, + { 0x0ebb, 0x314b }, + { 0x0ebc, 0x314c }, + { 0x0ebd, 0x314d }, + { 0x0ebe, 0x314e }, + { 0x0ebf, 0x314f }, + { 0x0ec0, 0x3150 }, + { 0x0ec1, 0x3151 }, + { 0x0ec2, 0x3152 }, + { 0x0ec3, 0x3153 }, + { 0x0ec4, 0x3154 }, + { 0x0ec5, 0x3155 }, + { 0x0ec6, 0x3156 }, + { 0x0ec7, 0x3157 }, + { 0x0ec8, 0x3158 }, + { 0x0ec9, 0x3159 }, + { 0x0eca, 0x315a }, + { 0x0ecb, 0x315b }, + { 0x0ecc, 0x315c }, + { 0x0ecd, 0x315d }, + { 0x0ece, 0x315e }, + { 0x0ecf, 0x315f }, + { 0x0ed0, 0x3160 }, + { 0x0ed1, 0x3161 }, + { 0x0ed2, 0x3162 }, + { 0x0ed3, 0x3163 }, + { 0x0ed4, 0x11a8 }, + { 0x0ed5, 0x11a9 }, + { 0x0ed6, 0x11aa }, + { 0x0ed7, 0x11ab }, + { 0x0ed8, 0x11ac }, + { 0x0ed9, 0x11ad }, + { 0x0eda, 0x11ae }, + { 0x0edb, 0x11af }, + { 0x0edc, 0x11b0 }, + { 0x0edd, 0x11b1 }, + { 0x0ede, 0x11b2 }, + { 0x0edf, 0x11b3 }, + { 0x0ee0, 0x11b4 }, + { 0x0ee1, 0x11b5 }, + { 0x0ee2, 0x11b6 }, + { 0x0ee3, 0x11b7 }, + { 0x0ee4, 0x11b8 }, + { 0x0ee5, 0x11b9 }, + { 0x0ee6, 0x11ba }, + { 0x0ee7, 0x11bb }, + { 0x0ee8, 0x11bc }, + { 0x0ee9, 0x11bd }, + { 0x0eea, 0x11be }, + { 0x0eeb, 0x11bf }, + { 0x0eec, 0x11c0 }, + { 0x0eed, 0x11c1 }, + { 0x0eee, 0x11c2 }, + { 0x0eef, 0x316d }, + { 0x0ef0, 0x3171 }, + { 0x0ef1, 0x3178 }, + { 0x0ef2, 0x317f }, + { 0x0ef3, 0x3181 }, + { 0x0ef4, 0x3184 }, + { 0x0ef5, 0x3186 }, + { 0x0ef6, 0x318d }, + { 0x0ef7, 0x318e }, + { 0x0ef8, 0x11eb }, + { 0x0ef9, 0x11f0 }, + { 0x0efa, 0x11f9 }, + { 0x0eff, 0x20a9 }, + { 0x13a4, 0x20ac }, + { 0x13bc, 0x0152 }, + { 0x13bd, 0x0153 }, + { 0x13be, 0x0178 }, + { 0x20ac, 0x20ac }, + { 0xfe50, '`' }, + { 0xfe51, 0x00b4 }, + { 0xfe52, '^' }, + { 0xfe53, '~' }, + { 0xfe54, 0x00af }, + { 0xfe55, 0x02d8 }, + { 0xfe56, 0x02d9 }, + { 0xfe57, 0x00a8 }, + { 0xfe58, 0x02da }, + { 0xfe59, 0x02dd }, + { 0xfe5a, 0x02c7 }, + { 0xfe5b, 0x00b8 }, + { 0xfe5c, 0x02db }, + { 0xfe5d, 0x037a }, + { 0xfe5e, 0x309b }, + { 0xfe5f, 0x309c }, + { 0xfe63, '/' }, + { 0xfe64, 0x02bc }, + { 0xfe65, 0x02bd }, + { 0xfe66, 0x02f5 }, + { 0xfe67, 0x02f3 }, + { 0xfe68, 0x02cd }, + { 0xfe69, 0xa788 }, + { 0xfe6a, 0x02f7 }, + { 0xfe6e, ',' }, + { 0xfe6f, 0x00a4 }, + { 0xfe80, 'a' }, /* XK_dead_a */ + { 0xfe81, 'A' }, /* XK_dead_A */ + { 0xfe82, 'e' }, /* XK_dead_e */ + { 0xfe83, 'E' }, /* XK_dead_E */ + { 0xfe84, 'i' }, /* XK_dead_i */ + { 0xfe85, 'I' }, /* XK_dead_I */ + { 0xfe86, 'o' }, /* XK_dead_o */ + { 0xfe87, 'O' }, /* XK_dead_O */ + { 0xfe88, 'u' }, /* XK_dead_u */ + { 0xfe89, 'U' }, /* XK_dead_U */ + { 0xfe8a, 0x0259 }, + { 0xfe8b, 0x018f }, + { 0xfe8c, 0x00b5 }, + { 0xfe90, '_' }, + { 0xfe91, 0x02c8 }, + { 0xfe92, 0x02cc }, + { 0xff80 /*XKB_KEY_KP_Space*/, ' ' }, + { 0xff95 /*XKB_KEY_KP_7*/, 0x0037 }, + { 0xff96 /*XKB_KEY_KP_4*/, 0x0034 }, + { 0xff97 /*XKB_KEY_KP_8*/, 0x0038 }, + { 0xff98 /*XKB_KEY_KP_6*/, 0x0036 }, + { 0xff99 /*XKB_KEY_KP_2*/, 0x0032 }, + { 0xff9a /*XKB_KEY_KP_9*/, 0x0039 }, + { 0xff9b /*XKB_KEY_KP_3*/, 0x0033 }, + { 0xff9c /*XKB_KEY_KP_1*/, 0x0031 }, + { 0xff9d /*XKB_KEY_KP_5*/, 0x0035 }, + { 0xff9e /*XKB_KEY_KP_0*/, 0x0030 }, + { 0xffaa /*XKB_KEY_KP_Multiply*/, '*' }, + { 0xffab /*XKB_KEY_KP_Add*/, '+' }, + { 0xffac /*XKB_KEY_KP_Separator*/, ',' }, + { 0xffad /*XKB_KEY_KP_Subtract*/, '-' }, + { 0xffae /*XKB_KEY_KP_Decimal*/, '.' }, + { 0xffaf /*XKB_KEY_KP_Divide*/, '/' }, + { 0xffb0 /*XKB_KEY_KP_0*/, 0x0030 }, + { 0xffb1 /*XKB_KEY_KP_1*/, 0x0031 }, + { 0xffb2 /*XKB_KEY_KP_2*/, 0x0032 }, + { 0xffb3 /*XKB_KEY_KP_3*/, 0x0033 }, + { 0xffb4 /*XKB_KEY_KP_4*/, 0x0034 }, + { 0xffb5 /*XKB_KEY_KP_5*/, 0x0035 }, + { 0xffb6 /*XKB_KEY_KP_6*/, 0x0036 }, + { 0xffb7 /*XKB_KEY_KP_7*/, 0x0037 }, + { 0xffb8 /*XKB_KEY_KP_8*/, 0x0038 }, + { 0xffb9 /*XKB_KEY_KP_9*/, 0x0039 }, + { 0xffbd /*XKB_KEY_KP_Equal*/, '=' } +}; + +_SOKOL_PRIVATE int _sapp_x11_error_handler(Display* display, XErrorEvent* event) { + _sapp_x11_error_code = event->error_code; + return 0; +} + +_SOKOL_PRIVATE void _sapp_x11_grab_error_handler(void) { + _sapp_x11_error_code = Success; + XSetErrorHandler(_sapp_x11_error_handler); +} + +_SOKOL_PRIVATE void _sapp_x11_release_error_handler(void) { + XSync(_sapp_x11_display, False); + XSetErrorHandler(NULL); +} + +_SOKOL_PRIVATE void _sapp_x11_init_extensions(void) { + _sapp_x11_UTF8_STRING = XInternAtom(_sapp_x11_display, "UTF8_STRING", False); + _sapp_x11_WM_PROTOCOLS = XInternAtom(_sapp_x11_display, "WM_PROTOCOLS", False); + _sapp_x11_WM_DELETE_WINDOW = XInternAtom(_sapp_x11_display, "WM_DELETE_WINDOW", False); + _sapp_x11_WM_STATE = XInternAtom(_sapp_x11_display, "WM_STATE", False); + _sapp_x11_NET_WM_NAME = XInternAtom(_sapp_x11_display, "_NET_WM_NAME", False); + _sapp_x11_NET_WM_ICON_NAME = XInternAtom(_sapp_x11_display, "_NET_WM_ICON_NAME", False); +} + +_SOKOL_PRIVATE void _sapp_x11_query_system_dpi(void) { + /* from GLFW: + + NOTE: Default to the display-wide DPI as we don't currently have a policy + for which monitor a window is considered to be on + _sapp_x11_dpi = DisplayWidth(_sapp_x11_display, _sapp_x11_screen) * + 25.4f / DisplayWidthMM(_sapp_x11_display, _sapp_x11_screen); + + NOTE: Basing the scale on Xft.dpi where available should provide the most + consistent user experience (matches Qt, Gtk, etc), although not + always the most accurate one + */ + char* rms = XResourceManagerString(_sapp_x11_display); + if (rms) { + XrmDatabase db = XrmGetStringDatabase(rms); + if (db) { + XrmValue value; + char* type = NULL; + if (XrmGetResource(db, "Xft.dpi", "Xft.Dpi", &type, &value)) { + if (type && strcmp(type, "String") == 0) { + _sapp_x11_dpi = atof(value.addr); + } + } + XrmDestroyDatabase(db); + } + } +} + +_SOKOL_PRIVATE bool _sapp_glx_has_ext(const char* ext, const char* extensions) { + SOKOL_ASSERT(ext); + const char* start = extensions; + while (true) { + const char* where = strstr(start, ext); + if (!where) { + return false; + } + const char* terminator = where + strlen(ext); + if ((where == start) || (*(where - 1) == ' ')) { + if (*terminator == ' ' || *terminator == '\0') { + break; + } + } + start = terminator; + } + return true; +} + +_SOKOL_PRIVATE bool _sapp_glx_extsupported(const char* ext, const char* extensions) { + if (extensions) { + return _sapp_glx_has_ext(ext, extensions); + } + else { + return false; + } +} + +_SOKOL_PRIVATE void* _sapp_glx_getprocaddr(const char* procname) +{ + if (_sapp_glx_GetProcAddress) { + return (void*) _sapp_glx_GetProcAddress((const GLubyte*) procname); + } + else if (_sapp_glx_GetProcAddressARB) { + return (void*) _sapp_glx_GetProcAddressARB((const GLubyte*) procname); + } + else { + return dlsym(_sapp_glx_libgl, procname); + } +} + +_SOKOL_PRIVATE void _sapp_glx_init() { + const char* sonames[] = { "libGL.so.1", "libGL.so", 0 }; + for (int i = 0; sonames[i]; i++) { + _sapp_glx_libgl = dlopen(sonames[i], RTLD_LAZY|RTLD_GLOBAL); + if (_sapp_glx_libgl) { + break; + } + } + if (!_sapp_glx_libgl) { + _sapp_fail("GLX: failed to load libGL"); + } + _sapp_glx_GetFBConfigs = (PFNGLXGETFBCONFIGSPROC) dlsym(_sapp_glx_libgl, "glXGetFBConfigs"); + _sapp_glx_GetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC) dlsym(_sapp_glx_libgl, "glXGetFBConfigAttrib"); + _sapp_glx_GetClientString = (PFNGLXGETCLIENTSTRINGPROC) dlsym(_sapp_glx_libgl, "glXGetClientString"); + _sapp_glx_QueryExtension = (PFNGLXQUERYEXTENSIONPROC) dlsym(_sapp_glx_libgl, "glXQueryExtension"); + _sapp_glx_QueryVersion = (PFNGLXQUERYVERSIONPROC) dlsym(_sapp_glx_libgl, "glXQueryVersion"); + _sapp_glx_DestroyContext = (PFNGLXDESTROYCONTEXTPROC) dlsym(_sapp_glx_libgl, "glXDestroyContext"); + _sapp_glx_MakeCurrent = (PFNGLXMAKECURRENTPROC) dlsym(_sapp_glx_libgl, "glXMakeCurrent"); + _sapp_glx_SwapBuffers = (PFNGLXSWAPBUFFERSPROC) dlsym(_sapp_glx_libgl, "glXSwapBuffers"); + _sapp_glx_QueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRINGPROC) dlsym(_sapp_glx_libgl, "glXQueryExtensionsString"); + _sapp_glx_CreateNewContext = (PFNGLXCREATENEWCONTEXTPROC) dlsym(_sapp_glx_libgl, "glXCreateNewContext"); + _sapp_glx_CreateWindow = (PFNGLXCREATEWINDOWPROC) dlsym(_sapp_glx_libgl, "glXCreateWindow"); + _sapp_glx_DestroyWindow = (PFNGLXDESTROYWINDOWPROC) dlsym(_sapp_glx_libgl, "glXDestroyWindow"); + _sapp_glx_GetProcAddress = (PFNGLXGETPROCADDRESSPROC) dlsym(_sapp_glx_libgl, "glXGetProcAddress"); + _sapp_glx_GetProcAddressARB = (PFNGLXGETPROCADDRESSPROC) dlsym(_sapp_glx_libgl, "glXGetProcAddressARB"); + _sapp_glx_GetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) dlsym(_sapp_glx_libgl, "glXGetVisualFromFBConfig"); + if (!_sapp_glx_GetFBConfigs || + !_sapp_glx_GetFBConfigAttrib || + !_sapp_glx_GetClientString || + !_sapp_glx_QueryExtension || + !_sapp_glx_QueryVersion || + !_sapp_glx_DestroyContext || + !_sapp_glx_MakeCurrent || + !_sapp_glx_SwapBuffers || + !_sapp_glx_QueryExtensionsString || + !_sapp_glx_CreateNewContext || + !_sapp_glx_CreateWindow || + !_sapp_glx_DestroyWindow || + !_sapp_glx_GetProcAddress || + !_sapp_glx_GetProcAddressARB || + !_sapp_glx_GetVisualFromFBConfig) + { + _sapp_fail("GLX: failed to load required entry points"); + } + + if (!_sapp_glx_QueryExtension(_sapp_x11_display, + &_sapp_glx_errorbase, + &_sapp_glx_eventbase)) + { + _sapp_fail("GLX: GLX extension not found"); + } + if (!_sapp_glx_QueryVersion(_sapp_x11_display, &_sapp_glx_major, &_sapp_glx_minor)) { + _sapp_fail("GLX: Failed to query GLX version"); + } + if (_sapp_glx_major == 1 && _sapp_glx_minor < 3) { + _sapp_fail("GLX: GLX version 1.3 is required"); + } + const char* exts = _sapp_glx_QueryExtensionsString(_sapp_x11_display, _sapp_x11_screen); + if (_sapp_glx_extsupported("GLX_EXT_swap_control", exts)) { + _sapp_glx_SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC) _sapp_glx_getprocaddr("glXSwapIntervalEXT"); + _sapp_glx_EXT_swap_control = 0 != _sapp_glx_SwapIntervalEXT; + } + if (_sapp_glx_extsupported("GLX_MESA_swap_control", exts)) { + _sapp_glx_SwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC) _sapp_glx_getprocaddr("glXSwapIntervalMESA"); + _sapp_glx_MESA_swap_control = 0 != _sapp_glx_SwapIntervalMESA; + } + _sapp_glx_ARB_multisample = _sapp_glx_extsupported("GLX_ARB_multisample", exts); + _sapp_glx_ARB_framebuffer_sRGB = _sapp_glx_extsupported("GLX_ARB_framebuffer_sRGB", exts); + _sapp_glx_EXT_framebuffer_sRGB = _sapp_glx_extsupported("GLX_EXT_framebuffer_sRGB", exts); + if (_sapp_glx_extsupported("GLX_ARB_create_context", exts)) { + _sapp_glx_CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) _sapp_glx_getprocaddr("glXCreateContextAttribsARB"); + _sapp_glx_ARB_create_context = 0 != _sapp_glx_CreateContextAttribsARB; + } + _sapp_glx_ARB_create_context_profile = _sapp_glx_extsupported("GLX_ARB_create_context_profile", exts); +} + +_SOKOL_PRIVATE int _sapp_glx_attrib(GLXFBConfig fbconfig, int attrib) { + int value; + _sapp_glx_GetFBConfigAttrib(_sapp_x11_display, fbconfig, attrib, &value); + return value; +} + +_SOKOL_PRIVATE GLXFBConfig _sapp_glx_choosefbconfig() { + GLXFBConfig* native_configs; + _sapp_gl_fbconfig* usable_configs; + const _sapp_gl_fbconfig* closest; + int i, native_count, usable_count; + const char* vendor; + bool trust_window_bit = true; + + /* HACK: This is a (hopefully temporary) workaround for Chromium + (VirtualBox GL) not setting the window bit on any GLXFBConfigs + */ + vendor = _sapp_glx_GetClientString(_sapp_x11_display, GLX_VENDOR); + if (vendor && strcmp(vendor, "Chromium") == 0) { + trust_window_bit = false; + } + + native_configs = _sapp_glx_GetFBConfigs(_sapp_x11_display, _sapp_x11_screen, &native_count); + if (!native_configs || !native_count) { + _sapp_fail("GLX: No GLXFBConfigs returned"); + } + + usable_configs = (_sapp_gl_fbconfig*) SOKOL_CALLOC(native_count, sizeof(_sapp_gl_fbconfig)); + usable_count = 0; + for (i = 0; i < native_count; i++) { + const GLXFBConfig n = native_configs[i]; + _sapp_gl_fbconfig* u = usable_configs + usable_count; + _sapp_gl_init_fbconfig(u); + + /* Only consider RGBA GLXFBConfigs */ + if (0 == (_sapp_glx_attrib(n, GLX_RENDER_TYPE) & GLX_RGBA_BIT)) { + continue; + } + /* Only consider window GLXFBConfigs */ + if (0 == (_sapp_glx_attrib(n, GLX_DRAWABLE_TYPE) & GLX_WINDOW_BIT)) { + if (trust_window_bit) { + continue; + } + } + u->red_bits = _sapp_glx_attrib(n, GLX_RED_SIZE); + u->green_bits = _sapp_glx_attrib(n, GLX_GREEN_SIZE); + u->blue_bits = _sapp_glx_attrib(n, GLX_BLUE_SIZE); + u->alpha_bits = _sapp_glx_attrib(n, GLX_ALPHA_SIZE); + u->depth_bits = _sapp_glx_attrib(n, GLX_DEPTH_SIZE); + u->stencil_bits = _sapp_glx_attrib(n, GLX_STENCIL_SIZE); + if (_sapp_glx_attrib(n, GLX_DOUBLEBUFFER)) { + u->doublebuffer = true; + } + if (_sapp_glx_ARB_multisample) { + u->samples = _sapp_glx_attrib(n, GLX_SAMPLES); + } + u->handle = (uintptr_t) n; + usable_count++; + } + _sapp_gl_fbconfig desired; + _sapp_gl_init_fbconfig(&desired); + desired.red_bits = 8; + desired.green_bits = 8; + desired.blue_bits = 8; + desired.alpha_bits = 8; + desired.depth_bits = 24; + desired.stencil_bits = 8; + desired.doublebuffer = true; + desired.samples = _sapp.sample_count > 1 ? _sapp.sample_count : 0; + closest = _sapp_gl_choose_fbconfig(&desired, usable_configs, usable_count); + GLXFBConfig result = 0; + if (closest) { + result = (GLXFBConfig) closest->handle; + } + XFree(native_configs); + SOKOL_FREE(usable_configs); + return result; +} + +_SOKOL_PRIVATE void _sapp_glx_choose_visual(Visual** visual, int* depth) { + GLXFBConfig native = _sapp_glx_choosefbconfig(); + if (0 == native) { + _sapp_fail("GLX: Failed to find a suitable GLXFBConfig"); + } + XVisualInfo* result = _sapp_glx_GetVisualFromFBConfig(_sapp_x11_display, native); + if (!result) { + _sapp_fail("GLX: Failed to retrieve Visual for GLXFBConfig"); + } + *visual = result->visual; + *depth = result->depth; + XFree(result); +} + +_SOKOL_PRIVATE void _sapp_glx_create_context(void) { + GLXFBConfig native = _sapp_glx_choosefbconfig(); + if (0 == native){ + _sapp_fail("GLX: Failed to find a suitable GLXFBConfig (2)"); + } + if (!(_sapp_glx_ARB_create_context && _sapp_glx_ARB_create_context_profile)) { + _sapp_fail("GLX: ARB_create_context and ARB_create_context_profile required"); + } + _sapp_x11_grab_error_handler(); + const int attribs[] = { + GLX_CONTEXT_MAJOR_VERSION_ARB, 3, + GLX_CONTEXT_MINOR_VERSION_ARB, 3, + GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, + GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + 0, 0 + }; + _sapp_glx_ctx = _sapp_glx_CreateContextAttribsARB(_sapp_x11_display, native, NULL, True, attribs); + if (!_sapp_glx_ctx) { + _sapp_fail("GLX: failed to create GL context"); + } + _sapp_x11_release_error_handler(); + _sapp_glx_window = _sapp_glx_CreateWindow(_sapp_x11_display, native, _sapp_x11_window, NULL); + if (!_sapp_glx_window) { + _sapp_fail("GLX: failed to create window"); + } +} + +_SOKOL_PRIVATE void _sapp_glx_destroy_context(void) { + if (_sapp_glx_window) { + _sapp_glx_DestroyWindow(_sapp_x11_display, _sapp_glx_window); + _sapp_glx_window = 0; + } + if (_sapp_glx_ctx) { + _sapp_glx_DestroyContext(_sapp_x11_display, _sapp_glx_ctx); + _sapp_glx_ctx = 0; + } +} + +_SOKOL_PRIVATE void _sapp_glx_make_current(void) { + _sapp_glx_MakeCurrent(_sapp_x11_display, _sapp_glx_window, _sapp_glx_ctx); +} + +_SOKOL_PRIVATE void _sapp_glx_swap_buffers(void) { + _sapp_glx_SwapBuffers(_sapp_x11_display, _sapp_glx_window); +} + +_SOKOL_PRIVATE void _sapp_glx_swapinterval(int interval) { + _sapp_glx_make_current(); + if (_sapp_glx_EXT_swap_control) { + _sapp_glx_SwapIntervalEXT(_sapp_x11_display, _sapp_glx_window, interval); + } + else if (_sapp_glx_MESA_swap_control) { + _sapp_glx_SwapIntervalMESA(interval); + } +} + +_SOKOL_PRIVATE void _sapp_x11_update_window_title(void) { + Xutf8SetWMProperties(_sapp_x11_display, + _sapp_x11_window, + _sapp.window_title, _sapp.window_title, + NULL, 0, NULL, NULL, NULL); + XChangeProperty(_sapp_x11_display, _sapp_x11_window, + _sapp_x11_NET_WM_NAME, _sapp_x11_UTF8_STRING, 8, + PropModeReplace, + (unsigned char*)_sapp.window_title, + strlen(_sapp.window_title)); + XChangeProperty(_sapp_x11_display, _sapp_x11_window, + _sapp_x11_NET_WM_ICON_NAME, _sapp_x11_UTF8_STRING, 8, + PropModeReplace, + (unsigned char*)_sapp.window_title, + strlen(_sapp.window_title)); + XFlush(_sapp_x11_display); +} + +_SOKOL_PRIVATE void _sapp_x11_query_window_size(void) { + XWindowAttributes attribs; + XGetWindowAttributes(_sapp_x11_display, _sapp_x11_window, &attribs); + _sapp.window_width = attribs.width; + _sapp.window_height = attribs.height; + _sapp.framebuffer_width = _sapp.window_width; + _sapp.framebuffer_height = _sapp.framebuffer_height; +} + +_SOKOL_PRIVATE void _sapp_x11_create_window(Visual* visual, int depth) { + _sapp_x11_colormap = XCreateColormap(_sapp_x11_display, _sapp_x11_root, visual, AllocNone); + XSetWindowAttributes wa; + memset(&wa, 0, sizeof(wa)); + const uint32_t wamask = CWBorderPixel | CWColormap | CWEventMask; + wa.colormap = _sapp_x11_colormap; + wa.border_pixel = 0; + wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask | + PointerMotionMask | ButtonPressMask | ButtonReleaseMask | + ExposureMask | FocusChangeMask | VisibilityChangeMask | + EnterWindowMask | LeaveWindowMask | PropertyChangeMask; + _sapp_x11_grab_error_handler(); + _sapp_x11_window = XCreateWindow(_sapp_x11_display, + _sapp_x11_root, + 0, 0, + _sapp.window_width, + _sapp.window_height, + 0, /* border width */ + depth, /* color depth */ + InputOutput, + visual, + wamask, + &wa); + _sapp_x11_release_error_handler(); + if (!_sapp_x11_window) { + _sapp_fail("X11: Failed to create window"); + } + + Atom protocols[] = { + _sapp_x11_WM_DELETE_WINDOW + }; + XSetWMProtocols(_sapp_x11_display, _sapp_x11_window, protocols, 1); + + XSizeHints* hints = XAllocSizeHints(); + hints->flags |= PWinGravity; + hints->win_gravity = StaticGravity; + XSetWMNormalHints(_sapp_x11_display, _sapp_x11_window, hints); + XFree(hints); + + _sapp_x11_update_window_title(); + _sapp_x11_query_window_size(); +} + +_SOKOL_PRIVATE void _sapp_x11_destroy_window(void) { + if (_sapp_x11_window) { + XUnmapWindow(_sapp_x11_display, _sapp_x11_window); + XDestroyWindow(_sapp_x11_display, _sapp_x11_window); + _sapp_x11_window = 0; + } + if (_sapp_x11_colormap) { + XFreeColormap(_sapp_x11_display, _sapp_x11_colormap); + _sapp_x11_colormap = 0; + } + XFlush(_sapp_x11_display); +} + +_SOKOL_PRIVATE bool _sapp_x11_window_visible(void) { + XWindowAttributes wa; + XGetWindowAttributes(_sapp_x11_display, _sapp_x11_window, &wa); + return wa.map_state == IsViewable; +} + +_SOKOL_PRIVATE void _sapp_x11_show_window(void) { + if (!_sapp_x11_window_visible()) { + XMapWindow(_sapp_x11_display, _sapp_x11_window); + XRaiseWindow(_sapp_x11_display, _sapp_x11_window); + XFlush(_sapp_x11_display); + } +} + +_SOKOL_PRIVATE void _sapp_x11_hide_window(void) { + XUnmapWindow(_sapp_x11_display, _sapp_x11_window); + XFlush(_sapp_x11_display); +} + +_SOKOL_PRIVATE unsigned long _sapp_x11_get_window_property(Atom property, Atom type, unsigned char** value) { + Atom actualType; + int actualFormat; + unsigned long itemCount, bytesAfter; + XGetWindowProperty(_sapp_x11_display, + _sapp_x11_window, + property, + 0, + LONG_MAX, + False, + type, + &actualType, + &actualFormat, + &itemCount, + &bytesAfter, + value); + return itemCount; +} + +_SOKOL_PRIVATE int _sapp_x11_get_window_state(void) { + int result = WithdrawnState; + struct { + CARD32 state; + Window icon; + } *state = NULL; + + if (_sapp_x11_get_window_property(_sapp_x11_WM_STATE, _sapp_x11_WM_STATE, (unsigned char**)&state) >= 2) { + result = state->state; + } + if (state) { + XFree(state); + } + return result; +} + +_SOKOL_PRIVATE uint32_t _sapp_x11_mod(int x11_mods) { + uint32_t mods = 0; + if (x11_mods & ShiftMask) { + mods |= SAPP_MODIFIER_SHIFT; + } + if (x11_mods & ControlMask) { + mods |= SAPP_MODIFIER_CTRL; + } + if (x11_mods & Mod1Mask) { + mods |= SAPP_MODIFIER_ALT; + } + if (x11_mods & Mod4Mask) { + mods |= SAPP_MODIFIER_SUPER; + } + return mods; +} + +_SOKOL_PRIVATE void _sapp_x11_app_event(sapp_event_type type) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE sapp_mousebutton _sapp_x11_translate_button(const XEvent* event) { + switch (event->xbutton.button) { + case Button1: return SAPP_MOUSEBUTTON_LEFT; + case Button2: return SAPP_MOUSEBUTTON_MIDDLE; + case Button3: return SAPP_MOUSEBUTTON_RIGHT; + default: return SAPP_MOUSEBUTTON_INVALID; + } +} + +_SOKOL_PRIVATE void _sapp_x11_mouse_event(sapp_event_type type, sapp_mousebutton btn, uint32_t mods) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp.event.mouse_button = btn; + _sapp.event.modifiers = mods; + _sapp.event.mouse_x = _sapp.mouse_x; + _sapp.event.mouse_y = _sapp.mouse_y; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_x11_scroll_event(float x, float y, uint32_t mods) { + if (_sapp_events_enabled()) { + _sapp_init_event(SAPP_EVENTTYPE_MOUSE_SCROLL); + _sapp.event.modifiers = mods; + _sapp.event.scroll_x = x; + _sapp.event.scroll_y = y; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_x11_key_event(sapp_event_type type, sapp_keycode key, bool repeat, uint32_t mods) { + if (_sapp_events_enabled()) { + _sapp_init_event(type); + _sapp.event.key_code = key; + _sapp.event.key_repeat = repeat; + _sapp.event.modifiers = mods; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE void _sapp_x11_char_event(uint32_t chr, bool repeat, uint32_t mods) { + if (_sapp_events_enabled()) { + _sapp_init_event(SAPP_EVENTTYPE_CHAR); + _sapp.event.char_code = chr; + _sapp.event.key_repeat = repeat; + _sapp.event.modifiers = mods; + _sapp_call_event(&_sapp.event); + } +} + +_SOKOL_PRIVATE sapp_keycode _sapp_x11_translate_key(int scancode) { + int dummy; + KeySym* keysyms = XGetKeyboardMapping(_sapp_x11_display, scancode, 1, &dummy); + SOKOL_ASSERT(keysyms); + KeySym keysym = keysyms[0]; + XFree(keysyms); + switch (keysym) { + case XK_Escape: return SAPP_KEYCODE_ESCAPE; + case XK_Tab: return SAPP_KEYCODE_TAB; + case XK_Shift_L: return SAPP_KEYCODE_LEFT_SHIFT; + case XK_Shift_R: return SAPP_KEYCODE_RIGHT_SHIFT; + case XK_Control_L: return SAPP_KEYCODE_LEFT_CONTROL; + case XK_Control_R: return SAPP_KEYCODE_RIGHT_CONTROL; + case XK_Meta_L: + case XK_Alt_L: return SAPP_KEYCODE_LEFT_ALT; + case XK_Mode_switch: /* Mapped to Alt_R on many keyboards */ + case XK_ISO_Level3_Shift: /* AltGr on at least some machines */ + case XK_Meta_R: + case XK_Alt_R: return SAPP_KEYCODE_RIGHT_ALT; + case XK_Super_L: return SAPP_KEYCODE_LEFT_SUPER; + case XK_Super_R: return SAPP_KEYCODE_RIGHT_SUPER; + case XK_Menu: return SAPP_KEYCODE_MENU; + case XK_Num_Lock: return SAPP_KEYCODE_NUM_LOCK; + case XK_Caps_Lock: return SAPP_KEYCODE_CAPS_LOCK; + case XK_Print: return SAPP_KEYCODE_PRINT_SCREEN; + case XK_Scroll_Lock: return SAPP_KEYCODE_SCROLL_LOCK; + case XK_Pause: return SAPP_KEYCODE_PAUSE; + case XK_Delete: return SAPP_KEYCODE_DELETE; + case XK_BackSpace: return SAPP_KEYCODE_BACKSPACE; + case XK_Return: return SAPP_KEYCODE_ENTER; + case XK_Home: return SAPP_KEYCODE_HOME; + case XK_End: return SAPP_KEYCODE_END; + case XK_Page_Up: return SAPP_KEYCODE_PAGE_UP; + case XK_Page_Down: return SAPP_KEYCODE_PAGE_DOWN; + case XK_Insert: return SAPP_KEYCODE_INSERT; + case XK_Left: return SAPP_KEYCODE_LEFT; + case XK_Right: return SAPP_KEYCODE_RIGHT; + case XK_Down: return SAPP_KEYCODE_DOWN; + case XK_Up: return SAPP_KEYCODE_UP; + case XK_F1: return SAPP_KEYCODE_F1; + case XK_F2: return SAPP_KEYCODE_F2; + case XK_F3: return SAPP_KEYCODE_F3; + case XK_F4: return SAPP_KEYCODE_F4; + case XK_F5: return SAPP_KEYCODE_F5; + case XK_F6: return SAPP_KEYCODE_F6; + case XK_F7: return SAPP_KEYCODE_F7; + case XK_F8: return SAPP_KEYCODE_F8; + case XK_F9: return SAPP_KEYCODE_F9; + case XK_F10: return SAPP_KEYCODE_F10; + case XK_F11: return SAPP_KEYCODE_F11; + case XK_F12: return SAPP_KEYCODE_F12; + case XK_F13: return SAPP_KEYCODE_F13; + case XK_F14: return SAPP_KEYCODE_F14; + case XK_F15: return SAPP_KEYCODE_F15; + case XK_F16: return SAPP_KEYCODE_F16; + case XK_F17: return SAPP_KEYCODE_F17; + case XK_F18: return SAPP_KEYCODE_F18; + case XK_F19: return SAPP_KEYCODE_F19; + case XK_F20: return SAPP_KEYCODE_F20; + case XK_F21: return SAPP_KEYCODE_F21; + case XK_F22: return SAPP_KEYCODE_F22; + case XK_F23: return SAPP_KEYCODE_F23; + case XK_F24: return SAPP_KEYCODE_F24; + case XK_F25: return SAPP_KEYCODE_F25; + + case XK_KP_Divide: return SAPP_KEYCODE_KP_DIVIDE; + case XK_KP_Multiply: return SAPP_KEYCODE_KP_MULTIPLY; + case XK_KP_Subtract: return SAPP_KEYCODE_KP_SUBTRACT; + case XK_KP_Add: return SAPP_KEYCODE_KP_ADD; + + case XK_KP_Insert: return SAPP_KEYCODE_KP_0; + case XK_KP_End: return SAPP_KEYCODE_KP_1; + case XK_KP_Down: return SAPP_KEYCODE_KP_2; + case XK_KP_Page_Down: return SAPP_KEYCODE_KP_3; + case XK_KP_Left: return SAPP_KEYCODE_KP_4; + case XK_KP_Begin: return SAPP_KEYCODE_KP_5; + case XK_KP_Right: return SAPP_KEYCODE_KP_6; + case XK_KP_Home: return SAPP_KEYCODE_KP_7; + case XK_KP_Up: return SAPP_KEYCODE_KP_8; + case XK_KP_Page_Up: return SAPP_KEYCODE_KP_9; + case XK_KP_Delete: return SAPP_KEYCODE_KP_DECIMAL; + case XK_KP_Equal: return SAPP_KEYCODE_KP_EQUAL; + case XK_KP_Enter: return SAPP_KEYCODE_KP_ENTER; + + case XK_a: return SAPP_KEYCODE_A; + case XK_b: return SAPP_KEYCODE_B; + case XK_c: return SAPP_KEYCODE_C; + case XK_d: return SAPP_KEYCODE_D; + case XK_e: return SAPP_KEYCODE_E; + case XK_f: return SAPP_KEYCODE_F; + case XK_g: return SAPP_KEYCODE_G; + case XK_h: return SAPP_KEYCODE_H; + case XK_i: return SAPP_KEYCODE_I; + case XK_j: return SAPP_KEYCODE_J; + case XK_k: return SAPP_KEYCODE_K; + case XK_l: return SAPP_KEYCODE_L; + case XK_m: return SAPP_KEYCODE_M; + case XK_n: return SAPP_KEYCODE_N; + case XK_o: return SAPP_KEYCODE_O; + case XK_p: return SAPP_KEYCODE_P; + case XK_q: return SAPP_KEYCODE_Q; + case XK_r: return SAPP_KEYCODE_R; + case XK_s: return SAPP_KEYCODE_S; + case XK_t: return SAPP_KEYCODE_T; + case XK_u: return SAPP_KEYCODE_U; + case XK_v: return SAPP_KEYCODE_V; + case XK_w: return SAPP_KEYCODE_W; + case XK_x: return SAPP_KEYCODE_X; + case XK_y: return SAPP_KEYCODE_Y; + case XK_z: return SAPP_KEYCODE_Z; + case XK_1: return SAPP_KEYCODE_1; + case XK_2: return SAPP_KEYCODE_2; + case XK_3: return SAPP_KEYCODE_3; + case XK_4: return SAPP_KEYCODE_4; + case XK_5: return SAPP_KEYCODE_5; + case XK_6: return SAPP_KEYCODE_6; + case XK_7: return SAPP_KEYCODE_7; + case XK_8: return SAPP_KEYCODE_8; + case XK_9: return SAPP_KEYCODE_9; + case XK_0: return SAPP_KEYCODE_0; + case XK_space: return SAPP_KEYCODE_SPACE; + case XK_minus: return SAPP_KEYCODE_MINUS; + case XK_equal: return SAPP_KEYCODE_EQUAL; + case XK_bracketleft: return SAPP_KEYCODE_LEFT_BRACKET; + case XK_bracketright: return SAPP_KEYCODE_RIGHT_BRACKET; + case XK_backslash: return SAPP_KEYCODE_BACKSLASH; + case XK_semicolon: return SAPP_KEYCODE_SEMICOLON; + case XK_apostrophe: return SAPP_KEYCODE_APOSTROPHE; + case XK_grave: return SAPP_KEYCODE_GRAVE_ACCENT; + case XK_comma: return SAPP_KEYCODE_COMMA; + case XK_period: return SAPP_KEYCODE_PERIOD; + case XK_slash: return SAPP_KEYCODE_SLASH; + case XK_less: return SAPP_KEYCODE_WORLD_1; /* At least in some layouts... */ + default: return SAPP_KEYCODE_INVALID; + } +} + +_SOKOL_PRIVATE int32_t _sapp_x11_keysym_to_unicode(KeySym keysym) { + int min = 0; + int max = sizeof(_sapp_x11_keysymtab) / sizeof(struct _sapp_x11_codepair) - 1; + int mid; + + /* First check for Latin-1 characters (1:1 mapping) */ + if ((keysym >= 0x0020 && keysym <= 0x007e) || + (keysym >= 0x00a0 && keysym <= 0x00ff)) + { + return keysym; + } + + /* Also check for directly encoded 24-bit UCS characters */ + if ((keysym & 0xff000000) == 0x01000000) { + return keysym & 0x00ffffff; + } + + /* Binary search in table */ + while (max >= min) { + mid = (min + max) / 2; + if (_sapp_x11_keysymtab[mid].keysym < keysym) { + min = mid + 1; + } + else if (_sapp_x11_keysymtab[mid].keysym > keysym) { + max = mid - 1; + } + else { + return _sapp_x11_keysymtab[mid].ucs; + } + } + + /* No matching Unicode value found */ + return -1; +} + +// XLib manual says keycodes are in the range [8, 255] inclusive. +// https://tronche.com/gui/x/xlib/input/keyboard-encoding.html +static bool _sapp_x11_keycodes[256]; + +_SOKOL_PRIVATE void _sapp_x11_process_event(XEvent* event) { + switch (event->type) { + case KeyPress: + { + int keycode = event->xkey.keycode; + const sapp_keycode key = _sapp_x11_translate_key(keycode); + bool repeat = _sapp_x11_keycodes[keycode & 0xFF]; + _sapp_x11_keycodes[keycode & 0xFF] = true; + const uint32_t mods = _sapp_x11_mod(event->xkey.state); + if (key != SAPP_KEYCODE_INVALID) { + _sapp_x11_key_event(SAPP_EVENTTYPE_KEY_DOWN, key, repeat, mods); + } + KeySym keysym; + XLookupString(&event->xkey, NULL, 0, &keysym, NULL); + int32_t chr = _sapp_x11_keysym_to_unicode(keysym); + if (chr > 0) { + _sapp_x11_char_event((uint32_t)chr, repeat, mods); + } + } + break; + case KeyRelease: + { + int keycode = event->xkey.keycode; + const sapp_keycode key = _sapp_x11_translate_key(keycode); + _sapp_x11_keycodes[keycode & 0xFF] = false; + if (key != SAPP_KEYCODE_INVALID) { + const uint32_t mods = _sapp_x11_mod(event->xkey.state); + _sapp_x11_key_event(SAPP_EVENTTYPE_KEY_UP, key, false, mods); + } + } + break; + case ButtonPress: + { + const sapp_mousebutton btn = _sapp_x11_translate_button(event); + const uint32_t mods = _sapp_x11_mod(event->xbutton.state); + if (btn != SAPP_MOUSEBUTTON_INVALID) { + _sapp_x11_mouse_event(SAPP_EVENTTYPE_MOUSE_DOWN, btn, mods); + } + else { + /* might be a scroll event */ + switch (event->xbutton.button) { + case 4: _sapp_x11_scroll_event(0.0f, 1.0f, mods); break; + case 5: _sapp_x11_scroll_event(0.0f, -1.0f, mods); break; + case 6: _sapp_x11_scroll_event(1.0f, 0.0f, mods); break; + case 7: _sapp_x11_scroll_event(-1.0f, 0.0f, mods); break; + } + } + } + break; + case ButtonRelease: + { + const sapp_mousebutton btn = _sapp_x11_translate_button(event); + if (btn != SAPP_MOUSEBUTTON_INVALID) { + _sapp_x11_mouse_event(SAPP_EVENTTYPE_MOUSE_UP, btn, _sapp_x11_mod(event->xbutton.state)); + } + } + break; + case EnterNotify: + _sapp_x11_mouse_event(SAPP_EVENTTYPE_MOUSE_ENTER, SAPP_MOUSEBUTTON_INVALID, _sapp_x11_mod(event->xcrossing.state)); + break; + case LeaveNotify: + _sapp_x11_mouse_event(SAPP_EVENTTYPE_MOUSE_LEAVE, SAPP_MOUSEBUTTON_INVALID, _sapp_x11_mod(event->xcrossing.state)); + break; + case MotionNotify: + _sapp.mouse_x = event->xmotion.x; + _sapp.mouse_y = event->xmotion.y; + _sapp_x11_mouse_event(SAPP_EVENTTYPE_MOUSE_MOVE, SAPP_MOUSEBUTTON_INVALID, _sapp_x11_mod(event->xmotion.state)); + break; + case ConfigureNotify: + if ((event->xconfigure.width != _sapp.window_width) || (event->xconfigure.height != _sapp.window_height)) { + _sapp.window_width = event->xconfigure.width; + _sapp.window_height = event->xconfigure.height; + _sapp.framebuffer_width = _sapp.window_width; + _sapp.framebuffer_height = _sapp.window_height; + _sapp_x11_app_event(SAPP_EVENTTYPE_RESIZED); + } + break; + case PropertyNotify: + if (event->xproperty.state == PropertyNewValue) { + if (event->xproperty.atom == _sapp_x11_WM_STATE) { + const int state = _sapp_x11_get_window_state(); + if (state != _sapp_x11_window_state) { + _sapp_x11_window_state = state; + if (state == IconicState) { + _sapp_x11_app_event(SAPP_EVENTTYPE_ICONIFIED); + } + else if (state == NormalState) { + _sapp_x11_app_event(SAPP_EVENTTYPE_RESTORED); + } + } + } + } + break; + case ClientMessage: + if (event->xclient.message_type == _sapp_x11_WM_PROTOCOLS) { + const Atom protocol = event->xclient.data.l[0]; + if (protocol == _sapp_x11_WM_DELETE_WINDOW) { + _sapp.quit_requested = true; + } + } + break; + case DestroyNotify: + break; + } +} + +_SOKOL_PRIVATE void _sapp_run(const sapp_desc* desc) { + _sapp_init_state(desc); + _sapp_x11_window_state = NormalState; + + XInitThreads(); + XrmInitialize(); + _sapp_x11_display = XOpenDisplay(NULL); + if (!_sapp_x11_display) { + _sapp_fail("XOpenDisplay() failed!\n"); + } + _sapp_x11_screen = DefaultScreen(_sapp_x11_display); + _sapp_x11_root = DefaultRootWindow(_sapp_x11_display); + XkbSetDetectableAutoRepeat(_sapp_x11_display, true, NULL); + _sapp_x11_query_system_dpi(); + _sapp.dpi_scale = _sapp_x11_dpi / 96.0f; + _sapp_x11_init_extensions(); + _sapp_glx_init(); + Visual* visual = 0; + int depth = 0; + _sapp_glx_choose_visual(&visual, &depth); + _sapp_x11_create_window(visual, depth); + _sapp_glx_create_context(); + _sapp.valid = true; + _sapp_x11_show_window(); + _sapp_glx_swapinterval(_sapp.swap_interval); + XFlush(_sapp_x11_display); + while (!_sapp.quit_ordered) { + _sapp_glx_make_current(); + int count = XPending(_sapp_x11_display); + while (count--) { + XEvent event; + XNextEvent(_sapp_x11_display, &event); + _sapp_x11_process_event(&event); + } + _sapp_frame(); + _sapp_glx_swap_buffers(); + XFlush(_sapp_x11_display); + /* handle quit-requested, either from window or from sapp_request_quit() */ + if (_sapp.quit_requested && !_sapp.quit_ordered) { + /* give user code a chance to intervene */ + _sapp_x11_app_event(SAPP_EVENTTYPE_QUIT_REQUESTED); + /* if user code hasn't intervened, quit the app */ + if (_sapp.quit_requested) { + _sapp.quit_ordered = true; + } + } + } + _sapp_call_cleanup(); + _sapp_glx_destroy_context(); + _sapp_x11_destroy_window(); + XCloseDisplay(_sapp_x11_display); +} + +#if !defined(SOKOL_NO_ENTRY) +int main(int argc, char* argv[]) { + sapp_desc desc = sokol_main(argc, argv); + _sapp_run(&desc); + return 0; +} +#endif /* SOKOL_NO_ENTRY */ +#endif /* LINUX */ + +/*== PUBLIC API FUNCTIONS ====================================================*/ +#if defined(SOKOL_NO_ENTRY) + +SOKOL_API_IMPL int sapp_run(const sapp_desc* desc) { + SOKOL_ASSERT(desc); + _sapp_run(desc); + return 0; +} + +/* this is just a stub so the linker doesn't complain */ +sapp_desc sokol_main(int argc, char* argv[]) { + _SOKOL_UNUSED(argc); + _SOKOL_UNUSED(argv); + sapp_desc desc; + memset(&desc, 0, sizeof(desc)); + return desc; +} +#else +/* likewise, in normal mode, sapp_run() is just an empty stub */ +SOKOL_API_IMPL int sapp_run(const sapp_desc* desc) { + _SOKOL_UNUSED(desc); + return 0; +} +#endif + +SOKOL_API_IMPL bool sapp_isvalid(void) { + return _sapp.valid; +} + +SOKOL_API_IMPL void* sapp_userdata(void) { + return _sapp.desc.user_data; +} + +SOKOL_API_IMPL sapp_desc sapp_query_desc(void) { + return _sapp.desc; +} + +SOKOL_API_IMPL uint64_t sapp_frame_count(void) { + return _sapp.frame_count; +} + +SOKOL_API_IMPL int sapp_width(void) { + return (_sapp.framebuffer_width > 0) ? _sapp.framebuffer_width : 1; +} + +SOKOL_API_IMPL int sapp_height(void) { + return (_sapp.framebuffer_height > 0) ? _sapp.framebuffer_height : 1; +} + +SOKOL_API_IMPL bool sapp_high_dpi(void) { + return _sapp.desc.high_dpi && (_sapp.dpi_scale > 1.5f); +} + +SOKOL_API_IMPL float sapp_dpi_scale(void) { + return _sapp.dpi_scale; +} + +SOKOL_API_IMPL bool sapp_gles2(void) { + return _sapp.gles2_fallback; +} + +SOKOL_API_IMPL void sapp_show_keyboard(bool shown) { + #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE + _sapp_ios_show_keyboard(shown); + #elif defined(__EMSCRIPTEN__) + _sapp_emsc_show_keyboard(shown); + #elif defined(__ANDROID__) + _sapp_android_show_keyboard(shown); + #else + _SOKOL_UNUSED(shown); + #endif +} + +SOKOL_API_IMPL bool sapp_keyboard_shown(void) { + return _sapp.onscreen_keyboard_shown; +} + +SOKOL_API_IMPL void sapp_show_mouse(bool shown) { + #if defined(_WIN32) + _sapp_win32_show_mouse(shown); + #else + _SOKOL_UNUSED(shown); + #endif +} + +SOKOL_API_IMPL bool sapp_mouse_shown(void) { + #if defined(_WIN32) + return _sapp_win32_mouse_shown(); + #else + return false; + #endif +} + +SOKOL_API_IMPL void sapp_request_quit(void) { + _sapp.quit_requested = true; +} + +SOKOL_API_IMPL void sapp_cancel_quit(void) { + _sapp.quit_requested = false; +} + +SOKOL_API_IMPL void sapp_quit(void) { + _sapp.quit_ordered = true; +} + +SOKOL_API_IMPL const void* sapp_metal_get_device(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_METAL) + const void* obj = (__bridge const void*) _sapp_mtl_device_obj; + SOKOL_ASSERT(obj); + return obj; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_metal_get_renderpass_descriptor(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_METAL) + const void* obj = (__bridge const void*) [_sapp_view_obj currentRenderPassDescriptor]; + SOKOL_ASSERT(obj); + return obj; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_metal_get_drawable(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_METAL) + const void* obj = (__bridge const void*) [_sapp_view_obj currentDrawable]; + SOKOL_ASSERT(obj); + return obj; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_macos_get_window(void) { + #if defined(__APPLE__) && !TARGET_OS_IPHONE + const void* obj = (__bridge const void*) _sapp_macos_window_obj; + SOKOL_ASSERT(obj); + return obj; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_ios_get_window(void) { + #if defined(__APPLE__) && TARGET_OS_IPHONE + const void* obj = (__bridge const void*) _sapp_ios_window_obj; + SOKOL_ASSERT(obj); + return obj; + #else + return 0; + #endif + +} + +SOKOL_API_IMPL const void* sapp_d3d11_get_device(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_D3D11) + return _sapp_d3d11_device; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_d3d11_get_device_context(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_D3D11) + return _sapp_d3d11_device_context; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_d3d11_get_render_target_view(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_D3D11) + return _sapp_d3d11_rtv; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_d3d11_get_depth_stencil_view(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(SOKOL_D3D11) + return _sapp_d3d11_dsv; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_win32_get_hwnd(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(_WIN32) + return _sapp_win32_hwnd; + #else + return 0; + #endif +} + +SOKOL_API_IMPL const void* sapp_android_get_native_activity(void) { + SOKOL_ASSERT(_sapp.valid); + #if defined(__ANDROID__) + return (void*)_sapp_android_state.activity; + #else + return 0; + #endif +} + +SOKOL_API_IMPL void sapp_html5_ask_leave_site(bool ask) { + _sapp.html5_ask_leave_site = ask; +} + +#undef _sapp_def + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif /* SOKOL_IMPL */ diff --git a/sokol-app-sys/external/sokol/sokol_args.h b/sokol-app-sys/external/sokol/sokol_args.h new file mode 100644 index 00000000..3d11d981 --- /dev/null +++ b/sokol-app-sys/external/sokol/sokol_args.h @@ -0,0 +1,768 @@ +#ifndef SOKOL_ARGS_INCLUDED +/* + sokol_args.h -- cross-platform key/value arg-parsing for web and native + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + Optionally provide the following defines with your own implementations: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_LOG(msg) - your own logging functions (default: puts(msg)) + SOKOL_CALLOC(n,s) - your own calloc() implementation (default: calloc(n,s)) + SOKOL_FREE(p) - your own free() implementation (default: free(p)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + + If sokol_args.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + OVERVIEW + ======== + sokol_args.h provides a simple unified argument parsing API for WebAssembly and + native apps. + + When running as WebAssembly app, arguments are taken from the page URL: + + https://floooh.github.io/tiny8bit/kc85.html?type=kc85_3&mod=m022&snapshot=kc85/jungle.kcc + + The same arguments provided to a command line app: + + kc85 type=kc85_3 mod=m022 snapshot=kc85/jungle.kcc + + ARGUMENT FORMATTING + =================== + On the web platform, arguments must be formatted as a valid URL query string + with 'percent encoding' used for special characters. + + Strings are expected to be UTF-8 encoded (although sokol_args.h doesn't + contain any special UTF-8 handling). See below on how to obtain + UTF-8 encoded argc/argv values on Windows when using WinMain() as + entry point. + + On native platforms the following rules must be followed: + + Arguments have the general form + + key=value + + Key/value pairs are separated by 'whitespace', valid whitespace + characters are space and tab. + + Whitespace characters in front and after the separating '=' character + are ignored: + + key = value + + ...is the same as + + key=value + + The 'key' string must be a simple string without escape sequences or whitespace. + + Currently 'single keys' without values are not allowed, but may be + in the future. + + The 'value' string can be quoted, and quoted value strings can contain + whitespace: + + key = 'single-quoted value' + key = "double-quoted value" + + Single-quoted value strings can contain double quotes, and vice-versa: + + key = 'single-quoted value "can contain double-quotes"' + key = "double-quoted value 'can contain single-quotes'" + + Note that correct quoting can be tricky on some shells, since command + shells may remove quotes, unless they're escaped. + + Value strings can contain a small selection of escape sequences: + + \n - newline + \r - carriage return + \t - tab + \\ - escaped backslash + + (more escape codes may be added in the future). + + CODE EXAMPLE + ============ + + int main(int argc, char* argv[]) { + // initialize sokol_args with default parameters + sargs_setup(&(sargs_desc){ + .argc = argc, + .argv = argv + }); + + // check if a key exists... + if (sargs_exists("bla")) { + ... + } + + // get value string for key, if not found, return empty string "" + const char* val0 = sargs_value("bla"); + + // get value string for key, or default string if key not found + const char* val1 = sargs_value_def("bla", "default_value"); + + // check if a key matches expected value + if (sargs_equals("type", "kc85_4")) { + ... + } + + // check if a key's value is "true", "yes" or "on" + if (sargs_boolean("joystick_enabled")) { + ... + } + + // iterate over keys and values + for (int i = 0; i < sargs_num_args(); i++) { + printf("key: %s, value: %s\n", sargs_key_at(i), sargs_value_at(i)); + } + + // lookup argument index by key string, will return -1 if key + // is not found, sargs_key_at() and sargs_value_at() will return + // an empty string for invalid indices + int index = sargs_find("bla"); + printf("key: %s, value: %s\n", sargs_key_at(index), sargs_value_at(index)); + + // shutdown sokol-args + sargs_shutdown(); + } + + WINMAIN AND ARGC / ARGV + ======================= + On Windows with WinMain() based apps, use the __argc and __argv global + variables provided by Windows. These are compatible with main(argc, argv) + and have already been converted to UTF-8 by Windows: + + int WINAPI WinMain(...) { + sargs_setup(&(sargs_desc){ + .argc = __argc, + .argv = __argv + }); + } + + (this is also what sokol_app.h uses btw) + + API DOCUMENTATION + ================= + void sargs_setup(const sargs_desc* desc) + Initialize sokol_args, desc contains the following configuration + parameters: + int argc - the main function's argc parameter + char** argv - the main function's argv parameter + int max_args - max number of key/value pairs, default is 16 + int buf_size - size of the internal string buffer, default is 16384 + + Note that on the web, argc and argv will be ignored and the arguments + will be taken from the page URL instead. + + sargs_setup() will allocate 2 memory chunks: one for keeping track + of the key/value args of size 'max_args*8', and a string buffer + of size 'buf_size'. + + void sargs_shutdown(void) + Shutdown sokol-args and free any allocated memory. + + bool sargs_isvalid(void) + Return true between sargs_setup() and sargs_shutdown() + + bool sargs_exists(const char* key) + Test if a key arg exists. + + const char* sargs_value(const char* key) + Return value associated with key. Returns an empty + string ("") if the key doesn't exist. + + const char* sargs_value_def(const char* key, const char* default) + Return value associated with key, or the provided default + value if the value doesn't exist. + + bool sargs_equals(const char* key, const char* val); + Return true if the value associated with key matches + the 'val' argument. + + bool sargs_boolean(const char* key) + Return true if the value string of 'key' is one + of 'true', 'yes', 'on'. + + int sargs_find(const char* key) + Find argument by key name and return its index, or -1 if not found. + + int sargs_num_args(void) + Return number of key/value pairs. + + const char* sargs_key_at(int index) + Return the key name of argument at index. Returns empty string if + is index is outside range. + + const char* sargs_value_at(int index) + Return the value of argument at index. Returns empty string + if index is outside range. + + TODO + ==== + - parsing errors? + + LICENSE + ======= + + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_ARGS_INCLUDED (1) +#include +#include + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct sargs_desc { + int argc; + char** argv; + int max_args; + int buf_size; +} sargs_desc; + +/* setup sokol-args */ +SOKOL_API_DECL void sargs_setup(const sargs_desc* desc); +/* shutdown sokol-args */ +SOKOL_API_DECL void sargs_shutdown(void); +/* true between sargs_setup() and sargs_shutdown() */ +SOKOL_API_DECL bool sargs_isvalid(void); +/* test if an argument exists by key name */ +SOKOL_API_DECL bool sargs_exists(const char* key); +/* get value by key name, return empty string if key doesn't exist */ +SOKOL_API_DECL const char* sargs_value(const char* key); +/* get value by key name, return provided default if key doesn't exist */ +SOKOL_API_DECL const char* sargs_value_def(const char* key, const char* def); +/* return true if val arg matches the value associated with key */ +SOKOL_API_DECL bool sargs_equals(const char* key, const char* val); +/* return true if key's value is "true", "yes" or "on" */ +SOKOL_API_DECL bool sargs_boolean(const char* key); +/* get index of arg by key name, return -1 if not exists */ +SOKOL_API_DECL int sargs_find(const char* key); +/* get number of parsed arguments */ +SOKOL_API_DECL int sargs_num_args(void); +/* get key name of argument at index, or empty string */ +SOKOL_API_DECL const char* sargs_key_at(int index); +/* get value string of argument at index, or empty string */ +SOKOL_API_DECL const char* sargs_value_at(int index); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif // SOKOL_ARGS_INCLUDED + +/*--- IMPLEMENTATION ---------------------------------------------------------*/ +#ifdef SOKOL_IMPL +#define SOKOL_ARGS_IMPL_INCLUDED (1) +#include /* memset, strcmp */ + +#if defined(__EMSCRIPTEN__) +#include +#endif + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#if !defined(SOKOL_CALLOC) && !defined(SOKOL_FREE) + #include +#endif +#if !defined(SOKOL_CALLOC) + #define SOKOL_CALLOC(n,s) calloc(n,s) +#endif +#if !defined(SOKOL_FREE) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #else + #define SOKOL_LOG(s) + #endif +#endif + +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif + +#define _sargs_def(val, def) (((val) == 0) ? (def) : (val)) + +#define _SARGS_MAX_ARGS_DEF (16) +#define _SARGS_BUF_SIZE_DEF (16*1024) + +/* parser state (no parser needed on emscripten) */ +#if !defined(__EMSCRIPTEN__) +#define _SARGS_EXPECT_KEY (1<<0) +#define _SARGS_EXPECT_SEP (1<<1) +#define _SARGS_EXPECT_VAL (1<<2) +#define _SARGS_PARSING_KEY (1<<3) +#define _SARGS_PARSING_VAL (1<<4) +#define _SARGS_ERROR (1<<5) +#endif + +/* a key/value pair struct */ +typedef struct { + int key; /* index to start of key string in buf */ + int val; /* index to start of value string in buf */ +} _sargs_kvp_t; + +/* sokol-args state */ +typedef struct { + int max_args; /* number of key/value pairs in args array */ + int num_args; /* number of valid items in args array */ + _sargs_kvp_t* args; /* key/value pair array */ + int buf_size; /* size of buffer in bytes */ + int buf_pos; /* current buffer position */ + char* buf; /* character buffer, first char is reserved and zero for 'empty string' */ + bool valid; + + /* arg parsing isn't needed on emscripten */ + #if !defined(__EMSCRIPTEN__) + uint32_t parse_state; + char quote; /* current quote char, 0 if not in a quote */ + bool in_escape; /* currently in an escape sequence */ + #endif +} _sargs_state_t; +static _sargs_state_t _sargs; + +/*== PRIVATE IMPLEMENTATION FUNCTIONS ========================================*/ + +_SOKOL_PRIVATE void _sargs_putc(char c) { + if ((_sargs.buf_pos+2) < _sargs.buf_size) { + _sargs.buf[_sargs.buf_pos++] = c; + } +} + +_SOKOL_PRIVATE const char* _sargs_str(int index) { + SOKOL_ASSERT((index >= 0) && (index < _sargs.buf_size)); + return &_sargs.buf[index]; +} + +/*-- argument parser functions (not required on emscripten) ------------------*/ +#if !defined(__EMSCRIPTEN__) +_SOKOL_PRIVATE void _sargs_expect_key(void) { + _sargs.parse_state = _SARGS_EXPECT_KEY; +} + +_SOKOL_PRIVATE bool _sargs_key_expected(void) { + return 0 != (_sargs.parse_state & _SARGS_EXPECT_KEY); +} + +_SOKOL_PRIVATE void _sargs_expect_val(void) { + _sargs.parse_state = _SARGS_EXPECT_VAL; +} + +_SOKOL_PRIVATE bool _sargs_val_expected(void) { + return 0 != (_sargs.parse_state & _SARGS_EXPECT_VAL); +} + +_SOKOL_PRIVATE void _sargs_expect_sep(void) { + _sargs.parse_state = _SARGS_EXPECT_SEP; +} + +_SOKOL_PRIVATE bool _sargs_sep_expected(void) { + return 0 != (_sargs.parse_state & _SARGS_EXPECT_SEP); +} + +_SOKOL_PRIVATE bool _sargs_any_expected(void) { + return 0 != (_sargs.parse_state & (_SARGS_EXPECT_KEY | _SARGS_EXPECT_VAL | _SARGS_EXPECT_SEP)); +} + +_SOKOL_PRIVATE bool _sargs_is_separator(char c) { + return c == '='; +} + +_SOKOL_PRIVATE bool _sargs_is_quote(char c) { + if (0 == _sargs.quote) { + return (c == '\'') || (c == '"'); + } + else { + return c == _sargs.quote; + } +} + +_SOKOL_PRIVATE void _sargs_begin_quote(char c) { + _sargs.quote = c; +} + +_SOKOL_PRIVATE void _sargs_end_quote(void) { + _sargs.quote = 0; +} + +_SOKOL_PRIVATE bool _sargs_in_quotes(void) { + return 0 != _sargs.quote; +} + +_SOKOL_PRIVATE bool _sargs_is_whitespace(char c) { + return !_sargs_in_quotes() && ((c == ' ') || (c == '\t')); +} + +_SOKOL_PRIVATE void _sargs_start_key(void) { + SOKOL_ASSERT(_sargs.num_args < _sargs.max_args); + _sargs.parse_state = _SARGS_PARSING_KEY; + _sargs.args[_sargs.num_args].key = _sargs.buf_pos; +} + +_SOKOL_PRIVATE void _sargs_end_key(void) { + SOKOL_ASSERT(_sargs.num_args < _sargs.max_args); + _sargs_putc(0); + _sargs.parse_state = 0; +} + +_SOKOL_PRIVATE bool _sargs_parsing_key(void) { + return 0 != (_sargs.parse_state & _SARGS_PARSING_KEY); +} + +_SOKOL_PRIVATE void _sargs_start_val(void) { + SOKOL_ASSERT(_sargs.num_args < _sargs.max_args); + _sargs.parse_state = _SARGS_PARSING_VAL; + _sargs.args[_sargs.num_args].val = _sargs.buf_pos; +} + +_SOKOL_PRIVATE void _sargs_end_val(void) { + SOKOL_ASSERT(_sargs.num_args < _sargs.max_args); + _sargs_putc(0); + _sargs.num_args++; + _sargs.parse_state = 0; +} + +_SOKOL_PRIVATE bool _sargs_is_escape(char c) { + return '\\' == c; +} + +_SOKOL_PRIVATE void _sargs_start_escape(void) { + _sargs.in_escape = true; +} + +_SOKOL_PRIVATE bool _sargs_in_escape(void) { + return _sargs.in_escape; +} + +_SOKOL_PRIVATE char _sargs_escape(char c) { + switch (c) { + case 'n': return '\n'; + case 't': return '\t'; + case 'r': return '\r'; + case '\\': return '\\'; + default: return c; + } +} + +_SOKOL_PRIVATE void _sargs_end_escape(void) { + _sargs.in_escape = false; +} + +_SOKOL_PRIVATE bool _sargs_parsing_val(void) { + return 0 != (_sargs.parse_state & _SARGS_PARSING_VAL); +} + +_SOKOL_PRIVATE bool _sargs_parse_carg(const char* src) { + char c; + while (0 != (c = *src++)) { + if (_sargs_in_escape()) { + c = _sargs_escape(c); + _sargs_end_escape(); + } + else if (_sargs_is_escape(c)) { + _sargs_start_escape(); + continue; + } + if (_sargs_any_expected()) { + if (!_sargs_is_whitespace(c)) { + /* start of key, value or separator */ + if (_sargs_key_expected()) { + /* start of new key */ + _sargs_start_key(); + } + else if (_sargs_val_expected()) { + /* start of value */ + if (_sargs_is_quote(c)) { + _sargs_begin_quote(c); + continue; + } + _sargs_start_val(); + } + else { + /* separator */ + if (_sargs_is_separator(c)) { + _sargs_expect_val(); + continue; + } + } + } + else { + /* skip white space */ + continue; + } + } + else if (_sargs_parsing_key()) { + if (_sargs_is_whitespace(c) || _sargs_is_separator(c)) { + /* end of key string */ + _sargs_end_key(); + if (_sargs_is_separator(c)) { + _sargs_expect_val(); + } + else { + _sargs_expect_sep(); + } + continue; + } + } + else if (_sargs_parsing_val()) { + if (_sargs_in_quotes()) { + /* when in quotes, whitespace is a normal character + and a matching quote ends the value string + */ + if (_sargs_is_quote(c)) { + _sargs_end_quote(); + _sargs_end_val(); + _sargs_expect_key(); + continue; + } + } + else if (_sargs_is_whitespace(c)) { + /* end of value string (no quotes) */ + _sargs_end_val(); + _sargs_expect_key(); + continue; + } + } + _sargs_putc(c); + } + if (_sargs_parsing_key()) { + _sargs_end_key(); + _sargs_expect_sep(); + } + else if (_sargs_parsing_val() && !_sargs_in_quotes()) { + _sargs_end_val(); + _sargs_expect_key(); + } + return true; +} + +_SOKOL_PRIVATE bool _sargs_parse_cargs(int argc, const char** argv) { + _sargs_expect_key(); + bool retval = true; + for (int i = 1; i < argc; i++) { + retval &= _sargs_parse_carg(argv[i]); + } + _sargs.parse_state = 0; + return retval; +} +#endif /* __EMSCRIPTEN__ */ + +/*-- EMSCRIPTEN IMPLEMENTATION -----------------------------------------------*/ +#if defined(__EMSCRIPTEN__) + +#ifdef __cplusplus +extern "C" { +#endif +EMSCRIPTEN_KEEPALIVE void _sargs_add_kvp(const char* key, const char* val) { + SOKOL_ASSERT(_sargs.valid && key && val); + if (_sargs.num_args >= _sargs.max_args) { + return; + } + + /* copy key string */ + char c; + _sargs.args[_sargs.num_args].key = _sargs.buf_pos; + const char* ptr = key; + while (0 != (c = *ptr++)) { + _sargs_putc(c); + } + _sargs_putc(0); + + /* copy value string */ + _sargs.args[_sargs.num_args].val = _sargs.buf_pos; + ptr = val; + while (0 != (c = *ptr++)) { + _sargs_putc(c); + } + _sargs_putc(0); + + _sargs.num_args++; +} +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/* JS function to extract arguments from the page URL */ +EM_JS(void, sargs_js_parse_url, (void), { + var params = new URLSearchParams(window.location.search).entries(); + for (var p = params.next(); !p.done; p = params.next()) { + var key = p.value[0]; + var val = p.value[1]; + var res = ccall('_sargs_add_kvp', 'void', ['string','string'], [key,val]); + } +}); + +#endif /* EMSCRIPTEN */ + +/*== PUBLIC IMPLEMENTATION FUNCTIONS =========================================*/ +SOKOL_API_IMPL void sargs_setup(const sargs_desc* desc) { + SOKOL_ASSERT(desc); + memset(&_sargs, 0, sizeof(_sargs)); + _sargs.max_args = _sargs_def(desc->max_args, _SARGS_MAX_ARGS_DEF); + _sargs.buf_size = _sargs_def(desc->buf_size, _SARGS_BUF_SIZE_DEF); + SOKOL_ASSERT(_sargs.buf_size > 8); + _sargs.args = (_sargs_kvp_t*) SOKOL_CALLOC(_sargs.max_args, sizeof(_sargs_kvp_t)); + _sargs.buf = (char*) SOKOL_CALLOC(_sargs.buf_size, sizeof(char)); + /* the first character in buf is reserved and always zero, this is the 'empty string' */ + _sargs.buf_pos = 1; + #if defined(__EMSCRIPTEN__) + /* on emscripten, ignore argc/argv, and parse the page URL instead */ + sargs_js_parse_url(); + #else + /* on native platform, parse argc/argv */ + _sargs_parse_cargs(desc->argc, (const char**) desc->argv); + #endif + _sargs.valid = true; +} + +SOKOL_API_IMPL void sargs_shutdown(void) { + SOKOL_ASSERT(_sargs.valid); + if (_sargs.args) { + SOKOL_FREE(_sargs.args); + _sargs.args = 0; + } + if (_sargs.buf) { + SOKOL_FREE(_sargs.buf); + _sargs.buf = 0; + } + _sargs.valid = false; +} + +SOKOL_API_IMPL bool sargs_isvalid(void) { + return _sargs.valid; +} + +SOKOL_API_IMPL int sargs_find(const char* key) { + SOKOL_ASSERT(_sargs.valid && key); + for (int i = 0; i < _sargs.num_args; i++) { + if (0 == strcmp(_sargs_str(_sargs.args[i].key), key)) { + return i; + } + } + return -1; +} + +SOKOL_API_IMPL int sargs_num_args(void) { + SOKOL_ASSERT(_sargs.valid); + return _sargs.num_args; +} + +SOKOL_API_IMPL const char* sargs_key_at(int index) { + SOKOL_ASSERT(_sargs.valid); + if ((index >= 0) && (index < _sargs.num_args)) { + return _sargs_str(_sargs.args[index].key); + } + else { + /* index 0 is always the empty string */ + return _sargs_str(0); + } +} + +SOKOL_API_IMPL const char* sargs_value_at(int index) { + SOKOL_ASSERT(_sargs.valid); + if ((index >= 0) && (index < _sargs.num_args)) { + return _sargs_str(_sargs.args[index].val); + } + else { + /* index 0 is always the empty string */ + return _sargs_str(0); + } +} + +SOKOL_API_IMPL bool sargs_exists(const char* key) { + SOKOL_ASSERT(_sargs.valid && key); + return -1 != sargs_find(key); +} + +SOKOL_API_IMPL const char* sargs_value(const char* key) { + SOKOL_ASSERT(_sargs.valid && key); + return sargs_value_at(sargs_find(key)); +} + +SOKOL_API_IMPL const char* sargs_value_def(const char* key, const char* def) { + SOKOL_ASSERT(_sargs.valid && key && def); + int arg_index = sargs_find(key); + if (-1 != arg_index) { + return sargs_value_at(arg_index); + } + else { + return def; + } +} + +SOKOL_API_IMPL bool sargs_equals(const char* key, const char* val) { + SOKOL_ASSERT(_sargs.valid && key && val); + return 0 == strcmp(sargs_value(key), val); +} + +SOKOL_API_IMPL bool sargs_boolean(const char* key) { + const char* val = sargs_value(key); + return (0 == strcmp("true", val)) || + (0 == strcmp("yes", val)) || + (0 == strcmp("on", val)); +} + +#endif /* SOKOL_IMPL */ diff --git a/sokol-app-sys/external/sokol/sokol_audio.h b/sokol-app-sys/external/sokol/sokol_audio.h new file mode 100644 index 00000000..3c21e7c7 --- /dev/null +++ b/sokol-app-sys/external/sokol/sokol_audio.h @@ -0,0 +1,1729 @@ +#ifndef SOKOL_AUDIO_INCLUDED +/* + sokol_audio.h -- cross-platform audio-streaming API + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + Optionally provide the following defines with your own implementations: + + SOKOL_DUMMY_BACKEND - use a dummy backend + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_LOG(msg) - your own logging function (default: puts(msg)) + SOKOL_MALLOC(s) - your own malloc() implementation (default: malloc(s)) + SOKOL_FREE(p) - your own free() implementation (default: free(p)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + + SAUDIO_RING_MAX_SLOTS - max number of slots in the push-audio ring buffer (default 1024) + + If sokol_audio.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + FEATURE OVERVIEW + ================ + You provide a mono- or stereo-stream of 32-bit float samples, which + Sokol Audio feeds into platform-specific audio backends: + + - Windows: WASAPI + - Linux: ALSA (link with asound) + - macOS/iOS: CoreAudio (link with AudioToolbox) + - emscripten: WebAudio with ScriptProcessorNode + - Android: OpenSLES (link with OpenSLES) + + Sokol Audio will not do any buffer mixing or volume control, if you have + multiple independent input streams of sample data you need to perform the + mixing yourself before forwarding the data to Sokol Audio. + + There are two mutually exclusive ways to provide the sample data: + + 1. Callback model: You provide a callback function, which will be called + when Sokol Audio needs new samples. On all platforms except emscripten, + this function is called from a separate thread. + 2. Push model: Your code pushes small blocks of sample data from your + main loop or a thread you created. The pushed data is stored in + a ring buffer where it is pulled by the backend code when + needed. + + The callback model is preferred because it is the most direct way to + feed sample data into the audio backends and also has less moving parts + (there is no ring buffer between your code and the audio backend). + + Sometimes it is not possible to generate the audio stream directly in a + callback function running in a separate thread, for such cases Sokol Audio + provides the push-model as a convenience. + + SOKOL AUDIO AND SOLOUD + ====================== + The WASAPI, ALSA, OpenSLES and CoreAudio backend code has been taken from the + SoLoud library (with some modifications, so any bugs in there are most + likely my fault). If you need a more fully-featured audio solution, check + out SoLoud, it's excellent: + + https://github.com/jarikomppa/soloud + + GLOSSARY + ======== + - stream buffer: + The internal audio data buffer, usually provided by the backend API. The + size of the stream buffer defines the base latency, smaller buffers have + lower latency but may cause audio glitches. Bigger buffers reduce or + eliminate glitches, but have a higher base latency. + + - stream callback: + Optional callback function which is called by Sokol Audio when it + needs new samples. On Windows, macOS/iOS and Linux, this is called in + a separate thread, on WebAudio, this is called per-frame in the + browser thread. + + - channel: + A discrete track of audio data, currently 1-channel (mono) and + 2-channel (stereo) is supported and tested. + + - sample: + The magnitude of an audio signal on one channel at a given time. In + Sokol Audio, samples are 32-bit float numbers in the range -1.0 to + +1.0. + + - frame: + The tightly packed set of samples for all channels at a given time. + For mono 1 frame is 1 sample. For stereo, 1 frame is 2 samples. + + - packet: + In Sokol Audio, a small chunk of audio data that is moved from the + main thread to the audio streaming thread in order to decouple the + rate at which the main thread provides new audio data, and the + streaming thread consuming audio data. + + WORKING WITH SOKOL AUDIO + ======================== + First call saudio_setup() with your preferred audio playback options. + In most cases you can stick with the default values, these provide + a good balance between low-latency and glitch-free playback + on all audio backends. + + If you want to use the callback-model, you need to provide a stream + callback function either in saudio_desc.stream_cb or saudio_desc.stream_userdata_cb, + otherwise keep both function pointers zero-initialized. + + Use push model and default playback parameters: + + saudio_setup(&(saudio_desc){0}); + + Use stream callback model and default playback parameters: + + saudio_setup(&(saudio_desc){ + .stream_cb = my_stream_callback + }); + + The standard stream callback doesn't have a user data argument, if you want + that, use the alternative stream_userdata_cb and also set the user_data pointer: + + saudio_setup(&(saudio_desc){ + .stream_userdata_cb = my_stream_callback, + .user_data = &my_data + }); + + The following playback parameters can be provided through the + saudio_desc struct: + + General parameters (both for stream-callback and push-model): + + int sample_rate -- the sample rate in Hz, default: 44100 + int num_channels -- number of channels, default: 1 (mono) + int buffer_frames -- number of frames in streaming buffer, default: 2048 + + The stream callback prototype (either with or without userdata): + + void (*stream_cb)(float* buffer, int num_frames, int num_channels) + void (*stream_userdata_cb)(float* buffer, int num_frames, int num_channels, void* user_data) + Function pointer to the user-provide stream callback. + + Push-model parameters: + + int packet_frames -- number of frames in a packet, default: 128 + int num_packets -- number of packets in ring buffer, default: 64 + + The sample_rate and num_channels parameters are only hints for the audio + backend, it isn't guaranteed that those are the values used for actual + playback. + + To get the actual parameters, call the following functions after + saudio_setup(): + + int saudio_sample_rate(void) + int saudio_channels(void); + + It's unlikely that the number of channels will be different than requested, + but a different sample rate isn't uncommon. + + (NOTE: there's an yet unsolved issue when an audio backend might switch + to a different sample rate when switching output devices, for instance + plugging in a bluetooth headset, this case is currently not handled in + Sokol Audio). + + You can check if audio initialization was successful with + saudio_isvalid(). If backend initialization failed for some reason + (for instance when there's no audio device in the machine), this + will return false. Not checking for success won't do any harm, all + Sokol Audio function will silently fail when called after initialization + has failed, so apart from missing audio output, nothing bad will happen. + + Before your application exits, you should call + + saudio_shutdown(); + + This stops the audio thread (on Linux, Windows and macOS/iOS) and + properly shuts down the audio backend. + + THE STREAM CALLBACK MODEL + ========================= + To use Sokol Audio in stream-callback-mode, provide a callback function + like this in the saudio_desc struct when calling saudio_setup(): + + void stream_cb(float* buffer, int num_frames, int num_channels) { + ... + } + + Or the alternative version with a user-data argument: + + void stream_userdata_cb(float* buffer, int num_frames, int num_channels, void* user_data) { + my_data_t* my_data = (my_data_t*) user_data; + ... + } + + The job of the callback function is to fill the *buffer* with 32-bit + float sample values. + + To output silence, fill the buffer with zeros: + + void stream_cb(float* buffer, int num_frames, int num_channels) { + const int num_samples = num_frames * num_channels; + for (int i = 0; i < num_samples; i++) { + buffer[i] = 0.0f; + } + } + + For stereo output (num_channels == 2), the samples for the left + and right channel are interleaved: + + void stream_cb(float* buffer, int num_frames, int num_channels) { + assert(2 == num_channels); + for (int i = 0; i < num_frames; i++) { + buffer[2*i + 0] = ...; // left channel + buffer[2*i + 1] = ...; // right channel + } + } + + Please keep in mind that the stream callback function is running in a + separate thread, if you need to share data with the main thread you need + to take care yourself to make the access to the shared data thread-safe! + + THE PUSH MODEL + ============== + To use the push-model for providing audio data, simply don't set (keep + zero-initialized) the stream_cb field in the saudio_desc struct when + calling saudio_setup(). + + To provide sample data with the push model, call the saudio_push() + function at regular intervals (for instance once per frame). You can + call the saudio_expect() function to ask Sokol Audio how much room is + in the ring buffer, but if you provide a continuous stream of data + at the right sample rate, saudio_expect() isn't required (it's a simple + way to sync/throttle your sample generation code with the playback + rate though). + + With saudio_push() you may need to maintain your own intermediate sample + buffer, since pushing individual sample values isn't very efficient. + The following example is from the MOD player sample in + sokol-samples (https://github.com/floooh/sokol-samples): + + const int num_frames = saudio_expect(); + if (num_frames > 0) { + const int num_samples = num_frames * saudio_channels(); + read_samples(flt_buf, num_samples); + saudio_push(flt_buf, num_frames); + } + + Another option is to ignore saudio_expect(), and just push samples as they + are generated in small batches. In this case you *need* to generate the + samples at the right sample rate: + + The following example is taken from the Tiny Emulators project + (https://github.com/floooh/chips-test), this is for mono playback, + so (num_samples == num_frames): + + // tick the sound generator + if (ay38910_tick(&sys->psg)) { + // new sample is ready + sys->sample_buffer[sys->sample_pos++] = sys->psg.sample; + if (sys->sample_pos == sys->num_samples) { + // new sample packet is ready + saudio_push(sys->sample_buffer, sys->num_samples); + sys->sample_pos = 0; + } + } + + THE WEBAUDIO BACKEND + ==================== + The WebAudio backend is currently using a ScriptProcessorNode callback to + feed the sample data into WebAudio. ScriptProcessorNode has been + deprecated for a while because it is running from the main thread, with + the default initialization parameters it works 'pretty well' though. + Ultimately Sokol Audio will use Audio Worklets, but this requires a few + more things to fall into place (Audio Worklets implemented everywhere, + SharedArrayBuffers enabled again, and I need to figure out a 'low-cost' + solution in terms of implementation effort, since Audio Worklets are + a lot more complex than ScriptProcessorNode if the audio data needs to come + from the main thread). + + The WebAudio backend is automatically selected when compiling for + emscripten (__EMSCRIPTEN__ define exists). + + https://developers.google.com/web/updates/2017/12/audio-worklet + https://developers.google.com/web/updates/2018/06/audio-worklet-design-pattern + + "Blob URLs": https://www.html5rocks.com/en/tutorials/workers/basics/ + + THE COREAUDIO BACKEND + ===================== + The CoreAudio backend is selected on macOS and iOS (__APPLE__ is defined). + Since the CoreAudio API is implemented in C (not Objective-C) the + implementation part of Sokol Audio can be included into a C source file. + + For thread synchronisation, the CoreAudio backend will use the + pthread_mutex_* functions. + + The incoming floating point samples will be directly forwarded to + CoreAudio without further conversion. + + macOS and iOS applications that use Sokol Audio need to link with + the AudioToolbox framework. + + THE WASAPI BACKEND + ================== + The WASAPI backend is automatically selected when compiling on Windows + (_WIN32 is defined). + + For thread synchronisation a Win32 critical section is used. + + WASAPI may use a different size for its own streaming buffer then requested, + so the base latency may be slightly bigger. The current backend implementation + convertes the incoming floating point sample values to signed 16-bit + integers. + + The required Windows system DLLs are linked with #pragma comment(lib, ...), + so you shouldn't need to add additional linker libs in the build process + (otherwise this is a bug which should be fixed in sokol_audio.h). + + THE ALSA BACKEND + ================ + The ALSA backend is automatically selected when compiling on Linux + ('linux' is defined). + + For thread synchronisation, the pthread_mutex_* functions are used. + + Samples are directly forwarded to ALSA in 32-bit float format, no + further conversion is taking place. + + You need to link with the 'asound' library, and the + header must be present (usually both are installed with some sort + of ALSA development package). + + LICENSE + ======= + + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_AUDIO_INCLUDED (1) +#include +#include + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct saudio_desc { + int sample_rate; /* requested sample rate */ + int num_channels; /* number of channels, default: 1 (mono) */ + int buffer_frames; /* number of frames in streaming buffer */ + int packet_frames; /* number of frames in a packet */ + int num_packets; /* number of packets in packet queue */ + void (*stream_cb)(float* buffer, int num_frames, int num_channels); /* optional streaming callback (no user data) */ + void (*stream_userdata_cb)(float* buffer, int num_frames, int num_channels, void* user_data); /*... and with user data */ + void* user_data; /* optional user data argument for stream_userdata_cb */ +} saudio_desc; + +/* setup sokol-audio */ +SOKOL_API_DECL void saudio_setup(const saudio_desc* desc); +/* shutdown sokol-audio */ +SOKOL_API_DECL void saudio_shutdown(void); +/* true after setup if audio backend was successfully initialized */ +SOKOL_API_DECL bool saudio_isvalid(void); +/* return the saudio_desc.user_data pointer */ +SOKOL_API_DECL void* saudio_userdata(void); +/* return a copy of the original saudio_desc struct */ +SOKOL_API_DECL saudio_desc saudio_query_desc(void); +/* actual sample rate */ +SOKOL_API_DECL int saudio_sample_rate(void); +/* return actual backend buffer size in number of frames */ +SOKOL_API_DECL int saudio_buffer_frames(void); +/* actual number of channels */ +SOKOL_API_DECL int saudio_channels(void); +/* get current number of frames to fill packet queue */ +SOKOL_API_DECL int saudio_expect(void); +/* push sample frames from main thread, returns number of frames actually pushed */ +SOKOL_API_DECL int saudio_push(const float* frames, int num_frames); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif // SOKOL_AUDIO_INCLUDED + +/*=== IMPLEMENTATION =========================================================*/ +#ifdef SOKOL_IMPL +#define SOKOL_AUDIO_IMPL_INCLUDED (1) +#include /* memset, memcpy */ + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef SOKOL_MALLOC + #include + #define SOKOL_MALLOC(s) malloc(s) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #else + #define SOKOL_LOG(s) + #endif +#endif + +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif + +#if (defined(__APPLE__) || defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) + #include +#elif defined(_WIN32) + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include + #pragma comment (lib, "kernel32.lib") + #pragma comment (lib, "ole32.lib") +#endif + +#if defined(__APPLE__) + #include +#elif (defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) + #define ALSA_PCM_NEW_HW_PARAMS_API + #include +#elif defined(__ANDROID__) + #include "SLES/OpenSLES_Android.h" +#elif defined(_WIN32) + #ifndef CINTERFACE + #define CINTERFACE + #endif + #ifndef COBJMACROS + #define COBJMACROS + #endif + #ifndef CONST_VTABLE + #define CONST_VTABLE + #endif + #include + #include + static const IID _saudio_IID_IAudioClient = { 0x1cb9ad4c, 0xdbfa, 0x4c32, { 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2 } }; + static const IID _saudio_IID_IMMDeviceEnumerator = { 0xa95664d2, 0x9614, 0x4f35, { 0xa7, 0x46, 0xde, 0x8d, 0xb6, 0x36, 0x17, 0xe6 } }; + static const CLSID _saudio_CLSID_IMMDeviceEnumerator = { 0xbcde0395, 0xe52f, 0x467c, { 0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e } }; + static const IID _saudio_IID_IAudioRenderClient = { 0xf294acfc, 0x3146, 0x4483,{ 0xa7, 0xbf, 0xad, 0xdc, 0xa7, 0xc2, 0x60, 0xe2 } }; + #if defined(__cplusplus) + #define _SOKOL_AUDIO_WIN32COM_ID(x) (x) + #else + #define _SOKOL_AUDIO_WIN32COM_ID(x) (&x) + #endif + /* fix for Visual Studio 2015 SDKs */ + #ifndef AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM + #define AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM 0x80000000 + #endif + #ifndef AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY + #define AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY 0x08000000 + #endif +#elif defined(__EMSCRIPTEN__) + #include +#endif + +#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable:4505) /* unreferenced local function has been removed */ +#endif + +#define _saudio_def(val, def) (((val) == 0) ? (def) : (val)) +#define _saudio_def_flt(val, def) (((val) == 0.0f) ? (def) : (val)) + +#define _SAUDIO_DEFAULT_SAMPLE_RATE (44100) +#define _SAUDIO_DEFAULT_BUFFER_FRAMES (2048) +#define _SAUDIO_DEFAULT_PACKET_FRAMES (128) +#define _SAUDIO_DEFAULT_NUM_PACKETS ((_SAUDIO_DEFAULT_BUFFER_FRAMES/_SAUDIO_DEFAULT_PACKET_FRAMES)*4) + +#ifndef SAUDIO_RING_MAX_SLOTS +#define SAUDIO_RING_MAX_SLOTS (1024) +#endif + +/*=== MUTEX WRAPPER DECLARATIONS =============================================*/ +#if (defined(__APPLE__) || defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) + +typedef struct { + pthread_mutex_t mutex; +} _saudio_mutex_t; + +#elif defined(_WIN32) + +typedef struct { + CRITICAL_SECTION critsec; +} _saudio_mutex_t; + +#else +typedef struct { } _saudio_mutex_t; +#endif + +/*=== COREAUDIO BACKEND DECLARATIONS =========================================*/ +#if defined(__APPLE__) + +typedef struct { + AudioQueueRef ca_audio_queue; +} _saudio_backend_t; + +/*=== ALSA BACKEND DECLARATIONS ==============================================*/ +#elif (defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) + +typedef struct { + snd_pcm_t* device; + float* buffer; + int buffer_byte_size; + int buffer_frames; + pthread_t thread; + bool thread_stop; +} _saudio_backend_t; + +/*=== OpenSLES BACKEND DECLARATIONS ==============================================*/ +#elif defined(__ANDROID__) + +#define SAUDIO_NUM_BUFFERS 2 + +typedef struct { + pthread_mutex_t mutex; + pthread_cond_t cond; + int count; +} _saudio_semaphore_t; + +typedef struct { + SLObjectItf engine_obj; + SLEngineItf engine; + SLObjectItf output_mix_obj; + SLVolumeItf output_mix_vol; + SLDataLocator_OutputMix out_locator; + SLDataSink dst_data_sink; + SLObjectItf player_obj; + SLPlayItf player; + SLVolumeItf player_vol; + SLAndroidSimpleBufferQueueItf player_buffer_queue; + + int16_t* output_buffers[SAUDIO_NUM_BUFFERS]; + float* src_buffer; + int active_buffer; + _saudio_semaphore_t buffer_sem; + pthread_t thread; + volatile int thread_stop; + SLDataLocator_AndroidSimpleBufferQueue in_locator; +} _saudio_backend_t; + +/*=== WASAPI BACKEND DECLARATIONS ============================================*/ +#elif defined(_WIN32) + +typedef struct { + HANDLE thread_handle; + HANDLE buffer_end_event; + bool stop; + UINT32 dst_buffer_frames; + int src_buffer_frames; + int src_buffer_byte_size; + int src_buffer_pos; + float* src_buffer; +} _saudio_wasapi_thread_data_t; + +typedef struct { + IMMDeviceEnumerator* device_enumerator; + IMMDevice* device; + IAudioClient* audio_client; + IAudioRenderClient* render_client; + int si16_bytes_per_frame; + _saudio_wasapi_thread_data_t thread; +} _saudio_backend_t; + +/*=== WEBAUDIO BACKEND DECLARATIONS ==========================================*/ +#elif defined(__EMSCRIPTEN__) + +typedef struct { + uint8_t* buffer; +} _saudio_backend_t; + +/*=== DUMMY BACKEND DECLARATIONS =============================================*/ +#else +typedef struct { } _saudio_backend_t; +#endif +/*=== GENERAL DECLARATIONS ===================================================*/ + +/* a ringbuffer structure */ +typedef struct { + uint32_t head; /* next slot to write to */ + uint32_t tail; /* next slot to read from */ + uint32_t num; /* number of slots in queue */ + uint32_t queue[SAUDIO_RING_MAX_SLOTS]; +} _saudio_ring_t; + +/* a packet FIFO structure */ +typedef struct { + bool valid; + int packet_size; /* size of a single packets in bytes(!) */ + int num_packets; /* number of packet in fifo */ + uint8_t* base_ptr; /* packet memory chunk base pointer (dynamically allocated) */ + int cur_packet; /* current write-packet */ + int cur_offset; /* current byte-offset into current write packet */ + _saudio_mutex_t mutex; /* mutex for thread-safe access */ + _saudio_ring_t read_queue; /* buffers with data, ready to be streamed */ + _saudio_ring_t write_queue; /* empty buffers, ready to be pushed to */ +} _saudio_fifo_t; + +/* sokol-audio state */ +typedef struct { + bool valid; + void (*stream_cb)(float* buffer, int num_frames, int num_channels); + void (*stream_userdata_cb)(float* buffer, int num_frames, int num_channels, void* user_data); + void* user_data; + int sample_rate; /* sample rate */ + int buffer_frames; /* number of frames in streaming buffer */ + int bytes_per_frame; /* filled by backend */ + int packet_frames; /* number of frames in a packet */ + int num_packets; /* number of packets in packet queue */ + int num_channels; /* actual number of channels */ + saudio_desc desc; + _saudio_fifo_t fifo; + _saudio_backend_t backend; +} _saudio_state_t; + +static _saudio_state_t _saudio; + +_SOKOL_PRIVATE bool _saudio_has_callback(void) { + return (_saudio.stream_cb || _saudio.stream_userdata_cb); +} + +_SOKOL_PRIVATE void _saudio_stream_callback(float* buffer, int num_frames, int num_channels) { + if (_saudio.stream_cb) { + _saudio.stream_cb(buffer, num_frames, num_channels); + } + else if (_saudio.stream_userdata_cb) { + _saudio.stream_userdata_cb(buffer, num_frames, num_channels, _saudio.user_data); + } +} + +/*=== MUTEX IMPLEMENTATION ===================================================*/ +#if (defined(__APPLE__) || defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) +_SOKOL_PRIVATE void _saudio_mutex_init(_saudio_mutex_t* m) { + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&m->mutex, &attr); +} + +_SOKOL_PRIVATE void _saudio_mutex_destroy(_saudio_mutex_t* m) { + pthread_mutex_destroy(&m->mutex); +} + +_SOKOL_PRIVATE void _saudio_mutex_lock(_saudio_mutex_t* m) { + pthread_mutex_lock(&m->mutex); +} + +_SOKOL_PRIVATE void _saudio_mutex_unlock(_saudio_mutex_t* m) { + pthread_mutex_unlock(&m->mutex); +} + +#elif defined(_WIN32) +_SOKOL_PRIVATE void _saudio_mutex_init(_saudio_mutex_t* m) { + InitializeCriticalSection(&m->critsec); +} + +_SOKOL_PRIVATE void _saudio_mutex_destroy(_saudio_mutex_t* m) { + DeleteCriticalSection(&m->critsec); +} + +_SOKOL_PRIVATE void _saudio_mutex_lock(_saudio_mutex_t* m) { + EnterCriticalSection(&m->critsec); +} + +_SOKOL_PRIVATE void _saudio_mutex_unlock(_saudio_mutex_t* m) { + LeaveCriticalSection(&m->critsec); +} +#else +_SOKOL_PRIVATE void _saudio_mutex_init(_saudio_mutex_t* m) { (void)m; } +_SOKOL_PRIVATE void _saudio_mutex_destroy(_saudio_mutex_t* m) { (void)m; } +_SOKOL_PRIVATE void _saudio_mutex_lock(_saudio_mutex_t* m) { (void)m; } +_SOKOL_PRIVATE void _saudio_mutex_unlock(_saudio_mutex_t* m) { (void)m; } +#endif + +/*=== RING-BUFFER QUEUE IMPLEMENTATION =======================================*/ +_SOKOL_PRIVATE uint16_t _saudio_ring_idx(_saudio_ring_t* ring, uint32_t i) { + return (uint16_t) (i % ring->num); +} + +_SOKOL_PRIVATE void _saudio_ring_init(_saudio_ring_t* ring, uint32_t num_slots) { + SOKOL_ASSERT((num_slots + 1) <= SAUDIO_RING_MAX_SLOTS); + ring->head = 0; + ring->tail = 0; + /* one slot reserved to detect 'full' vs 'empty' */ + ring->num = num_slots + 1; +} + +_SOKOL_PRIVATE bool _saudio_ring_full(_saudio_ring_t* ring) { + return _saudio_ring_idx(ring, ring->head + 1) == ring->tail; +} + +_SOKOL_PRIVATE bool _saudio_ring_empty(_saudio_ring_t* ring) { + return ring->head == ring->tail; +} + +_SOKOL_PRIVATE int _saudio_ring_count(_saudio_ring_t* ring) { + uint32_t count; + if (ring->head >= ring->tail) { + count = ring->head - ring->tail; + } + else { + count = (ring->head + ring->num) - ring->tail; + } + SOKOL_ASSERT(count < ring->num); + return count; +} + +_SOKOL_PRIVATE void _saudio_ring_enqueue(_saudio_ring_t* ring, uint32_t val) { + SOKOL_ASSERT(!_saudio_ring_full(ring)); + ring->queue[ring->head] = val; + ring->head = _saudio_ring_idx(ring, ring->head + 1); +} + +_SOKOL_PRIVATE uint32_t _saudio_ring_dequeue(_saudio_ring_t* ring) { + SOKOL_ASSERT(!_saudio_ring_empty(ring)); + uint32_t val = ring->queue[ring->tail]; + ring->tail = _saudio_ring_idx(ring, ring->tail + 1); + return val; +} + +/*--- a packet fifo for queueing audio data from main thread ----------------*/ +_SOKOL_PRIVATE void _saudio_fifo_init_mutex(_saudio_fifo_t* fifo) { + /* this must be called before initializing both the backend and the fifo itself! */ + _saudio_mutex_init(&fifo->mutex); +} + +_SOKOL_PRIVATE void _saudio_fifo_init(_saudio_fifo_t* fifo, int packet_size, int num_packets) { + /* NOTE: there's a chicken-egg situation during the init phase where the + streaming thread must be started before the fifo is actually initialized, + thus the fifo init must already be protected from access by the fifo_read() func. + */ + _saudio_mutex_lock(&fifo->mutex); + SOKOL_ASSERT((packet_size > 0) && (num_packets > 0)); + fifo->packet_size = packet_size; + fifo->num_packets = num_packets; + fifo->base_ptr = (uint8_t*) SOKOL_MALLOC(packet_size * num_packets); + SOKOL_ASSERT(fifo->base_ptr); + fifo->cur_packet = -1; + fifo->cur_offset = 0; + _saudio_ring_init(&fifo->read_queue, num_packets); + _saudio_ring_init(&fifo->write_queue, num_packets); + for (int i = 0; i < num_packets; i++) { + _saudio_ring_enqueue(&fifo->write_queue, i); + } + SOKOL_ASSERT(_saudio_ring_full(&fifo->write_queue)); + SOKOL_ASSERT(_saudio_ring_count(&fifo->write_queue) == num_packets); + SOKOL_ASSERT(_saudio_ring_empty(&fifo->read_queue)); + SOKOL_ASSERT(_saudio_ring_count(&fifo->read_queue) == 0); + fifo->valid = true; + _saudio_mutex_unlock(&fifo->mutex); +} + +_SOKOL_PRIVATE void _saudio_fifo_shutdown(_saudio_fifo_t* fifo) { + SOKOL_ASSERT(fifo->base_ptr); + SOKOL_FREE(fifo->base_ptr); + fifo->base_ptr = 0; + fifo->valid = false; + _saudio_mutex_destroy(&fifo->mutex); +} + +_SOKOL_PRIVATE int _saudio_fifo_writable_bytes(_saudio_fifo_t* fifo) { + _saudio_mutex_lock(&fifo->mutex); + int num_bytes = (_saudio_ring_count(&fifo->write_queue) * fifo->packet_size); + if (fifo->cur_packet != -1) { + num_bytes += fifo->packet_size - fifo->cur_offset; + } + _saudio_mutex_unlock(&fifo->mutex); + SOKOL_ASSERT((num_bytes >= 0) && (num_bytes <= (fifo->num_packets * fifo->packet_size))); + return num_bytes; +} + +/* write new data to the write queue, this is called from main thread */ +_SOKOL_PRIVATE int _saudio_fifo_write(_saudio_fifo_t* fifo, const uint8_t* ptr, int num_bytes) { + /* returns the number of bytes written, this will be smaller then requested + if the write queue runs full + */ + int all_to_copy = num_bytes; + while (all_to_copy > 0) { + /* need to grab a new packet? */ + if (fifo->cur_packet == -1) { + _saudio_mutex_lock(&fifo->mutex); + if (!_saudio_ring_empty(&fifo->write_queue)) { + fifo->cur_packet = _saudio_ring_dequeue(&fifo->write_queue); + } + _saudio_mutex_unlock(&fifo->mutex); + SOKOL_ASSERT(fifo->cur_offset == 0); + } + /* append data to current write packet */ + if (fifo->cur_packet != -1) { + int to_copy = all_to_copy; + const int max_copy = fifo->packet_size - fifo->cur_offset; + if (to_copy > max_copy) { + to_copy = max_copy; + } + uint8_t* dst = fifo->base_ptr + fifo->cur_packet * fifo->packet_size + fifo->cur_offset; + memcpy(dst, ptr, to_copy); + ptr += to_copy; + fifo->cur_offset += to_copy; + all_to_copy -= to_copy; + SOKOL_ASSERT(fifo->cur_offset <= fifo->packet_size); + SOKOL_ASSERT(all_to_copy >= 0); + } + else { + /* early out if we're starving */ + int bytes_copied = num_bytes - all_to_copy; + SOKOL_ASSERT((bytes_copied >= 0) && (bytes_copied < num_bytes)); + return bytes_copied; + } + /* if write packet is full, push to read queue */ + if (fifo->cur_offset == fifo->packet_size) { + _saudio_mutex_lock(&fifo->mutex); + _saudio_ring_enqueue(&fifo->read_queue, fifo->cur_packet); + _saudio_mutex_unlock(&fifo->mutex); + fifo->cur_packet = -1; + fifo->cur_offset = 0; + } + } + SOKOL_ASSERT(all_to_copy == 0); + return num_bytes; +} + +/* read queued data, this is called form the stream callback (maybe separate thread) */ +_SOKOL_PRIVATE int _saudio_fifo_read(_saudio_fifo_t* fifo, uint8_t* ptr, int num_bytes) { + /* NOTE: fifo_read might be called before the fifo is properly initialized */ + _saudio_mutex_lock(&fifo->mutex); + int num_bytes_copied = 0; + if (fifo->valid) { + SOKOL_ASSERT(0 == (num_bytes % fifo->packet_size)); + SOKOL_ASSERT(num_bytes <= (fifo->packet_size * fifo->num_packets)); + const int num_packets_needed = num_bytes / fifo->packet_size; + uint8_t* dst = ptr; + /* either pull a full buffer worth of data, or nothing */ + if (_saudio_ring_count(&fifo->read_queue) >= num_packets_needed) { + for (int i = 0; i < num_packets_needed; i++) { + int packet_index = _saudio_ring_dequeue(&fifo->read_queue); + _saudio_ring_enqueue(&fifo->write_queue, packet_index); + const uint8_t* src = fifo->base_ptr + packet_index * fifo->packet_size; + memcpy(dst, src, fifo->packet_size); + dst += fifo->packet_size; + num_bytes_copied += fifo->packet_size; + } + SOKOL_ASSERT(num_bytes == num_bytes_copied); + } + } + _saudio_mutex_unlock(&fifo->mutex); + return num_bytes_copied; +} + +/*=== DUMMY BACKEND IMPLEMENTATION ===========================================*/ +#if defined(SOKOL_DUMMY_BACKEND) +_SOKOL_PRIVATE bool _saudio_backend_init(void) { + _saudio.bytes_per_frame = _saudio.num_channels * sizeof(float); + return true; +}; +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { }; + +/*=== COREAUDIO BACKEND IMPLEMENTATION =======================================*/ +#elif defined(__APPLE__) + +/* NOTE: the buffer data callback is called on a separate thread! */ +_SOKOL_PRIVATE void _sapp_ca_callback(void* user_data, AudioQueueRef queue, AudioQueueBufferRef buffer) { + if (_saudio_has_callback()) { + const int num_frames = buffer->mAudioDataByteSize / _saudio.bytes_per_frame; + const int num_channels = _saudio.num_channels; + _saudio_stream_callback((float*)buffer->mAudioData, num_frames, num_channels); + } + else { + uint8_t* ptr = (uint8_t*)buffer->mAudioData; + int num_bytes = (int) buffer->mAudioDataByteSize; + if (0 == _saudio_fifo_read(&_saudio.fifo, ptr, num_bytes)) { + /* not enough read data available, fill the entire buffer with silence */ + memset(ptr, 0, num_bytes); + } + } + AudioQueueEnqueueBuffer(queue, buffer, 0, NULL); +} + +_SOKOL_PRIVATE bool _saudio_backend_init(void) { + SOKOL_ASSERT(0 == _saudio.backend.ca_audio_queue); + + /* create an audio queue with fp32 samples */ + AudioStreamBasicDescription fmt; + memset(&fmt, 0, sizeof(fmt)); + fmt.mSampleRate = (Float64) _saudio.sample_rate; + fmt.mFormatID = kAudioFormatLinearPCM; + fmt.mFormatFlags = kLinearPCMFormatFlagIsFloat | kAudioFormatFlagIsPacked; + fmt.mFramesPerPacket = 1; + fmt.mChannelsPerFrame = _saudio.num_channels; + fmt.mBytesPerFrame = sizeof(float) * _saudio.num_channels; + fmt.mBytesPerPacket = fmt.mBytesPerFrame; + fmt.mBitsPerChannel = 32; + OSStatus res = AudioQueueNewOutput(&fmt, _sapp_ca_callback, 0, NULL, NULL, 0, &_saudio.backend.ca_audio_queue); + SOKOL_ASSERT((res == 0) && _saudio.backend.ca_audio_queue); + + /* create 2 audio buffers */ + for (int i = 0; i < 2; i++) { + AudioQueueBufferRef buf = NULL; + const uint32_t buf_byte_size = _saudio.buffer_frames * fmt.mBytesPerFrame; + res = AudioQueueAllocateBuffer(_saudio.backend.ca_audio_queue, buf_byte_size, &buf); + SOKOL_ASSERT((res == 0) && buf); + buf->mAudioDataByteSize = buf_byte_size; + memset(buf->mAudioData, 0, buf->mAudioDataByteSize); + AudioQueueEnqueueBuffer(_saudio.backend.ca_audio_queue, buf, 0, NULL); + } + + /* init or modify actual playback parameters */ + _saudio.bytes_per_frame = fmt.mBytesPerFrame; + + /* ...and start playback */ + res = AudioQueueStart(_saudio.backend.ca_audio_queue, NULL); + SOKOL_ASSERT(0 == res); + + return true; +} + +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { + AudioQueueStop(_saudio.backend.ca_audio_queue, true); + AudioQueueDispose(_saudio.backend.ca_audio_queue, false); + _saudio.backend.ca_audio_queue = NULL; +} + +/*=== ALSA BACKEND IMPLEMENTATION ============================================*/ +#elif (defined(__linux__) || defined(__unix__)) && !defined(__EMSCRIPTEN__) && !defined(__ANDROID__) + +/* the streaming callback runs in a separate thread */ +_SOKOL_PRIVATE void* _saudio_alsa_cb(void* param) { + while (!_saudio.backend.thread_stop) { + /* snd_pcm_writei() will be blocking until it needs data */ + int write_res = snd_pcm_writei(_saudio.backend.device, _saudio.backend.buffer, _saudio.backend.buffer_frames); + if (write_res < 0) { + /* underrun occurred */ + snd_pcm_prepare(_saudio.backend.device); + } + else { + /* fill the streaming buffer with new data */ + if (_saudio_has_callback()) { + _saudio_stream_callback(_saudio.backend.buffer, _saudio.backend.buffer_frames, _saudio.num_channels); + } + else { + if (0 == _saudio_fifo_read(&_saudio.fifo, (uint8_t*)_saudio.backend.buffer, _saudio.backend.buffer_byte_size)) { + /* not enough read data available, fill the entire buffer with silence */ + memset(_saudio.backend.buffer, 0, _saudio.backend.buffer_byte_size); + } + } + } + } + return 0; +} + +_SOKOL_PRIVATE bool _saudio_backend_init(void) { + int dir; unsigned int val; + int rc = snd_pcm_open(&_saudio.backend.device, "default", SND_PCM_STREAM_PLAYBACK, 0); + if (rc < 0) { + return false; + } + snd_pcm_hw_params_t* params = 0; + snd_pcm_hw_params_alloca(¶ms); + snd_pcm_hw_params_any(_saudio.backend.device, params); + snd_pcm_hw_params_set_access(_saudio.backend.device, params, SND_PCM_ACCESS_RW_INTERLEAVED); + snd_pcm_hw_params_set_channels(_saudio.backend.device, params, _saudio.num_channels); + snd_pcm_hw_params_set_buffer_size(_saudio.backend.device, params, _saudio.buffer_frames); + if (0 > snd_pcm_hw_params_test_format(_saudio.backend.device, params, SND_PCM_FORMAT_FLOAT_LE)) { + goto error; + } + else { + snd_pcm_hw_params_set_format(_saudio.backend.device, params, SND_PCM_FORMAT_FLOAT_LE); + } + val = _saudio.sample_rate; + dir = 0; + if (0 > snd_pcm_hw_params_set_rate_near(_saudio.backend.device, params, &val, &dir)) { + goto error; + } + if (0 > snd_pcm_hw_params(_saudio.backend.device, params)) { + goto error; + } + + /* read back actual sample rate and channels */ + snd_pcm_hw_params_get_rate(params, &val, &dir); + _saudio.sample_rate = val; + snd_pcm_hw_params_get_channels(params, &val); + SOKOL_ASSERT((int)val == _saudio.num_channels); + _saudio.bytes_per_frame = _saudio.num_channels * sizeof(float); + + /* allocate the streaming buffer */ + _saudio.backend.buffer_byte_size = _saudio.buffer_frames * _saudio.bytes_per_frame; + _saudio.backend.buffer_frames = _saudio.buffer_frames; + _saudio.backend.buffer = (float*) SOKOL_MALLOC(_saudio.backend.buffer_byte_size); + memset(_saudio.backend.buffer, 0, _saudio.backend.buffer_byte_size); + + /* create the buffer-streaming start thread */ + if (0 != pthread_create(&_saudio.backend.thread, 0, _saudio_alsa_cb, 0)) { + goto error; + } + + return true; +error: + if (_saudio.backend.device) { + snd_pcm_close(_saudio.backend.device); + _saudio.backend.device = 0; + } + return false; +}; + +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { + SOKOL_ASSERT(_saudio.backend.device); + _saudio.backend.thread_stop = true; + pthread_join(_saudio.backend.thread, 0); + snd_pcm_drain(_saudio.backend.device); + snd_pcm_close(_saudio.backend.device); + SOKOL_FREE(_saudio.backend.buffer); +}; + +/*=== WASAPI BACKEND IMPLEMENTATION ==========================================*/ +#elif defined(_WIN32) + +/* fill intermediate buffer with new data and reset buffer_pos */ +_SOKOL_PRIVATE void _saudio_wasapi_fill_buffer(void) { + if (_saudio_has_callback()) { + _saudio_stream_callback(_saudio.backend.thread.src_buffer, _saudio.backend.thread.src_buffer_frames, _saudio.num_channels); + } + else { + if (0 == _saudio_fifo_read(&_saudio.fifo, (uint8_t*)_saudio.backend.thread.src_buffer, _saudio.backend.thread.src_buffer_byte_size)) { + /* not enough read data available, fill the entire buffer with silence */ + memset(_saudio.backend.thread.src_buffer, 0, _saudio.backend.thread.src_buffer_byte_size); + } + } +} + +_SOKOL_PRIVATE void _saudio_wasapi_submit_buffer(UINT32 num_frames) { + BYTE* wasapi_buffer = 0; + if (FAILED(IAudioRenderClient_GetBuffer(_saudio.backend.render_client, num_frames, &wasapi_buffer))) { + return; + } + SOKOL_ASSERT(wasapi_buffer); + + /* convert float samples to int16_t, refill float buffer if needed */ + const int num_samples = num_frames * _saudio.num_channels; + int16_t* dst = (int16_t*) wasapi_buffer; + uint32_t buffer_pos = _saudio.backend.thread.src_buffer_pos; + const uint32_t buffer_float_size = _saudio.backend.thread.src_buffer_byte_size / sizeof(float); + float* src = _saudio.backend.thread.src_buffer; + for (int i = 0; i < num_samples; i++) { + if (0 == buffer_pos) { + _saudio_wasapi_fill_buffer(); + } + dst[i] = (int16_t) (src[buffer_pos] * 0x7FFF); + buffer_pos += 1; + if (buffer_pos == buffer_float_size) { + buffer_pos = 0; + } + } + _saudio.backend.thread.src_buffer_pos = buffer_pos; + + IAudioRenderClient_ReleaseBuffer(_saudio.backend.render_client, num_frames, 0); +} + +_SOKOL_PRIVATE DWORD WINAPI _saudio_wasapi_thread_fn(LPVOID param) { + (void)param; + _saudio_wasapi_submit_buffer(_saudio.backend.thread.src_buffer_frames); + IAudioClient_Start(_saudio.backend.audio_client); + while (!_saudio.backend.thread.stop) { + WaitForSingleObject(_saudio.backend.thread.buffer_end_event, INFINITE); + UINT32 padding = 0; + if (FAILED(IAudioClient_GetCurrentPadding(_saudio.backend.audio_client, &padding))) { + continue; + } + SOKOL_ASSERT(_saudio.backend.thread.dst_buffer_frames >= (int)padding); + UINT32 num_frames = _saudio.backend.thread.dst_buffer_frames - padding; + if (num_frames > 0) { + _saudio_wasapi_submit_buffer(num_frames); + } + } + return 0; +} + +_SOKOL_PRIVATE void _saudio_wasapi_release(void) { + if (_saudio.backend.thread.src_buffer) { + SOKOL_FREE(_saudio.backend.thread.src_buffer); + _saudio.backend.thread.src_buffer = 0; + } + if (_saudio.backend.render_client) { + IAudioRenderClient_Release(_saudio.backend.render_client); + _saudio.backend.render_client = 0; + } + if (_saudio.backend.audio_client) { + IAudioClient_Release(_saudio.backend.audio_client); + _saudio.backend.audio_client = 0; + } + if (_saudio.backend.device) { + IMMDevice_Release(_saudio.backend.device); + _saudio.backend.device = 0; + } + if (_saudio.backend.device_enumerator) { + IMMDeviceEnumerator_Release(_saudio.backend.device_enumerator); + _saudio.backend.device_enumerator = 0; + } + if (0 != _saudio.backend.thread.buffer_end_event) { + CloseHandle(_saudio.backend.thread.buffer_end_event); + _saudio.backend.thread.buffer_end_event = 0; + } +} + +_SOKOL_PRIVATE bool _saudio_backend_init(void) { + REFERENCE_TIME dur; + if (FAILED(CoInitializeEx(0, COINIT_MULTITHREADED))) { + SOKOL_LOG("sokol_audio wasapi: CoInitializeEx failed"); + return false; + } + _saudio.backend.thread.buffer_end_event = CreateEvent(0, FALSE, FALSE, 0); + if (0 == _saudio.backend.thread.buffer_end_event) { + SOKOL_LOG("sokol_audio wasapi: failed to create buffer_end_event"); + goto error; + } + if (FAILED(CoCreateInstance(_SOKOL_AUDIO_WIN32COM_ID(_saudio_CLSID_IMMDeviceEnumerator), + 0, CLSCTX_ALL, + _SOKOL_AUDIO_WIN32COM_ID(_saudio_IID_IMMDeviceEnumerator), + (void**)&_saudio.backend.device_enumerator))) + { + SOKOL_LOG("sokol_audio wasapi: failed to create device enumerator"); + goto error; + } + if (FAILED(IMMDeviceEnumerator_GetDefaultAudioEndpoint(_saudio.backend.device_enumerator, + eRender, eConsole, + &_saudio.backend.device))) + { + SOKOL_LOG("sokol_audio wasapi: GetDefaultAudioEndPoint failed"); + goto error; + } + if (FAILED(IMMDevice_Activate(_saudio.backend.device, + _SOKOL_AUDIO_WIN32COM_ID(_saudio_IID_IAudioClient), + CLSCTX_ALL, 0, + (void**)&_saudio.backend.audio_client))) + { + SOKOL_LOG("sokol_audio wasapi: device activate failed"); + goto error; + } + WAVEFORMATEX fmt; + memset(&fmt, 0, sizeof(fmt)); + fmt.nChannels = (WORD) _saudio.num_channels; + fmt.nSamplesPerSec = _saudio.sample_rate; + fmt.wFormatTag = WAVE_FORMAT_PCM; + fmt.wBitsPerSample = 16; + fmt.nBlockAlign = (fmt.nChannels * fmt.wBitsPerSample) / 8; + fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nBlockAlign; + dur = (REFERENCE_TIME) + (((double)_saudio.buffer_frames) / (((double)_saudio.sample_rate) * (1.0/10000000.0))); + if (FAILED(IAudioClient_Initialize(_saudio.backend.audio_client, + AUDCLNT_SHAREMODE_SHARED, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK|AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM|AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY, + dur, 0, &fmt, 0))) + { + SOKOL_LOG("sokol_audio wasapi: audio client initialize failed"); + goto error; + } + if (FAILED(IAudioClient_GetBufferSize(_saudio.backend.audio_client, &_saudio.backend.thread.dst_buffer_frames))) { + SOKOL_LOG("sokol_audio wasapi: audio client get buffer size failed"); + goto error; + } + if (FAILED(IAudioClient_GetService(_saudio.backend.audio_client, + _SOKOL_AUDIO_WIN32COM_ID(_saudio_IID_IAudioRenderClient), + (void**)&_saudio.backend.render_client))) + { + SOKOL_LOG("sokol_audio wasapi: audio client GetService failed"); + goto error; + } + if (FAILED(IAudioClient_SetEventHandle(_saudio.backend.audio_client, _saudio.backend.thread.buffer_end_event))) { + SOKOL_LOG("sokol_audio wasapi: audio client SetEventHandle failed"); + goto error; + } + _saudio.backend.si16_bytes_per_frame = _saudio.num_channels * sizeof(int16_t); + _saudio.bytes_per_frame = _saudio.num_channels * sizeof(float); + _saudio.backend.thread.src_buffer_frames = _saudio.buffer_frames; + _saudio.backend.thread.src_buffer_byte_size = _saudio.backend.thread.src_buffer_frames * _saudio.bytes_per_frame; + + /* allocate an intermediate buffer for sample format conversion */ + _saudio.backend.thread.src_buffer = (float*) SOKOL_MALLOC(_saudio.backend.thread.src_buffer_byte_size); + SOKOL_ASSERT(_saudio.backend.thread.src_buffer); + + /* create streaming thread */ + _saudio.backend.thread.thread_handle = CreateThread(NULL, 0, _saudio_wasapi_thread_fn, 0, 0, 0); + if (0 == _saudio.backend.thread.thread_handle) { + SOKOL_LOG("sokol_audio wasapi: CreateThread failed"); + goto error; + } + return true; +error: + _saudio_wasapi_release(); + return false; +} + +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { + if (_saudio.backend.thread.thread_handle) { + _saudio.backend.thread.stop = true; + SetEvent(_saudio.backend.thread.buffer_end_event); + WaitForSingleObject(_saudio.backend.thread.thread_handle, INFINITE); + CloseHandle(_saudio.backend.thread.thread_handle); + _saudio.backend.thread.thread_handle = 0; + } + if (_saudio.backend.audio_client) { + IAudioClient_Stop(_saudio.backend.audio_client); + } + _saudio_wasapi_release(); + CoUninitialize(); +} + +/*=== EMSCRIPTEN BACKEND IMPLEMENTATION ======================================*/ +#elif defined(__EMSCRIPTEN__) + +#ifdef __cplusplus +extern "C" { +#endif + +EMSCRIPTEN_KEEPALIVE int _saudio_emsc_pull(int num_frames) { + SOKOL_ASSERT(_saudio.backend.buffer); + if (num_frames == _saudio.buffer_frames) { + if (_saudio_has_callback()) { + _saudio_stream_callback((float*)_saudio.backend.buffer, num_frames, _saudio.num_channels); + } + else { + const int num_bytes = num_frames * _saudio.bytes_per_frame; + if (0 == _saudio_fifo_read(&_saudio.fifo, _saudio.backend.buffer, num_bytes)) { + /* not enough read data available, fill the entire buffer with silence */ + memset(_saudio.backend.buffer, 0, num_bytes); + } + } + int res = (int) _saudio.backend.buffer; + return res; + } + else { + return 0; + } +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +/* setup the WebAudio context and attach a ScriptProcessorNode */ +EM_JS(int, saudio_js_init, (int sample_rate, int num_channels, int buffer_size), { + Module._saudio_context = null; + Module._saudio_node = null; + if (typeof AudioContext !== 'undefined') { + Module._saudio_context = new AudioContext({ + sampleRate: sample_rate, + latencyHint: 'interactive', + }); + console.log('sokol_audio.h: created AudioContext'); + } + else if (typeof webkitAudioContext !== 'undefined') { + Module._saudio_context = new webkitAudioContext({ + sampleRate: sample_rate, + latencyHint: 'interactive', + }); + console.log('sokol_audio.h: created webkitAudioContext'); + } + else { + Module._saudio_context = null; + console.log('sokol_audio.h: no WebAudio support'); + } + if (Module._saudio_context) { + console.log('sokol_audio.h: sample rate ', Module._saudio_context.sampleRate); + Module._saudio_node = Module._saudio_context.createScriptProcessor(buffer_size, 0, num_channels); + Module._saudio_node.onaudioprocess = function pump_audio(event) { + var num_frames = event.outputBuffer.length; + var ptr = __saudio_emsc_pull(num_frames); + if (ptr) { + var num_channels = event.outputBuffer.numberOfChannels; + for (var chn = 0; chn < num_channels; chn++) { + var chan = event.outputBuffer.getChannelData(chn); + for (var i = 0; i < num_frames; i++) { + chan[i] = HEAPF32[(ptr>>2) + ((num_channels*i)+chn)] + } + } + } + }; + Module._saudio_node.connect(Module._saudio_context.destination); + + // in some browsers, WebAudio needs to be activated on a user action + var resume_webaudio = function() { + if (Module._saudio_context) { + if (Module._saudio_context.state === 'suspended') { + Module._saudio_context.resume(); + } + } + }; + document.addEventListener('click', resume_webaudio, {once:true}); + document.addEventListener('touchstart', resume_webaudio, {once:true}); + document.addEventListener('keydown', resume_webaudio, {once:true}); + return 1; + } + else { + return 0; + } +}); + +/* get the actual sample rate back from the WebAudio context */ +EM_JS(int, saudio_js_sample_rate, (void), { + if (Module._saudio_context) { + return Module._saudio_context.sampleRate; + } + else { + return 0; + } +}); + +/* get the actual buffer size in number of frames */ +EM_JS(int, saudio_js_buffer_frames, (void), { + if (Module._saudio_node) { + return Module._saudio_node.bufferSize; + } + else { + return 0; + } +}); + +_SOKOL_PRIVATE bool _saudio_backend_init(void) { + if (saudio_js_init(_saudio.sample_rate, _saudio.num_channels, _saudio.buffer_frames)) { + _saudio.bytes_per_frame = sizeof(float) * _saudio.num_channels; + _saudio.sample_rate = saudio_js_sample_rate(); + _saudio.buffer_frames = saudio_js_buffer_frames(); + const int buf_size = _saudio.buffer_frames * _saudio.bytes_per_frame; + _saudio.backend.buffer = (uint8_t*) SOKOL_MALLOC(buf_size); + return true; + } + else { + return false; + } +} + +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { + /* on HTML5, there's always a 'hard exit' without warning, + so nothing useful to do here + */ +} + +/*=== ANDROID BACKEND IMPLEMENTATION ======================================*/ +#elif defined(__ANDROID__) + +#ifdef __cplusplus +extern "C" { +#endif + +_SOKOL_PRIVATE void _saudio_semaphore_init(_saudio_semaphore_t* sem) { + sem->count = 0; + int r = pthread_mutex_init(&sem->mutex, NULL); + SOKOL_ASSERT(r == 0); + + r = pthread_cond_init(&sem->cond, NULL); + SOKOL_ASSERT(r == 0); + + (void)(r); +} + +_SOKOL_PRIVATE void _saudio_semaphore_destroy(_saudio_semaphore_t* sem) +{ + pthread_cond_destroy(&sem->cond); + pthread_mutex_destroy(&sem->mutex); +} + +_SOKOL_PRIVATE void _saudio_semaphore_post(_saudio_semaphore_t* sem, int count) +{ + int r = pthread_mutex_lock(&sem->mutex); + SOKOL_ASSERT(r == 0); + + for (int ii = 0; ii < count; ii++) { + r = pthread_cond_signal(&sem->cond); + SOKOL_ASSERT(r == 0); + } + + sem->count += count; + r = pthread_mutex_unlock(&sem->mutex); + SOKOL_ASSERT(r == 0); + + (void)(r); +} + +_SOKOL_PRIVATE bool _saudio_semaphore_wait(_saudio_semaphore_t* sem) +{ + int r = pthread_mutex_lock(&sem->mutex); + SOKOL_ASSERT(r == 0); + + while (r == 0 && sem->count <= 0) { + r = pthread_cond_wait(&sem->cond, &sem->mutex); + } + + bool ok = (r == 0); + if (ok) { + --sem->count; + } + r = pthread_mutex_unlock(&sem->mutex); + (void)(r); + return ok; +} + +/* fill intermediate buffer with new data and reset buffer_pos */ +_SOKOL_PRIVATE void _saudio_opensles_fill_buffer(void) { + int src_buffer_frames = _saudio.buffer_frames; + if (_saudio_has_callback()) { + _saudio_stream_callback(_saudio.backend.src_buffer, src_buffer_frames, _saudio.num_channels); + } + else { + const int src_buffer_byte_size = src_buffer_frames * _saudio.num_channels * sizeof(float); + if (0 == _saudio_fifo_read(&_saudio.fifo, (uint8_t*)_saudio.backend.src_buffer, src_buffer_byte_size)) { + /* not enough read data available, fill the entire buffer with silence */ + memset(_saudio.backend.src_buffer, 0x0, src_buffer_byte_size); + } + } +} + +_SOKOL_PRIVATE void SLAPIENTRY _saudio_opensles_play_cb(SLPlayItf player, void *context, SLuint32 event) { + (void)(context); + (void)(player); + + if (event & SL_PLAYEVENT_HEADATEND) { + _saudio_semaphore_post(&_saudio.backend.buffer_sem, 1); + } +} + +_SOKOL_PRIVATE void* _saudio_opensles_thread_fn(void* param) { + while (!_saudio.backend.thread_stop) { + /* get next output buffer, advance, next buffer. */ + int16_t* out_buffer = _saudio.backend.output_buffers[_saudio.backend.active_buffer]; + _saudio.backend.active_buffer = (_saudio.backend.active_buffer + 1) % SAUDIO_NUM_BUFFERS; + int16_t* next_buffer = _saudio.backend.output_buffers[_saudio.backend.active_buffer]; + + /* queue this buffer */ + const int buffer_size_bytes = _saudio.buffer_frames * _saudio.num_channels * sizeof(short); + (*_saudio.backend.player_buffer_queue)->Enqueue(_saudio.backend.player_buffer_queue, out_buffer, buffer_size_bytes); + + /* fill the next buffer */ + _saudio_opensles_fill_buffer(); + const int num_samples = _saudio.num_channels * _saudio.buffer_frames; + for (int i = 0; i < num_samples; ++i) { + next_buffer[i] = (int16_t) (_saudio.backend.src_buffer[i] * 0x7FFF); + } + + _saudio_semaphore_wait(&_saudio.backend.buffer_sem); + } + + return 0; +} + +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { + _saudio.backend.thread_stop = 1; + pthread_join(_saudio.backend.thread, 0); + + if (_saudio.backend.player_obj) { + (*_saudio.backend.player_obj)->Destroy(_saudio.backend.player_obj); + } + + if (_saudio.backend.output_mix_obj) { + (*_saudio.backend.output_mix_obj)->Destroy(_saudio.backend.output_mix_obj); + } + + if (_saudio.backend.engine_obj) { + (*_saudio.backend.engine_obj)->Destroy(_saudio.backend.engine_obj); + } + + for (int i = 0; i < SAUDIO_NUM_BUFFERS; i++) { + SOKOL_FREE(_saudio.backend.output_buffers[i]); + } + SOKOL_FREE(_saudio.backend.src_buffer); +} + +_SOKOL_PRIVATE bool _saudio_backend_init(void) { + _saudio.bytes_per_frame = sizeof(float) * _saudio.num_channels; + + for (int i = 0; i < SAUDIO_NUM_BUFFERS; ++i) { + const int buffer_size_bytes = sizeof(int16_t) * _saudio.num_channels * _saudio.buffer_frames; + _saudio.backend.output_buffers[i] = SOKOL_MALLOC(buffer_size_bytes); + SOKOL_ASSERT(_saudio.backend.output_buffers[i]); + memset(_saudio.backend.output_buffers[i], 0x0, buffer_size_bytes); + } + + { + const int buffer_size_bytes = _saudio.bytes_per_frame * _saudio.buffer_frames; + _saudio.backend.src_buffer = SOKOL_MALLOC(buffer_size_bytes); + SOKOL_ASSERT(_saudio.backend.src_buffer); + memset(_saudio.backend.src_buffer, 0x0, buffer_size_bytes); + } + + + /* Create engine */ + const SLEngineOption opts[] = { SL_ENGINEOPTION_THREADSAFE, SL_BOOLEAN_TRUE }; + if (slCreateEngine(&_saudio.backend.engine_obj, 1, opts, 0, NULL, NULL ) != SL_RESULT_SUCCESS) { + SOKOL_LOG("sokol_audio opensles: slCreateEngine failed"); + _saudio_backend_shutdown(); + return false; + } + + (*_saudio.backend.engine_obj)->Realize(_saudio.backend.engine_obj, SL_BOOLEAN_FALSE); + if ((*_saudio.backend.engine_obj)->GetInterface(_saudio.backend.engine_obj, SL_IID_ENGINE, &_saudio.backend.engine) != SL_RESULT_SUCCESS) { + SOKOL_LOG("sokol_audio opensles: GetInterface->Engine failed"); + _saudio_backend_shutdown(); + return false; + } + + /* Create output mix. */ + { + const SLInterfaceID ids[] = { SL_IID_VOLUME }; + const SLboolean req[] = { SL_BOOLEAN_FALSE }; + + if( (*_saudio.backend.engine)->CreateOutputMix(_saudio.backend.engine, &_saudio.backend.output_mix_obj, 1, ids, req) != SL_RESULT_SUCCESS) + { + SOKOL_LOG("sokol_audio opensles: CreateOutputMix failed"); + _saudio_backend_shutdown(); + return false; + } + (*_saudio.backend.output_mix_obj)->Realize(_saudio.backend.output_mix_obj, SL_BOOLEAN_FALSE); + + if((*_saudio.backend.output_mix_obj)->GetInterface(_saudio.backend.output_mix_obj, SL_IID_VOLUME, &_saudio.backend.output_mix_vol) != SL_RESULT_SUCCESS) { + SOKOL_LOG("sokol_audio opensles: GetInterface->OutputMixVol failed"); + } + } + + /* android buffer queue */ + _saudio.backend.in_locator.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE; + _saudio.backend.in_locator.numBuffers = SAUDIO_NUM_BUFFERS; + + /* data format */ + SLDataFormat_PCM format; + format.formatType = SL_DATAFORMAT_PCM; + format.numChannels = _saudio.num_channels; + format.samplesPerSec = _saudio.sample_rate * 1000; + format.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16; + format.containerSize = 16; + format.endianness = SL_BYTEORDER_LITTLEENDIAN; + + if (_saudio.num_channels == 2) { + format.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT; + } else { + format.channelMask = SL_SPEAKER_FRONT_CENTER; + } + + SLDataSource src; + src.pLocator = &_saudio.backend.in_locator; + src.pFormat = &format; + + /* Output mix. */ + _saudio.backend.out_locator.locatorType = SL_DATALOCATOR_OUTPUTMIX; + _saudio.backend.out_locator.outputMix = _saudio.backend.output_mix_obj; + + _saudio.backend.dst_data_sink.pLocator = &_saudio.backend.out_locator; + _saudio.backend.dst_data_sink.pFormat = NULL; + + /* setup player */ + { + const SLInterfaceID ids[] = { SL_IID_VOLUME, SL_IID_ANDROIDSIMPLEBUFFERQUEUE }; + const SLboolean req[] = { SL_BOOLEAN_FALSE, SL_BOOLEAN_TRUE }; + + (*_saudio.backend.engine)->CreateAudioPlayer(_saudio.backend.engine, &_saudio.backend.player_obj, &src, &_saudio.backend.dst_data_sink, sizeof(ids) / sizeof(ids[0]), ids, req); + + (*_saudio.backend.player_obj)->Realize(_saudio.backend.player_obj, SL_BOOLEAN_FALSE); + + (*_saudio.backend.player_obj)->GetInterface(_saudio.backend.player_obj, SL_IID_PLAY, &_saudio.backend.player); + (*_saudio.backend.player_obj)->GetInterface(_saudio.backend.player_obj, SL_IID_VOLUME, &_saudio.backend.player_vol); + + (*_saudio.backend.player_obj)->GetInterface(_saudio.backend.player_obj, SL_IID_ANDROIDSIMPLEBUFFERQUEUE, &_saudio.backend.player_buffer_queue); + } + + /* begin */ + { + const int buffer_size_bytes = sizeof(int16_t) * _saudio.num_channels * _saudio.buffer_frames; + (*_saudio.backend.player_buffer_queue)->Enqueue(_saudio.backend.player_buffer_queue, _saudio.backend.output_buffers[0], buffer_size_bytes); + _saudio.backend.active_buffer = (_saudio.backend.active_buffer + 1) % SAUDIO_NUM_BUFFERS; + + (*_saudio.backend.player)->RegisterCallback(_saudio.backend.player, _saudio_opensles_play_cb, NULL); + (*_saudio.backend.player)->SetCallbackEventsMask(_saudio.backend.player, SL_PLAYEVENT_HEADATEND); + (*_saudio.backend.player)->SetPlayState(_saudio.backend.player, SL_PLAYSTATE_PLAYING); + } + + /* create the buffer-streaming start thread */ + if (0 != pthread_create(&_saudio.backend.thread, 0, _saudio_opensles_thread_fn, 0)) { + _saudio_backend_shutdown(); + return false; + } + + return true; +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#else /* dummy backend */ +_SOKOL_PRIVATE bool _saudio_backend_init(void) { return false; }; +_SOKOL_PRIVATE void _saudio_backend_shutdown(void) { }; +#endif + +/*=== PUBLIC API FUNCTIONS ===================================================*/ +SOKOL_API_IMPL void saudio_setup(const saudio_desc* desc) { + SOKOL_ASSERT(!_saudio.valid); + SOKOL_ASSERT(desc); + memset(&_saudio, 0, sizeof(_saudio)); + _saudio.desc = *desc; + _saudio.stream_cb = desc->stream_cb; + _saudio.stream_userdata_cb = desc->stream_userdata_cb; + _saudio.user_data = desc->user_data; + _saudio.sample_rate = _saudio_def(_saudio.desc.sample_rate, _SAUDIO_DEFAULT_SAMPLE_RATE); + _saudio.buffer_frames = _saudio_def(_saudio.desc.buffer_frames, _SAUDIO_DEFAULT_BUFFER_FRAMES); + _saudio.packet_frames = _saudio_def(_saudio.desc.packet_frames, _SAUDIO_DEFAULT_PACKET_FRAMES); + _saudio.num_packets = _saudio_def(_saudio.desc.num_packets, _SAUDIO_DEFAULT_NUM_PACKETS); + _saudio.num_channels = _saudio_def(_saudio.desc.num_channels, 1); + _saudio_fifo_init_mutex(&_saudio.fifo); + if (_saudio_backend_init()) { + SOKOL_ASSERT(0 == (_saudio.buffer_frames % _saudio.packet_frames)); + SOKOL_ASSERT(_saudio.bytes_per_frame > 0); + _saudio_fifo_init(&_saudio.fifo, _saudio.packet_frames * _saudio.bytes_per_frame, _saudio.num_packets); + _saudio.valid = true; + } +} + +SOKOL_API_IMPL void saudio_shutdown(void) { + if (_saudio.valid) { + _saudio_backend_shutdown(); + _saudio_fifo_shutdown(&_saudio.fifo); + _saudio.valid = false; + } +} + +SOKOL_API_IMPL bool saudio_isvalid(void) { + return _saudio.valid; +} + +SOKOL_API_IMPL void* saudio_userdata(void) { + return _saudio.desc.user_data; +} + +SOKOL_API_IMPL saudio_desc saudio_query_desc(void) { + return _saudio.desc; +} + +SOKOL_API_IMPL int saudio_sample_rate(void) { + return _saudio.sample_rate; +} + +SOKOL_API_IMPL int saudio_buffer_frames(void) { + return _saudio.buffer_frames; +} + +SOKOL_API_IMPL int saudio_channels(void) { + return _saudio.num_channels; +} + +SOKOL_API_IMPL int saudio_expect(void) { + if (_saudio.valid) { + const int num_frames = _saudio_fifo_writable_bytes(&_saudio.fifo) / _saudio.bytes_per_frame; + return num_frames; + } + else { + return 0; + } +} + +SOKOL_API_IMPL int saudio_push(const float* frames, int num_frames) { + SOKOL_ASSERT(frames && (num_frames > 0)); + if (_saudio.valid) { + const int num_bytes = num_frames * _saudio.bytes_per_frame; + const int num_written = _saudio_fifo_write(&_saudio.fifo, (const uint8_t*)frames, num_bytes); + return num_written / _saudio.bytes_per_frame; + } + else { + return 0; + } +} + +#undef _saudio_def +#undef _saudio_def_flt + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif /* SOKOL_IMPL */ diff --git a/sokol-app-sys/external/sokol/sokol_fetch.h b/sokol-app-sys/external/sokol/sokol_fetch.h new file mode 100644 index 00000000..309b7d68 --- /dev/null +++ b/sokol-app-sys/external/sokol/sokol_fetch.h @@ -0,0 +1,2492 @@ +#ifndef SOKOL_FETCH_INCLUDED +/* + sokol_fetch.h -- asynchronous data loading/streaming + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + Optionally provide the following defines with your own implementations: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) + SOKOL_FREE(p) - your own free function (default: free(p)) + SOKOL_LOG(msg) - your own logging function (default: puts(msg)) + SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + SFETCH_MAX_PATH - max length of UTF-8 filesystem path / URL (default: 1024 bytes) + SFETCH_MAX_USERDATA_UINT64 - max size of embedded userdata in number of uint64_t, userdata + will be copied into an 8-byte aligned memory region associated + with each in-flight request, default value is 16 (== 128 bytes) + SFETCH_MAX_CHANNELS - max number of IO channels (default is 16, also see sfetch_desc_t.num_channels) + + If sokol_fetch.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + NOTE: The following documentation talks a lot about "IO threads". Actual + threads are only used on platforms where threads are available. The web + version (emscripten/wasm) doesn't use POSIX-style threads, but instead + asynchronous Javascript calls chained together by callbacks. The actual + source code differences between the two approaches have been kept to + a minimum though. + + FEATURE OVERVIEW + ================ + + - Asynchronously load complete files, or stream files incrementally via + HTTP (on web platform), or the local file system (on native platforms) + + - Request / response-callback model, user code sends a request + to initiate a file-load, sokol_fetch.h calls the response callback + on the same thread when data is ready or user-code needs + to respond otherwise + + - Not limited to the main-thread or a single thread: A sokol-fetch + "context" can live on any thread, and multiple contexts + can operate side-by-side on different threads. + + - Memory management for data buffers is under full control of user code. + sokol_fetch.h won't allocate memory after it has been setup. + + - Automatic rate-limiting guarantees that only a maximum number of + requests is processed at any one time, allowing a zero-allocation + model, where all data is streamed into fixed-size, pre-allocated + buffers. + + - Active Requests can be paused, continued and cancelled from anywhere + in the user-thread which sent this request. + + + TL;DR EXAMPLE CODE + ================== + This is the most-simple example code to load a single data file with a + known maximum size: + + (1) initialize sokol-fetch with default parameters (but NOTE that the + default setup parameters provide a safe-but-slow "serialized" + operation): + + sfetch_setup(&(sfetch_desc_t){ 0 }); + + (2) send a fetch-request to load a file from the current directory + into a buffer big enough to hold the entire file content: + + static uint8_t buf[MAX_FILE_SIZE]; + + sfetch_send(&(sfetch_request_t){ + .path = "my_file.txt", + .callback = response_callback, + .buffer_ptr = buf, + .buffer_size = sizeof(buf) + }); + + (3) write a 'response-callback' function, this will be called whenever + the user-code must respond to state changes of the request + (most importantly when data has been loaded): + + void response_callback(const sfetch_response_t* response) { + if (response->fetched) { + // data has been loaded, and is available via + // 'buffer_ptr' and 'fetched_size': + const void* data = response->buffer_ptr; + uint64_t num_bytes = response->fetched_size; + } + if (response->finished) { + // the 'finished'-flag is the catch-all flag for when the request + // is finished, no matter if loading was successful or failed, + // so any cleanup-work should happen here... + ... + if (response->failed) { + // 'failed' is true in (addition to 'finished') if something + // went wrong (file doesn't exist, or less bytes could be + // read from the file than expected) + } + } + } + + (4) finally, call sfetch_shutdown() at the end of the application: + + sfetch_shutdown() + + There's many other loading-scenarios, for instance one doesn't have to + provide a buffer upfront, this can also happen in the response callback. + + Or it's possible to stream huge files into small fixed-size buffer, + complete with pausing and continuing the download. + + It's also possible to improve the 'pipeline throughput' by fetching + multiple files in parallel, but at the same time limit the maximum + number of requests that can be 'in-flight'. + + For how this all works, please read the following documentation sections :) + + + API DOCUMENTATION + ================= + + void sfetch_setup(const sfetch_desc_t* desc) + -------------------------------------------- + First call sfetch_setup(const sfetch_desc_t*) on any thread before calling + any other sokol-fetch functions on the same thread. + + sfetch_setup() takes a pointer to an sfetch_desc_t struct with setup + parameters. Parameters which should use their default values must + be zero-initialized: + + - max_requests (uint32_t): + The maximum number of requests that can be alive at any time, the + default is 128. + + - num_channels (uint32_t): + The number of "IO channels" used to parallelize and prioritize + requests, the default is 1. + + - num_lanes (uint32_t): + The number of "lanes" on a single channel. Each request which is + currently 'inflight' on a channel occupies one lane until the + request is finished. This is used for automatic rate-limiting + (search below for CHANNELS AND LANES for more details). The + default number of lanes is 1. + + For example, to setup sokol-fetch for max 1024 active requests, 4 channels, + and 8 lanes per channel in C99: + + sfetch_setup(&(sfetch_desc_t){ + .max_requests = 1024, + .num_channels = 4, + .num_lanes = 8 + }); + + sfetch_setup() is the only place where sokol-fetch will allocate memory. + + NOTE that the default setup parameters of 1 channel and 1 lane per channel + has a very poor 'pipeline throughput' since this essentially serializes + IO requests (a new request will only be processed when the last one has + finished), and since each request needs at least one roundtrip between + the user- and IO-thread the throughput will be at most one request per + frame. Search for LATENCY AND THROUGHPUT below for more information on + how to increase throughput. + + NOTE that you can call sfetch_setup() on multiple threads, each thread + will get its own thread-local sokol-fetch instance, which will work + independently from sokol-fetch instances on other threads. + + void sfetch_shutdown(void) + -------------------------- + Call sfetch_shutdown() at the end of the application to stop any + IO threads and free all memory that was allocated in sfetch_setup(). + + sfetch_handle_t sfetch_send(const sfetch_request_t* request) + ------------------------------------------------------------ + Call sfetch_send() to start loading data, the function takes a pointer to an + sfetch_request_t struct with request parameters and returns a + sfetch_handle_t identifying the request for later calls. At least + a path/URL and callback must be provided: + + sfetch_handle_t h = sfetch_send(&(sfetch_request_t){ + .path = "my_file.txt", + .callback = my_response_callback + }); + + sfetch_send() will return an invalid handle if no request can be allocated + from the internal pool because all available request items are 'in-flight'. + + The sfetch_request_t struct contains the following parameters (optional + parameters that are not provided must be zero-initialized): + + - path (const char*, required) + Pointer to an UTF-8 encoded C string describing the filesystem + path or HTTP URL. The string will be copied into an internal data + structure, and passed "as is" (apart from any required + encoding-conversions) to fopen(), CreateFileW() or + XMLHttpRequest. The maximum length of the string is defined by + the SFETCH_MAX_PATH configuration define, the default is 1024 bytes + including the 0-terminator byte. + + - callback (sfetch_callback_t, required) + Pointer to a response-callback function which is called when the + request needs "user code attention". Search below for REQUEST + STATES AND THE RESPONSE CALLBACK for detailed information about + handling responses in the response callback. + + - channel (uint32_t, optional) + Index of the IO channel where the request should be processed. + Channels are used to parallelize and prioritize requests relative + to each other. Search below for CHANNELS AND LANES for more + information. The default channel is 0. + + - chunk_size (uint32_t, optional) + The chunk_size member is used for streaming data incrementally + in small chunks. After 'chunk_size' bytes have been loaded into + to the streaming buffer, the response callback will be called + with the buffer containing the fetched data for the current chunk. + If chunk_size is 0 (the default), than the whole file will be loaded. + Please search below for CHUNK SIZE AND HTTP COMPRESSION for + important information how streaming works if the web server + is serving compressed data. + + - buffer_ptr, buffer_size (void*, uint64_t, optional) + This is a optional pointer/size pair describing a chunk of memory where + data will be loaded into (if no buffer is provided upfront, this + must happen in the response callback). If a buffer is provided, + it must be big enough to either hold the entire file (if chunk_size + is zero), or the *uncompressed* data for one downloaded chunk + (if chunk_size is > 0). + + - user_data_ptr, user_data_size (const void*, uint32_t, both optional) + user_data_ptr and user_data_size describe an optional POD (plain-old-data) + associated with the request which will be copied(!) into an internal + memory block. The maximum default size of this memory block is + 128 bytes (but can be overridden by defining SFETCH_MAX_USERDATA_UINT64 + before including the notification, note that this define is in + "number of uint64_t", not number of bytes). The user-data + block is 8-byte aligned, and will be copied via memcpy() (so don't + put any C++ "smart members" in there). + + NOTE that request handles are strictly thread-local and only unique + within the thread the handle was created on, and all function calls + involving a request handle must happen on that same thread. + + bool sfetch_handle_valid(sfetch_handle_t request) + ------------------------------------------------- + This checks if the provided request handle is valid, and is associated with + a currently active request. It will return false if: + + - sfetch_send() returned an invalid handle because it couldn't allocate + a new request from the internal request pool (because they're all + in flight) + - the request associated with the handle is no longer alive (because + it either finished successfully, or the request failed for some + reason) + + void sfetch_dowork(void) + ------------------------ + Call sfetch_dowork(void) in regular intervals (for instance once per frame) + on the same thread as sfetch_setup() to "turn the gears". If you are sending + requests but never hear back from them in the response callback function, then + the most likely reason is that you forgot to add the call to sfetch_dowork() + in the per-frame function. + + sfetch_dowork() roughly performs the following work: + + - any new requests that have been sent with sfetch_send() since the + last call to sfetch_dowork() will be dispatched to their IO channels + and assigned a free lane. If all lanes on that channel are occupied + by requests 'in flight', incoming requests must wait until + a lane becomes avaible + + - for all new requests which have been enquened on a channel which + don't already have a buffer assigned the response callback will be + called with (response->dispatched == true) so that the response + callback can inspect the dynamically assigned lane and bind a buffer + to the request (search below for CHANNELS AND LANE for more info) + + - a state transition from "user side" to "IO thread side" happens for + each new request that has been dispatched to a channel. + + - requests dispatched to a channel are either forwarded into that + channel's worker thread (on native platforms), or cause an HTTP + request to be sent via an asynchronous XMLHttpRequest (on the web + platform) + + - for all requests which have finished their current IO operation a + state transition from "IO thread side" to "user side" happens, + and the response callback is called so that the fetched data + can be processed. + + - requests which are completely finished (either because the entire + file content has been loaded, or they are in the FAILED state) are + freed (this just changes their state in the 'request pool', no actual + memory is freed) + + - requests which are not yet finished are fed back into the + 'incoming' queue of their channel, and the cycle starts again, this + only happens for requests which perform data streaming (not load + the entire file at once). + + void sfetch_cancel(sfetch_handle_t request) + ------------------------------------------- + This cancels a request in the next sfetch_dowork() call and invokes the + response callback with (response.failed == true) and (response.finished + == true) to give user-code a chance to do any cleanup work for the + request. If sfetch_cancel() is called for a request that is no longer + alive, nothing bad will happen (the call will simply do nothing). + + void sfetch_pause(sfetch_handle_t request) + ------------------------------------------ + This pauses an active request in the next sfetch_dowork() call and puts + it into the PAUSED state. For all requests in PAUSED state, the response + callback will be called in each call to sfetch_dowork() to give user-code + a chance to CONTINUE the request (by calling sfetch_continue()). Pausing + a request makes sense for dynamic rate-limiting in streaming scenarios + (like video/audio streaming with a fixed number of streaming buffers. As + soon as all available buffers are filled with download data, downloading + more data must be prevented to allow video/audio playback to catch up and + free up empty buffers for new download data. + + void sfetch_continue(sfetch_handle_t request) + --------------------------------------------- + Continues a paused request, counterpart to the sfetch_pause() function. + + void sfetch_bind_buffer(sfetch_handle_t request, void* buffer_ptr, uint64_t buffer_size) + ---------------------------------------------------------------------------------------- + This "binds" a new buffer (pointer/size pair) to an active request. The + function *must* be called from inside the response-callback, and there + must not already be another buffer bound. + + void* sfetch_unbind_buffer(sfetch_handle_t request) + --------------------------------------------------- + This removes the current buffer binding from the request and returns + a pointer to the previous buffer (useful if the buffer was dynamically + allocated and it must be freed). + + sfetch_unbind_buffer() *must* be called from inside the response callback. + + The usual code sequence to bind a different buffer in the response + callback might look like this: + + void response_callback(const sfetch_response_t* response) { + if (response.fetched) { + ... + // switch to a different buffer (in the FETCHED state it is + // guaranteed that the request has a buffer, otherwise it + // would have gone into the FAILED state + void* old_buf_ptr = sfetch_unbind_buffer(response.handle); + free(old_buf_ptr); + void* new_buf_ptr = malloc(new_buf_size); + sfetch_bind_buffer(response.handle, new_buf_ptr, new_buf_size); + } + if (response.finished) { + // unbind and free the currently associated buffer, + // the buffer pointer could be null if the request has failed + // NOTE that it is legal to call free() with a nullptr, + // this happens if the request failed to open its file + // and never goes into the OPENED state + void* buf_ptr = sfetch_unbind_buffer(response.handle); + free(buf_ptr); + } + } + + sfetch_desc_t sfetch_desc(void) + ------------------------------- + sfetch_desc() returns a copy of the sfetch_desc_t struct passed to + sfetch_setup(), with zero-inititialized values replaced with + their default values. + + int sfetch_max_userdata_bytes(void) + ----------------------------------- + This returns the value of the SFETCH_MAX_USERDATA_UINT64 config + define, but in number of bytes (so SFETCH_MAX_USERDATA_UINT64*8). + + int sfetch_max_path(void) + ------------------------- + Returns the value of the SFETCH_MAX_PATH config define. + + + REQUEST STATES AND THE RESPONSE CALLBACK + ======================================== + A request goes through a number of states during its lifetime. Depending + on the current state of a request, it will be 'owned' either by the + "user-thread" (where the request was sent) or an IO thread. + + You can think of a request as "ping-ponging" between the IO thread and + user thread, any actual IO work is done on the IO thread, while + invocations of the response-callback happen on the user-thread. + + All state transitions and callback invocations happen inside the + sfetch_dowork() function. + + An active request goes through the following states: + + ALLOCATED (user-thread) + + The request has been allocated in sfetch_send() and is + waiting to be dispatched into its IO channel. When this + happens, the request will transition into the DISPATCHED state. + + DISPATCHED (IO thread) + + The request has been dispatched into its IO channel, and a + lane has been assigned to the request. + + If a buffer was provided in sfetch_send() the request will + immediately transition into the FETCHING state and start loading + data into the buffer. + + If no buffer was provided in sfetch_send(), the response + callback will be called with (response->dispatched == true), + so that the response callback can bind a buffer to the + request. Binding the buffer in the response callback makes + sense if the buffer isn't dynamically allocated, but instead + a pre-allocated buffer must be selected from the request's + channel and lane. + + Note that it isn't possible to get a file size in the response callback + which would help with allocating a buffer of the right size, this is + because it isn't possible in HTTP to query the file size before the + entire file is downloaded (...when the web server serves files compressed). + + If opening the file failed, the request will transition into + the FAILED state with the error code SFETCH_ERROR_FILE_NOT_FOUND. + + FETCHING (IO thread) + + While a request is in the FETCHING state, data will be loaded into + the user-provided buffer. + + If no buffer was provided, the request will go into the FAILED + state with the error code SFETCH_ERROR_NO_BUFFER. + + If a buffer was provided, but it is too small to contain the + fetched data, the request will go into the FAILED state with + error code SFETCH_ERROR_BUFFER_TOO_SMALL. + + If less data can be read from the file than expected, the request + will go into the FAILED state with error code SFETCH_ERROR_UNEXPECTED_EOF. + + If loading data into the provided buffer works as expected, the + request will go into the FETCHED state. + + FETCHED (user thread) + + The request goes into the FETCHED state either when the entire file + has been loaded into the provided buffer (when request.chunk_size == 0), + or a chunk has been loaded (and optionally decompressed) into the + buffer (when request.chunk_size > 0). + + The response callback will be called so that the user-code can + process the loaded data using the following sfetch_response_t struct members: + + - fetched_size: the number of bytes in the provided buffer + - buffer_ptr: pointer to the start of fetched data + - fetched_offset: the byte offset of the loaded data chunk in the + overall file (this is only set to a non-zero value in a streaming + scenario) + + Once all file data has been loaded, the 'finished' flag will be set + in the response callback's sfetch_response_t argument. + + After the user callback returns, and all file data has been loaded + (response.finished flag is set) the request has reached its end-of-life + and will recycled. + + Otherwise, if there's still data to load (because streaming was + requested by providing a non-zero request.chunk_size), the request + will switch back to the FETCHING state to load the next chunk of data. + + Note that it is ok to associate a different buffer or buffer-size + with the request by calling sfetch_bind_buffer() in the response-callback. + + To check in the response callback for the FETCHED state, and + independently whether the request is finished: + + void response_callback(const sfetch_response_t* response) { + if (response->fetched) { + // request is in FETCHED state, the loaded data is available + // in .buffer_ptr, and the number of bytes that have been + // loaded in .fetched_size: + const void* data = response->buffer_ptr; + const uint64_t num_bytes = response->fetched_size; + } + if (response->finished) { + // the finished flag is set either when all data + // has been loaded, the request has been cancelled, + // or the file operation has failed, this is where + // any required per-request cleanup work should happen + } + } + + + FAILED (user thread) + + A request will transition into the FAILED state in the following situations: + + - if the file doesn't exist or couldn't be opened for other + reasons (SFETCH_ERROR_FILE_NOT_FOUND) + - if no buffer is associated with the request in the FETCHING state + (SFETCH_ERROR_NO_BUFFER) + - if the provided buffer is too small to hold the entire file + (if request.chunk_size == 0), or the (potentially decompressed) + partial data chunk (SFETCH_ERROR_BUFFER_TOO_SMALL) + - if less bytes could be read from the file then expected + (SFETCH_ERROR_UNEXPECTED_EOF) + - if a request has been cancelled via sfetch_cancel() + (SFETCH_ERROR_CANCELLED) + + The response callback will be called once after a request goes into + the FAILED state, with the 'response->finished' and + 'response->failed' flags set to true. + + This gives the user-code a chance to cleanup any resources associated + with the request. + + To check for the failed state in the response callback: + + void response_callback(const sfetch_response_t* response) { + if (response->failed) { + // specifically check for the failed state... + } + // or you can do a catch-all check via the finished-flag: + if (response->finished) { + if (response->failed) { + // if more detailed error handling is needed: + switch (response->error_code) { + ... + } + } + } + } + + PAUSED (user thread) + + A request will transition into the PAUSED state after user-code + calls the function sfetch_pause() on the request's handle. Usually + this happens from within the response-callback in streaming scenarios + when the data streaming needs to wait for a data decoder (like + a video/audio player) to catch up. + + While a request is in PAUSED state, the response-callback will be + called in each sfetch_dowork(), so that the user-code can either + continue the request by calling sfetch_continue(), or cancel + the request by calling sfetch_cancel(). + + When calling sfetch_continue() on a paused request, the request will + transition into the FETCHING state. Otherwise if sfetch_cancel() is + called, the request will switch into the FAILED state. + + To check for the PAUSED state in the response callback: + + void response_callback(const sfetch_response_t* response) { + if (response->paused) { + // we can check here whether the request should + // continue to load data: + if (should_continue(response->handle)) { + sfetch_continue(response->handle); + } + } + } + + + CHUNK SIZE AND HTTP COMPRESSION + =============================== + TL;DR: for streaming scenarios, the provided chunk-size must be smaller + than the provided buffer-size because the web server may decide to + serve the data compressed and the chunk-size must be given in 'compressed + bytes' while the buffer receives 'uncompressed bytes'. It's not possible + in HTTP to query the uncompressed size for a compressed download until + that download has finished. + + With vanilla HTTP, it is not possible to query the actual size of a file + without downloading the entire file first (the Content-Length response + header only provides the compressed size). Furthermore, for HTTP + range-requests, the range is given on the compressed data, not the + uncompressed data. So if the web server decides to server the data + compressed, the content-length and range-request parameters don't + correspond to the uncompressed data that's arriving in the sokol-fetch + buffers, and there's no way from JS or WASM to either force uncompressed + downloads (e.g. by setting the Accept-Encoding field), or access the + compressed data. + + This has some implications for sokol_fetch.h, most notably that buffers + can't be provided in the exactly right size, because that size can't + be queried from HTTP before the data is actually downloaded. + + When downloading whole files at once, it is basically expected that you + know the maximum files size upfront through other means (for instance + through a separate meta-data-file which contains the file sizes and + other meta-data for each file that needs to be loaded). + + For streaming downloads the situation is a bit more complicated. These + use HTTP range-requests, and those ranges are defined on the (potentially) + compressed data which the JS/WASM side doesn't have access to. However, + the JS/WASM side only ever sees the uncompressed data, and it's not possible + to query the uncompressed size of a range request before that range request + has finished. + + If the provided buffer is too small to contain the uncompressed data, + the request will fail with error code SFETCH_ERROR_BUFFER_TOO_SMALL. + + + CHANNELS AND LANES + ================== + Channels and lanes are (somewhat artificial) concepts to manage + parallelization, prioritization and rate-limiting. + + Channels can be used to parallelize message processing for better + 'pipeline throughput', and to prioritize messages: user-code could + reserve one channel for "small and big" streaming downloads, + another channel for "regular" downloads and yet another high-priority channel + which would only be used for small files which need to start loading + immediately. + + Each channel comes with its own IO thread and message queues for pumping + messages in and out of the thread. The channel where a request is + processed is selected manually when sending a message: + + sfetch_send(&(sfetch_request_t){ + .path = "my_file.txt", + .callback = my_reponse_callback, + .channel = 2 + }); + + The number of channels is configured at startup in sfetch_setup() and + cannot be changed afterwards. + + Channels are completely separate from each other, and a request will + never "hop" from one channel to another. + + Each channel consists of a fixed number of "lanes" for automatic rate + limiting: + + When a request is sent to a channel via sfetch_send(), a "free lane" will + be picked and assigned to the request. The request will occupy this lane + for its entire life time (also while it is paused). If all lanes of a + channel are currently occupied, new requests will need to wait until a + lane becomes unoccupied. + + Since the number of channels and lanes is known upfront, it is guaranteed + that there will never be more than "num_channels * num_lanes" requests + in flight at any one time. + + This guarantee eliminates unexpected load- and memory-spikes when + many requests are sent in very short time, and it allows to pre-allocate + a fixed number of memory buffers which can be reused for the entire + "lifetime" of a sokol-fetch context. + + In the most simple scenario - when a maximum file size is known - buffers + can be statically allocated like this: + + uint8_t buffer[NUM_CHANNELS][NUM_LANES][MAX_FILE_SIZE]; + + Then in the user callback pick a buffer by channel and lane, + and associate it with the request like this: + + void response_callback(const sfetch_response_t* response) { + if (response->dispatched) { + void* ptr = buffer[response->channel][response->lane]; + sfetch_bind_buffer(response->handle, ptr, MAX_FILE_SIZE); + } + ... + } + + + NOTES ON OPTIMIZING PIPELINE LATENCY AND THROUGHPUT + =================================================== + With the default configuration of 1 channel and 1 lane per channel, + sokol_fetch.h will appear to have a shockingly bad loading performance + if several files are loaded. + + This has two reasons: + + (1) all parallelization when loading data has been disabled. A new + request will only be processed, when the last request has finished. + + (2) every invocation of the response-callback adds one frame of latency + to the request, because callbacks will only be called from within + sfetch_dowork() + + sokol-fetch takes a few shortcuts to improve step (2) and reduce + the 'inherent latency' of a request: + + - if a buffer is provided upfront, the response-callback won't be + called in the OPENED state, but start right with the FETCHED state + where data has already been loaded into the buffer + + - there is no separate CLOSED state where the callback is invoked + separately when loading has finished (or the request has failed), + instead the finished and failed flags will be set as part of + the last FETCHED invocation + + This means providing a big-enough buffer to fit the entire file is the + best case, the response callback will only be called once, ideally in + the next frame (or two calls to sfetch_dowork()). + + If no buffer is provided upfront, one frame of latency is added because + the response callback needs to be invoked in the OPENED state so that + the user code can bind a buffer. + + This means the best case for a request without an upfront-provided + buffer is 2 frames (or 3 calls to sfetch_dowork()). + + That's about what can be done to improve the latency for a single request, + but the really important step is to improve overall throughput. If you + need to load thousands of files you don't want that to be completely + serialized. + + The most important action to increase throughput is to increase the + number of lanes per channel. This defines how many requests can be + 'in flight' on a single channel at the same time. The guiding decision + factor for how many lanes you can "afford" is the memory size you want + to set aside for buffers. Each lane needs its own buffer so that + the data loaded for one request doesn't scribble over the data + loaded for another request. + + Here's a simple example of sending 4 requests without upfront buffer + on a channel with 1, 2 and 4 lanes, each line is one frame: + + 1 LANE (8 frames): + Lane 0: + ------------- + REQ 0 OPENED + REQ 0 FETCHED + REQ 1 OPENED + REQ 1 FETCHED + REQ 2 OPENED + REQ 2 FETCHED + REQ 3 OPENED + REQ 3 FETCHED + + Note how the request don't overlap, so they can all use the same buffer. + + 2 LANES (4 frames): + Lane 0: Lane 1: + --------------------------------- + REQ 0 OPENED REQ 1 OPENED + REQ 0 FETCHED REQ 1 FETCHED + REQ 2 OPENED REQ 3 OPENED + REQ 2 FETCHED REQ 3 FETCHED + + This reduces the overall time to 4 frames, but now you need 2 buffers so + that requests don't scribble over each other. + + 4 LANES (2 frames): + Lane 0: Lane 1: Lane 2: Lane 3: + ------------------------------------------------------------- + REQ 0 OPENED REQ 1 OPENED REQ 2 OPENED REQ 3 OPENED + REQ 0 FETCHED REQ 1 FETCHED REQ 2 FETCHED REQ 3 FETCHED + + Now we're down to the same 'best-case' latency as sending a single + request. + + Apart from the memory requirements for the streaming buffers (which is + under your control), you can be generous with the number of channels, + they don't add any processing overhead. + + The last option for tweaking latency and throughput is channels. Each + channel works independently from other channels, so while one + channel is busy working through a large number of requests (or one + very long streaming download), you can set aside a high-priority channel + for requests that need to start as soon as possible. + + On platforms with threading support, each channel runs on its own + thread, but this is mainly an implementation detail to work around + the blocking traditional file IO functions, not for performance reasons. + + + FUTURE PLANS / V2.0 IDEA DUMP + ============================= + - An optional polling API (as alternative to callback API) + - Move buffer-management into the API? The "manual management" + can be quite tricky especially for dynamic allocation scenarios, + API support for buffer management would simplify cases like + preventing that requests scribble over each other's buffers, or + an automatic garbage collection for dynamically allocated buffers, + or automatically falling back to dynamic allocation if static + buffers aren't big enough. + - Pluggable request handlers to load data from other "sources" + (especially HTTP downloads on native platforms via e.g. libcurl + would be useful) + - I'm currently not happy how the user-data block is handled, this + should getting and updating the user-data should be wrapped by + API functions (similar to bind/unbind buffer) + + + LICENSE + ======= + zlib/libpng license + + Copyright (c) 2019 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_FETCH_INCLUDED (1) +#include +#include + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* configuration values for sfetch_setup() */ +typedef struct sfetch_desc_t { + uint32_t _start_canary; + uint32_t max_requests; /* max number of active requests across all channels, default is 128 */ + uint32_t num_channels; /* number of channels to fetch requests in parallel, default is 1 */ + uint32_t num_lanes; /* max number of requests active on the same channel, default is 1 */ + uint32_t _end_canary; +} sfetch_desc_t; + +/* a request handle to identify an active fetch request, returned by sfetch_send() */ +typedef struct sfetch_handle_t { uint32_t id; } sfetch_handle_t; + +/* error codes */ +typedef enum { + SFETCH_ERROR_NO_ERROR, + SFETCH_ERROR_FILE_NOT_FOUND, + SFETCH_ERROR_NO_BUFFER, + SFETCH_ERROR_BUFFER_TOO_SMALL, + SFETCH_ERROR_UNEXPECTED_EOF, + SFETCH_ERROR_INVALID_HTTP_STATUS, + SFETCH_ERROR_CANCELLED +} sfetch_error_t; + +/* the response struct passed to the response callback */ +typedef struct sfetch_response_t { + sfetch_handle_t handle; /* request handle this response belongs to */ + bool dispatched; /* true when request is in DISPATCHED state (lane has been assigned) */ + bool fetched; /* true when request is in FETCHED state (fetched data is available) */ + bool paused; /* request is currently in paused state */ + bool finished; /* this is the last response for this request */ + bool failed; /* request has failed (always set together with 'finished') */ + bool cancelled; /* request was cancelled (always set together with 'finished') */ + sfetch_error_t error_code; /* more detailed error code when failed is true */ + uint32_t channel; /* the channel which processes this request */ + uint32_t lane; /* the lane this request occupies on its channel */ + const char* path; /* the original filesystem path of the request (FIXME: this is unsafe, wrap in API call?) */ + void* user_data; /* pointer to read/write user-data area (FIXME: this is unsafe, wrap in API call?) */ + uint32_t fetched_offset; /* current offset of fetched data chunk in file data */ + uint32_t fetched_size; /* size of fetched data chunk in number of bytes */ + void* buffer_ptr; /* pointer to buffer with fetched data */ + uint32_t buffer_size; /* overall buffer size (may be >= than fetched_size!) */ +} sfetch_response_t; + +/* response callback function signature */ +typedef void(*sfetch_callback_t)(const sfetch_response_t*); + +/* request parameters passed to sfetch_send() */ +typedef struct sfetch_request_t { + uint32_t _start_canary; + uint32_t channel; /* index of channel this request is assigned to (default: 0) */ + const char* path; /* filesystem path or HTTP URL (required) */ + sfetch_callback_t callback; /* response callback function pointer (required) */ + void* buffer_ptr; /* buffer pointer where data will be loaded into (optional) */ + uint32_t buffer_size; /* buffer size in number of bytes (optional) */ + uint32_t chunk_size; /* number of bytes to load per stream-block (optional) */ + const void* user_data_ptr; /* pointer to a POD user-data block which will be memcpy'd(!) (optional) */ + uint32_t user_data_size; /* size of user-data block (optional) */ + uint32_t _end_canary; +} sfetch_request_t; + +/* setup sokol-fetch (can be called on multiple threads) */ +SOKOL_API_DECL void sfetch_setup(const sfetch_desc_t* desc); +/* discard a sokol-fetch context */ +SOKOL_API_DECL void sfetch_shutdown(void); +/* return true if sokol-fetch has been setup */ +SOKOL_API_DECL bool sfetch_valid(void); +/* get the desc struct that was passed to sfetch_setup() */ +SOKOL_API_DECL sfetch_desc_t sfetch_desc(void); +/* return the max userdata size in number of bytes (SFETCH_MAX_USERDATA_UINT64 * sizeof(uint64_t)) */ +SOKOL_API_DECL int sfetch_max_userdata_bytes(void); +/* return the value of the SFETCH_MAX_PATH implementation config value */ +SOKOL_API_DECL int sfetch_max_path(void); + +/* send a fetch-request, get handle to request back */ +SOKOL_API_DECL sfetch_handle_t sfetch_send(const sfetch_request_t* request); +/* return true if a handle is valid *and* the request is alive */ +SOKOL_API_DECL bool sfetch_handle_valid(sfetch_handle_t h); +/* do per-frame work, moves requests into and out of IO threads, and invokes response-callbacks */ +SOKOL_API_DECL void sfetch_dowork(void); + +/* bind a data buffer to a request (request must not currently have a buffer bound, must be called from response callback */ +SOKOL_API_DECL void sfetch_bind_buffer(sfetch_handle_t h, void* buffer_ptr, uint32_t buffer_size); +/* clear the 'buffer binding' of a request, returns previous buffer pointer (can be 0), must be called from response callback */ +SOKOL_API_DECL void* sfetch_unbind_buffer(sfetch_handle_t h); +/* cancel a request that's in flight (will call response callback with .cancelled + .finished) */ +SOKOL_API_DECL void sfetch_cancel(sfetch_handle_t h); +/* pause a request (will call response callback each frame with .paused) */ +SOKOL_API_DECL void sfetch_pause(sfetch_handle_t h); +/* continue a paused request */ +SOKOL_API_DECL void sfetch_continue(sfetch_handle_t h); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif // SOKOL_FETCH_INCLUDED + +/*--- IMPLEMENTATION ---------------------------------------------------------*/ +#ifdef SOKOL_IMPL +#define SOKOL_FETCH_IMPL_INCLUDED (1) +#include /* memset, memcpy */ + +#ifndef SFETCH_MAX_PATH +#define SFETCH_MAX_PATH (1024) +#endif +#ifndef SFETCH_MAX_USERDATA_UINT64 +#define SFETCH_MAX_USERDATA_UINT64 (16) +#endif +#ifndef SFETCH_MAX_CHANNELS +#define SFETCH_MAX_CHANNELS (16) +#endif + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef SOKOL_MALLOC + #include + #define SOKOL_MALLOC(s) malloc(s) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #else + #define SOKOL_LOG(s) + #endif +#endif + +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif + +#if defined(__EMSCRIPTEN__) + #include + #define _SFETCH_PLATFORM_EMSCRIPTEN (1) + #define _SFETCH_PLATFORM_WINDOWS (0) + #define _SFETCH_PLATFORM_POSIX (0) + #define _SFETCH_HAS_THREADS (0) +#elif defined(_WIN32) + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #define _SFETCH_PLATFORM_WINDOWS (1) + #define _SFETCH_PLATFORM_EMSCRIPTEN (0) + #define _SFETCH_PLATFORM_POSIX (0) + #define _SFETCH_HAS_THREADS (1) +#else + #include + #include /* fopen, fread, fseek, fclose */ + #define _SFETCH_PLATFORM_POSIX (1) + #define _SFETCH_PLATFORM_EMSCRIPTEN (0) + #define _SFETCH_PLATFORM_WINDOWS (0) + #define _SFETCH_HAS_THREADS (1) +#endif + +/*=== private type definitions ===============================================*/ +typedef struct _sfetch_path_t { + char buf[SFETCH_MAX_PATH]; +} _sfetch_path_t; + +typedef struct _sfetch_buffer_t { + uint8_t* ptr; + uint32_t size; +} _sfetch_buffer_t; + +/* a thread with incoming and outgoing message queue syncing */ +#if _SFETCH_PLATFORM_POSIX +typedef struct { + pthread_t thread; + pthread_cond_t incoming_cond; + pthread_mutex_t incoming_mutex; + pthread_mutex_t outgoing_mutex; + pthread_mutex_t running_mutex; + pthread_mutex_t stop_mutex; + bool stop_requested; + bool valid; +} _sfetch_thread_t; +#elif _SFETCH_PLATFORM_WINDOWS +typedef struct { + HANDLE thread; + HANDLE incoming_event; + CRITICAL_SECTION incoming_critsec; + CRITICAL_SECTION outgoing_critsec; + CRITICAL_SECTION running_critsec; + CRITICAL_SECTION stop_critsec; + bool stop_requested; + bool valid; +} _sfetch_thread_t; +#endif + +/* file handle abstraction */ +#if _SFETCH_PLATFORM_POSIX +typedef FILE* _sfetch_file_handle_t; +#define _SFETCH_INVALID_FILE_HANDLE (0) +typedef void*(*_sfetch_thread_func_t)(void*); +#elif _SFETCH_PLATFORM_WINDOWS +typedef HANDLE _sfetch_file_handle_t; +#define _SFETCH_INVALID_FILE_HANDLE (INVALID_HANDLE_VALUE) +typedef LPTHREAD_START_ROUTINE _sfetch_thread_func_t; +#endif + +/* user-side per-request state */ +typedef struct { + bool pause; /* switch item to PAUSED state if true */ + bool cont; /* switch item back to FETCHING if true */ + bool cancel; /* cancel the request, switch into FAILED state */ + /* transfer IO => user thread */ + uint32_t fetched_offset; /* number of bytes fetched so far */ + uint32_t fetched_size; /* size of last fetched chunk */ + sfetch_error_t error_code; + bool finished; + /* user thread only */ + uint32_t user_data_size; + uint64_t user_data[SFETCH_MAX_USERDATA_UINT64]; +} _sfetch_item_user_t; + +/* thread-side per-request state */ +typedef struct { + /* transfer IO => user thread */ + uint32_t fetched_offset; + uint32_t fetched_size; + sfetch_error_t error_code; + bool failed; + bool finished; + /* IO thread only */ + #if _SFETCH_PLATFORM_EMSCRIPTEN + uint32_t http_range_offset; + #else + _sfetch_file_handle_t file_handle; + #endif + uint32_t content_size; +} _sfetch_item_thread_t; + +/* a request goes through the following states, ping-ponging between IO and user thread */ +typedef enum _sfetch_state_t { + _SFETCH_STATE_INITIAL, /* internal: request has just been initialized */ + _SFETCH_STATE_ALLOCATED, /* internal: request has been allocated from internal pool */ + _SFETCH_STATE_DISPATCHED, /* user thread: request has been dispatched to its IO channel */ + _SFETCH_STATE_FETCHING, /* IO thread: waiting for data to be fetched */ + _SFETCH_STATE_FETCHED, /* user thread: fetched data available */ + _SFETCH_STATE_PAUSED, /* user thread: request has been paused via sfetch_pause() */ + _SFETCH_STATE_FAILED, /* user thread: follow state or FETCHING if something went wrong */ +} _sfetch_state_t; + +/* an internal request item */ +#define _SFETCH_INVALID_LANE (0xFFFFFFFF) +typedef struct { + sfetch_handle_t handle; + _sfetch_state_t state; + uint32_t channel; + uint32_t lane; + uint32_t chunk_size; + sfetch_callback_t callback; + _sfetch_buffer_t buffer; + + /* updated by IO-thread, off-limits to user thread */ + _sfetch_item_thread_t thread; + + /* accessible by user-thread, off-limits to IO thread */ + _sfetch_item_user_t user; + + /* big stuff at the end */ + _sfetch_path_t path; +} _sfetch_item_t; + +/* a pool of internal per-request items */ +typedef struct { + uint32_t size; + uint32_t free_top; + _sfetch_item_t* items; + uint32_t* free_slots; + uint32_t* gen_ctrs; + bool valid; +} _sfetch_pool_t; + +/* a ringbuffer for pool-slot ids */ +typedef struct { + uint32_t head; + uint32_t tail; + uint32_t num; + uint32_t* buf; +} _sfetch_ring_t; + +/* an IO channel with its own IO thread */ +struct _sfetch_t; +typedef struct { + struct _sfetch_t* ctx; /* back-pointer to thread-local _sfetch state pointer, + since this isn't accessible from the IO threads */ + _sfetch_ring_t free_lanes; + _sfetch_ring_t user_sent; + _sfetch_ring_t user_incoming; + _sfetch_ring_t user_outgoing; + #if _SFETCH_HAS_THREADS + _sfetch_ring_t thread_incoming; + _sfetch_ring_t thread_outgoing; + _sfetch_thread_t thread; + #endif + void (*request_handler)(struct _sfetch_t* ctx, uint32_t slot_id); + bool valid; +} _sfetch_channel_t; + +/* the sfetch global state */ +typedef struct _sfetch_t { + bool setup; + bool valid; + bool in_callback; + sfetch_desc_t desc; + _sfetch_pool_t pool; + _sfetch_channel_t chn[SFETCH_MAX_CHANNELS]; +} _sfetch_t; +#if _SFETCH_HAS_THREADS +#if defined(_MSC_VER) +static __declspec(thread) _sfetch_t* _sfetch; +#else +static __thread _sfetch_t* _sfetch; +#endif +#else +static _sfetch_t* _sfetch; +#endif + +/*=== general helper functions and macros =====================================*/ +#define _sfetch_def(val, def) (((val) == 0) ? (def) : (val)) + +_SOKOL_PRIVATE _sfetch_t* _sfetch_ctx(void) { + return _sfetch; +} + +_SOKOL_PRIVATE void _sfetch_path_copy(_sfetch_path_t* dst, const char* src) { + SOKOL_ASSERT(dst); + if (src && (strlen(src) < SFETCH_MAX_PATH)) { + #if defined(_MSC_VER) + strncpy_s(dst->buf, SFETCH_MAX_PATH, src, (SFETCH_MAX_PATH-1)); + #else + strncpy(dst->buf, src, SFETCH_MAX_PATH); + #endif + dst->buf[SFETCH_MAX_PATH-1] = 0; + } + else { + memset(dst->buf, 0, SFETCH_MAX_PATH); + } +} + +_SOKOL_PRIVATE _sfetch_path_t _sfetch_path_make(const char* str) { + _sfetch_path_t res; + _sfetch_path_copy(&res, str); + return res; +} + +_SOKOL_PRIVATE uint32_t _sfetch_make_id(uint32_t index, uint32_t gen_ctr) { + return (gen_ctr<<16) | (index & 0xFFFF); +} + +_SOKOL_PRIVATE sfetch_handle_t _sfetch_make_handle(uint32_t slot_id) { + sfetch_handle_t h; + h.id = slot_id; + return h; +} + +_SOKOL_PRIVATE uint32_t _sfetch_slot_index(uint32_t slot_id) { + return slot_id & 0xFFFF; +} + +/*=== a circular message queue ===============================================*/ +_SOKOL_PRIVATE uint32_t _sfetch_ring_wrap(const _sfetch_ring_t* rb, uint32_t i) { + return i % rb->num; +} + +_SOKOL_PRIVATE void _sfetch_ring_discard(_sfetch_ring_t* rb) { + SOKOL_ASSERT(rb); + if (rb->buf) { + SOKOL_FREE(rb->buf); + rb->buf = 0; + } + rb->head = 0; + rb->tail = 0; + rb->num = 0; +} + +_SOKOL_PRIVATE bool _sfetch_ring_init(_sfetch_ring_t* rb, uint32_t num_slots) { + SOKOL_ASSERT(rb && (num_slots > 0)); + SOKOL_ASSERT(0 == rb->buf); + rb->head = 0; + rb->tail = 0; + /* one slot reserved to detect full vs empty */ + rb->num = num_slots + 1; + const size_t queue_size = rb->num * sizeof(sfetch_handle_t); + rb->buf = (uint32_t*) SOKOL_MALLOC(queue_size); + if (rb->buf) { + memset(rb->buf, 0, queue_size); + return true; + } + else { + _sfetch_ring_discard(rb); + return false; + } +} + +_SOKOL_PRIVATE bool _sfetch_ring_full(const _sfetch_ring_t* rb) { + SOKOL_ASSERT(rb && rb->buf); + return _sfetch_ring_wrap(rb, rb->head + 1) == rb->tail; +} + +_SOKOL_PRIVATE bool _sfetch_ring_empty(const _sfetch_ring_t* rb) { + SOKOL_ASSERT(rb && rb->buf); + return rb->head == rb->tail; +} + +_SOKOL_PRIVATE uint32_t _sfetch_ring_count(const _sfetch_ring_t* rb) { + SOKOL_ASSERT(rb && rb->buf); + uint32_t count; + if (rb->head >= rb->tail) { + count = rb->head - rb->tail; + } + else { + count = (rb->head + rb->num) - rb->tail; + } + SOKOL_ASSERT(count < rb->num); + return count; +} + +_SOKOL_PRIVATE void _sfetch_ring_enqueue(_sfetch_ring_t* rb, uint32_t slot_id) { + SOKOL_ASSERT(rb && rb->buf); + SOKOL_ASSERT(!_sfetch_ring_full(rb)); + SOKOL_ASSERT(rb->head < rb->num); + rb->buf[rb->head] = slot_id; + rb->head = _sfetch_ring_wrap(rb, rb->head + 1); +} + +_SOKOL_PRIVATE uint32_t _sfetch_ring_dequeue(_sfetch_ring_t* rb) { + SOKOL_ASSERT(rb && rb->buf); + SOKOL_ASSERT(!_sfetch_ring_empty(rb)); + SOKOL_ASSERT(rb->tail < rb->num); + uint32_t slot_id = rb->buf[rb->tail]; + rb->tail = _sfetch_ring_wrap(rb, rb->tail + 1); + return slot_id; +} + +_SOKOL_PRIVATE uint32_t _sfetch_ring_peek(const _sfetch_ring_t* rb, uint32_t index) { + SOKOL_ASSERT(rb && rb->buf); + SOKOL_ASSERT(!_sfetch_ring_empty(rb)); + SOKOL_ASSERT(index < _sfetch_ring_count(rb)); + uint32_t rb_index = _sfetch_ring_wrap(rb, rb->tail + index); + return rb->buf[rb_index]; +} + +/*=== request pool implementation ============================================*/ +_SOKOL_PRIVATE void _sfetch_item_init(_sfetch_item_t* item, uint32_t slot_id, const sfetch_request_t* request) { + SOKOL_ASSERT(item && (0 == item->handle.id)); + SOKOL_ASSERT(request && request->path); + memset(item, 0, sizeof(_sfetch_item_t)); + item->handle.id = slot_id; + item->state = _SFETCH_STATE_INITIAL; + item->channel = request->channel; + item->chunk_size = request->chunk_size; + item->lane = _SFETCH_INVALID_LANE; + item->callback = request->callback; + item->buffer.ptr = (uint8_t*) request->buffer_ptr; + item->buffer.size = request->buffer_size; + item->path = _sfetch_path_make(request->path); + #if !_SFETCH_PLATFORM_EMSCRIPTEN + item->thread.file_handle = _SFETCH_INVALID_FILE_HANDLE; + #endif + if (request->user_data_ptr && + (request->user_data_size > 0) && + (request->user_data_size <= (SFETCH_MAX_USERDATA_UINT64*8))) + { + item->user.user_data_size = request->user_data_size; + memcpy(item->user.user_data, request->user_data_ptr, request->user_data_size); + } +} + +_SOKOL_PRIVATE void _sfetch_item_discard(_sfetch_item_t* item) { + SOKOL_ASSERT(item && (0 != item->handle.id)); + memset(item, 0, sizeof(_sfetch_item_t)); +} + +_SOKOL_PRIVATE void _sfetch_pool_discard(_sfetch_pool_t* pool) { + SOKOL_ASSERT(pool); + if (pool->free_slots) { + SOKOL_FREE(pool->free_slots); + pool->free_slots = 0; + } + if (pool->gen_ctrs) { + SOKOL_FREE(pool->gen_ctrs); + pool->gen_ctrs = 0; + } + if (pool->items) { + SOKOL_FREE(pool->items); + pool->items = 0; + } + pool->size = 0; + pool->free_top = 0; + pool->valid = false; +} + +_SOKOL_PRIVATE bool _sfetch_pool_init(_sfetch_pool_t* pool, uint32_t num_items) { + SOKOL_ASSERT(pool && (num_items > 0) && (num_items < ((1<<16)-1))); + SOKOL_ASSERT(0 == pool->items); + /* NOTE: item slot 0 is reserved for the special "invalid" item index 0*/ + pool->size = num_items + 1; + pool->free_top = 0; + const size_t items_size = pool->size * sizeof(_sfetch_item_t); + pool->items = (_sfetch_item_t*) SOKOL_MALLOC(items_size); + /* generation counters indexable by pool slot index, slot 0 is reserved */ + const size_t gen_ctrs_size = sizeof(uint32_t) * pool->size; + pool->gen_ctrs = (uint32_t*) SOKOL_MALLOC(gen_ctrs_size); + SOKOL_ASSERT(pool->gen_ctrs); + /* NOTE: it's not a bug to only reserve num_items here */ + const size_t free_slots_size = num_items * sizeof(int); + pool->free_slots = (uint32_t*) SOKOL_MALLOC(free_slots_size); + if (pool->items && pool->free_slots) { + memset(pool->items, 0, items_size); + memset(pool->gen_ctrs, 0, gen_ctrs_size); + /* never allocate the 0-th item, this is the reserved 'invalid item' */ + for (uint32_t i = pool->size - 1; i >= 1; i--) { + pool->free_slots[pool->free_top++] = i; + } + pool->valid = true; + } + else { + /* allocation error */ + _sfetch_pool_discard(pool); + } + return pool->valid; +} + +_SOKOL_PRIVATE uint32_t _sfetch_pool_item_alloc(_sfetch_pool_t* pool, const sfetch_request_t* request) { + SOKOL_ASSERT(pool && pool->valid); + if (pool->free_top > 0) { + uint32_t slot_index = pool->free_slots[--pool->free_top]; + SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size)); + uint32_t slot_id = _sfetch_make_id(slot_index, ++pool->gen_ctrs[slot_index]); + _sfetch_item_init(&pool->items[slot_index], slot_id, request); + pool->items[slot_index].state = _SFETCH_STATE_ALLOCATED; + return slot_id; + } + else { + /* pool exhausted, return the 'invalid handle' */ + return _sfetch_make_id(0, 0); + } +} + +_SOKOL_PRIVATE void _sfetch_pool_item_free(_sfetch_pool_t* pool, uint32_t slot_id) { + SOKOL_ASSERT(pool && pool->valid); + uint32_t slot_index = _sfetch_slot_index(slot_id); + SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size)); + SOKOL_ASSERT(pool->items[slot_index].handle.id == slot_id); + #if defined(SOKOL_DEBUG) + /* debug check against double-free */ + for (uint32_t i = 0; i < pool->free_top; i++) { + SOKOL_ASSERT(pool->free_slots[i] != slot_index); + } + #endif + _sfetch_item_discard(&pool->items[slot_index]); + pool->free_slots[pool->free_top++] = slot_index; + SOKOL_ASSERT(pool->free_top <= (pool->size - 1)); +} + +/* return pointer to item by handle without matching id check */ +_SOKOL_PRIVATE _sfetch_item_t* _sfetch_pool_item_at(_sfetch_pool_t* pool, uint32_t slot_id) { + SOKOL_ASSERT(pool && pool->valid); + uint32_t slot_index = _sfetch_slot_index(slot_id); + SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size)); + return &pool->items[slot_index]; +} + +/* return pointer to item by handle with matching id check */ +_SOKOL_PRIVATE _sfetch_item_t* _sfetch_pool_item_lookup(_sfetch_pool_t* pool, uint32_t slot_id) { + SOKOL_ASSERT(pool && pool->valid); + if (0 != slot_id) { + _sfetch_item_t* item = _sfetch_pool_item_at(pool, slot_id); + if (item->handle.id == slot_id) { + return item; + } + } + return 0; +} + +/*=== PLATFORM WRAPPER FUNCTIONS =============================================*/ +#if _SFETCH_PLATFORM_POSIX +_SOKOL_PRIVATE _sfetch_file_handle_t _sfetch_file_open(const _sfetch_path_t* path) { + return fopen(path->buf, "rb"); +} + +_SOKOL_PRIVATE void _sfetch_file_close(_sfetch_file_handle_t h) { + fclose(h); +} + +_SOKOL_PRIVATE bool _sfetch_file_handle_valid(_sfetch_file_handle_t h) { + return h != _SFETCH_INVALID_FILE_HANDLE; +} + +_SOKOL_PRIVATE uint32_t _sfetch_file_size(_sfetch_file_handle_t h) { + fseek(h, 0, SEEK_END); + return (uint32_t) ftell(h); +} + +_SOKOL_PRIVATE bool _sfetch_file_read(_sfetch_file_handle_t h, uint32_t offset, uint32_t num_bytes, void* ptr) { + fseek(h, offset, SEEK_SET); + return num_bytes == fread(ptr, 1, num_bytes, h); +} + +_SOKOL_PRIVATE bool _sfetch_thread_init(_sfetch_thread_t* thread, _sfetch_thread_func_t thread_func, void* thread_arg) { + SOKOL_ASSERT(thread && !thread->valid && !thread->stop_requested); + + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutex_init(&thread->incoming_mutex, &attr); + pthread_mutexattr_destroy(&attr); + + pthread_mutexattr_init(&attr); + pthread_mutex_init(&thread->outgoing_mutex, &attr); + pthread_mutexattr_destroy(&attr); + + pthread_mutexattr_init(&attr); + pthread_mutex_init(&thread->running_mutex, &attr); + pthread_mutexattr_destroy(&attr); + + pthread_mutexattr_init(&attr); + pthread_mutex_init(&thread->stop_mutex, &attr); + pthread_mutexattr_destroy(&attr); + + pthread_condattr_t cond_attr; + pthread_condattr_init(&cond_attr); + pthread_cond_init(&thread->incoming_cond, &cond_attr); + pthread_condattr_destroy(&cond_attr); + + /* FIXME: in debug mode, the threads should be named */ + pthread_mutex_lock(&thread->running_mutex); + int res = pthread_create(&thread->thread, 0, thread_func, thread_arg); + thread->valid = (0 == res); + pthread_mutex_unlock(&thread->running_mutex); + return thread->valid; +} + +_SOKOL_PRIVATE void _sfetch_thread_request_stop(_sfetch_thread_t* thread) { + pthread_mutex_lock(&thread->stop_mutex); + thread->stop_requested = true; + pthread_mutex_unlock(&thread->stop_mutex); +} + +_SOKOL_PRIVATE bool _sfetch_thread_stop_requested(_sfetch_thread_t* thread) { + pthread_mutex_lock(&thread->stop_mutex); + bool stop_requested = thread->stop_requested; + pthread_mutex_unlock(&thread->stop_mutex); + return stop_requested; +} + +_SOKOL_PRIVATE void _sfetch_thread_join(_sfetch_thread_t* thread) { + SOKOL_ASSERT(thread); + if (thread->valid) { + pthread_mutex_lock(&thread->incoming_mutex); + _sfetch_thread_request_stop(thread); + pthread_cond_signal(&thread->incoming_cond); + pthread_mutex_unlock(&thread->incoming_mutex); + pthread_join(thread->thread, 0); + thread->valid = false; + } + pthread_mutex_destroy(&thread->stop_mutex); + pthread_mutex_destroy(&thread->running_mutex); + pthread_mutex_destroy(&thread->incoming_mutex); + pthread_mutex_destroy(&thread->outgoing_mutex); + pthread_cond_destroy(&thread->incoming_cond); +} + +/* called when the thread-func is entered, this blocks the thread func until + the _sfetch_thread_t object is fully initialized +*/ +_SOKOL_PRIVATE void _sfetch_thread_entered(_sfetch_thread_t* thread) { + pthread_mutex_lock(&thread->running_mutex); +} + +/* called by the thread-func right before it is left */ +_SOKOL_PRIVATE void _sfetch_thread_leaving(_sfetch_thread_t* thread) { + pthread_mutex_unlock(&thread->running_mutex); +} + +_SOKOL_PRIVATE void _sfetch_thread_enqueue_incoming(_sfetch_thread_t* thread, _sfetch_ring_t* incoming, _sfetch_ring_t* src) { + /* called from user thread */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(incoming && incoming->buf); + SOKOL_ASSERT(src && src->buf); + if (!_sfetch_ring_empty(src)) { + pthread_mutex_lock(&thread->incoming_mutex); + while (!_sfetch_ring_full(incoming) && !_sfetch_ring_empty(src)) { + _sfetch_ring_enqueue(incoming, _sfetch_ring_dequeue(src)); + } + pthread_cond_signal(&thread->incoming_cond); + pthread_mutex_unlock(&thread->incoming_mutex); + } +} + +_SOKOL_PRIVATE uint32_t _sfetch_thread_dequeue_incoming(_sfetch_thread_t* thread, _sfetch_ring_t* incoming) { + /* called from thread function */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(incoming && incoming->buf); + pthread_mutex_lock(&thread->incoming_mutex); + while (_sfetch_ring_empty(incoming) && !thread->stop_requested) { + pthread_cond_wait(&thread->incoming_cond, &thread->incoming_mutex); + } + uint32_t item = 0; + if (!thread->stop_requested) { + item = _sfetch_ring_dequeue(incoming); + } + pthread_mutex_unlock(&thread->incoming_mutex); + return item; +} + +_SOKOL_PRIVATE bool _sfetch_thread_enqueue_outgoing(_sfetch_thread_t* thread, _sfetch_ring_t* outgoing, uint32_t item) { + /* called from thread function */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(outgoing && outgoing->buf); + SOKOL_ASSERT(0 != item); + pthread_mutex_lock(&thread->outgoing_mutex); + bool result = false; + if (!_sfetch_ring_full(outgoing)) { + _sfetch_ring_enqueue(outgoing, item); + } + pthread_mutex_unlock(&thread->outgoing_mutex); + return result; +} + +_SOKOL_PRIVATE void _sfetch_thread_dequeue_outgoing(_sfetch_thread_t* thread, _sfetch_ring_t* outgoing, _sfetch_ring_t* dst) { + /* called from user thread */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(outgoing && outgoing->buf); + SOKOL_ASSERT(dst && dst->buf); + pthread_mutex_lock(&thread->outgoing_mutex); + while (!_sfetch_ring_full(dst) && !_sfetch_ring_empty(outgoing)) { + _sfetch_ring_enqueue(dst, _sfetch_ring_dequeue(outgoing)); + } + pthread_mutex_unlock(&thread->outgoing_mutex); +} +#endif /* _SFETCH_PLATFORM_POSIX */ + +#if _SFETCH_PLATFORM_WINDOWS +_SOKOL_PRIVATE bool _sfetch_win32_utf8_to_wide(const char* src, wchar_t* dst, int dst_num_bytes) { + SOKOL_ASSERT(src && dst && (dst_num_bytes > 1)); + memset(dst, 0, dst_num_bytes); + const int dst_chars = dst_num_bytes / sizeof(wchar_t); + const int dst_needed = MultiByteToWideChar(CP_UTF8, 0, src, -1, 0, 0); + if ((dst_needed > 0) && (dst_needed < dst_chars)) { + MultiByteToWideChar(CP_UTF8, 0, src, -1, dst, dst_chars); + return true; + } + else { + /* input string doesn't fit into destination buffer */ + return false; + } +} + +_SOKOL_PRIVATE _sfetch_file_handle_t _sfetch_file_open(const _sfetch_path_t* path) { + wchar_t w_path[SFETCH_MAX_PATH]; + if (!_sfetch_win32_utf8_to_wide(path->buf, w_path, sizeof(w_path))) { + SOKOL_LOG("_sfetch_file_open: error converting UTF-8 path to wide string"); + return 0; + } + _sfetch_file_handle_t h = CreateFileW( + w_path, /* lpFileName */ + GENERIC_READ, /* dwDesiredAccess */ + FILE_SHARE_READ, /* dwShareMode */ + NULL, /* lpSecurityAttributes */ + OPEN_EXISTING, /* dwCreationDisposition */ + FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN, /* dwFlagsAndAttributes */ + NULL); /* hTemplateFile */ + return h; +} + +_SOKOL_PRIVATE void _sfetch_file_close(_sfetch_file_handle_t h) { + CloseHandle(h); +} + +_SOKOL_PRIVATE bool _sfetch_file_handle_valid(_sfetch_file_handle_t h) { + return h != _SFETCH_INVALID_FILE_HANDLE; +} + +_SOKOL_PRIVATE uint32_t _sfetch_file_size(_sfetch_file_handle_t h) { + return GetFileSize(h, NULL); +} + +_SOKOL_PRIVATE bool _sfetch_file_read(_sfetch_file_handle_t h, uint32_t offset, uint32_t num_bytes, void* ptr) { + LARGE_INTEGER offset_li; + offset_li.QuadPart = offset; + BOOL seek_res = SetFilePointerEx(h, offset_li, NULL, FILE_BEGIN); + if (seek_res) { + DWORD bytes_read = 0; + BOOL read_res = ReadFile(h, ptr, (DWORD)num_bytes, &bytes_read, NULL); + return read_res && (bytes_read == num_bytes); + } + else { + return false; + } +} + +_SOKOL_PRIVATE bool _sfetch_thread_init(_sfetch_thread_t* thread, _sfetch_thread_func_t thread_func, void* thread_arg) { + SOKOL_ASSERT(thread && !thread->valid && !thread->stop_requested); + + thread->incoming_event = CreateEventA(NULL, FALSE, FALSE, NULL); + SOKOL_ASSERT(NULL != thread->incoming_event); + InitializeCriticalSection(&thread->incoming_critsec); + InitializeCriticalSection(&thread->outgoing_critsec); + InitializeCriticalSection(&thread->running_critsec); + InitializeCriticalSection(&thread->stop_critsec); + + EnterCriticalSection(&thread->running_critsec); + const SIZE_T stack_size = 512 * 1024; + thread->thread = CreateThread(NULL, 512*1024, thread_func, thread_arg, 0, NULL); + thread->valid = (NULL != thread->thread); + LeaveCriticalSection(&thread->running_critsec); + return thread->valid; +} + +_SOKOL_PRIVATE void _sfetch_thread_request_stop(_sfetch_thread_t* thread) { + EnterCriticalSection(&thread->stop_critsec); + thread->stop_requested = true; + LeaveCriticalSection(&thread->stop_critsec); +} + +_SOKOL_PRIVATE bool _sfetch_thread_stop_requested(_sfetch_thread_t* thread) { + EnterCriticalSection(&thread->stop_critsec); + bool stop_requested = thread->stop_requested; + LeaveCriticalSection(&thread->stop_critsec); + return stop_requested; +} + +_SOKOL_PRIVATE void _sfetch_thread_join(_sfetch_thread_t* thread) { + if (thread->valid) { + EnterCriticalSection(&thread->incoming_critsec); + _sfetch_thread_request_stop(thread); + BOOL set_event_res = SetEvent(thread->incoming_event); + SOKOL_ASSERT(set_event_res); + LeaveCriticalSection(&thread->incoming_critsec); + WaitForSingleObject(thread->thread, INFINITE); + CloseHandle(thread->thread); + thread->valid = false; + } + CloseHandle(thread->incoming_event); + DeleteCriticalSection(&thread->stop_critsec); + DeleteCriticalSection(&thread->running_critsec); + DeleteCriticalSection(&thread->outgoing_critsec); + DeleteCriticalSection(&thread->incoming_critsec); +} + +_SOKOL_PRIVATE void _sfetch_thread_entered(_sfetch_thread_t* thread) { + EnterCriticalSection(&thread->running_critsec); +} + +/* called by the thread-func right before it is left */ +_SOKOL_PRIVATE void _sfetch_thread_leaving(_sfetch_thread_t* thread) { + LeaveCriticalSection(&thread->running_critsec); +} + +_SOKOL_PRIVATE void _sfetch_thread_enqueue_incoming(_sfetch_thread_t* thread, _sfetch_ring_t* incoming, _sfetch_ring_t* src) { + /* called from user thread */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(incoming && incoming->buf); + SOKOL_ASSERT(src && src->buf); + if (!_sfetch_ring_empty(src)) { + EnterCriticalSection(&thread->incoming_critsec); + while (!_sfetch_ring_full(incoming) && !_sfetch_ring_empty(src)) { + _sfetch_ring_enqueue(incoming, _sfetch_ring_dequeue(src)); + } + LeaveCriticalSection(&thread->incoming_critsec); + BOOL set_event_res = SetEvent(thread->incoming_event); + SOKOL_ASSERT(set_event_res); + } +} + +_SOKOL_PRIVATE uint32_t _sfetch_thread_dequeue_incoming(_sfetch_thread_t* thread, _sfetch_ring_t* incoming) { + /* called from thread function */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(incoming && incoming->buf); + EnterCriticalSection(&thread->incoming_critsec); + while (_sfetch_ring_empty(incoming) && !thread->stop_requested) { + LeaveCriticalSection(&thread->incoming_critsec); + WaitForSingleObject(&thread->incoming_event, INFINITE); + EnterCriticalSection(&thread->incoming_critsec); + } + uint32_t item = 0; + if (!thread->stop_requested) { + item = _sfetch_ring_dequeue(incoming); + } + LeaveCriticalSection(&thread->incoming_critsec); + return item; +} + +_SOKOL_PRIVATE bool _sfetch_thread_enqueue_outgoing(_sfetch_thread_t* thread, _sfetch_ring_t* outgoing, uint32_t item) { + /* called from thread function */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(outgoing && outgoing->buf); + EnterCriticalSection(&thread->outgoing_critsec); + bool result = false; + if (!_sfetch_ring_full(outgoing)) { + _sfetch_ring_enqueue(outgoing, item); + } + LeaveCriticalSection(&thread->outgoing_critsec); + return result; +} + +_SOKOL_PRIVATE void _sfetch_thread_dequeue_outgoing(_sfetch_thread_t* thread, _sfetch_ring_t* outgoing, _sfetch_ring_t* dst) { + /* called from user thread */ + SOKOL_ASSERT(thread && thread->valid); + SOKOL_ASSERT(outgoing && outgoing->buf); + SOKOL_ASSERT(dst && dst->buf); + EnterCriticalSection(&thread->outgoing_critsec); + while (!_sfetch_ring_full(dst) && !_sfetch_ring_empty(outgoing)) { + _sfetch_ring_enqueue(dst, _sfetch_ring_dequeue(outgoing)); + } + LeaveCriticalSection(&thread->outgoing_critsec); +} +#endif /* _SFETCH_PLATFORM_WINDOWS */ + +/*=== IO CHANNEL implementation ==============================================*/ + +/* per-channel request handler for native platforms accessing the local filesystem */ +#if _SFETCH_HAS_THREADS +_SOKOL_PRIVATE void _sfetch_request_handler(_sfetch_t* ctx, uint32_t slot_id) { + _sfetch_state_t state; + _sfetch_path_t* path; + _sfetch_item_thread_t* thread; + _sfetch_buffer_t* buffer; + uint32_t chunk_size; + { + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, slot_id); + if (!item) { + return; + } + state = item->state; + SOKOL_ASSERT((state == _SFETCH_STATE_FETCHING) || + (state == _SFETCH_STATE_PAUSED) || + (state == _SFETCH_STATE_FAILED)); + path = &item->path; + thread = &item->thread; + buffer = &item->buffer; + chunk_size = item->chunk_size; + } + if (thread->failed) { + return; + } + if (state == _SFETCH_STATE_FETCHING) { + if ((buffer->ptr == 0) || (buffer->size == 0)) { + thread->error_code = SFETCH_ERROR_NO_BUFFER; + thread->failed = true; + } + else { + /* open file if not happened yet */ + if (!_sfetch_file_handle_valid(thread->file_handle)) { + SOKOL_ASSERT(path->buf[0]); + SOKOL_ASSERT(thread->fetched_offset == 0); + SOKOL_ASSERT(thread->fetched_size == 0); + thread->file_handle = _sfetch_file_open(path); + if (_sfetch_file_handle_valid(thread->file_handle)) { + thread->content_size = _sfetch_file_size(thread->file_handle); + } + else { + thread->error_code = SFETCH_ERROR_FILE_NOT_FOUND; + thread->failed = true; + } + } + if (!thread->failed) { + uint32_t read_offset = 0; + uint32_t bytes_to_read = 0; + if (chunk_size == 0) { + /* load entire file */ + if (thread->content_size <= buffer->size) { + bytes_to_read = thread->content_size; + read_offset = 0; + } + else { + /* provided buffer to small to fit entire file */ + thread->error_code = SFETCH_ERROR_BUFFER_TOO_SMALL; + thread->failed = true; + } + } + else { + if (chunk_size <= buffer->size) { + bytes_to_read = chunk_size; + read_offset = thread->fetched_offset; + if ((read_offset + bytes_to_read) > thread->content_size) { + bytes_to_read = thread->content_size - read_offset; + } + } + else { + /* provided buffer to small to fit next chunk */ + thread->error_code = SFETCH_ERROR_BUFFER_TOO_SMALL; + thread->failed = true; + } + } + if (!thread->failed) { + if (_sfetch_file_read(thread->file_handle, read_offset, bytes_to_read, buffer->ptr)) { + thread->fetched_size = bytes_to_read; + thread->fetched_offset += bytes_to_read; + } + else { + thread->error_code = SFETCH_ERROR_UNEXPECTED_EOF; + thread->failed = true; + } + } + } + } + SOKOL_ASSERT(thread->fetched_offset <= thread->content_size); + if (thread->failed || (thread->fetched_offset == thread->content_size)) { + if (_sfetch_file_handle_valid(thread->file_handle)) { + _sfetch_file_close(thread->file_handle); + thread->file_handle = _SFETCH_INVALID_FILE_HANDLE; + } + thread->finished = true; + } + } + /* ignore items in PAUSED or FAILED state */ +} + +#if _SFETCH_PLATFORM_WINDOWS +_SOKOL_PRIVATE DWORD WINAPI _sfetch_channel_thread_func(LPVOID arg) { +#else +_SOKOL_PRIVATE void* _sfetch_channel_thread_func(void* arg) { +#endif + _sfetch_channel_t* chn = (_sfetch_channel_t*) arg; + _sfetch_thread_entered(&chn->thread); + while (!_sfetch_thread_stop_requested(&chn->thread)) { + /* block until work arrives */ + uint32_t slot_id = _sfetch_thread_dequeue_incoming(&chn->thread, &chn->thread_incoming); + /* slot_id will be invalid if the thread was woken up to join */ + if (!_sfetch_thread_stop_requested(&chn->thread)) { + SOKOL_ASSERT(0 != slot_id); + chn->request_handler(chn->ctx, slot_id); + SOKOL_ASSERT(!_sfetch_ring_full(&chn->thread_outgoing)); + _sfetch_thread_enqueue_outgoing(&chn->thread, &chn->thread_outgoing, slot_id); + } + } + _sfetch_thread_leaving(&chn->thread); + return 0; +} +#endif /* _SFETCH_HAS_THREADS */ + +#if _SFETCH_PLATFORM_EMSCRIPTEN +/*=== embedded Javascript helper functions ===================================*/ +EM_JS(void, sfetch_js_send_head_request, (uint32_t slot_id, const char* path_cstr), { + var path_str = UTF8ToString(path_cstr); + var req = new XMLHttpRequest(); + req.open('HEAD', path_str); + req.onreadystatechange = function() { + if (this.readyState == this.DONE) { + if (this.status == 200) { + var content_length = this.getResponseHeader('Content-Length'); + __sfetch_emsc_head_response(slot_id, content_length); + } + else { + __sfetch_emsc_failed_http_status(slot_id, this.status); + } + } + }; + req.send(); +}); + +/* if bytes_to_read != 0, a range-request will be sent, otherwise a normal request */ +EM_JS(void, sfetch_js_send_get_request, (uint32_t slot_id, const char* path_cstr, int offset, int bytes_to_read, void* buf_ptr, int buf_size), { + var path_str = UTF8ToString(path_cstr); + var req = new XMLHttpRequest(); + req.open('GET', path_str); + req.responseType = 'arraybuffer'; + var need_range_request = (bytes_to_read > 0); + if (need_range_request) { + req.setRequestHeader('Range', 'bytes='+offset+'-'+(offset+bytes_to_read)); + } + req.onreadystatechange = function() { + if (this.readyState == this.DONE) { + if ((this.status == 206) || ((this.status == 200) && !need_range_request)) { + var u8_array = new Uint8Array(req.response); + var content_fetched_size = u8_array.length; + if (content_fetched_size <= buf_size) { + HEAPU8.set(u8_array, buf_ptr); + __sfetch_emsc_get_response(slot_id, bytes_to_read, content_fetched_size); + } + else { + __sfetch_emsc_failed_buffer_too_small(slot_id); + } + } + else { + __sfetch_emsc_failed_http_status(slot_id, this.status); + } + } + }; + req.send(); +}); + +/*=== emscripten specific C helper functions =================================*/ +#ifdef __cplusplus +extern "C" { +#endif +void _sfetch_emsc_send_get_request(uint32_t slot_id, _sfetch_item_t* item) { + if ((item->buffer.ptr == 0) || (item->buffer.size == 0)) { + item->thread.error_code = SFETCH_ERROR_NO_BUFFER; + item->thread.failed = true; + } + else { + uint32_t offset = 0; + uint32_t bytes_to_read = 0; + if (item->chunk_size > 0) { + /* send HTTP range request */ + SOKOL_ASSERT(item->thread.content_size > 0); + SOKOL_ASSERT(item->thread.http_range_offset < item->thread.content_size); + bytes_to_read = item->thread.content_size - item->thread.http_range_offset; + if (bytes_to_read > item->chunk_size) { + bytes_to_read = item->chunk_size; + } + SOKOL_ASSERT(bytes_to_read > 0); + offset = item->thread.http_range_offset; + } + sfetch_js_send_get_request(slot_id, item->path.buf, offset, bytes_to_read, item->buffer.ptr, item->buffer.size); + } +} + +/* called by JS when an initial HEAD request finished successfully (only when streaming chunks) */ +EMSCRIPTEN_KEEPALIVE void _sfetch_emsc_head_response(uint32_t slot_id, uint32_t content_length) { + _sfetch_t* ctx = _sfetch_ctx(); + if (ctx && ctx->valid) { + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, slot_id); + if (item) { + SOKOL_ASSERT(item->buffer.ptr && (item->buffer.size > 0)); + item->thread.content_size = content_length; + _sfetch_emsc_send_get_request(slot_id, item); + } + } +} + +/* called by JS when a followup GET request finished successfully */ +EMSCRIPTEN_KEEPALIVE void _sfetch_emsc_get_response(uint32_t slot_id, uint32_t range_fetched_size, uint32_t content_fetched_size) { + _sfetch_t* ctx = _sfetch_ctx(); + if (ctx && ctx->valid) { + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, slot_id); + if (item) { + item->thread.fetched_size = content_fetched_size; + item->thread.fetched_offset += content_fetched_size; + item->thread.http_range_offset += range_fetched_size; + if (item->chunk_size == 0) { + item->thread.finished = true; + } + else if (item->thread.http_range_offset >= item->thread.content_size) { + item->thread.finished = true; + } + _sfetch_ring_enqueue(&ctx->chn[item->channel].user_outgoing, slot_id); + } + } +} + +/* called by JS when an error occurred */ +EMSCRIPTEN_KEEPALIVE void _sfetch_emsc_failed_http_status(uint32_t slot_id, uint32_t http_status) { + _sfetch_t* ctx = _sfetch_ctx(); + if (ctx && ctx->valid) { + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, slot_id); + if (item) { + if (http_status == 404) { + item->thread.error_code = SFETCH_ERROR_FILE_NOT_FOUND; + } + else { + item->thread.error_code = SFETCH_ERROR_INVALID_HTTP_STATUS; + } + item->thread.failed = true; + item->thread.finished = true; + _sfetch_ring_enqueue(&ctx->chn[item->channel].user_outgoing, slot_id); + } + } +} + +EMSCRIPTEN_KEEPALIVE void _sfetch_emsc_failed_buffer_too_small(uint32_t slot_id) { + _sfetch_t* ctx = _sfetch_ctx(); + if (ctx && ctx->valid) { + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, slot_id); + if (item) { + item->thread.error_code = SFETCH_ERROR_BUFFER_TOO_SMALL; + item->thread.failed = true; + item->thread.finished = true; + _sfetch_ring_enqueue(&ctx->chn[item->channel].user_outgoing, slot_id); + } + } +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +_SOKOL_PRIVATE void _sfetch_request_handler(_sfetch_t* ctx, uint32_t slot_id) { + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, slot_id); + if (!item) { + return; + } + if (item->state == _SFETCH_STATE_FETCHING) { + if ((item->chunk_size > 0) && (item->thread.content_size == 0)) { + /* if streaming download is requested, and the content-length isn't known + yet, need to send a HEAD request first + */ + sfetch_js_send_head_request(slot_id, item->path.buf); + } + else { + /* otherwise, this is either a request to load the entire file, or + to load the next streaming chunk + */ + _sfetch_emsc_send_get_request(slot_id, item); + } + } + else { + /* just move all other items (e.g. paused or cancelled) + into the outgoing queue, so they wont get lost + */ + _sfetch_ring_enqueue(&ctx->chn[item->channel].user_outgoing, slot_id); + } + if (item->thread.failed) { + item->thread.finished = true; + } +} +#endif /* _SFETCH_PLATFORM_EMSCRIPTEN */ + +_SOKOL_PRIVATE void _sfetch_channel_discard(_sfetch_channel_t* chn) { + SOKOL_ASSERT(chn); + #if _SFETCH_HAS_THREADS + if (chn->valid) { + _sfetch_thread_join(&chn->thread); + } + _sfetch_ring_discard(&chn->thread_incoming); + _sfetch_ring_discard(&chn->thread_outgoing); + #endif + _sfetch_ring_discard(&chn->free_lanes); + _sfetch_ring_discard(&chn->user_sent); + _sfetch_ring_discard(&chn->user_incoming); + _sfetch_ring_discard(&chn->user_outgoing); + _sfetch_ring_discard(&chn->free_lanes); + chn->valid = false; +} + +_SOKOL_PRIVATE bool _sfetch_channel_init(_sfetch_channel_t* chn, _sfetch_t* ctx, uint32_t num_items, uint32_t num_lanes, void (*request_handler)(_sfetch_t* ctx, uint32_t)) { + SOKOL_ASSERT(chn && (num_items > 0) && request_handler); + SOKOL_ASSERT(!chn->valid); + bool valid = true; + chn->request_handler = request_handler; + chn->ctx = ctx; + valid &= _sfetch_ring_init(&chn->free_lanes, num_lanes); + for (uint32_t lane = 0; lane < num_lanes; lane++) { + _sfetch_ring_enqueue(&chn->free_lanes, lane); + } + valid &= _sfetch_ring_init(&chn->user_sent, num_items); + valid &= _sfetch_ring_init(&chn->user_incoming, num_lanes); + valid &= _sfetch_ring_init(&chn->user_outgoing, num_lanes); + #if _SFETCH_HAS_THREADS + valid &= _sfetch_ring_init(&chn->thread_incoming, num_lanes); + valid &= _sfetch_ring_init(&chn->thread_outgoing, num_lanes); + #endif + if (valid) { + chn->valid = true; + #if _SFETCH_HAS_THREADS + _sfetch_thread_init(&chn->thread, _sfetch_channel_thread_func, chn); + #endif + return true; + } + else { + _sfetch_channel_discard(chn); + return false; + } +} + +/* put a request into the channels sent-queue, this is where all new requests + are stored until a lane becomes free. +*/ +_SOKOL_PRIVATE bool _sfetch_channel_send(_sfetch_channel_t* chn, uint32_t slot_id) { + SOKOL_ASSERT(chn && chn->valid); + if (!_sfetch_ring_full(&chn->user_sent)) { + _sfetch_ring_enqueue(&chn->user_sent, slot_id); + return true; + } + else { + SOKOL_LOG("sfetch_send: user_sent queue is full)"); + return false; + } +} + +_SOKOL_PRIVATE void _sfetch_invoke_response_callback(_sfetch_item_t* item) { + sfetch_response_t response; + memset(&response, 0, sizeof(response)); + response.handle = item->handle; + response.dispatched = (item->state == _SFETCH_STATE_DISPATCHED); + response.fetched = (item->state == _SFETCH_STATE_FETCHED); + response.paused = (item->state == _SFETCH_STATE_PAUSED); + response.finished = item->user.finished; + response.failed = (item->state == _SFETCH_STATE_FAILED); + response.cancelled = item->user.cancel; + response.error_code = item->user.error_code; + response.channel = item->channel; + response.lane = item->lane; + response.path = item->path.buf; + response.user_data = item->user.user_data; + response.fetched_offset = item->user.fetched_offset - item->user.fetched_size; + response.fetched_size = item->user.fetched_size; + response.buffer_ptr = item->buffer.ptr; + response.buffer_size = item->buffer.size; + item->callback(&response); +} + +/* per-frame channel stuff: move requests in and out of the IO threads, call response callbacks */ +_SOKOL_PRIVATE void _sfetch_channel_dowork(_sfetch_channel_t* chn, _sfetch_pool_t* pool) { + + /* move items from sent- to incoming-queue permitting free lanes */ + const uint32_t num_sent = _sfetch_ring_count(&chn->user_sent); + const uint32_t avail_lanes = _sfetch_ring_count(&chn->free_lanes); + const uint32_t num_move = (num_sent < avail_lanes) ? num_sent : avail_lanes; + for (uint32_t i = 0; i < num_move; i++) { + const uint32_t slot_id = _sfetch_ring_dequeue(&chn->user_sent); + _sfetch_item_t* item = _sfetch_pool_item_lookup(pool, slot_id); + SOKOL_ASSERT(item); + SOKOL_ASSERT(item->state == _SFETCH_STATE_ALLOCATED); + item->state = _SFETCH_STATE_DISPATCHED; + item->lane = _sfetch_ring_dequeue(&chn->free_lanes); + /* if no buffer provided yet, invoke response callback to do so */ + if (0 == item->buffer.ptr) { + _sfetch_invoke_response_callback(item); + } + _sfetch_ring_enqueue(&chn->user_incoming, slot_id); + } + + /* prepare incoming items for being moved into the IO thread */ + const uint32_t num_incoming = _sfetch_ring_count(&chn->user_incoming); + for (uint32_t i = 0; i < num_incoming; i++) { + const uint32_t slot_id = _sfetch_ring_peek(&chn->user_incoming, i); + _sfetch_item_t* item = _sfetch_pool_item_lookup(pool, slot_id); + SOKOL_ASSERT(item); + SOKOL_ASSERT(item->state != _SFETCH_STATE_INITIAL); + SOKOL_ASSERT(item->state != _SFETCH_STATE_FETCHING); + /* transfer input params from user- to thread-data */ + if (item->user.pause) { + item->state = _SFETCH_STATE_PAUSED; + item->user.pause = false; + } + if (item->user.cont) { + if (item->state == _SFETCH_STATE_PAUSED) { + item->state = _SFETCH_STATE_FETCHED; + } + item->user.cont = false; + } + if (item->user.cancel) { + item->state = _SFETCH_STATE_FAILED; + item->user.finished = true; + } + switch (item->state) { + case _SFETCH_STATE_DISPATCHED: + case _SFETCH_STATE_FETCHED: + item->state = _SFETCH_STATE_FETCHING; + break; + default: break; + } + } + + #if _SFETCH_HAS_THREADS + /* move new items into the IO threads and processed items out of IO threads */ + _sfetch_thread_enqueue_incoming(&chn->thread, &chn->thread_incoming, &chn->user_incoming); + _sfetch_thread_dequeue_outgoing(&chn->thread, &chn->thread_outgoing, &chn->user_outgoing); + #else + /* without threading just directly dequeue items from the user_incoming queue and + call the request handler, the user_outgoing queue will be filled as the + asynchronous HTTP requests sent by the request handler are completed + */ + while (!_sfetch_ring_empty(&chn->user_incoming)) { + uint32_t slot_id = _sfetch_ring_dequeue(&chn->user_incoming); + _sfetch_request_handler(chn->ctx, slot_id); + } + #endif + + /* drain the outgoing queue, prepare items for invoking the response + callback, and finally call the response callback, free finished items + */ + while (!_sfetch_ring_empty(&chn->user_outgoing)) { + const uint32_t slot_id = _sfetch_ring_dequeue(&chn->user_outgoing); + SOKOL_ASSERT(slot_id); + _sfetch_item_t* item = _sfetch_pool_item_lookup(pool, slot_id); + SOKOL_ASSERT(item && item->callback); + SOKOL_ASSERT(item->state != _SFETCH_STATE_INITIAL); + SOKOL_ASSERT(item->state != _SFETCH_STATE_ALLOCATED); + SOKOL_ASSERT(item->state != _SFETCH_STATE_DISPATCHED); + SOKOL_ASSERT(item->state != _SFETCH_STATE_FETCHED); + /* transfer output params from thread- to user-data */ + item->user.fetched_offset = item->thread.fetched_offset; + item->user.fetched_size = item->thread.fetched_size; + if (item->user.cancel) { + item->user.error_code = SFETCH_ERROR_CANCELLED; + } + else { + item->user.error_code = item->thread.error_code; + } + if (item->thread.finished) { + item->user.finished = true; + } + /* state transition */ + if (item->thread.failed) { + item->state = _SFETCH_STATE_FAILED; + } + else if (item->state == _SFETCH_STATE_FETCHING) { + item->state = _SFETCH_STATE_FETCHED; + } + _sfetch_invoke_response_callback(item); + + /* when the request is finish, free the lane for another request, + otherwise feed it back into the incoming queue + */ + if (item->user.finished) { + _sfetch_ring_enqueue(&chn->free_lanes, item->lane); + _sfetch_pool_item_free(pool, slot_id); + } + else { + _sfetch_ring_enqueue(&chn->user_incoming, slot_id); + } + } +} + +/*=== private high-level functions ===========================================*/ +_SOKOL_PRIVATE bool _sfetch_validate_request(_sfetch_t* ctx, const sfetch_request_t* req) { + #if defined(SOKOL_DEBUG) + if (req->channel >= ctx->desc.num_channels) { + SOKOL_LOG("_sfetch_validate_request: request.num_channels too big!"); + return false; + } + if (!req->path) { + SOKOL_LOG("_sfetch_validate_request: request.path is null!"); + return false; + } + if (strlen(req->path) >= (SFETCH_MAX_PATH-1)) { + SOKOL_LOG("_sfetch_validate_request: request.path is too long (must be < SFETCH_MAX_PATH-1)"); + return false; + } + if (!req->callback) { + SOKOL_LOG("_sfetch_validate_request: request.callback missing"); + return false; + } + if (req->chunk_size > req->buffer_size) { + SOKOL_LOG("_sfetch_validate_request: request.stream_size is greater request.buffer_size)"); + return false; + } + if (req->user_data_ptr && (req->user_data_size == 0)) { + SOKOL_LOG("_sfetch_validate_request: request.user_data_ptr is set, but req.user_data_size is null"); + return false; + } + if (!req->user_data_ptr && (req->user_data_size > 0)) { + SOKOL_LOG("_sfetch_validate_request: request.user_data_ptr is null, but req.user_data_size is not"); + return false; + } + if (req->user_data_size > SFETCH_MAX_USERDATA_UINT64 * sizeof(uint64_t)) { + SOKOL_LOG("_sfetch_validate_request: request.user_data_size is too big (see SFETCH_MAX_USERDATA_UINT64"); + return false; + } + #endif + return true; +} + +/*=== PUBLIC API FUNCTIONS ===================================================*/ +SOKOL_API_IMPL void sfetch_setup(const sfetch_desc_t* desc) { + SOKOL_ASSERT(desc); + SOKOL_ASSERT((desc->_start_canary == 0) && (desc->_end_canary == 0)); + SOKOL_ASSERT(0 == _sfetch); + _sfetch = (_sfetch_t*) SOKOL_MALLOC(sizeof(_sfetch_t)); + SOKOL_ASSERT(_sfetch); + memset(_sfetch, 0, sizeof(_sfetch_t)); + _sfetch_t* ctx = _sfetch_ctx(); + ctx->desc = *desc; + ctx->setup = true; + ctx->valid = true; + + /* replace zero-init items with default values */ + ctx->desc.max_requests = _sfetch_def(ctx->desc.max_requests, 128); + ctx->desc.num_channels = _sfetch_def(ctx->desc.num_channels, 1); + ctx->desc.num_lanes = _sfetch_def(ctx->desc.num_lanes, 1); + if (ctx->desc.num_channels > SFETCH_MAX_CHANNELS) { + ctx->desc.num_channels = SFETCH_MAX_CHANNELS; + SOKOL_LOG("sfetch_setup: clamping num_channels to SFETCH_MAX_CHANNELS"); + } + + /* setup the global request item pool */ + ctx->valid &= _sfetch_pool_init(&ctx->pool, ctx->desc.max_requests); + + /* setup IO channels (one thread per channel) */ + for (uint32_t i = 0; i < ctx->desc.num_channels; i++) { + ctx->valid &= _sfetch_channel_init(&ctx->chn[i], ctx, ctx->desc.max_requests, ctx->desc.num_lanes, _sfetch_request_handler); + } +} + +SOKOL_API_IMPL void sfetch_shutdown(void) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->setup); + ctx->valid = false; + /* IO threads must be shutdown first */ + for (uint32_t i = 0; i < ctx->desc.num_channels; i++) { + if (ctx->chn[i].valid) { + _sfetch_channel_discard(&ctx->chn[i]); + } + } + _sfetch_pool_discard(&ctx->pool); + ctx->setup = false; + SOKOL_FREE(ctx); + _sfetch = 0; +} + +SOKOL_API_IMPL bool sfetch_valid(void) { + _sfetch_t* ctx = _sfetch_ctx(); + return ctx && ctx->valid; +} + +SOKOL_API_IMPL sfetch_desc_t sfetch_desc(void) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + return ctx->desc; +} + +SOKOL_API_IMPL int sfetch_max_userdata_bytes(void) { + return SFETCH_MAX_USERDATA_UINT64 * 8; +} + +SOKOL_API_IMPL int sfetch_max_path(void) { + return SFETCH_MAX_PATH; +} + +SOKOL_API_IMPL bool sfetch_handle_valid(sfetch_handle_t h) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + /* shortcut invalid handle */ + if (h.id == 0) { + return false; + } + return 0 != _sfetch_pool_item_lookup(&ctx->pool, h.id); +} + +SOKOL_API_IMPL sfetch_handle_t sfetch_send(const sfetch_request_t* request) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->setup); + SOKOL_ASSERT(request && (request->_start_canary == 0) && (request->_end_canary == 0)); + + const sfetch_handle_t invalid_handle = _sfetch_make_handle(0); + if (!ctx->valid) { + return invalid_handle; + } + if (!_sfetch_validate_request(ctx, request)) { + return invalid_handle; + } + SOKOL_ASSERT(request->channel < ctx->desc.num_channels); + + uint32_t slot_id = _sfetch_pool_item_alloc(&ctx->pool, request); + if (0 == slot_id) { + SOKOL_LOG("sfetch_send: request pool exhausted (too many active requests)"); + return invalid_handle; + } + if (!_sfetch_channel_send(&ctx->chn[request->channel], slot_id)) { + /* send failed because the channels sent-queue overflowed */ + _sfetch_pool_item_free(&ctx->pool, slot_id); + return invalid_handle; + } + return _sfetch_make_handle(slot_id); +} + +SOKOL_API_IMPL void sfetch_dowork(void) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->setup); + if (!ctx->valid) { + return; + } + /* we're pumping each channel 2x so that unfinished request items coming out the + IO threads can be moved back into the IO-thread immediately without + having to wait a frame + */ + ctx->in_callback = true; + for (int pass = 0; pass < 2; pass++) { + for (uint32_t chn_index = 0; chn_index < ctx->desc.num_channels; chn_index++) { + _sfetch_channel_dowork(&ctx->chn[chn_index], &ctx->pool); + } + } + ctx->in_callback = false; +} + +SOKOL_API_IMPL void sfetch_bind_buffer(sfetch_handle_t h, void* buffer_ptr, uint32_t buffer_size) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + SOKOL_ASSERT(ctx->in_callback); + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, h.id); + if (item) { + SOKOL_ASSERT((0 == item->buffer.ptr) && (0 == item->buffer.size)); + item->buffer.ptr = (uint8_t*) buffer_ptr; + item->buffer.size = buffer_size; + } +} + +SOKOL_API_IMPL void* sfetch_unbind_buffer(sfetch_handle_t h) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + SOKOL_ASSERT(ctx->in_callback); + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, h.id); + if (item) { + void* prev_buf_ptr = item->buffer.ptr; + item->buffer.ptr = 0; + item->buffer.size = 0; + return prev_buf_ptr; + } + else { + return 0; + } +} + +SOKOL_API_IMPL void sfetch_pause(sfetch_handle_t h) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, h.id); + if (item) { + item->user.pause = true; + item->user.cont = false; + } +} + +SOKOL_API_IMPL void sfetch_continue(sfetch_handle_t h) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, h.id); + if (item) { + item->user.cont = true; + item->user.pause = false; + } +} + +SOKOL_API_IMPL void sfetch_cancel(sfetch_handle_t h) { + _sfetch_t* ctx = _sfetch_ctx(); + SOKOL_ASSERT(ctx && ctx->valid); + _sfetch_item_t* item = _sfetch_pool_item_lookup(&ctx->pool, h.id); + if (item) { + item->user.cont = false; + item->user.pause = false; + item->user.cancel = true; + } +} + +#endif /* SOKOL_IMPL */ + diff --git a/sokol-app-sys/external/sokol/sokol_gfx.h b/sokol-app-sys/external/sokol/sokol_gfx.h new file mode 100644 index 00000000..9249ad8b --- /dev/null +++ b/sokol-app-sys/external/sokol/sokol_gfx.h @@ -0,0 +1,11701 @@ +#ifndef SOKOL_GFX_INCLUDED +/* + sokol_gfx.h -- simple 3D API wrapper + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + In the same place define one of the following to select the rendering + backend: + #define SOKOL_GLCORE33 + #define SOKOL_GLES2 + #define SOKOL_GLES3 + #define SOKOL_D3D11 + #define SOKOL_METAL + #define SOKOL_DUMMY_BACKEND + + I.e. for the GL 3.3 Core Profile it should look like this: + + #include ... + #include ... + #define SOKOL_IMPL + #define SOKOL_GLCORE33 + #include "sokol_gfx.h" + + The dummy backend replaces the platform-specific backend code with empty + stub functions. This is useful for writing tests that need to run on the + command line. + + Optionally provide the following defines with your own implementations: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) + SOKOL_FREE(p) - your own free function (default: free(p)) + SOKOL_LOG(msg) - your own logging function (default: puts(msg)) + SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + SOKOL_TRACE_HOOKS - enable trace hook callbacks (search below for TRACE HOOKS) + + If sokol_gfx.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + If you want to compile without deprecated structs and functions, + define: + + SOKOL_NO_DEPRECATED + + API usage validation macros: + + SOKOL_VALIDATE_BEGIN() - begin a validation block (default:_sg_validate_begin()) + SOKOL_VALIDATE(cond, err) - like assert but for API validation (default: _sg_validate(cond, err)) + SOKOL_VALIDATE_END() - end a validation block, return true if all checks in block passed (default: bool _sg_validate()) + + If you don't want validation errors to be fatal, define SOKOL_VALIDATE_NON_FATAL, + be aware though that this may spam SOKOL_LOG messages. + + Optionally define the following to force debug checks and validations + even in release mode: + + SOKOL_DEBUG - by default this is defined if _DEBUG is defined + + + sokol_gfx DOES NOT: + =================== + - create a window or the 3D-API context/device, you must do this + before sokol_gfx is initialized, and pass any required information + (like 3D device pointers) to the sokol_gfx initialization call + + - present the rendered frame, how this is done exactly usually depends + on how the window and 3D-API context/device was created + + - provide a unified shader language, instead 3D-API-specific shader + source-code or shader-bytecode must be provided + + For complete code examples using the various backend 3D-APIs, see: + + https://github.com/floooh/sokol-samples + + For an optional shader-cross-compile solution, see: + + https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md + + + STEP BY STEP + ============ + --- to initialize sokol_gfx, after creating a window and a 3D-API + context/device, call: + + sg_setup(const sg_desc*) + + --- create resource objects (at least buffers, shaders and pipelines, + and optionally images and passes): + + sg_buffer sg_make_buffer(const sg_buffer_desc*) + sg_image sg_make_image(const sg_image_desc*) + sg_shader sg_make_shader(const sg_shader_desc*) + sg_pipeline sg_make_pipeline(const sg_pipeline_desc*) + sg_pass sg_make_pass(const sg_pass_desc*) + + --- start rendering to the default frame buffer with: + + sg_begin_default_pass(const sg_pass_action* actions, int width, int height) + + --- or start rendering to an offscreen framebuffer with: + + sg_begin_pass(sg_pass pass, const sg_pass_action* actions) + + --- set the pipeline state for the next draw call with: + + sg_apply_pipeline(sg_pipeline pip) + + --- fill an sg_bindings struct with the resource bindings for the next + draw call (1..N vertex buffers, 0 or 1 index buffer, 0..N image objects + to use as textures each on the vertex-shader- and fragment-shader-stage + and then call + + sg_apply_bindings(const sg_bindings* bindings) + + to update the resource bindings + + --- optionally update shader uniform data with: + + sg_apply_uniforms(sg_shader_stage stage, int ub_index, const void* data, int num_bytes) + + --- kick off a draw call with: + + sg_draw(int base_element, int num_elements, int num_instances) + + --- finish the current rendering pass with: + + sg_end_pass() + + --- when done with the current frame, call + + sg_commit() + + --- at the end of your program, shutdown sokol_gfx with: + + sg_shutdown() + + --- if you need to destroy resources before sg_shutdown(), call: + + sg_destroy_buffer(sg_buffer buf) + sg_destroy_image(sg_image img) + sg_destroy_shader(sg_shader shd) + sg_destroy_pipeline(sg_pipeline pip) + sg_destroy_pass(sg_pass pass) + + --- to set a new viewport rectangle, call + + sg_apply_viewport(int x, int y, int width, int height, bool origin_top_left) + + --- to set a new scissor rect, call: + + sg_apply_scissor_rect(int x, int y, int width, int height, bool origin_top_left) + + both sg_apply_viewport() and sg_apply_scissor_rect() must be called + inside a rendering pass + + beginning a pass will reset the viewport to the size of the framebuffer used + in the new pass, + + --- to update (overwrite) the content of buffer and image resources, call: + + sg_update_buffer(sg_buffer buf, const void* ptr, int num_bytes) + sg_update_image(sg_image img, const sg_image_content* content) + + Buffers and images to be updated must have been created with + SG_USAGE_DYNAMIC or SG_USAGE_STREAM + + Only one update per frame is allowed for buffer and image resources. + The rationale is to have a simple countermeasure to avoid the CPU + scribbling over data the GPU is currently using, or the CPU having to + wait for the GPU + + Buffer and image updates can be partial, as long as a rendering + operation only references the valid (updated) data in the + buffer or image. + + --- to append a chunk of data to a buffer resource, call: + + int sg_append_buffer(sg_buffer buf, const void* ptr, int num_bytes) + + The difference to sg_update_buffer() is that sg_append_buffer() + can be called multiple times per frame to append new data to the + buffer piece by piece, optionally interleaved with draw calls referencing + the previously written data. + + sg_append_buffer() returns a byte offset to the start of the + written data, this offset can be assigned to + sg_bindings.vertex_buffer_offsets[n] or + sg_bindings.index_buffer_offset + + Code example: + + for (...) { + const void* data = ...; + const int num_bytes = ...; + int offset = sg_append_buffer(buf, data, num_bytes); + bindings.vertex_buffer_offsets[0] = offset; + sg_apply_pipeline(pip); + sg_apply_bindings(&bindings); + sg_apply_uniforms(...); + sg_draw(...); + } + + A buffer to be used with sg_append_buffer() must have been created + with SG_USAGE_DYNAMIC or SG_USAGE_STREAM. + + If the application appends more data to the buffer then fits into + the buffer, the buffer will go into the "overflow" state for the + rest of the frame. + + Any draw calls attempting to render an overflown buffer will be + silently dropped (in debug mode this will also result in a + validation error). + + You can also check manually if a buffer is in overflow-state by calling + + bool sg_query_buffer_overflow(sg_buffer buf) + + --- to check at runtime for optional features, limits and pixelformat support, + call: + + sg_features sg_query_features() + sg_limits sg_query_limits() + sg_pixelformat_info sg_query_pixelformat(sg_pixel_format fmt) + + --- if you need to call into the underlying 3D-API directly, you must call: + + sg_reset_state_cache() + + ...before calling sokol_gfx functions again + + --- you can inspect the original sg_desc structure handed to sg_setup() + by calling sg_query_desc(). This will return an sg_desc struct with + the default values patched in instead of any zero-initialized values + + --- you can inspect various internal resource attributes via: + + sg_buffer_info sg_query_buffer_info(sg_buffer buf) + sg_image_info sg_query_image_info(sg_image img) + sg_shader_info sg_query_shader_info(sg_shader shd) + sg_pipeline_info sg_query_pipeline_info(sg_pipeline pip) + sg_pass_info sg_query_pass_info(sg_pass pass) + + ...please note that the returned info-structs are tied quite closely + to sokol_gfx.h internals, and may change more often than other + public API functions and structs. + + --- you can ask at runtime what backend sokol_gfx.h has been compiled + for, or whether the GLES3 backend had to fall back to GLES2 with: + + sg_backend sg_query_backend(void) + + --- you can query the default resource creation parameters through the functions + + sg_buffer_desc sg_query_buffer_defaults(const sg_buffer_desc* desc) + sg_image_desc sg_query_image_defaults(const sg_image_desc* desc) + sg_shader_desc sg_query_shader_defaults(const sg_shader_desc* desc) + sg_pipeline_desc sg_query_pipeline_defaults(const sg_pipeline_desc* desc) + sg_pass_desc sg_query_pass_defaults(const sg_pass_desc* desc) + + These functions take a pointer to a desc structure which may contain + zero-initialized items for default values. These zero-init values + will be replaced with their concrete values in the returned desc + struct. + + + BACKEND-SPECIFIC TOPICS: + ======================== + --- the GL backends need to know about the internal structure of uniform + blocks, and the texture sampler-name and -type: + + typedef struct { + float mvp[16]; // model-view-projection matrix + float offset0[2]; // some 2D vectors + float offset1[2]; + float offset2[2]; + } params_t; + + // uniform block structure and texture image definition in sg_shader_desc: + sg_shader_desc desc = { + // uniform block description (size and internal structure) + .vs.uniform_blocks[0] = { + .size = sizeof(params_t), + .uniforms = { + [0] = { .name="mvp", .type=SG_UNIFORMTYPE_MAT4 }, + [1] = { .name="offset0", .type=SG_UNIFORMTYPE_VEC2 }, + ... + } + }, + // one texture on the fragment-shader-stage, GLES2/WebGL needs name and image type + .fs.images[0] = { .name="tex", .type=SG_IMAGETYPE_ARRAY } + ... + }; + + --- the Metal and D3D11 backends only need to know the size of uniform blocks, + not their internal member structure, and they only need to know + the type of a texture sampler, not its name: + + sg_shader_desc desc = { + .vs.uniform_blocks[0].size = sizeof(params_t), + .fs.images[0].type = SG_IMAGETYPE_ARRAY, + ... + }; + + --- when creating a shader object, GLES2/WebGL need to know the vertex + attribute names as used in the vertex shader: + + sg_shader_desc desc = { + .attrs = { + [0] = { .name="position" }, + [1] = { .name="color1" } + } + }; + + The vertex attribute names provided when creating a shader will be + used later in sg_create_pipeline() for matching the vertex layout + to vertex shader inputs. + + --- on D3D11 you need to provide a semantic name and semantic index in the + shader description struct instead (see the D3D11 documentation on + D3D11_INPUT_ELEMENT_DESC for details): + + sg_shader_desc desc = { + .attrs = { + [0] = { .sem_name="POSITION", .sem_index=0 } + [1] = { .sem_name="COLOR", .sem_index=1 } + } + }; + + The provided semantic information will be used later in sg_create_pipeline() + to match the vertex layout to vertex shader inputs. + + --- on Metal, GL 3.3 or GLES3/WebGL2, you don't need to provide an attribute + name or semantic name, since vertex attributes can be bound by their slot index + (this is mandatory in Metal, and optional in GL): + + sg_pipeline_desc desc = { + .layout = { + .attrs = { + [0] = { .format=SG_VERTEXFORMAT_FLOAT3 }, + [1] = { .format=SG_VERTEXFORMAT_FLOAT4 } + } + } + }; + + WORKING WITH CONTEXTS + ===================== + sokol-gfx allows to switch between different rendering contexts and + associate resource objects with contexts. This is useful to + create GL applications that render into multiple windows. + + A rendering context keeps track of all resources created while + the context is active. When the context is destroyed, all resources + "belonging to the context" are destroyed as well. + + A default context will be created and activated implicitly in + sg_setup(), and destroyed in sg_shutdown(). So for a typical application + which *doesn't* use multiple contexts, nothing changes, and calling + the context functions isn't necessary. + + Three functions have been added to work with contexts: + + --- sg_context sg_setup_context(): + This must be called once after a GL context has been created and + made active. + + --- void sg_activate_context(sg_context ctx) + This must be called after making a different GL context active. + Apart from 3D-API-specific actions, the call to sg_activate_context() + will internally call sg_reset_state_cache(). + + --- void sg_discard_context(sg_context ctx) + This must be called right before a GL context is destroyed and + will destroy all resources associated with the context (that + have been created while the context was active) The GL context must be + active at the time sg_discard_context(sg_context ctx) is called. + + Also note that resources (buffers, images, shaders and pipelines) must + only be used or destroyed while the same GL context is active that + was also active while the resource was created (an exception is + resource sharing on GL, such resources can be used while + another context is active, but must still be destroyed under + the same context that was active during creation). + + For more information, check out the multiwindow-glfw sample: + + https://github.com/floooh/sokol-samples/blob/master/glfw/multiwindow-glfw.c + + TRACE HOOKS: + ============ + sokol_gfx.h optionally allows to install "trace hook" callbacks for + each public API functions. When a public API function is called, and + a trace hook callback has been installed for this function, the + callback will be invoked with the parameters and result of the function. + This is useful for things like debugging- and profiling-tools, or + keeping track of resource creation and destruction. + + To use the trace hook feature: + + --- Define SOKOL_TRACE_HOOKS before including the implementation. + + --- Setup an sg_trace_hooks structure with your callback function + pointers (keep all function pointers you're not interested + in zero-initialized), optionally set the user_data member + in the sg_trace_hooks struct. + + --- Install the trace hooks by calling sg_install_trace_hooks(), + the return value of this function is another sg_trace_hooks + struct which contains the previously set of trace hooks. + You should keep this struct around, and call those previous + functions pointers from your own trace callbacks for proper + chaining. + + As an example of how trace hooks are used, have a look at the + imgui/sokol_gfx_imgui.h header which implements a realtime + debugging UI for sokol_gfx.h on top of Dear ImGui. + + A NOTE ON PORTABLE PACKED VERTEX FORMATS: + ========================================= + There are two things to consider when using packed + vertex formats like UBYTE4, SHORT2, etc which need to work + across all backends: + + - D3D11 can only convert *normalized* vertex formats to + floating point during vertex fetch, normalized formats + have a trailing 'N', and are "normalized" to a range + -1.0..+1.0 (for the signed formats) or 0.0..1.0 (for the + unsigned formats): + + - SG_VERTEXFORMAT_BYTE4N + - SG_VERTEXFORMAT_UBYTE4N + - SG_VERTEXFORMAT_SHORT2N + - SG_VERTEXFORMAT_USHORT2N + - SG_VERTEXFORMAT_SHORT4N + - SG_VERTEXFORMAT_USHORT4N + + D3D11 will not convert *non-normalized* vertex formats + to floating point vertex shader inputs, those can + only use the ivecn formats when D3D11 is used + as backend (GL and should Metal can use both formats) + + - SG_VERTEXFORMAT_BYTE4, + - SG_VERTEXFORMAT_UBYTE4 + - SG_VERTEXFORMAT_SHORT2 + - SG_VERTEXFORMAT_SHORT4 + + - WebGL/GLES2 cannot use integer vertex shader inputs (int or ivecn) + + - SG_VERTEXFORMAT_UINT10_N2 is not supported on WebGL/GLES2 + + So for a vertex input layout which works on all platforms, only use the following + vertex formats, and if needed "expand" the normalized vertex shader + inputs in the vertex shader by multiplying with 127.0, 255.0, 32767.0 or + 65535.0: + + - SG_VERTEXFORMAT_FLOAT, + - SG_VERTEXFORMAT_FLOAT2, + - SG_VERTEXFORMAT_FLOAT3, + - SG_VERTEXFORMAT_FLOAT4, + - SG_VERTEXFORMAT_BYTE4N, + - SG_VERTEXFORMAT_UBYTE4N, + - SG_VERTEXFORMAT_SHORT2N, + - SG_VERTEXFORMAT_USHORT2N + - SG_VERTEXFORMAT_SHORT4N, + - SG_VERTEXFORMAT_USHORT4N + + TODO: + ==== + - talk about asynchronous resource creation + + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_GFX_INCLUDED (1) +#include +#include + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */ +#endif + +/* + Resource id typedefs: + + sg_buffer: vertex- and index-buffers + sg_image: textures and render targets + sg_shader: vertex- and fragment-shaders, uniform blocks + sg_pipeline: associated shader and vertex-layouts, and render states + sg_pass: a bundle of render targets and actions on them + sg_context: a 'context handle' for switching between 3D-API contexts + + Instead of pointers, resource creation functions return a 32-bit + number which uniquely identifies the resource object. + + The 32-bit resource id is split into a 16-bit pool index in the lower bits, + and a 16-bit 'unique counter' in the upper bits. The index allows fast + pool lookups, and combined with the unique-mask it allows to detect + 'dangling accesses' (trying to use an object which no longer exists, and + its pool slot has been reused for a new object) + + The resource ids are wrapped into a struct so that the compiler + can complain when the wrong resource type is used. +*/ +typedef struct sg_buffer { uint32_t id; } sg_buffer; +typedef struct sg_image { uint32_t id; } sg_image; +typedef struct sg_shader { uint32_t id; } sg_shader; +typedef struct sg_pipeline { uint32_t id; } sg_pipeline; +typedef struct sg_pass { uint32_t id; } sg_pass; +typedef struct sg_context { uint32_t id; } sg_context; + +/* + various compile-time constants + + FIXME: it may make sense to convert some of those into defines so + that the user code can override them. +*/ +enum { + SG_INVALID_ID = 0, + SG_NUM_SHADER_STAGES = 2, + SG_NUM_INFLIGHT_FRAMES = 2, + SG_MAX_COLOR_ATTACHMENTS = 4, + SG_MAX_SHADERSTAGE_BUFFERS = 8, + SG_MAX_SHADERSTAGE_IMAGES = 12, + SG_MAX_SHADERSTAGE_UBS = 4, + SG_MAX_UB_MEMBERS = 16, + SG_MAX_VERTEX_ATTRIBUTES = 16, /* NOTE: actual max vertex attrs can be less on GLES2, see sg_limits! */ + SG_MAX_MIPMAPS = 16, + SG_MAX_TEXTUREARRAY_LAYERS = 128 +}; + +/* + sg_backend + + The active 3D-API backend, use the function sg_query_backend() + to get the currently active backend. + + For returned value corresponds with the compile-time define to select + a backend, with the only exception of SOKOL_GLES3: this may + return SG_BACKEND_GLES2 if the backend has to fallback to GLES2 mode + because GLES3 isn't supported. +*/ +typedef enum sg_backend { + SG_BACKEND_GLCORE33, + SG_BACKEND_GLES2, + SG_BACKEND_GLES3, + SG_BACKEND_D3D11, + SG_BACKEND_METAL_IOS, + SG_BACKEND_METAL_MACOS, + SG_BACKEND_METAL_SIMULATOR, + SG_BACKEND_DUMMY, +} sg_backend; + +/* + sg_pixel_format + + sokol_gfx.h basically uses the same pixel formats as WebGPU, since these + are supported on most newer GPUs. GLES2 and WebGL has a much smaller + subset of available pixel formats. Call sg_query_pixelformat() to check + at runtime if a pixel format supports the desired features. + + A pixelformat name consist of three parts: + + - components (R, RG, RGB or RGBA) + - bit width per component (8, 16 or 32) + - component data type: + - unsigned normalized (no postfix) + - signed normalized (SN postfix) + - unsigned integer (UI postfix) + - signed integer (SI postfix) + - float (F postfix) + + Not all pixel formats can be used for everything, call sg_query_pixelformat() + to inspect the capabilities of a given pixelformat. The function returns + an sg_pixelformat_info struct with the following bool members: + + - sample: the pixelformat can be sampled as texture at least with + nearest filtering + - filter: the pixelformat can be samples as texture with linear + filtering + - render: the pixelformat can be used for render targets + - blend: blending is supported when using the pixelformat for + render targets + - msaa: multisample-antiliasing is supported when using the + pixelformat for render targets + - depth: the pixelformat can be used for depth-stencil attachments + + When targeting GLES2/WebGL, the only safe formats to use + as texture are SG_PIXELFORMAT_R8 and SG_PIXELFORMAT_RGBA8. For rendering + in GLES2/WebGL, only SG_PIXELFORMAT_RGBA8 is safe. All other formats + must be checked via sg_query_pixelformats(). + + The default pixel format for texture images is SG_PIXELFORMAT_RGBA8. + + The default pixel format for render target images is platform-dependent: + - for Metal and D3D11 it is SG_PIXELFORMAT_BGRA8 + - for GL backends it is SG_PIXELFORMAT_RGBA8 + + This is mainly because of the default framebuffer which is setup outside + of sokol_gfx.h. On some backends, using BGRA for the default frame buffer + allows more efficient frame flips. For your own offscreen-render-targets, + use whatever renderable pixel format is convenient for you. +*/ +typedef enum sg_pixel_format { + _SG_PIXELFORMAT_DEFAULT, /* value 0 reserved for default-init */ + SG_PIXELFORMAT_NONE, + + SG_PIXELFORMAT_R8, + SG_PIXELFORMAT_R8SN, + SG_PIXELFORMAT_R8UI, + SG_PIXELFORMAT_R8SI, + + SG_PIXELFORMAT_R16, + SG_PIXELFORMAT_R16SN, + SG_PIXELFORMAT_R16UI, + SG_PIXELFORMAT_R16SI, + SG_PIXELFORMAT_R16F, + SG_PIXELFORMAT_RG8, + SG_PIXELFORMAT_RG8SN, + SG_PIXELFORMAT_RG8UI, + SG_PIXELFORMAT_RG8SI, + + SG_PIXELFORMAT_R32UI, + SG_PIXELFORMAT_R32SI, + SG_PIXELFORMAT_R32F, + SG_PIXELFORMAT_RG16, + SG_PIXELFORMAT_RG16SN, + SG_PIXELFORMAT_RG16UI, + SG_PIXELFORMAT_RG16SI, + SG_PIXELFORMAT_RG16F, + SG_PIXELFORMAT_RGBA8, + SG_PIXELFORMAT_RGBA8SN, + SG_PIXELFORMAT_RGBA8UI, + SG_PIXELFORMAT_RGBA8SI, + SG_PIXELFORMAT_BGRA8, + SG_PIXELFORMAT_RGB10A2, + SG_PIXELFORMAT_RG11B10F, + + SG_PIXELFORMAT_RG32UI, + SG_PIXELFORMAT_RG32SI, + SG_PIXELFORMAT_RG32F, + SG_PIXELFORMAT_RGBA16, + SG_PIXELFORMAT_RGBA16SN, + SG_PIXELFORMAT_RGBA16UI, + SG_PIXELFORMAT_RGBA16SI, + SG_PIXELFORMAT_RGBA16F, + + SG_PIXELFORMAT_RGBA32UI, + SG_PIXELFORMAT_RGBA32SI, + SG_PIXELFORMAT_RGBA32F, + + SG_PIXELFORMAT_DEPTH, + SG_PIXELFORMAT_DEPTH_STENCIL, + + SG_PIXELFORMAT_BC1_RGBA, + SG_PIXELFORMAT_BC2_RGBA, + SG_PIXELFORMAT_BC3_RGBA, + SG_PIXELFORMAT_BC4_R, + SG_PIXELFORMAT_BC4_RSN, + SG_PIXELFORMAT_BC5_RG, + SG_PIXELFORMAT_BC5_RGSN, + SG_PIXELFORMAT_BC6H_RGBF, + SG_PIXELFORMAT_BC6H_RGBUF, + SG_PIXELFORMAT_BC7_RGBA, + SG_PIXELFORMAT_PVRTC_RGB_2BPP, + SG_PIXELFORMAT_PVRTC_RGB_4BPP, + SG_PIXELFORMAT_PVRTC_RGBA_2BPP, + SG_PIXELFORMAT_PVRTC_RGBA_4BPP, + SG_PIXELFORMAT_ETC2_RGB8, + SG_PIXELFORMAT_ETC2_RGB8A1, + SG_PIXELFORMAT_ETC2_RGBA8, + SG_PIXELFORMAT_ETC2_RG11, + SG_PIXELFORMAT_ETC2_RG11SN, + + _SG_PIXELFORMAT_NUM, + _SG_PIXELFORMAT_FORCE_U32 = 0x7FFFFFFF +} sg_pixel_format; + +/* + Runtime information about a pixel format, returned + by sg_query_pixelformat(). +*/ +typedef struct sg_pixelformat_info { + bool sample; /* pixel format can be sampled in shaders */ + bool filter; /* pixel format can be sampled with filtering */ + bool render; /* pixel format can be used as render target */ + bool blend; /* alpha-blending is supported */ + bool msaa; /* pixel format can be used as MSAA render target */ + bool depth; /* pixel format is a depth format */ +} sg_pixelformat_info; + +/* + Runtime information about available optional features, + returned by sg_query_features() +*/ +typedef struct sg_features { + bool instancing; + bool origin_top_left; + bool multiple_render_targets; + bool msaa_render_targets; + bool imagetype_3d; /* creation of SG_IMAGETYPE_3D images is supported */ + bool imagetype_array; /* creation of SG_IMAGETYPE_ARRAY images is supported */ + bool image_clamp_to_border; /* border color and clamp-to-border UV-wrap mode is supported */ +} sg_features; + +/* + Runtime information about resource limits, returned by sg_query_limit() +*/ +typedef struct sg_limits { + uint32_t max_image_size_2d; /* max width/height of SG_IMAGETYPE_2D images */ + uint32_t max_image_size_cube; /* max width/height of SG_IMAGETYPE_CUBE images */ + uint32_t max_image_size_3d; /* max width/height/depth of SG_IMAGETYPE_3D images */ + uint32_t max_image_size_array; + uint32_t max_image_array_layers; + uint32_t max_vertex_attrs; /* <= SG_MAX_VERTEX_ATTRIBUTES (only on some GLES2 impls) */ +} sg_limits; + +/* + sg_resource_state + + The current state of a resource in its resource pool. + Resources start in the INITIAL state, which means the + pool slot is unoccupied and can be allocated. When a resource is + created, first an id is allocated, and the resource pool slot + is set to state ALLOC. After allocation, the resource is + initialized, which may result in the VALID or FAILED state. The + reason why allocation and initialization are separate is because + some resource types (e.g. buffers and images) might be asynchronously + initialized by the user application. If a resource which is not + in the VALID state is attempted to be used for rendering, rendering + operations will silently be dropped. + + The special INVALID state is returned in sg_query_xxx_state() if no + resource object exists for the provided resource id. +*/ +typedef enum sg_resource_state { + SG_RESOURCESTATE_INITIAL, + SG_RESOURCESTATE_ALLOC, + SG_RESOURCESTATE_VALID, + SG_RESOURCESTATE_FAILED, + SG_RESOURCESTATE_INVALID, + _SG_RESOURCESTATE_FORCE_U32 = 0x7FFFFFFF +} sg_resource_state; + +/* + sg_usage + + A resource usage hint describing the update strategy of + buffers and images. This is used in the sg_buffer_desc.usage + and sg_image_desc.usage members when creating buffers + and images: + + SG_USAGE_IMMUTABLE: the resource will never be updated with + new data, instead the data content of the + resource must be provided on creation + SG_USAGE_DYNAMIC: the resource will be updated infrequently + with new data (this could range from "once + after creation", to "quite often but not + every frame") + SG_USAGE_STREAM: the resource will be updated each frame + with new content + + The rendering backends use this hint to prevent that the + CPU needs to wait for the GPU when attempting to update + a resource that might be currently accessed by the GPU. + + Resource content is updated with the function sg_update_buffer() for + buffer objects, and sg_update_image() for image objects. Only + one update is allowed per frame and resource object. The + application must update all data required for rendering (this + means that the update data can be smaller than the resource size, + if only a part of the overall resource size is used for rendering, + you only need to make sure that the data that *is* used is valid. + + The default usage is SG_USAGE_IMMUTABLE. +*/ +typedef enum sg_usage { + _SG_USAGE_DEFAULT, /* value 0 reserved for default-init */ + SG_USAGE_IMMUTABLE, + SG_USAGE_DYNAMIC, + SG_USAGE_STREAM, + _SG_USAGE_NUM, + _SG_USAGE_FORCE_U32 = 0x7FFFFFFF +} sg_usage; + +/* + sg_buffer_type + + This indicates whether a buffer contains vertex- or index-data, + used in the sg_buffer_desc.type member when creating a buffer. + + The default value is SG_BUFFERTYPE_VERTEXBUFFER. +*/ +typedef enum sg_buffer_type { + _SG_BUFFERTYPE_DEFAULT, /* value 0 reserved for default-init */ + SG_BUFFERTYPE_VERTEXBUFFER, + SG_BUFFERTYPE_INDEXBUFFER, + _SG_BUFFERTYPE_NUM, + _SG_BUFFERTYPE_FORCE_U32 = 0x7FFFFFFF +} sg_buffer_type; + +/* + sg_index_type + + Indicates whether indexed rendering (fetching vertex-indices from an + index buffer) is used, and if yes, the index data type (16- or 32-bits). + This is used in the sg_pipeline_desc.index_type member when creating a + pipeline object. + + The default index type is SG_INDEXTYPE_NONE. +*/ +typedef enum sg_index_type { + _SG_INDEXTYPE_DEFAULT, /* value 0 reserved for default-init */ + SG_INDEXTYPE_NONE, + SG_INDEXTYPE_UINT16, + SG_INDEXTYPE_UINT32, + _SG_INDEXTYPE_NUM, + _SG_INDEXTYPE_FORCE_U32 = 0x7FFFFFFF +} sg_index_type; + +/* + sg_image_type + + Indicates the basic image type (2D-texture, cubemap, 3D-texture + or 2D-array-texture). 3D- and array-textures are not supported + on the GLES2/WebGL backend. The image type is used in the + sg_image_desc.type member when creating an image. + + The default image type when creating an image is SG_IMAGETYPE_2D. +*/ +typedef enum sg_image_type { + _SG_IMAGETYPE_DEFAULT, /* value 0 reserved for default-init */ + SG_IMAGETYPE_2D, + SG_IMAGETYPE_CUBE, + SG_IMAGETYPE_3D, + SG_IMAGETYPE_ARRAY, + _SG_IMAGETYPE_NUM, + _SG_IMAGETYPE_FORCE_U32 = 0x7FFFFFFF +} sg_image_type; + +/* + sg_cube_face + + The cubemap faces. Use these as indices in the sg_image_desc.content + array. +*/ +typedef enum sg_cube_face { + SG_CUBEFACE_POS_X, + SG_CUBEFACE_NEG_X, + SG_CUBEFACE_POS_Y, + SG_CUBEFACE_NEG_Y, + SG_CUBEFACE_POS_Z, + SG_CUBEFACE_NEG_Z, + SG_CUBEFACE_NUM, + _SG_CUBEFACE_FORCE_U32 = 0x7FFFFFFF +} sg_cube_face; + +/* + sg_shader_stage + + There are 2 shader stages: vertex- and fragment-shader-stage. + Each shader stage consists of: + + - one slot for a shader function (provided as source- or byte-code) + - SG_MAX_SHADERSTAGE_UBS slots for uniform blocks + - SG_MAX_SHADERSTAGE_IMAGES slots for images used as textures by + the shader function +*/ +typedef enum sg_shader_stage { + SG_SHADERSTAGE_VS, + SG_SHADERSTAGE_FS, + _SG_SHADERSTAGE_FORCE_U32 = 0x7FFFFFFF +} sg_shader_stage; + +/* + sg_primitive_type + + This is the common subset of 3D primitive types supported across all 3D + APIs. This is used in the sg_pipeline_desc.primitive_type member when + creating a pipeline object. + + The default primitive type is SG_PRIMITIVETYPE_TRIANGLES. +*/ +typedef enum sg_primitive_type { + _SG_PRIMITIVETYPE_DEFAULT, /* value 0 reserved for default-init */ + SG_PRIMITIVETYPE_POINTS, + SG_PRIMITIVETYPE_LINES, + SG_PRIMITIVETYPE_LINE_STRIP, + SG_PRIMITIVETYPE_TRIANGLES, + SG_PRIMITIVETYPE_TRIANGLE_STRIP, + _SG_PRIMITIVETYPE_NUM, + _SG_PRIMITIVETYPE_FORCE_U32 = 0x7FFFFFFF +} sg_primitive_type; + +/* + sg_filter + + The filtering mode when sampling a texture image. This is + used in the sg_image_desc.min_filter and sg_image_desc.mag_filter + members when creating an image object. + + The default filter mode is SG_FILTER_NEAREST. +*/ +typedef enum sg_filter { + _SG_FILTER_DEFAULT, /* value 0 reserved for default-init */ + SG_FILTER_NEAREST, + SG_FILTER_LINEAR, + SG_FILTER_NEAREST_MIPMAP_NEAREST, + SG_FILTER_NEAREST_MIPMAP_LINEAR, + SG_FILTER_LINEAR_MIPMAP_NEAREST, + SG_FILTER_LINEAR_MIPMAP_LINEAR, + _SG_FILTER_NUM, + _SG_FILTER_FORCE_U32 = 0x7FFFFFFF +} sg_filter; + +/* + sg_wrap + + The texture coordinates wrapping mode when sampling a texture + image. This is used in the sg_image_desc.wrap_u, .wrap_v + and .wrap_w members when creating an image. + + The default wrap mode is SG_WRAP_REPEAT. + + NOTE: SG_WRAP_CLAMP_TO_BORDER is not supported on all backends + and platforms. To check for support, call sg_query_features() + and check the "clamp_to_border" boolean in the returned + sg_features struct. + + Platforms which don't support SG_WRAP_CLAMP_TO_BORDER will silently fall back + to SG_WRAP_CLAMP_TO_EDGE without a validation error. + + Platforms which support clamp-to-border are: + + - all desktop GL platforms + - Metal on macOS + - D3D11 + + Platforms which do not support clamp-to-border: + + - GLES2/3 and WebGL/WebGL2 + - Metal on iOS +*/ +typedef enum sg_wrap { + _SG_WRAP_DEFAULT, /* value 0 reserved for default-init */ + SG_WRAP_REPEAT, + SG_WRAP_CLAMP_TO_EDGE, + SG_WRAP_CLAMP_TO_BORDER, + SG_WRAP_MIRRORED_REPEAT, + _SG_WRAP_NUM, + _SG_WRAP_FORCE_U32 = 0x7FFFFFFF +} sg_wrap; + +/* + sg_border_color + + The border color to use when sampling a texture, and the UV wrap + mode is SG_WRAP_CLAMP_TO_BORDER. + + The default border color is SG_BORDERCOLOR_OPAQUE_BLACK +*/ +typedef enum sg_border_color { + _SG_BORDERCOLOR_DEFAULT, /* value 0 reserved for default-init */ + SG_BORDERCOLOR_TRANSPARENT_BLACK, + SG_BORDERCOLOR_OPAQUE_BLACK, + SG_BORDERCOLOR_OPAQUE_WHITE, + _SG_BORDERCOLOR_NUM, + _SG_BORDERCOLOR_FORCE_U32 = 0x7FFFFFFF +} sg_border_color; + +/* + sg_vertex_format + + The data type of a vertex component. This is used to describe + the layout of vertex data when creating a pipeline object. +*/ +typedef enum sg_vertex_format { + SG_VERTEXFORMAT_INVALID, + SG_VERTEXFORMAT_FLOAT, + SG_VERTEXFORMAT_FLOAT2, + SG_VERTEXFORMAT_FLOAT3, + SG_VERTEXFORMAT_FLOAT4, + SG_VERTEXFORMAT_BYTE4, + SG_VERTEXFORMAT_BYTE4N, + SG_VERTEXFORMAT_UBYTE4, + SG_VERTEXFORMAT_UBYTE4N, + SG_VERTEXFORMAT_SHORT2, + SG_VERTEXFORMAT_SHORT2N, + SG_VERTEXFORMAT_USHORT2N, + SG_VERTEXFORMAT_SHORT4, + SG_VERTEXFORMAT_SHORT4N, + SG_VERTEXFORMAT_USHORT4N, + SG_VERTEXFORMAT_UINT10_N2, + _SG_VERTEXFORMAT_NUM, + _SG_VERTEXFORMAT_FORCE_U32 = 0x7FFFFFFF +} sg_vertex_format; + +/* + sg_vertex_step + + Defines whether the input pointer of a vertex input stream is advanced + 'per vertex' or 'per instance'. The default step-func is + SG_VERTEXSTEP_PER_VERTEX. SG_VERTEXSTEP_PER_INSTANCE is used with + instanced-rendering. + + The vertex-step is part of the vertex-layout definition + when creating pipeline objects. +*/ +typedef enum sg_vertex_step { + _SG_VERTEXSTEP_DEFAULT, /* value 0 reserved for default-init */ + SG_VERTEXSTEP_PER_VERTEX, + SG_VERTEXSTEP_PER_INSTANCE, + _SG_VERTEXSTEP_NUM, + _SG_VERTEXSTEP_FORCE_U32 = 0x7FFFFFFF +} sg_vertex_step; + +/* + sg_uniform_type + + The data type of a uniform block member. This is used to + describe the internal layout of uniform blocks when creating + a shader object. +*/ +typedef enum sg_uniform_type { + SG_UNIFORMTYPE_INVALID, + SG_UNIFORMTYPE_FLOAT, + SG_UNIFORMTYPE_FLOAT2, + SG_UNIFORMTYPE_FLOAT3, + SG_UNIFORMTYPE_FLOAT4, + SG_UNIFORMTYPE_MAT4, + _SG_UNIFORMTYPE_NUM, + _SG_UNIFORMTYPE_FORCE_U32 = 0x7FFFFFFF +} sg_uniform_type; + +/* + sg_cull_mode + + The face-culling mode, this is used in the + sg_pipeline_desc.rasterizer.cull_mode member when creating a + pipeline object. + + The default cull mode is SG_CULLMODE_NONE +*/ +typedef enum sg_cull_mode { + _SG_CULLMODE_DEFAULT, /* value 0 reserved for default-init */ + SG_CULLMODE_NONE, + SG_CULLMODE_FRONT, + SG_CULLMODE_BACK, + _SG_CULLMODE_NUM, + _SG_CULLMODE_FORCE_U32 = 0x7FFFFFFF +} sg_cull_mode; + +/* + sg_face_winding + + The vertex-winding rule that determines a front-facing primitive. This + is used in the member sg_pipeline_desc.rasterizer.face_winding + when creating a pipeline object. + + The default winding is SG_FACEWINDING_CW (clockwise) +*/ +typedef enum sg_face_winding { + _SG_FACEWINDING_DEFAULT, /* value 0 reserved for default-init */ + SG_FACEWINDING_CCW, + SG_FACEWINDING_CW, + _SG_FACEWINDING_NUM, + _SG_FACEWINDING_FORCE_U32 = 0x7FFFFFFF +} sg_face_winding; + +/* + sg_compare_func + + The compare-function for depth- and stencil-ref tests. + This is used when creating pipeline objects in the members: + + sg_pipeline_desc + .depth_stencil + .depth_compare_func + .stencil_front.compare_func + .stencil_back.compare_func + + The default compare func for depth- and stencil-tests is + SG_COMPAREFUNC_ALWAYS. +*/ +typedef enum sg_compare_func { + _SG_COMPAREFUNC_DEFAULT, /* value 0 reserved for default-init */ + SG_COMPAREFUNC_NEVER, + SG_COMPAREFUNC_LESS, + SG_COMPAREFUNC_EQUAL, + SG_COMPAREFUNC_LESS_EQUAL, + SG_COMPAREFUNC_GREATER, + SG_COMPAREFUNC_NOT_EQUAL, + SG_COMPAREFUNC_GREATER_EQUAL, + SG_COMPAREFUNC_ALWAYS, + _SG_COMPAREFUNC_NUM, + _SG_COMPAREFUNC_FORCE_U32 = 0x7FFFFFFF +} sg_compare_func; + +/* + sg_stencil_op + + The operation performed on a currently stored stencil-value when a + comparison test passes or fails. This is used when creating a pipeline + object in the members: + + sg_pipeline_desc + .depth_stencil + .stencil_front + .fail_op + .depth_fail_op + .pass_op + .stencil_back + .fail_op + .depth_fail_op + .pass_op + + The default value is SG_STENCILOP_KEEP. +*/ +typedef enum sg_stencil_op { + _SG_STENCILOP_DEFAULT, /* value 0 reserved for default-init */ + SG_STENCILOP_KEEP, + SG_STENCILOP_ZERO, + SG_STENCILOP_REPLACE, + SG_STENCILOP_INCR_CLAMP, + SG_STENCILOP_DECR_CLAMP, + SG_STENCILOP_INVERT, + SG_STENCILOP_INCR_WRAP, + SG_STENCILOP_DECR_WRAP, + _SG_STENCILOP_NUM, + _SG_STENCILOP_FORCE_U32 = 0x7FFFFFFF +} sg_stencil_op; + +/* + sg_blend_factor + + The source and destination factors in blending operations. + This is used in the following members when creating a pipeline object: + + sg_pipeline_desc + .blend + .src_factor_rgb + .dst_factor_rgb + .src_factor_alpha + .dst_factor_alpha + + The default value is SG_BLENDFACTOR_ONE for source + factors, and SG_BLENDFACTOR_ZERO for destination factors. +*/ +typedef enum sg_blend_factor { + _SG_BLENDFACTOR_DEFAULT, /* value 0 reserved for default-init */ + SG_BLENDFACTOR_ZERO, + SG_BLENDFACTOR_ONE, + SG_BLENDFACTOR_SRC_COLOR, + SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR, + SG_BLENDFACTOR_SRC_ALPHA, + SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, + SG_BLENDFACTOR_DST_COLOR, + SG_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SG_BLENDFACTOR_DST_ALPHA, + SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA, + SG_BLENDFACTOR_SRC_ALPHA_SATURATED, + SG_BLENDFACTOR_BLEND_COLOR, + SG_BLENDFACTOR_ONE_MINUS_BLEND_COLOR, + SG_BLENDFACTOR_BLEND_ALPHA, + SG_BLENDFACTOR_ONE_MINUS_BLEND_ALPHA, + _SG_BLENDFACTOR_NUM, + _SG_BLENDFACTOR_FORCE_U32 = 0x7FFFFFFF +} sg_blend_factor; + +/* + sg_blend_op + + Describes how the source and destination values are combined in the + fragment blending operation. It is used in the following members when + creating a pipeline object: + + sg_pipeline_desc + .blend + .op_rgb + .op_alpha + + The default value is SG_BLENDOP_ADD. +*/ +typedef enum sg_blend_op { + _SG_BLENDOP_DEFAULT, /* value 0 reserved for default-init */ + SG_BLENDOP_ADD, + SG_BLENDOP_SUBTRACT, + SG_BLENDOP_REVERSE_SUBTRACT, + _SG_BLENDOP_NUM, + _SG_BLENDOP_FORCE_U32 = 0x7FFFFFFF +} sg_blend_op; + +/* + sg_color_mask + + Selects the color channels when writing a fragment color to the + framebuffer. This is used in the members + sg_pipeline_desc.blend.color_write_mask when creating a pipeline object. + + The default colormask is SG_COLORMASK_RGBA (write all colors channels) +*/ +typedef enum sg_color_mask { + _SG_COLORMASK_DEFAULT = 0, /* value 0 reserved for default-init */ + SG_COLORMASK_NONE = (0x10), /* special value for 'all channels disabled */ + SG_COLORMASK_R = (1<<0), + SG_COLORMASK_G = (1<<1), + SG_COLORMASK_B = (1<<2), + SG_COLORMASK_A = (1<<3), + SG_COLORMASK_RGB = 0x7, + SG_COLORMASK_RGBA = 0xF, + _SG_COLORMASK_FORCE_U32 = 0x7FFFFFFF +} sg_color_mask; + +/* + sg_action + + Defines what action should be performed at the start of a render pass: + + SG_ACTION_CLEAR: clear the render target image + SG_ACTION_LOAD: load the previous content of the render target image + SG_ACTION_DONTCARE: leave the render target image content undefined + + This is used in the sg_pass_action structure. + + The default action for all pass attachments is SG_ACTION_CLEAR, with the + clear color rgba = {0.5f, 0.5f, 0.5f, 1.0f], depth=1.0 and stencil=0. + + If you want to override the default behaviour, it is important to not + only set the clear color, but the 'action' field as well (as long as this + is in its _SG_ACTION_DEFAULT, the value fields will be ignored). +*/ +typedef enum sg_action { + _SG_ACTION_DEFAULT, + SG_ACTION_CLEAR, + SG_ACTION_LOAD, + SG_ACTION_DONTCARE, + _SG_ACTION_NUM, + _SG_ACTION_FORCE_U32 = 0x7FFFFFFF +} sg_action; + +/* + sg_pass_action + + The sg_pass_action struct defines the actions to be performed + at the start of a rendering pass in the functions sg_begin_pass() + and sg_begin_default_pass(). + + A separate action and clear values can be defined for each + color attachment, and for the depth-stencil attachment. + + The default clear values are defined by the macros: + + - SG_DEFAULT_CLEAR_RED: 0.5f + - SG_DEFAULT_CLEAR_GREEN: 0.5f + - SG_DEFAULT_CLEAR_BLUE: 0.5f + - SG_DEFAULT_CLEAR_ALPHA: 1.0f + - SG_DEFAULT_CLEAR_DEPTH: 1.0f + - SG_DEFAULT_CLEAR_STENCIL: 0 +*/ +typedef struct sg_color_attachment_action { + sg_action action; + float val[4]; +} sg_color_attachment_action; + +typedef struct sg_depth_attachment_action { + sg_action action; + float val; +} sg_depth_attachment_action; + +typedef struct sg_stencil_attachment_action { + sg_action action; + uint8_t val; +} sg_stencil_attachment_action; + +typedef struct sg_pass_action { + uint32_t _start_canary; + sg_color_attachment_action colors[SG_MAX_COLOR_ATTACHMENTS]; + sg_depth_attachment_action depth; + sg_stencil_attachment_action stencil; + uint32_t _end_canary; +} sg_pass_action; + +/* + sg_bindings + + The sg_bindings structure defines the resource binding slots + of the sokol_gfx render pipeline, used as argument to the + sg_apply_bindings() function. + + A resource binding struct contains: + + - 1..N vertex buffers + - 0..N vertex buffer offsets + - 0..1 index buffers + - 0..1 index buffer offsets + - 0..N vertex shader stage images + - 0..N fragment shader stage images + + The max number of vertex buffer and shader stage images + are defined by the SG_MAX_SHADERSTAGE_BUFFERS and + SG_MAX_SHADERSTAGE_IMAGES configuration constants. + + The optional buffer offsets can be used to group different chunks + of vertex- and/or index-data into the same buffer objects. +*/ +typedef struct sg_bindings { + uint32_t _start_canary; + sg_buffer vertex_buffers[SG_MAX_SHADERSTAGE_BUFFERS]; + int vertex_buffer_offsets[SG_MAX_SHADERSTAGE_BUFFERS]; + sg_buffer index_buffer; + int index_buffer_offset; + sg_image vs_images[SG_MAX_SHADERSTAGE_IMAGES]; + sg_image fs_images[SG_MAX_SHADERSTAGE_IMAGES]; + uint32_t _end_canary; +} sg_bindings; + +/* + sg_buffer_desc + + Creation parameters for sg_buffer objects, used in the + sg_make_buffer() call. + + The default configuration is: + + .size: 0 (this *must* be set to a valid size in bytes) + .type: SG_BUFFERTYPE_VERTEXBUFFER + .usage: SG_USAGE_IMMUTABLE + .content 0 + .label 0 (optional string label for trace hooks) + + The dbg_label will be ignored by sokol_gfx.h, it is only useful + when hooking into sg_make_buffer() or sg_init_buffer() via + the sg_install_trace_hook + + ADVANCED TOPIC: Injecting native 3D-API buffers: + + The following struct members allow to inject your own GL, Metal + or D3D11 buffers into sokol_gfx: + + .gl_buffers[SG_NUM_INFLIGHT_FRAMES] + .mtl_buffers[SG_NUM_INFLIGHT_FRAMES] + .d3d11_buffer + + You must still provide all other members except the .content member, and + these must match the creation parameters of the native buffers you + provide. For SG_USAGE_IMMUTABLE, only provide a single native 3D-API + buffer, otherwise you need to provide SG_NUM_INFLIGHT_FRAMES buffers + (only for GL and Metal, not D3D11). Providing multiple buffers for GL and + Metal is necessary because sokol_gfx will rotate through them when + calling sg_update_buffer() to prevent lock-stalls. + + Note that it is expected that immutable injected buffer have already been + initialized with content, and the .content member must be 0! + + Also you need to call sg_reset_state_cache() after calling native 3D-API + functions, and before calling any sokol_gfx function. +*/ +typedef struct sg_buffer_desc { + uint32_t _start_canary; + int size; + sg_buffer_type type; + sg_usage usage; + const void* content; + const char* label; + /* GL specific */ + uint32_t gl_buffers[SG_NUM_INFLIGHT_FRAMES]; + /* Metal specific */ + const void* mtl_buffers[SG_NUM_INFLIGHT_FRAMES]; + /* D3D11 specific */ + const void* d3d11_buffer; + uint32_t _end_canary; +} sg_buffer_desc; + +/* + sg_subimage_content + + Pointer to and size of a subimage-surface data, this is + used to describe the initial content of immutable-usage images, + or for updating a dynamic- or stream-usage images. + + For 3D- or array-textures, one sg_subimage_content item + describes an entire mipmap level consisting of all array- or + 3D-slices of the mipmap level. It is only possible to update + an entire mipmap level, not parts of it. +*/ +typedef struct sg_subimage_content { + const void* ptr; /* pointer to subimage data */ + int size; /* size in bytes of pointed-to subimage data */ +} sg_subimage_content; + +/* + sg_image_content + + Defines the content of an image through a 2D array + of sg_subimage_content structs. The first array dimension + is the cubemap face, and the second array dimension the + mipmap level. +*/ +typedef struct sg_image_content { + sg_subimage_content subimage[SG_CUBEFACE_NUM][SG_MAX_MIPMAPS]; +} sg_image_content; + +/* + sg_image_desc + + Creation parameters for sg_image objects, used in the + sg_make_image() call. + + The default configuration is: + + .type: SG_IMAGETYPE_2D + .render_target: false + .width 0 (must be set to >0) + .height 0 (must be set to >0) + .depth/.layers: 1 + .num_mipmaps: 1 + .usage: SG_USAGE_IMMUTABLE + .pixel_format: SG_PIXELFORMAT_RGBA8 for textures, backend-dependent + for render targets (RGBA8 or BGRA8) + .sample_count: 1 (only used in render_targets) + .min_filter: SG_FILTER_NEAREST + .mag_filter: SG_FILTER_NEAREST + .wrap_u: SG_WRAP_REPEAT + .wrap_v: SG_WRAP_REPEAT + .wrap_w: SG_WRAP_REPEAT (only SG_IMAGETYPE_3D) + .border_color SG_BORDERCOLOR_OPAQUE_BLACK + .max_anisotropy 1 (must be 1..16) + .min_lod 0.0f + .max_lod FLT_MAX + .content an sg_image_content struct to define the initial content + .label 0 (optional string label for trace hooks) + + SG_IMAGETYPE_ARRAY and SG_IMAGETYPE_3D are not supported on + WebGL/GLES2, use sg_query_features().imagetype_array and + sg_query_features().imagetype_3d at runtime to check + if array- and 3D-textures are supported. + + Images with usage SG_USAGE_IMMUTABLE must be fully initialized by + providing a valid .content member which points to + initialization data. + + ADVANCED TOPIC: Injecting native 3D-API textures: + + The following struct members allow to inject your own GL, Metal + or D3D11 textures into sokol_gfx: + + .gl_textures[SG_NUM_INFLIGHT_FRAMES] + .mtl_textures[SG_NUM_INFLIGHT_FRAMES] + .d3d11_texture + + The same rules apply as for injecting native buffers + (see sg_buffer_desc documentation for more details). +*/ +typedef struct sg_image_desc { + uint32_t _start_canary; + sg_image_type type; + bool render_target; + int width; + int height; + union { + int depth; + int layers; + }; + int num_mipmaps; + sg_usage usage; + sg_pixel_format pixel_format; + int sample_count; + sg_filter min_filter; + sg_filter mag_filter; + sg_wrap wrap_u; + sg_wrap wrap_v; + sg_wrap wrap_w; + sg_border_color border_color; + uint32_t max_anisotropy; + float min_lod; + float max_lod; + sg_image_content content; + const char* label; + /* GL specific */ + uint32_t gl_textures[SG_NUM_INFLIGHT_FRAMES]; + /* Metal specific */ + const void* mtl_textures[SG_NUM_INFLIGHT_FRAMES]; + /* D3D11 specific */ + const void* d3d11_texture; + uint32_t _end_canary; +} sg_image_desc; + +/* + sg_shader_desc + + The structure sg_shader_desc defines all creation parameters + for shader programs, used as input to the sg_make_shader() function: + + - reflection information for vertex attributes (vertex shader inputs): + - vertex attribute name (required for GLES2, optional for GLES3 and GL) + - a semantic name and index (required for D3D11) + - for each vertex- and fragment-shader-stage: + - the shader source or bytecode + - an optional entry function name + - reflection info for each uniform block used by the shader stage: + - the size of the uniform block in bytes + - reflection info for each uniform block member (only required for GL backends): + - member name + - member type (SG_UNIFORMTYPE_xxx) + - if the member is an array, the number of array items + - reflection info for the texture images used by the shader stage: + - the image type (SG_IMAGETYPE_xxx) + - the name of the texture sampler (required for GLES2, optional everywhere else) + + For all GL backends, shader source-code must be provided. For D3D11 and Metal, + either shader source-code or byte-code can be provided. + + For D3D11, if source code is provided, the d3dcompiler_47.dll will be loaded + on demand. If this fails, shader creation will fail. +*/ +typedef struct sg_shader_attr_desc { + const char* name; /* GLSL vertex attribute name (only required for GLES2) */ + const char* sem_name; /* HLSL semantic name */ + int sem_index; /* HLSL semantic index */ +} sg_shader_attr_desc; + +typedef struct sg_shader_uniform_desc { + const char* name; + sg_uniform_type type; + int array_count; +} sg_shader_uniform_desc; + +typedef struct sg_shader_uniform_block_desc { + int size; + sg_shader_uniform_desc uniforms[SG_MAX_UB_MEMBERS]; +} sg_shader_uniform_block_desc; + +typedef struct sg_shader_image_desc { + const char* name; + sg_image_type type; +} sg_shader_image_desc; + +typedef struct sg_shader_stage_desc { + const char* source; + const uint8_t* byte_code; + int byte_code_size; + const char* entry; + sg_shader_uniform_block_desc uniform_blocks[SG_MAX_SHADERSTAGE_UBS]; + sg_shader_image_desc images[SG_MAX_SHADERSTAGE_IMAGES]; +} sg_shader_stage_desc; + +typedef struct sg_shader_desc { + uint32_t _start_canary; + sg_shader_attr_desc attrs[SG_MAX_VERTEX_ATTRIBUTES]; + sg_shader_stage_desc vs; + sg_shader_stage_desc fs; + const char* label; + uint32_t _end_canary; +} sg_shader_desc; + +/* + sg_pipeline_desc + + The sg_pipeline_desc struct defines all creation parameters + for an sg_pipeline object, used as argument to the + sg_make_pipeline() function: + + - the vertex layout for all input vertex buffers + - a shader object + - the 3D primitive type (points, lines, triangles, ...) + - the index type (none, 16- or 32-bit) + - depth-stencil state + - alpha-blending state + - rasterizer state + + If the vertex data has no gaps between vertex components, you can omit + the .layout.buffers[].stride and layout.attrs[].offset items (leave them + default-initialized to 0), sokol will then compute the offsets and strides + from the vertex component formats (.layout.attrs[].offset). Please note + that ALL vertex attribute offsets must be 0 in order for the the + automatic offset computation to kick in. + + The default configuration is as follows: + + .layout: + .buffers[]: vertex buffer layouts + .stride: 0 (if no stride is given it will be computed) + .step_func SG_VERTEXSTEP_PER_VERTEX + .step_rate 1 + .attrs[]: vertex attribute declarations + .buffer_index 0 the vertex buffer bind slot + .offset 0 (offsets can be omitted if the vertex layout has no gaps) + .format SG_VERTEXFORMAT_INVALID (must be initialized!) + .shader: 0 (must be intilized with a valid sg_shader id!) + .primitive_type: SG_PRIMITIVETYPE_TRIANGLES + .index_type: SG_INDEXTYPE_NONE + .depth_stencil: + .stencil_front, .stencil_back: + .fail_op: SG_STENCILOP_KEEP + .depth_fail_op: SG_STENCILOP_KEEP + .pass_op: SG_STENCILOP_KEEP + .compare_func SG_COMPAREFUNC_ALWAYS + .depth_compare_func: SG_COMPAREFUNC_ALWAYS + .depth_write_enabled: false + .stencil_enabled: false + .stencil_read_mask: 0 + .stencil_write_mask: 0 + .stencil_ref: 0 + .blend: + .enabled: false + .src_factor_rgb: SG_BLENDFACTOR_ONE + .dst_factor_rgb: SG_BLENDFACTOR_ZERO + .op_rgb: SG_BLENDOP_ADD + .src_factor_alpha: SG_BLENDFACTOR_ONE + .dst_factor_alpha: SG_BLENDFACTOR_ZERO + .op_alpha: SG_BLENDOP_ADD + .color_write_mask: SG_COLORMASK_RGBA + .color_attachment_count 1 + .color_format SG_PIXELFORMAT_RGBA8 + .depth_format SG_PIXELFORMAT_DEPTHSTENCIL + .blend_color: { 0.0f, 0.0f, 0.0f, 0.0f } + .rasterizer: + .alpha_to_coverage_enabled: false + .cull_mode: SG_CULLMODE_NONE + .face_winding: SG_FACEWINDING_CW + .sample_count: 1 + .depth_bias: 0.0f + .depth_bias_slope_scale: 0.0f + .depth_bias_clamp: 0.0f + .label 0 (optional string label for trace hooks) +*/ +typedef struct sg_buffer_layout_desc { + int stride; + sg_vertex_step step_func; + int step_rate; +} sg_buffer_layout_desc; + +typedef struct sg_vertex_attr_desc { + int buffer_index; + int offset; + sg_vertex_format format; +} sg_vertex_attr_desc; + +typedef struct sg_layout_desc { + sg_buffer_layout_desc buffers[SG_MAX_SHADERSTAGE_BUFFERS]; + sg_vertex_attr_desc attrs[SG_MAX_VERTEX_ATTRIBUTES]; +} sg_layout_desc; + +typedef struct sg_stencil_state { + sg_stencil_op fail_op; + sg_stencil_op depth_fail_op; + sg_stencil_op pass_op; + sg_compare_func compare_func; +} sg_stencil_state; + +typedef struct sg_depth_stencil_state { + sg_stencil_state stencil_front; + sg_stencil_state stencil_back; + sg_compare_func depth_compare_func; + bool depth_write_enabled; + bool stencil_enabled; + uint8_t stencil_read_mask; + uint8_t stencil_write_mask; + uint8_t stencil_ref; +} sg_depth_stencil_state; + +typedef struct sg_blend_state { + bool enabled; + sg_blend_factor src_factor_rgb; + sg_blend_factor dst_factor_rgb; + sg_blend_op op_rgb; + sg_blend_factor src_factor_alpha; + sg_blend_factor dst_factor_alpha; + sg_blend_op op_alpha; + uint8_t color_write_mask; + int color_attachment_count; + sg_pixel_format color_format; + sg_pixel_format depth_format; + float blend_color[4]; +} sg_blend_state; + +typedef struct sg_rasterizer_state { + bool alpha_to_coverage_enabled; + sg_cull_mode cull_mode; + sg_face_winding face_winding; + int sample_count; + float depth_bias; + float depth_bias_slope_scale; + float depth_bias_clamp; +} sg_rasterizer_state; + +typedef struct sg_pipeline_desc { + uint32_t _start_canary; + sg_layout_desc layout; + sg_shader shader; + sg_primitive_type primitive_type; + sg_index_type index_type; + sg_depth_stencil_state depth_stencil; + sg_blend_state blend; + sg_rasterizer_state rasterizer; + const char* label; + uint32_t _end_canary; +} sg_pipeline_desc; + +/* + sg_pass_desc + + Creation parameters for an sg_pass object, used as argument + to the sg_make_pass() function. + + A pass object contains 1..4 color-attachments and none, or one, + depth-stencil-attachment. Each attachment consists of + an image, and two additional indices describing + which subimage the pass will render: one mipmap index, and + if the image is a cubemap, array-texture or 3D-texture, the + face-index, array-layer or depth-slice. + + Pass images must fulfill the following requirements: + + All images must have: + - been created as render target (sg_image_desc.render_target = true) + - the same size + - the same sample count + + In addition, all color-attachment images must have the same + pixel format. +*/ +typedef struct sg_attachment_desc { + sg_image image; + int mip_level; + union { + int face; + int layer; + int slice; + }; +} sg_attachment_desc; + +typedef struct sg_pass_desc { + uint32_t _start_canary; + sg_attachment_desc color_attachments[SG_MAX_COLOR_ATTACHMENTS]; + sg_attachment_desc depth_stencil_attachment; + const char* label; + uint32_t _end_canary; +} sg_pass_desc; + +/* + sg_trace_hooks + + Installable callback functions to keep track of the sokol_gfx calls, + this is useful for debugging, or keeping track of resource creation + and destruction. + + Trace hooks are installed with sg_install_trace_hooks(), this returns + another sg_trace_hooks struct with the previous set of + trace hook function pointers. These should be invoked by the + new trace hooks to form a proper call chain. +*/ +typedef struct sg_trace_hooks { + void* user_data; + void (*reset_state_cache)(void* user_data); + void (*make_buffer)(const sg_buffer_desc* desc, sg_buffer result, void* user_data); + void (*make_image)(const sg_image_desc* desc, sg_image result, void* user_data); + void (*make_shader)(const sg_shader_desc* desc, sg_shader result, void* user_data); + void (*make_pipeline)(const sg_pipeline_desc* desc, sg_pipeline result, void* user_data); + void (*make_pass)(const sg_pass_desc* desc, sg_pass result, void* user_data); + void (*destroy_buffer)(sg_buffer buf, void* user_data); + void (*destroy_image)(sg_image img, void* user_data); + void (*destroy_shader)(sg_shader shd, void* user_data); + void (*destroy_pipeline)(sg_pipeline pip, void* user_data); + void (*destroy_pass)(sg_pass pass, void* user_data); + void (*update_buffer)(sg_buffer buf, const void* data_ptr, int data_size, void* user_data); + void (*update_image)(sg_image img, const sg_image_content* data, void* user_data); + void (*append_buffer)(sg_buffer buf, const void* data_ptr, int data_size, int result, void* user_data); + void (*begin_default_pass)(const sg_pass_action* pass_action, int width, int height, void* user_data); + void (*begin_pass)(sg_pass pass, const sg_pass_action* pass_action, void* user_data); + void (*apply_viewport)(int x, int y, int width, int height, bool origin_top_left, void* user_data); + void (*apply_scissor_rect)(int x, int y, int width, int height, bool origin_top_left, void* user_data); + void (*apply_pipeline)(sg_pipeline pip, void* user_data); + void (*apply_bindings)(const sg_bindings* bindings, void* user_data); + void (*apply_uniforms)(sg_shader_stage stage, int ub_index, const void* data, int num_bytes, void* user_data); + void (*draw)(int base_element, int num_elements, int num_instances, void* user_data); + void (*end_pass)(void* user_data); + void (*commit)(void* user_data); + void (*alloc_buffer)(sg_buffer result, void* user_data); + void (*alloc_image)(sg_image result, void* user_data); + void (*alloc_shader)(sg_shader result, void* user_data); + void (*alloc_pipeline)(sg_pipeline result, void* user_data); + void (*alloc_pass)(sg_pass result, void* user_data); + void (*init_buffer)(sg_buffer buf_id, const sg_buffer_desc* desc, void* user_data); + void (*init_image)(sg_image img_id, const sg_image_desc* desc, void* user_data); + void (*init_shader)(sg_shader shd_id, const sg_shader_desc* desc, void* user_data); + void (*init_pipeline)(sg_pipeline pip_id, const sg_pipeline_desc* desc, void* user_data); + void (*init_pass)(sg_pass pass_id, const sg_pass_desc* desc, void* user_data); + void (*fail_buffer)(sg_buffer buf_id, void* user_data); + void (*fail_image)(sg_image img_id, void* user_data); + void (*fail_shader)(sg_shader shd_id, void* user_data); + void (*fail_pipeline)(sg_pipeline pip_id, void* user_data); + void (*fail_pass)(sg_pass pass_id, void* user_data); + void (*push_debug_group)(const char* name, void* user_data); + void (*pop_debug_group)(void* user_data); + void (*err_buffer_pool_exhausted)(void* user_data); + void (*err_image_pool_exhausted)(void* user_data); + void (*err_shader_pool_exhausted)(void* user_data); + void (*err_pipeline_pool_exhausted)(void* user_data); + void (*err_pass_pool_exhausted)(void* user_data); + void (*err_context_mismatch)(void* user_data); + void (*err_pass_invalid)(void* user_data); + void (*err_draw_invalid)(void* user_data); + void (*err_bindings_invalid)(void* user_data); +} sg_trace_hooks; + +/* + sg_buffer_info + sg_image_info + sg_shader_info + sg_pipeline_info + sg_pass_info + + These structs contain various internal resource attributes which + might be useful for debug-inspection. Please don't rely on the + actual content of those structs too much, as they are quite closely + tied to sokol_gfx.h internals and may change more frequently than + the other public API elements. + + The *_info structs are used as the return values of the following functions: + + sg_query_buffer_info() + sg_query_image_info() + sg_query_shader_info() + sg_query_pipeline_info() + sg_query_pass_info() +*/ +typedef struct sg_slot_info { + sg_resource_state state; /* the current state of this resource slot */ + uint32_t res_id; /* type-neutral resource if (e.g. sg_buffer.id) */ + uint32_t ctx_id; /* the context this resource belongs to */ +} sg_slot_info; + +typedef struct sg_buffer_info { + sg_slot_info slot; /* resource pool slot info */ + uint32_t update_frame_index; /* frame index of last sg_update_buffer() */ + uint32_t append_frame_index; /* frame index of last sg_append_buffer() */ + int append_pos; /* current position in buffer for sg_append_buffer() */ + bool append_overflow; /* is buffer in overflow state (due to sg_append_buffer) */ + int num_slots; /* number of renaming-slots for dynamically updated buffers */ + int active_slot; /* currently active write-slot for dynamically updated buffers */ +} sg_buffer_info; + +typedef struct sg_image_info { + sg_slot_info slot; /* resource pool slot info */ + uint32_t upd_frame_index; /* frame index of last sg_update_image() */ + int num_slots; /* number of renaming-slots for dynamically updated images */ + int active_slot; /* currently active write-slot for dynamically updated images */ +} sg_image_info; + +typedef struct sg_shader_info { + sg_slot_info slot; /* resoure pool slot info */ +} sg_shader_info; + +typedef struct sg_pipeline_info { + sg_slot_info slot; /* resource pool slot info */ +} sg_pipeline_info; + +typedef struct sg_pass_info { + sg_slot_info slot; /* resource pool slot info */ +} sg_pass_info; + +/* + sg_desc + + The sg_desc struct contains configuration values for sokol_gfx, + it is used as parameter to the sg_setup() call. + + The default configuration is: + + .buffer_pool_size: 128 + .image_pool_size: 128 + .shader_pool_size: 32 + .pipeline_pool_size: 64 + .pass_pool_size: 16 + .context_pool_size: 16 + + GL specific: + .gl_force_gles2 + if this is true the GL backend will act in "GLES2 fallback mode" even + when compiled with SOKOL_GLES3, this is useful to fall back + to traditional WebGL if a browser doesn't support a WebGL2 context + + Metal specific: + (NOTE: All Objective-C object references are transferred through + a bridged (const void*) to sokol_gfx, which will use a unretained + bridged cast (__bridged id) to retrieve the Objective-C + references back. Since the bridge cast is unretained, the caller + must hold a strong reference to the Objective-C object for the + duration of the sokol_gfx call! + + .mtl_device + a pointer to the MTLDevice object + .mtl_renderpass_descriptor_cb + a C callback function to obtain the MTLRenderPassDescriptor for the + current frame when rendering to the default framebuffer, will be called + in sg_begin_default_pass() + .mtl_drawable_cb + a C callback function to obtain a MTLDrawable for the current + frame when rendering to the default framebuffer, will be called in + sg_end_pass() of the default pass + .mtl_global_uniform_buffer_size + the size of the global uniform buffer in bytes, this must be big + enough to hold all uniform block updates for a single frame, + the default value is 4 MByte (4 * 1024 * 1024) + .mtl_sampler_cache_size + the number of slots in the sampler cache, the Metal backend + will share texture samplers with the same state in this + cache, the default value is 64 + + D3D11 specific: + .d3d11_device + a pointer to the ID3D11Device object, this must have been created + before sg_setup() is called + .d3d11_device_context + a pointer to the ID3D11DeviceContext object + .d3d11_render_target_view_cb + a C callback function to obtain a pointer to the current + ID3D11RenderTargetView object of the default framebuffer, + this function will be called in sg_begin_pass() when rendering + to the default framebuffer + .d3d11_depth_stencil_view_cb + a C callback function to obtain a pointer to the current + ID3D11DepthStencilView object of the default framebuffer, + this function will be called in sg_begin_pass() when rendering + to the default framebuffer +*/ +typedef struct sg_desc { + uint32_t _start_canary; + int buffer_pool_size; + int image_pool_size; + int shader_pool_size; + int pipeline_pool_size; + int pass_pool_size; + int context_pool_size; + /* GL specific */ + bool gl_force_gles2; + /* Metal-specific */ + const void* mtl_device; + const void* (*mtl_renderpass_descriptor_cb)(void); + const void* (*mtl_drawable_cb)(void); + int mtl_global_uniform_buffer_size; + int mtl_sampler_cache_size; + /* D3D11-specific */ + const void* d3d11_device; + const void* d3d11_device_context; + const void* (*d3d11_render_target_view_cb)(void); + const void* (*d3d11_depth_stencil_view_cb)(void); + uint32_t _end_canary; +} sg_desc; + +/* setup and misc functions */ +SOKOL_API_DECL void sg_setup(const sg_desc* desc); +SOKOL_API_DECL void sg_shutdown(void); +SOKOL_API_DECL bool sg_isvalid(void); +SOKOL_API_DECL void sg_reset_state_cache(void); +SOKOL_API_DECL sg_trace_hooks sg_install_trace_hooks(const sg_trace_hooks* trace_hooks); +SOKOL_API_DECL void sg_push_debug_group(const char* name); +SOKOL_API_DECL void sg_pop_debug_group(void); + +/* resource creation, destruction and updating */ +SOKOL_API_DECL sg_buffer sg_make_buffer(const sg_buffer_desc* desc); +SOKOL_API_DECL sg_image sg_make_image(const sg_image_desc* desc); +SOKOL_API_DECL sg_shader sg_make_shader(const sg_shader_desc* desc); +SOKOL_API_DECL sg_pipeline sg_make_pipeline(const sg_pipeline_desc* desc); +SOKOL_API_DECL sg_pass sg_make_pass(const sg_pass_desc* desc); +SOKOL_API_DECL void sg_destroy_buffer(sg_buffer buf); +SOKOL_API_DECL void sg_destroy_image(sg_image img); +SOKOL_API_DECL void sg_destroy_shader(sg_shader shd); +SOKOL_API_DECL void sg_destroy_pipeline(sg_pipeline pip); +SOKOL_API_DECL void sg_destroy_pass(sg_pass pass); +SOKOL_API_DECL void sg_update_buffer(sg_buffer buf, const void* data_ptr, int data_size); +SOKOL_API_DECL void sg_update_image(sg_image img, const sg_image_content* data); +SOKOL_API_DECL int sg_append_buffer(sg_buffer buf, const void* data_ptr, int data_size); +SOKOL_API_DECL bool sg_query_buffer_overflow(sg_buffer buf); + +/* rendering functions */ +SOKOL_API_DECL void sg_begin_default_pass(const sg_pass_action* pass_action, int width, int height); +SOKOL_API_DECL void sg_begin_pass(sg_pass pass, const sg_pass_action* pass_action); +SOKOL_API_DECL void sg_apply_viewport(int x, int y, int width, int height, bool origin_top_left); +SOKOL_API_DECL void sg_apply_scissor_rect(int x, int y, int width, int height, bool origin_top_left); +SOKOL_API_DECL void sg_apply_pipeline(sg_pipeline pip); +SOKOL_API_DECL void sg_apply_bindings(const sg_bindings* bindings); +SOKOL_API_DECL void sg_apply_uniforms(sg_shader_stage stage, int ub_index, const void* data, int num_bytes); +SOKOL_API_DECL void sg_draw(int base_element, int num_elements, int num_instances); +SOKOL_API_DECL void sg_end_pass(void); +SOKOL_API_DECL void sg_commit(void); + +/* getting information */ +SOKOL_API_DECL sg_desc sg_query_desc(void); +SOKOL_API_DECL sg_backend sg_query_backend(void); +SOKOL_API_DECL sg_features sg_query_features(void); +SOKOL_API_DECL sg_limits sg_query_limits(void); +SOKOL_API_DECL sg_pixelformat_info sg_query_pixelformat(sg_pixel_format fmt); +/* get current state of a resource (INITIAL, ALLOC, VALID, FAILED, INVALID) */ +SOKOL_API_DECL sg_resource_state sg_query_buffer_state(sg_buffer buf); +SOKOL_API_DECL sg_resource_state sg_query_image_state(sg_image img); +SOKOL_API_DECL sg_resource_state sg_query_shader_state(sg_shader shd); +SOKOL_API_DECL sg_resource_state sg_query_pipeline_state(sg_pipeline pip); +SOKOL_API_DECL sg_resource_state sg_query_pass_state(sg_pass pass); +/* get runtime information about a resource */ +SOKOL_API_DECL sg_buffer_info sg_query_buffer_info(sg_buffer buf); +SOKOL_API_DECL sg_image_info sg_query_image_info(sg_image img); +SOKOL_API_DECL sg_shader_info sg_query_shader_info(sg_shader shd); +SOKOL_API_DECL sg_pipeline_info sg_query_pipeline_info(sg_pipeline pip); +SOKOL_API_DECL sg_pass_info sg_query_pass_info(sg_pass pass); +/* get resource creation desc struct with their default values replaced */ +SOKOL_API_DECL sg_buffer_desc sg_query_buffer_defaults(const sg_buffer_desc* desc); +SOKOL_API_DECL sg_image_desc sg_query_image_defaults(const sg_image_desc* desc); +SOKOL_API_DECL sg_shader_desc sg_query_shader_defaults(const sg_shader_desc* desc); +SOKOL_API_DECL sg_pipeline_desc sg_query_pipeline_defaults(const sg_pipeline_desc* desc); +SOKOL_API_DECL sg_pass_desc sg_query_pass_defaults(const sg_pass_desc* desc); + +/* separate resource allocation and initialization (for async setup) */ +SOKOL_API_DECL sg_buffer sg_alloc_buffer(void); +SOKOL_API_DECL sg_image sg_alloc_image(void); +SOKOL_API_DECL sg_shader sg_alloc_shader(void); +SOKOL_API_DECL sg_pipeline sg_alloc_pipeline(void); +SOKOL_API_DECL sg_pass sg_alloc_pass(void); +SOKOL_API_DECL void sg_init_buffer(sg_buffer buf_id, const sg_buffer_desc* desc); +SOKOL_API_DECL void sg_init_image(sg_image img_id, const sg_image_desc* desc); +SOKOL_API_DECL void sg_init_shader(sg_shader shd_id, const sg_shader_desc* desc); +SOKOL_API_DECL void sg_init_pipeline(sg_pipeline pip_id, const sg_pipeline_desc* desc); +SOKOL_API_DECL void sg_init_pass(sg_pass pass_id, const sg_pass_desc* desc); +SOKOL_API_DECL void sg_fail_buffer(sg_buffer buf_id); +SOKOL_API_DECL void sg_fail_image(sg_image img_id); +SOKOL_API_DECL void sg_fail_shader(sg_shader shd_id); +SOKOL_API_DECL void sg_fail_pipeline(sg_pipeline pip_id); +SOKOL_API_DECL void sg_fail_pass(sg_pass pass_id); + +/* rendering contexts (optional) */ +SOKOL_API_DECL sg_context sg_setup_context(void); +SOKOL_API_DECL void sg_activate_context(sg_context ctx_id); +SOKOL_API_DECL void sg_discard_context(sg_context ctx_id); + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif // SOKOL_GFX_INCLUDED + +/*--- IMPLEMENTATION ---------------------------------------------------------*/ +#ifdef SOKOL_IMPL +#define SOKOL_GFX_IMPL_INCLUDED (1) + +#if !(defined(SOKOL_GLCORE33)||defined(SOKOL_GLES2)||defined(SOKOL_GLES3)||defined(SOKOL_D3D11)||defined(SOKOL_METAL)||defined(SOKOL_DUMMY_BACKEND)) +#error "Please select a backend with SOKOL_GLCORE33, SOKOL_GLES2, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL or SOKOL_DUMMY_BACKEND" +#endif +#include /* memset */ +#include /* FLT_MAX */ + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef SOKOL_VALIDATE_BEGIN + #define SOKOL_VALIDATE_BEGIN() _sg_validate_begin() +#endif +#ifndef SOKOL_VALIDATE + #define SOKOL_VALIDATE(cond, err) _sg_validate((cond), err) +#endif +#ifndef SOKOL_VALIDATE_END + #define SOKOL_VALIDATE_END() _sg_validate_end() +#endif +#ifndef SOKOL_UNREACHABLE + #define SOKOL_UNREACHABLE SOKOL_ASSERT(false) +#endif +#ifndef SOKOL_MALLOC + #include + #define SOKOL_MALLOC(s) malloc(s) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #else + #define SOKOL_LOG(s) + #endif +#endif + +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif + +#ifndef _SOKOL_UNUSED + #define _SOKOL_UNUSED(x) (void)(x) +#endif + +#if defined(SOKOL_TRACE_HOOKS) +#define _SG_TRACE_ARGS(fn, ...) if (_sg.hooks.fn) { _sg.hooks.fn(__VA_ARGS__, _sg.hooks.user_data); } +#define _SG_TRACE_NOARGS(fn) if (_sg.hooks.fn) { _sg.hooks.fn(_sg.hooks.user_data); } +#else +#define _SG_TRACE_ARGS(fn, ...) +#define _SG_TRACE_NOARGS(fn) +#endif + +/* default clear values */ +#ifndef SG_DEFAULT_CLEAR_RED +#define SG_DEFAULT_CLEAR_RED (0.5f) +#endif +#ifndef SG_DEFAULT_CLEAR_GREEN +#define SG_DEFAULT_CLEAR_GREEN (0.5f) +#endif +#ifndef SG_DEFAULT_CLEAR_BLUE +#define SG_DEFAULT_CLEAR_BLUE (0.5f) +#endif +#ifndef SG_DEFAULT_CLEAR_ALPHA +#define SG_DEFAULT_CLEAR_ALPHA (1.0f) +#endif +#ifndef SG_DEFAULT_CLEAR_DEPTH +#define SG_DEFAULT_CLEAR_DEPTH (1.0f) +#endif +#ifndef SG_DEFAULT_CLEAR_STENCIL +#define SG_DEFAULT_CLEAR_STENCIL (0) +#endif + +#if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + #ifndef GL_UNSIGNED_INT_2_10_10_10_REV + #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 + #endif + #ifndef GL_UNSIGNED_INT_24_8 + #define GL_UNSIGNED_INT_24_8 0x84FA + #endif + #ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT + #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE + #endif + #ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT + #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + #endif + #ifndef GL_COMPRESSED_RGBA_S3TC_DXT1_EXT + #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 + #endif + #ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT + #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 + #endif + #ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT + #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + #endif + #ifndef GL_COMPRESSED_RED_RGTC1 + #define GL_COMPRESSED_RED_RGTC1 0x8DBB + #endif + #ifndef GL_COMPRESSED_SIGNED_RED_RGTC1 + #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC + #endif + #ifndef GL_COMPRESSED_RED_GREEN_RGTC2 + #define GL_COMPRESSED_RED_GREEN_RGTC2 0x8DBD + #endif + #ifndef GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 + #define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2 0x8DBE + #endif + #ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB + #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C + #endif + #ifndef GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB + #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D + #endif + #ifndef GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB + #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E + #endif + #ifndef GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB + #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + #endif + #ifndef GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG + #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 + #endif + #ifndef GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG + #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 + #endif + #ifndef GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG + #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 + #endif + #ifndef GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG + #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 + #endif + #ifndef GL_COMPRESSED_RGB8_ETC2 + #define GL_COMPRESSED_RGB8_ETC2 0x9274 + #endif + #ifndef GL_COMPRESSED_RGBA8_ETC2_EAC + #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 + #endif + #ifndef GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 + #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 + #endif + #ifndef GL_COMPRESSED_RG11_EAC + #define GL_COMPRESSED_RG11_EAC 0x9272 + #endif + #ifndef GL_COMPRESSED_SIGNED_RG11_EAC + #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 + #endif + #ifndef GL_DEPTH24_STENCIL8 + #define GL_DEPTH24_STENCIL8 0x88F0 + #endif + #ifndef GL_HALF_FLOAT + #define GL_HALF_FLOAT 0x140B + #endif + #ifndef GL_DEPTH_STENCIL + #define GL_DEPTH_STENCIL 0x84F9 + #endif + #ifndef GL_LUMINANCE + #define GL_LUMINANCE 0x1909 + #endif + + #ifdef SOKOL_GLES2 + # ifdef GL_ANGLE_instanced_arrays + # define SOKOL_INSTANCING_ENABLED + # define glDrawArraysInstanced(mode, first, count, instancecount) glDrawArraysInstancedANGLE(mode, first, count, instancecount) + # define glDrawElementsInstanced(mode, count, type, indices, instancecount) glDrawElementsInstancedANGLE(mode, count, type, indices, instancecount) + # define glVertexAttribDivisor(index, divisor) glVertexAttribDivisorANGLE(index, divisor) + # elif defined(GL_EXT_draw_instanced) && defined(GL_EXT_instanced_arrays) + # define SOKOL_INSTANCING_ENABLED + # define glDrawArraysInstanced(mode, first, count, instancecount) glDrawArraysInstancedEXT(mode, first, count, instancecount) + # define glDrawElementsInstanced(mode, count, type, indices, instancecount) glDrawElementsInstancedEXT(mode, count, type, indices, instancecount) + # define glVertexAttribDivisor(index, divisor) glVertexAttribDivisorEXT(index, divisor) + # else + # define SOKOL_GLES2_INSTANCING_ERROR "Select GL_ANGLE_instanced_arrays or (GL_EXT_draw_instanced & GL_EXT_instanced_arrays) to enable instancing in GLES2" + # define glDrawArraysInstanced(mode, first, count, instancecount) SOKOL_ASSERT(0 && SOKOL_GLES2_INSTANCING_ERROR) + # define glDrawElementsInstanced(mode, count, type, indices, instancecount) SOKOL_ASSERT(0 && SOKOL_GLES2_INSTANCING_ERROR) + # define glVertexAttribDivisor(index, divisor) SOKOL_ASSERT(0 && SOKOL_GLES2_INSTANCING_ERROR) + # endif + #else + # define SOKOL_INSTANCING_ENABLED + #endif + #define _SG_GL_CHECK_ERROR() { SOKOL_ASSERT(glGetError() == GL_NO_ERROR); } + +#elif defined(SOKOL_D3D11) + #ifndef D3D11_NO_HELPERS + #define D3D11_NO_HELPERS + #endif + #ifndef CINTERFACE + #define CINTERFACE + #endif + #ifndef COBJMACROS + #define COBJMACROS + #endif + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #include + #include + #include + #if (defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) + #pragma comment (lib, "WindowsApp.lib") + #else + #pragma comment (lib, "user32.lib") + #pragma comment (lib, "dxgi.lib") + #pragma comment (lib, "d3d11.lib") + #pragma comment (lib, "dxguid.lib") + #endif +#elif defined(SOKOL_METAL) + #if !__has_feature(objc_arc) + #error "Please enable ARC when using the Metal backend" + #endif + #include + #import + #if defined(TARGET_OS_IPHONE) && !TARGET_OS_IPHONE + #define _SG_TARGET_MACOS (1) + #else + #define _SG_TARGET_IOS (1) + #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR + #define _SG_TARGET_IOS_SIMULATOR (1) + #endif + #endif +#endif + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */ +#pragma warning(disable:4115) /* named type definition in parentheses */ +#pragma warning(disable:4505) /* unreferenced local function has been removed */ +#endif + +/*=== PRIVATE DECLS ==========================================================*/ + +/* resource pool slots */ +typedef struct { + uint32_t id; + uint32_t ctx_id; + sg_resource_state state; +} _sg_slot_t; + +/* constants */ +enum { + _SG_STRING_SIZE = 16, + _SG_SLOT_SHIFT = 16, + _SG_SLOT_MASK = (1<<_SG_SLOT_SHIFT)-1, + _SG_MAX_POOL_SIZE = (1<<_SG_SLOT_SHIFT), + _SG_DEFAULT_BUFFER_POOL_SIZE = 128, + _SG_DEFAULT_IMAGE_POOL_SIZE = 128, + _SG_DEFAULT_SHADER_POOL_SIZE = 32, + _SG_DEFAULT_PIPELINE_POOL_SIZE = 64, + _SG_DEFAULT_PASS_POOL_SIZE = 16, + _SG_DEFAULT_CONTEXT_POOL_SIZE = 16, + _SG_MTL_DEFAULT_UB_SIZE = 4 * 1024 * 1024, + _SG_MTL_DEFAULT_SAMPLER_CACHE_CAPACITY = 64, +}; + +/* fixed-size string */ +typedef struct { + char buf[_SG_STRING_SIZE]; +} _sg_str_t; + +/* helper macros */ +#define _sg_def(val, def) (((val) == 0) ? (def) : (val)) +#define _sg_def_flt(val, def) (((val) == 0.0f) ? (def) : (val)) +#define _sg_min(a,b) ((ab)?a:b) +#define _sg_clamp(v,v0,v1) ((vv1)?(v1):(v))) +#define _sg_fequal(val,cmp,delta) (((val-cmp)> -delta)&&((val-cmp) _sg_mtl_device; +static id _sg_mtl_cmd_queue; +static id _sg_mtl_cmd_buffer; +static id _sg_mtl_uniform_buffers[SG_NUM_INFLIGHT_FRAMES]; +static id _sg_mtl_cmd_encoder; +static dispatch_semaphore_t _sg_mtl_sem; + +#endif /* SOKOL_METAL */ + +/*=== RESOURCE POOL DECLARATIONS =============================================*/ + +/* this *MUST* remain 0 */ +#define _SG_INVALID_SLOT_INDEX (0) + +typedef struct { + int size; + int queue_top; + uint32_t* gen_ctrs; + int* free_queue; +} _sg_pool_t; + +typedef struct { + _sg_pool_t buffer_pool; + _sg_pool_t image_pool; + _sg_pool_t shader_pool; + _sg_pool_t pipeline_pool; + _sg_pool_t pass_pool; + _sg_pool_t context_pool; + _sg_buffer_t* buffers; + _sg_image_t* images; + _sg_shader_t* shaders; + _sg_pipeline_t* pipelines; + _sg_pass_t* passes; + _sg_context_t* contexts; +} _sg_pools_t; + +/*=== VALIDATION LAYER DECLARATIONS ==========================================*/ +typedef enum { + /* special case 'validation was successful' */ + _SG_VALIDATE_SUCCESS, + + /* buffer creation */ + _SG_VALIDATE_BUFFERDESC_CANARY, + _SG_VALIDATE_BUFFERDESC_SIZE, + _SG_VALIDATE_BUFFERDESC_CONTENT, + _SG_VALIDATE_BUFFERDESC_NO_CONTENT, + + /* image creation */ + _SG_VALIDATE_IMAGEDESC_CANARY, + _SG_VALIDATE_IMAGEDESC_WIDTH, + _SG_VALIDATE_IMAGEDESC_HEIGHT, + _SG_VALIDATE_IMAGEDESC_RT_PIXELFORMAT, + _SG_VALIDATE_IMAGEDESC_NONRT_PIXELFORMAT, + _SG_VALIDATE_IMAGEDESC_MSAA_BUT_NO_RT, + _SG_VALIDATE_IMAGEDESC_NO_MSAA_RT_SUPPORT, + _SG_VALIDATE_IMAGEDESC_RT_IMMUTABLE, + _SG_VALIDATE_IMAGEDESC_RT_NO_CONTENT, + _SG_VALIDATE_IMAGEDESC_CONTENT, + _SG_VALIDATE_IMAGEDESC_NO_CONTENT, + + /* shader creation */ + _SG_VALIDATE_SHADERDESC_CANARY, + _SG_VALIDATE_SHADERDESC_SOURCE, + _SG_VALIDATE_SHADERDESC_BYTECODE, + _SG_VALIDATE_SHADERDESC_SOURCE_OR_BYTECODE, + _SG_VALIDATE_SHADERDESC_NO_BYTECODE_SIZE, + _SG_VALIDATE_SHADERDESC_NO_CONT_UBS, + _SG_VALIDATE_SHADERDESC_NO_CONT_IMGS, + _SG_VALIDATE_SHADERDESC_NO_CONT_UB_MEMBERS, + _SG_VALIDATE_SHADERDESC_NO_UB_MEMBERS, + _SG_VALIDATE_SHADERDESC_UB_MEMBER_NAME, + _SG_VALIDATE_SHADERDESC_UB_SIZE_MISMATCH, + _SG_VALIDATE_SHADERDESC_IMG_NAME, + _SG_VALIDATE_SHADERDESC_ATTR_NAMES, + _SG_VALIDATE_SHADERDESC_ATTR_SEMANTICS, + _SG_VALIDATE_SHADERDESC_ATTR_STRING_TOO_LONG, + + /* pipeline creation */ + _SG_VALIDATE_PIPELINEDESC_CANARY, + _SG_VALIDATE_PIPELINEDESC_SHADER, + _SG_VALIDATE_PIPELINEDESC_NO_ATTRS, + _SG_VALIDATE_PIPELINEDESC_LAYOUT_STRIDE4, + _SG_VALIDATE_PIPELINEDESC_ATTR_NAME, + _SG_VALIDATE_PIPELINEDESC_ATTR_SEMANTICS, + + /* pass creation */ + _SG_VALIDATE_PASSDESC_CANARY, + _SG_VALIDATE_PASSDESC_NO_COLOR_ATTS, + _SG_VALIDATE_PASSDESC_NO_CONT_COLOR_ATTS, + _SG_VALIDATE_PASSDESC_IMAGE, + _SG_VALIDATE_PASSDESC_MIPLEVEL, + _SG_VALIDATE_PASSDESC_FACE, + _SG_VALIDATE_PASSDESC_LAYER, + _SG_VALIDATE_PASSDESC_SLICE, + _SG_VALIDATE_PASSDESC_IMAGE_NO_RT, + _SG_VALIDATE_PASSDESC_COLOR_PIXELFORMATS, + _SG_VALIDATE_PASSDESC_COLOR_INV_PIXELFORMAT, + _SG_VALIDATE_PASSDESC_DEPTH_INV_PIXELFORMAT, + _SG_VALIDATE_PASSDESC_IMAGE_SIZES, + _SG_VALIDATE_PASSDESC_IMAGE_SAMPLE_COUNTS, + + /* sg_begin_pass validation */ + _SG_VALIDATE_BEGINPASS_PASS, + _SG_VALIDATE_BEGINPASS_IMAGE, + + /* sg_apply_pipeline validation */ + _SG_VALIDATE_APIP_PIPELINE_VALID_ID, + _SG_VALIDATE_APIP_PIPELINE_EXISTS, + _SG_VALIDATE_APIP_PIPELINE_VALID, + _SG_VALIDATE_APIP_SHADER_EXISTS, + _SG_VALIDATE_APIP_SHADER_VALID, + _SG_VALIDATE_APIP_ATT_COUNT, + _SG_VALIDATE_APIP_COLOR_FORMAT, + _SG_VALIDATE_APIP_DEPTH_FORMAT, + _SG_VALIDATE_APIP_SAMPLE_COUNT, + + /* sg_apply_bindings validation */ + _SG_VALIDATE_ABND_PIPELINE, + _SG_VALIDATE_ABND_PIPELINE_EXISTS, + _SG_VALIDATE_ABND_PIPELINE_VALID, + _SG_VALIDATE_ABND_VBS, + _SG_VALIDATE_ABND_VB_EXISTS, + _SG_VALIDATE_ABND_VB_TYPE, + _SG_VALIDATE_ABND_VB_OVERFLOW, + _SG_VALIDATE_ABND_NO_IB, + _SG_VALIDATE_ABND_IB, + _SG_VALIDATE_ABND_IB_EXISTS, + _SG_VALIDATE_ABND_IB_TYPE, + _SG_VALIDATE_ABND_IB_OVERFLOW, + _SG_VALIDATE_ABND_VS_IMGS, + _SG_VALIDATE_ABND_VS_IMG_EXISTS, + _SG_VALIDATE_ABND_VS_IMG_TYPES, + _SG_VALIDATE_ABND_FS_IMGS, + _SG_VALIDATE_ABND_FS_IMG_EXISTS, + _SG_VALIDATE_ABND_FS_IMG_TYPES, + + /* sg_apply_uniforms validation */ + _SG_VALIDATE_AUB_NO_PIPELINE, + _SG_VALIDATE_AUB_NO_UB_AT_SLOT, + _SG_VALIDATE_AUB_SIZE, + + /* sg_update_buffer validation */ + _SG_VALIDATE_UPDATEBUF_USAGE, + _SG_VALIDATE_UPDATEBUF_SIZE, + _SG_VALIDATE_UPDATEBUF_ONCE, + _SG_VALIDATE_UPDATEBUF_APPEND, + + /* sg_append_buffer validation */ + _SG_VALIDATE_APPENDBUF_USAGE, + _SG_VALIDATE_APPENDBUF_SIZE, + _SG_VALIDATE_APPENDBUF_UPDATE, + + /* sg_update_image validation */ + _SG_VALIDATE_UPDIMG_USAGE, + _SG_VALIDATE_UPDIMG_NOTENOUGHDATA, + _SG_VALIDATE_UPDIMG_SIZE, + _SG_VALIDATE_UPDIMG_COMPRESSED, + _SG_VALIDATE_UPDIMG_ONCE +} _sg_validate_error_t; + +/*=== GENERIC BACKEND STATE ==================================================*/ + +typedef struct { + bool valid; + sg_desc desc; /* original desc with default values patched in */ + uint32_t frame_index; + sg_context active_context; + sg_pass cur_pass; + sg_pipeline cur_pipeline; + bool pass_valid; + bool bindings_valid; + bool next_draw_valid; + #if defined(SOKOL_DEBUG) + _sg_validate_error_t validate_error; + #endif + _sg_pools_t pools; + sg_backend backend; + sg_features features; + sg_limits limits; + sg_pixelformat_info formats[_SG_PIXELFORMAT_NUM]; + #if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + _sg_gl_backend_t gl; + #elif defined(SOKOL_METAL) + _sg_mtl_backend_t mtl; + #elif defined(SOKOL_D3D11) + _sg_d3d11_backend_t d3d11; + #endif + #if defined(SOKOL_TRACE_HOOKS) + sg_trace_hooks hooks; + #endif +} _sg_state_t; +static _sg_state_t _sg; + +/*-- helper functions --------------------------------------------------------*/ + +_SOKOL_PRIVATE bool _sg_strempty(const _sg_str_t* str) { + return 0 == str->buf[0]; +} + +_SOKOL_PRIVATE const char* _sg_strptr(const _sg_str_t* str) { + return &str->buf[0]; +} + +_SOKOL_PRIVATE void _sg_strcpy(_sg_str_t* dst, const char* src) { + SOKOL_ASSERT(dst); + if (src) { + #if defined(_MSC_VER) + strncpy_s(dst->buf, _SG_STRING_SIZE, src, (_SG_STRING_SIZE-1)); + #else + strncpy(dst->buf, src, _SG_STRING_SIZE); + #endif + dst->buf[_SG_STRING_SIZE-1] = 0; + } + else { + memset(dst->buf, 0, _SG_STRING_SIZE); + } +} + +/* return byte size of a vertex format */ +_SOKOL_PRIVATE int _sg_vertexformat_bytesize(sg_vertex_format fmt) { + switch (fmt) { + case SG_VERTEXFORMAT_FLOAT: return 4; + case SG_VERTEXFORMAT_FLOAT2: return 8; + case SG_VERTEXFORMAT_FLOAT3: return 12; + case SG_VERTEXFORMAT_FLOAT4: return 16; + case SG_VERTEXFORMAT_BYTE4: return 4; + case SG_VERTEXFORMAT_BYTE4N: return 4; + case SG_VERTEXFORMAT_UBYTE4: return 4; + case SG_VERTEXFORMAT_UBYTE4N: return 4; + case SG_VERTEXFORMAT_SHORT2: return 4; + case SG_VERTEXFORMAT_SHORT2N: return 4; + case SG_VERTEXFORMAT_USHORT2N: return 4; + case SG_VERTEXFORMAT_SHORT4: return 8; + case SG_VERTEXFORMAT_SHORT4N: return 8; + case SG_VERTEXFORMAT_USHORT4N: return 8; + case SG_VERTEXFORMAT_UINT10_N2: return 4; + case SG_VERTEXFORMAT_INVALID: return 0; + default: + SOKOL_UNREACHABLE; + return -1; + } +} + +/* return the byte size of a shader uniform */ +_SOKOL_PRIVATE int _sg_uniform_size(sg_uniform_type type, int count) { + switch (type) { + case SG_UNIFORMTYPE_INVALID: return 0; + case SG_UNIFORMTYPE_FLOAT: return 4 * count; + case SG_UNIFORMTYPE_FLOAT2: return 8 * count; + case SG_UNIFORMTYPE_FLOAT3: return 12 * count; /* FIXME: std140??? */ + case SG_UNIFORMTYPE_FLOAT4: return 16 * count; + case SG_UNIFORMTYPE_MAT4: return 64 * count; + default: + SOKOL_UNREACHABLE; + return -1; + } +} + +/* the default color pixelformat for render targets */ +_SOKOL_PRIVATE sg_pixel_format _sg_default_rendertarget_colorformat(void) { + #if defined(SOKOL_METAL) || defined(SOKOL_D3D11) + return SG_PIXELFORMAT_BGRA8; + #else + return SG_PIXELFORMAT_RGBA8; + #endif +} + +_SOKOL_PRIVATE sg_pixel_format _sg_default_rendertarget_depthformat(void) { + return SG_PIXELFORMAT_DEPTH_STENCIL; +} + +/* return true if pixel format is a compressed format */ +_SOKOL_PRIVATE bool _sg_is_compressed_pixel_format(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_BC1_RGBA: + case SG_PIXELFORMAT_BC2_RGBA: + case SG_PIXELFORMAT_BC3_RGBA: + case SG_PIXELFORMAT_BC4_R: + case SG_PIXELFORMAT_BC4_RSN: + case SG_PIXELFORMAT_BC5_RG: + case SG_PIXELFORMAT_BC5_RGSN: + case SG_PIXELFORMAT_BC6H_RGBF: + case SG_PIXELFORMAT_BC6H_RGBUF: + case SG_PIXELFORMAT_BC7_RGBA: + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: + case SG_PIXELFORMAT_ETC2_RGB8: + case SG_PIXELFORMAT_ETC2_RGB8A1: + case SG_PIXELFORMAT_ETC2_RGBA8: + case SG_PIXELFORMAT_ETC2_RG11: + case SG_PIXELFORMAT_ETC2_RG11SN: + return true; + default: + return false; + } +} + +/* return true if pixel format is a valid render target format */ +_SOKOL_PRIVATE bool _sg_is_valid_rendertarget_color_format(sg_pixel_format fmt) { + const int fmt_index = (int) fmt; + SOKOL_ASSERT((fmt_index >= 0) && (fmt_index < _SG_PIXELFORMAT_NUM)); + return _sg.formats[fmt_index].render && !_sg.formats[fmt_index].depth; +} + +/* return true if pixel format is a valid depth format */ +_SOKOL_PRIVATE bool _sg_is_valid_rendertarget_depth_format(sg_pixel_format fmt) { + const int fmt_index = (int) fmt; + SOKOL_ASSERT((fmt_index >= 0) && (fmt_index < _SG_PIXELFORMAT_NUM)); + return _sg.formats[fmt_index].render && _sg.formats[fmt_index].depth; +} + +/* return true if pixel format is a depth-stencil format */ +_SOKOL_PRIVATE bool _sg_is_depth_stencil_format(sg_pixel_format fmt) { + return (SG_PIXELFORMAT_DEPTH_STENCIL == fmt); +} + +/* return the bytes-per-pixel for a pixel format */ +_SOKOL_PRIVATE int _sg_pixelformat_bytesize(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_R8: + case SG_PIXELFORMAT_R8SN: + case SG_PIXELFORMAT_R8UI: + case SG_PIXELFORMAT_R8SI: + return 1; + + case SG_PIXELFORMAT_R16: + case SG_PIXELFORMAT_R16SN: + case SG_PIXELFORMAT_R16UI: + case SG_PIXELFORMAT_R16SI: + case SG_PIXELFORMAT_R16F: + case SG_PIXELFORMAT_RG8: + case SG_PIXELFORMAT_RG8SN: + case SG_PIXELFORMAT_RG8UI: + case SG_PIXELFORMAT_RG8SI: + return 2; + + case SG_PIXELFORMAT_R32UI: + case SG_PIXELFORMAT_R32SI: + case SG_PIXELFORMAT_R32F: + case SG_PIXELFORMAT_RG16: + case SG_PIXELFORMAT_RG16SN: + case SG_PIXELFORMAT_RG16UI: + case SG_PIXELFORMAT_RG16SI: + case SG_PIXELFORMAT_RG16F: + case SG_PIXELFORMAT_RGBA8: + case SG_PIXELFORMAT_RGBA8SN: + case SG_PIXELFORMAT_RGBA8UI: + case SG_PIXELFORMAT_RGBA8SI: + case SG_PIXELFORMAT_BGRA8: + case SG_PIXELFORMAT_RGB10A2: + case SG_PIXELFORMAT_RG11B10F: + return 4; + + case SG_PIXELFORMAT_RG32UI: + case SG_PIXELFORMAT_RG32SI: + case SG_PIXELFORMAT_RG32F: + case SG_PIXELFORMAT_RGBA16: + case SG_PIXELFORMAT_RGBA16SN: + case SG_PIXELFORMAT_RGBA16UI: + case SG_PIXELFORMAT_RGBA16SI: + case SG_PIXELFORMAT_RGBA16F: + return 8; + + case SG_PIXELFORMAT_RGBA32UI: + case SG_PIXELFORMAT_RGBA32SI: + case SG_PIXELFORMAT_RGBA32F: + return 16; + + default: + SOKOL_UNREACHABLE; + return 0; + } +} + +/* return row pitch for an image + see ComputePitch in https://github.com/microsoft/DirectXTex/blob/master/DirectXTex/DirectXTexUtil.cpp +*/ +_SOKOL_PRIVATE int _sg_row_pitch(sg_pixel_format fmt, int width) { + int pitch; + switch (fmt) { + case SG_PIXELFORMAT_BC1_RGBA: + case SG_PIXELFORMAT_BC4_R: + case SG_PIXELFORMAT_BC4_RSN: + case SG_PIXELFORMAT_ETC2_RGB8: + case SG_PIXELFORMAT_ETC2_RGB8A1: + pitch = ((width + 3) / 4) * 8; + pitch = pitch < 8 ? 8 : pitch; + break; + case SG_PIXELFORMAT_BC2_RGBA: + case SG_PIXELFORMAT_BC3_RGBA: + case SG_PIXELFORMAT_BC5_RG: + case SG_PIXELFORMAT_BC5_RGSN: + case SG_PIXELFORMAT_BC6H_RGBF: + case SG_PIXELFORMAT_BC6H_RGBUF: + case SG_PIXELFORMAT_BC7_RGBA: + case SG_PIXELFORMAT_ETC2_RGBA8: + case SG_PIXELFORMAT_ETC2_RG11: + case SG_PIXELFORMAT_ETC2_RG11SN: + pitch = ((width + 3) / 4) * 16; + pitch = pitch < 16 ? 16 : pitch; + break; + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: + { + const int block_size = 4*4; + const int bpp = 4; + int width_blocks = width / 4; + width_blocks = width_blocks < 2 ? 2 : width_blocks; + pitch = width_blocks * ((block_size * bpp) / 8); + } + break; + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: + { + const int block_size = 8*4; + const int bpp = 2; + int width_blocks = width / 4; + width_blocks = width_blocks < 2 ? 2 : width_blocks; + pitch = width_blocks * ((block_size * bpp) / 8); + } + break; + default: + pitch = width * _sg_pixelformat_bytesize(fmt); + break; + } + return pitch; +} + +/* return pitch of a 2D subimage / texture slice + see ComputePitch in https://github.com/microsoft/DirectXTex/blob/master/DirectXTex/DirectXTexUtil.cpp +*/ +_SOKOL_PRIVATE int _sg_surface_pitch(sg_pixel_format fmt, int width, int height) { + int num_rows = 0; + switch (fmt) { + case SG_PIXELFORMAT_BC1_RGBA: + case SG_PIXELFORMAT_BC4_R: + case SG_PIXELFORMAT_BC4_RSN: + case SG_PIXELFORMAT_ETC2_RGB8: + case SG_PIXELFORMAT_ETC2_RGB8A1: + case SG_PIXELFORMAT_ETC2_RGBA8: + case SG_PIXELFORMAT_ETC2_RG11: + case SG_PIXELFORMAT_ETC2_RG11SN: + case SG_PIXELFORMAT_BC2_RGBA: + case SG_PIXELFORMAT_BC3_RGBA: + case SG_PIXELFORMAT_BC5_RG: + case SG_PIXELFORMAT_BC5_RGSN: + case SG_PIXELFORMAT_BC6H_RGBF: + case SG_PIXELFORMAT_BC6H_RGBUF: + case SG_PIXELFORMAT_BC7_RGBA: + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: + num_rows = ((height + 3) / 4); + break; + default: + num_rows = height; + break; + } + if (num_rows < 1) { + num_rows = 1; + } + return num_rows * _sg_row_pitch(fmt, width); +} + +/* capability table pixel format helper functions */ +_SOKOL_PRIVATE void _sg_pixelformat_all(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->filter = true; + pfi->blend = true; + pfi->render = true; + pfi->msaa = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_s(sg_pixelformat_info* pfi) { + pfi->sample = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_sf(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->filter = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_sr(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->render = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_srmd(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->render = true; + pfi->msaa = true; + pfi->depth = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_srm(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->render = true; + pfi->msaa = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_sfrm(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->filter = true; + pfi->render = true; + pfi->msaa = true; +} +_SOKOL_PRIVATE void _sg_pixelformat_sbrm(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->blend = true; + pfi->render = true; + pfi->msaa = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_sbr(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->blend = true; + pfi->render = true; +} + +_SOKOL_PRIVATE void _sg_pixelformat_sfbr(sg_pixelformat_info* pfi) { + pfi->sample = true; + pfi->filter = true; + pfi->blend = true; + pfi->render = true; +} + +/* resolve pass action defaults into a new pass action struct */ +_SOKOL_PRIVATE void _sg_resolve_default_pass_action(const sg_pass_action* from, sg_pass_action* to) { + SOKOL_ASSERT(from && to); + *to = *from; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (to->colors[i].action == _SG_ACTION_DEFAULT) { + to->colors[i].action = SG_ACTION_CLEAR; + to->colors[i].val[0] = SG_DEFAULT_CLEAR_RED; + to->colors[i].val[1] = SG_DEFAULT_CLEAR_GREEN; + to->colors[i].val[2] = SG_DEFAULT_CLEAR_BLUE; + to->colors[i].val[3] = SG_DEFAULT_CLEAR_ALPHA; + } + } + if (to->depth.action == _SG_ACTION_DEFAULT) { + to->depth.action = SG_ACTION_CLEAR; + to->depth.val = SG_DEFAULT_CLEAR_DEPTH; + } + if (to->stencil.action == _SG_ACTION_DEFAULT) { + to->stencil.action = SG_ACTION_CLEAR; + to->stencil.val = SG_DEFAULT_CLEAR_STENCIL; + } +} + +/*== DUMMY BACKEND IMPL ======================================================*/ +#if defined(SOKOL_DUMMY_BACKEND) + +_SOKOL_PRIVATE void _sg_setup_backend(const sg_desc* desc) { + SOKOL_ASSERT(desc); + _SOKOL_UNUSED(desc); + _sg.backend = SG_BACKEND_DUMMY; + for (int i = SG_PIXELFORMAT_R8; i < SG_PIXELFORMAT_BC1_RGBA; i++) { + _sg.formats[i].sample = true; + _sg.formats[i].filter = true; + _sg.formats[i].render = true; + _sg.formats[i].blend = true; + _sg.formats[i].msaa = true; + } + _sg.formats[SG_PIXELFORMAT_DEPTH].depth = true; + _sg.formats[SG_PIXELFORMAT_DEPTH_STENCIL].depth = true; +} + +_SOKOL_PRIVATE void _sg_discard_backend(void) { + /* empty */ +} + +_SOKOL_PRIVATE void _sg_reset_state_cache(void) { + /* empty*/ +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); +} + +_SOKOL_PRIVATE void _sg_activate_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_buffer(_sg_buffer_t* buf, const sg_buffer_desc* desc) { + SOKOL_ASSERT(buf && desc); + buf->size = desc->size; + buf->append_pos = 0; + buf->append_overflow = false; + buf->type = desc->type; + buf->usage = desc->usage; + buf->update_frame_index = 0; + buf->append_frame_index = 0; + buf->num_slots = (buf->usage == SG_USAGE_IMMUTABLE) ? 1 : SG_NUM_INFLIGHT_FRAMES; + buf->active_slot = 0; + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_buffer(_sg_buffer_t* buf) { + SOKOL_ASSERT(buf); + _SOKOL_UNUSED(buf); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_image(_sg_image_t* img, const sg_image_desc* desc) { + SOKOL_ASSERT(img && desc); + img->type = desc->type; + img->render_target = desc->render_target; + img->width = desc->width; + img->height = desc->height; + img->depth = desc->depth; + img->num_mipmaps = desc->num_mipmaps; + img->usage = desc->usage; + img->pixel_format = desc->pixel_format; + img->sample_count = desc->sample_count; + img->min_filter = desc->min_filter; + img->mag_filter = desc->mag_filter; + img->wrap_u = desc->wrap_u; + img->wrap_v = desc->wrap_v; + img->wrap_w = desc->wrap_w; + img->max_anisotropy = desc->max_anisotropy; + img->upd_frame_index = 0; + img->num_slots = (img->usage == SG_USAGE_IMMUTABLE) ? 1 :SG_NUM_INFLIGHT_FRAMES; + img->active_slot = 0; + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_image(_sg_image_t* img) { + SOKOL_ASSERT(img); + _SOKOL_UNUSED(img); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_shader(_sg_shader_t* shd, const sg_shader_desc* desc) { + SOKOL_ASSERT(shd && desc); + /* uniform block sizes and image types */ + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const sg_shader_stage_desc* stage_desc = (stage_index == SG_SHADERSTAGE_VS) ? &desc->vs : &desc->fs; + _sg_shader_stage_t* stage = &shd->stage[stage_index]; + SOKOL_ASSERT(stage->num_uniform_blocks == 0); + for (int ub_index = 0; ub_index < SG_MAX_SHADERSTAGE_UBS; ub_index++) { + const sg_shader_uniform_block_desc* ub_desc = &stage_desc->uniform_blocks[ub_index]; + if (0 == ub_desc->size) { + break; + } + _sg_uniform_block_t* ub = &stage->uniform_blocks[ub_index]; + ub->size = ub_desc->size; + stage->num_uniform_blocks++; + } + SOKOL_ASSERT(stage->num_images == 0); + for (int img_index = 0; img_index < SG_MAX_SHADERSTAGE_IMAGES; img_index++) { + const sg_shader_image_desc* img_desc = &stage_desc->images[img_index]; + if (img_desc->type == _SG_IMAGETYPE_DEFAULT) { + break; + } + stage->images[img_index].type = img_desc->type; + stage->num_images++; + } + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_shader(_sg_shader_t* shd) { + SOKOL_ASSERT(shd); + _SOKOL_UNUSED(shd); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pipeline(_sg_pipeline_t* pip, _sg_shader_t* shd, const sg_pipeline_desc* desc) { + SOKOL_ASSERT(pip && desc); + pip->shader = shd; + pip->shader_id = desc->shader; + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + const sg_vertex_attr_desc* a_desc = &desc->layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + break; + } + SOKOL_ASSERT((a_desc->buffer_index >= 0) && (a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS)); + pip->vertex_layout_valid[a_desc->buffer_index] = true; + } + pip->color_attachment_count = desc->blend.color_attachment_count; + pip->color_format = desc->blend.color_format; + pip->depth_format = desc->blend.depth_format; + pip->sample_count = desc->rasterizer.sample_count; + pip->depth_bias = desc->rasterizer.depth_bias; + pip->depth_bias_slope_scale = desc->rasterizer.depth_bias_slope_scale; + pip->depth_bias_clamp = desc->rasterizer.depth_bias_clamp; + pip->index_type = desc->index_type; + for (int i = 0; i < 4; i++) { + pip->blend_color[i] = desc->blend.blend_color[i]; + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + _SOKOL_UNUSED(pip); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pass(_sg_pass_t* pass, _sg_image_t** att_images, const sg_pass_desc* desc) { + SOKOL_ASSERT(pass && desc); + SOKOL_ASSERT(att_images && att_images[0]); + /* copy image pointers and desc attributes */ + const sg_attachment_desc* att_desc; + _sg_attachment_t* att; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + SOKOL_ASSERT(0 == pass->color_atts[i].image); + att_desc = &desc->color_attachments[i]; + if (att_desc->image.id != SG_INVALID_ID) { + pass->num_color_atts++; + SOKOL_ASSERT(att_images[i] && (att_images[i]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_color_format(att_images[i]->pixel_format)); + att = &pass->color_atts[i]; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[i]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + } + } + SOKOL_ASSERT(0 == pass->ds_att.image); + att_desc = &desc->depth_stencil_attachment; + const int ds_img_index = SG_MAX_COLOR_ATTACHMENTS; + if (att_desc->image.id != SG_INVALID_ID) { + SOKOL_ASSERT(att_images[ds_img_index] && (att_images[ds_img_index]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_depth_format(att_images[ds_img_index]->pixel_format)); + att = &pass->ds_att; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[ds_img_index]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pass(_sg_pass_t* pass) { + SOKOL_ASSERT(pass); + _SOKOL_UNUSED(pass); +} + +_SOKOL_PRIVATE void _sg_begin_pass(_sg_pass_t* pass, const sg_pass_action* action, int w, int h) { + SOKOL_ASSERT(action); + _SOKOL_UNUSED(pass); + _SOKOL_UNUSED(action); + _SOKOL_UNUSED(w); + _SOKOL_UNUSED(h); +} + +_SOKOL_PRIVATE void _sg_end_pass(void) { + /* empty */ +} + +_SOKOL_PRIVATE void _sg_commit(void) { + /* empty */ +} + +_SOKOL_PRIVATE void _sg_apply_viewport(int x, int y, int w, int h, bool origin_top_left) { + _SOKOL_UNUSED(x); + _SOKOL_UNUSED(y); + _SOKOL_UNUSED(w); + _SOKOL_UNUSED(h); + _SOKOL_UNUSED(origin_top_left); +} + +_SOKOL_PRIVATE void _sg_apply_scissor_rect(int x, int y, int w, int h, bool origin_top_left) { + _SOKOL_UNUSED(x); + _SOKOL_UNUSED(y); + _SOKOL_UNUSED(w); + _SOKOL_UNUSED(h); + _SOKOL_UNUSED(origin_top_left); +} + +_SOKOL_PRIVATE void _sg_apply_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + _SOKOL_UNUSED(pip); +} + +_SOKOL_PRIVATE void _sg_apply_bindings( + _sg_pipeline_t* pip, + _sg_buffer_t** vbs, const int* vb_offsets, int num_vbs, + _sg_buffer_t* ib, int ib_offset, + _sg_image_t** vs_imgs, int num_vs_imgs, + _sg_image_t** fs_imgs, int num_fs_imgs) +{ + SOKOL_ASSERT(pip); + SOKOL_ASSERT(vbs && vb_offsets); + SOKOL_ASSERT(vs_imgs); + SOKOL_ASSERT(fs_imgs); + _SOKOL_UNUSED(pip); + _SOKOL_UNUSED(vbs); _SOKOL_UNUSED(vb_offsets); _SOKOL_UNUSED(num_vbs); + _SOKOL_UNUSED(ib); _SOKOL_UNUSED(ib_offset); + _SOKOL_UNUSED(vs_imgs); _SOKOL_UNUSED(num_vs_imgs); + _SOKOL_UNUSED(fs_imgs); _SOKOL_UNUSED(num_fs_imgs); +} + +_SOKOL_PRIVATE void _sg_apply_uniforms(sg_shader_stage stage_index, int ub_index, const void* data, int num_bytes) { + SOKOL_ASSERT(data && (num_bytes > 0)); + SOKOL_ASSERT((stage_index >= 0) && ((int)stage_index < SG_NUM_SHADER_STAGES)); + SOKOL_ASSERT((ub_index >= 0) && (ub_index < SG_MAX_SHADERSTAGE_UBS)); + _SOKOL_UNUSED(stage_index); + _SOKOL_UNUSED(ub_index); + _SOKOL_UNUSED(data); + _SOKOL_UNUSED(num_bytes); +} + +_SOKOL_PRIVATE void _sg_draw(int base_element, int num_elements, int num_instances) { + _SOKOL_UNUSED(base_element); + _SOKOL_UNUSED(num_elements); + _SOKOL_UNUSED(num_instances); +} + +_SOKOL_PRIVATE void _sg_update_buffer(_sg_buffer_t* buf, const void* data, int data_size) { + SOKOL_ASSERT(buf && data && (data_size > 0)); + _SOKOL_UNUSED(data); + _SOKOL_UNUSED(data_size); + if (++buf->active_slot >= buf->num_slots) { + buf->active_slot = 0; + } +} + +_SOKOL_PRIVATE void _sg_append_buffer(_sg_buffer_t* buf, const void* data, int data_size, bool new_frame) { + SOKOL_ASSERT(buf && data && (data_size > 0)); + _SOKOL_UNUSED(data); + _SOKOL_UNUSED(data_size); + if (new_frame) { + if (++buf->active_slot >= buf->num_slots) { + buf->active_slot = 0; + } + } +} + +_SOKOL_PRIVATE void _sg_update_image(_sg_image_t* img, const sg_image_content* data) { + SOKOL_ASSERT(img && data); + _SOKOL_UNUSED(data); + if (++img->active_slot >= img->num_slots) { + img->active_slot = 0; + } +} + +/*== GL BACKEND ==============================================================*/ +#elif defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + +/*-- type translation --------------------------------------------------------*/ +_SOKOL_PRIVATE GLenum _sg_gl_buffer_target(sg_buffer_type t) { + switch (t) { + case SG_BUFFERTYPE_VERTEXBUFFER: return GL_ARRAY_BUFFER; + case SG_BUFFERTYPE_INDEXBUFFER: return GL_ELEMENT_ARRAY_BUFFER; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_texture_target(sg_image_type t) { + switch (t) { + case SG_IMAGETYPE_2D: return GL_TEXTURE_2D; + case SG_IMAGETYPE_CUBE: return GL_TEXTURE_CUBE_MAP; + #if !defined(SOKOL_GLES2) + case SG_IMAGETYPE_3D: return GL_TEXTURE_3D; + case SG_IMAGETYPE_ARRAY: return GL_TEXTURE_2D_ARRAY; + #endif + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_usage(sg_usage u) { + switch (u) { + case SG_USAGE_IMMUTABLE: return GL_STATIC_DRAW; + case SG_USAGE_DYNAMIC: return GL_DYNAMIC_DRAW; + case SG_USAGE_STREAM: return GL_STREAM_DRAW; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_shader_stage(sg_shader_stage stage) { + switch (stage) { + case SG_SHADERSTAGE_VS: return GL_VERTEX_SHADER; + case SG_SHADERSTAGE_FS: return GL_FRAGMENT_SHADER; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLint _sg_gl_vertexformat_size(sg_vertex_format fmt) { + switch (fmt) { + case SG_VERTEXFORMAT_FLOAT: return 1; + case SG_VERTEXFORMAT_FLOAT2: return 2; + case SG_VERTEXFORMAT_FLOAT3: return 3; + case SG_VERTEXFORMAT_FLOAT4: return 4; + case SG_VERTEXFORMAT_BYTE4: return 4; + case SG_VERTEXFORMAT_BYTE4N: return 4; + case SG_VERTEXFORMAT_UBYTE4: return 4; + case SG_VERTEXFORMAT_UBYTE4N: return 4; + case SG_VERTEXFORMAT_SHORT2: return 2; + case SG_VERTEXFORMAT_SHORT2N: return 2; + case SG_VERTEXFORMAT_USHORT2N: return 2; + case SG_VERTEXFORMAT_SHORT4: return 4; + case SG_VERTEXFORMAT_SHORT4N: return 4; + case SG_VERTEXFORMAT_USHORT4N: return 4; + case SG_VERTEXFORMAT_UINT10_N2: return 4; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_vertexformat_type(sg_vertex_format fmt) { + switch (fmt) { + case SG_VERTEXFORMAT_FLOAT: + case SG_VERTEXFORMAT_FLOAT2: + case SG_VERTEXFORMAT_FLOAT3: + case SG_VERTEXFORMAT_FLOAT4: + return GL_FLOAT; + case SG_VERTEXFORMAT_BYTE4: + case SG_VERTEXFORMAT_BYTE4N: + return GL_BYTE; + case SG_VERTEXFORMAT_UBYTE4: + case SG_VERTEXFORMAT_UBYTE4N: + return GL_UNSIGNED_BYTE; + case SG_VERTEXFORMAT_SHORT2: + case SG_VERTEXFORMAT_SHORT2N: + case SG_VERTEXFORMAT_SHORT4: + case SG_VERTEXFORMAT_SHORT4N: + return GL_SHORT; + case SG_VERTEXFORMAT_USHORT2N: + case SG_VERTEXFORMAT_USHORT4N: + return GL_UNSIGNED_SHORT; + case SG_VERTEXFORMAT_UINT10_N2: + return GL_UNSIGNED_INT_2_10_10_10_REV; + default: + SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLboolean _sg_gl_vertexformat_normalized(sg_vertex_format fmt) { + switch (fmt) { + case SG_VERTEXFORMAT_BYTE4N: + case SG_VERTEXFORMAT_UBYTE4N: + case SG_VERTEXFORMAT_SHORT2N: + case SG_VERTEXFORMAT_USHORT2N: + case SG_VERTEXFORMAT_SHORT4N: + case SG_VERTEXFORMAT_USHORT4N: + case SG_VERTEXFORMAT_UINT10_N2: + return GL_TRUE; + default: + return GL_FALSE; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_primitive_type(sg_primitive_type t) { + switch (t) { + case SG_PRIMITIVETYPE_POINTS: return GL_POINTS; + case SG_PRIMITIVETYPE_LINES: return GL_LINES; + case SG_PRIMITIVETYPE_LINE_STRIP: return GL_LINE_STRIP; + case SG_PRIMITIVETYPE_TRIANGLES: return GL_TRIANGLES; + case SG_PRIMITIVETYPE_TRIANGLE_STRIP: return GL_TRIANGLE_STRIP; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_index_type(sg_index_type t) { + switch (t) { + case SG_INDEXTYPE_NONE: return 0; + case SG_INDEXTYPE_UINT16: return GL_UNSIGNED_SHORT; + case SG_INDEXTYPE_UINT32: return GL_UNSIGNED_INT; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_compare_func(sg_compare_func cmp) { + switch (cmp) { + case SG_COMPAREFUNC_NEVER: return GL_NEVER; + case SG_COMPAREFUNC_LESS: return GL_LESS; + case SG_COMPAREFUNC_EQUAL: return GL_EQUAL; + case SG_COMPAREFUNC_LESS_EQUAL: return GL_LEQUAL; + case SG_COMPAREFUNC_GREATER: return GL_GREATER; + case SG_COMPAREFUNC_NOT_EQUAL: return GL_NOTEQUAL; + case SG_COMPAREFUNC_GREATER_EQUAL: return GL_GEQUAL; + case SG_COMPAREFUNC_ALWAYS: return GL_ALWAYS; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_stencil_op(sg_stencil_op op) { + switch (op) { + case SG_STENCILOP_KEEP: return GL_KEEP; + case SG_STENCILOP_ZERO: return GL_ZERO; + case SG_STENCILOP_REPLACE: return GL_REPLACE; + case SG_STENCILOP_INCR_CLAMP: return GL_INCR; + case SG_STENCILOP_DECR_CLAMP: return GL_DECR; + case SG_STENCILOP_INVERT: return GL_INVERT; + case SG_STENCILOP_INCR_WRAP: return GL_INCR_WRAP; + case SG_STENCILOP_DECR_WRAP: return GL_DECR_WRAP; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_blend_factor(sg_blend_factor f) { + switch (f) { + case SG_BLENDFACTOR_ZERO: return GL_ZERO; + case SG_BLENDFACTOR_ONE: return GL_ONE; + case SG_BLENDFACTOR_SRC_COLOR: return GL_SRC_COLOR; + case SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR: return GL_ONE_MINUS_SRC_COLOR; + case SG_BLENDFACTOR_SRC_ALPHA: return GL_SRC_ALPHA; + case SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA: return GL_ONE_MINUS_SRC_ALPHA; + case SG_BLENDFACTOR_DST_COLOR: return GL_DST_COLOR; + case SG_BLENDFACTOR_ONE_MINUS_DST_COLOR: return GL_ONE_MINUS_DST_COLOR; + case SG_BLENDFACTOR_DST_ALPHA: return GL_DST_ALPHA; + case SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA: return GL_ONE_MINUS_DST_ALPHA; + case SG_BLENDFACTOR_SRC_ALPHA_SATURATED: return GL_SRC_ALPHA_SATURATE; + case SG_BLENDFACTOR_BLEND_COLOR: return GL_CONSTANT_COLOR; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_COLOR: return GL_ONE_MINUS_CONSTANT_COLOR; + case SG_BLENDFACTOR_BLEND_ALPHA: return GL_CONSTANT_ALPHA; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_ALPHA: return GL_ONE_MINUS_CONSTANT_ALPHA; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_blend_op(sg_blend_op op) { + switch (op) { + case SG_BLENDOP_ADD: return GL_FUNC_ADD; + case SG_BLENDOP_SUBTRACT: return GL_FUNC_SUBTRACT; + case SG_BLENDOP_REVERSE_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_filter(sg_filter f) { + switch (f) { + case SG_FILTER_NEAREST: return GL_NEAREST; + case SG_FILTER_LINEAR: return GL_LINEAR; + case SG_FILTER_NEAREST_MIPMAP_NEAREST: return GL_NEAREST_MIPMAP_NEAREST; + case SG_FILTER_NEAREST_MIPMAP_LINEAR: return GL_NEAREST_MIPMAP_LINEAR; + case SG_FILTER_LINEAR_MIPMAP_NEAREST: return GL_LINEAR_MIPMAP_NEAREST; + case SG_FILTER_LINEAR_MIPMAP_LINEAR: return GL_LINEAR_MIPMAP_LINEAR; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_wrap(sg_wrap w) { + switch (w) { + case SG_WRAP_CLAMP_TO_EDGE: return GL_CLAMP_TO_EDGE; + #if defined(SOKOL_GLCORE33) + case SG_WRAP_CLAMP_TO_BORDER: return GL_CLAMP_TO_BORDER; + #else + case SG_WRAP_CLAMP_TO_BORDER: return GL_CLAMP_TO_EDGE; + #endif + case SG_WRAP_REPEAT: return GL_REPEAT; + case SG_WRAP_MIRRORED_REPEAT: return GL_MIRRORED_REPEAT; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_teximage_type(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_R8: + case SG_PIXELFORMAT_R8UI: + case SG_PIXELFORMAT_RG8: + case SG_PIXELFORMAT_RG8UI: + case SG_PIXELFORMAT_RGBA8: + case SG_PIXELFORMAT_RGBA8UI: + case SG_PIXELFORMAT_BGRA8: + return GL_UNSIGNED_BYTE; + case SG_PIXELFORMAT_R8SN: + case SG_PIXELFORMAT_R8SI: + case SG_PIXELFORMAT_RG8SN: + case SG_PIXELFORMAT_RG8SI: + case SG_PIXELFORMAT_RGBA8SN: + case SG_PIXELFORMAT_RGBA8SI: + return GL_BYTE; + case SG_PIXELFORMAT_R16: + case SG_PIXELFORMAT_R16UI: + case SG_PIXELFORMAT_RG16: + case SG_PIXELFORMAT_RG16UI: + case SG_PIXELFORMAT_RGBA16: + case SG_PIXELFORMAT_RGBA16UI: + return GL_UNSIGNED_SHORT; + case SG_PIXELFORMAT_R16SN: + case SG_PIXELFORMAT_R16SI: + case SG_PIXELFORMAT_RG16SN: + case SG_PIXELFORMAT_RG16SI: + case SG_PIXELFORMAT_RGBA16SN: + case SG_PIXELFORMAT_RGBA16SI: + return GL_SHORT; + case SG_PIXELFORMAT_R16F: + case SG_PIXELFORMAT_RG16F: + case SG_PIXELFORMAT_RGBA16F: + return GL_HALF_FLOAT; + case SG_PIXELFORMAT_R32UI: + case SG_PIXELFORMAT_RG32UI: + case SG_PIXELFORMAT_RGBA32UI: + return GL_UNSIGNED_INT; + case SG_PIXELFORMAT_R32SI: + case SG_PIXELFORMAT_RG32SI: + case SG_PIXELFORMAT_RGBA32SI: + return GL_INT; + case SG_PIXELFORMAT_R32F: + case SG_PIXELFORMAT_RG32F: + case SG_PIXELFORMAT_RGBA32F: + return GL_FLOAT; + #if !defined(SOKOL_GLES2) + case SG_PIXELFORMAT_RGB10A2: + return GL_UNSIGNED_INT_2_10_10_10_REV; + case SG_PIXELFORMAT_RG11B10F: + return GL_UNSIGNED_INT_10F_11F_11F_REV; + #endif + case SG_PIXELFORMAT_DEPTH: + return GL_UNSIGNED_SHORT; + case SG_PIXELFORMAT_DEPTH_STENCIL: + return GL_UNSIGNED_INT_24_8; + default: + SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_teximage_format(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_R8: + case SG_PIXELFORMAT_R8SN: + case SG_PIXELFORMAT_R16: + case SG_PIXELFORMAT_R16SN: + case SG_PIXELFORMAT_R16F: + case SG_PIXELFORMAT_R32F: + #if defined(SOKOL_GLES2) + return GL_LUMINANCE; + #else + if (_sg.gl.gles2) { + return GL_LUMINANCE; + } + else { + return GL_RED; + } + #endif + #if !defined(SOKOL_GLES2) + case SG_PIXELFORMAT_R8UI: + case SG_PIXELFORMAT_R8SI: + case SG_PIXELFORMAT_R16UI: + case SG_PIXELFORMAT_R16SI: + case SG_PIXELFORMAT_R32UI: + case SG_PIXELFORMAT_R32SI: + return GL_RED_INTEGER; + case SG_PIXELFORMAT_RG8: + case SG_PIXELFORMAT_RG8SN: + case SG_PIXELFORMAT_RG16: + case SG_PIXELFORMAT_RG16SN: + case SG_PIXELFORMAT_RG16F: + case SG_PIXELFORMAT_RG32F: + return GL_RG; + case SG_PIXELFORMAT_RG8UI: + case SG_PIXELFORMAT_RG8SI: + case SG_PIXELFORMAT_RG16UI: + case SG_PIXELFORMAT_RG16SI: + case SG_PIXELFORMAT_RG32UI: + case SG_PIXELFORMAT_RG32SI: + return GL_RG_INTEGER; + #endif + case SG_PIXELFORMAT_RGBA8: + case SG_PIXELFORMAT_RGBA8SN: + case SG_PIXELFORMAT_RGBA16: + case SG_PIXELFORMAT_RGBA16SN: + case SG_PIXELFORMAT_RGBA16F: + case SG_PIXELFORMAT_RGBA32F: + case SG_PIXELFORMAT_RGB10A2: + return GL_RGBA; + #if !defined(SOKOL_GLES2) + case SG_PIXELFORMAT_RGBA8UI: + case SG_PIXELFORMAT_RGBA8SI: + case SG_PIXELFORMAT_RGBA16UI: + case SG_PIXELFORMAT_RGBA16SI: + case SG_PIXELFORMAT_RGBA32UI: + case SG_PIXELFORMAT_RGBA32SI: + return GL_RGBA_INTEGER; + #endif + case SG_PIXELFORMAT_RG11B10F: + return GL_RGB; + case SG_PIXELFORMAT_DEPTH: + return GL_DEPTH_COMPONENT; + case SG_PIXELFORMAT_DEPTH_STENCIL: + return GL_DEPTH_STENCIL; + case SG_PIXELFORMAT_BC1_RGBA: + return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case SG_PIXELFORMAT_BC2_RGBA: + return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case SG_PIXELFORMAT_BC3_RGBA: + return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case SG_PIXELFORMAT_BC4_R: + return GL_COMPRESSED_RED_RGTC1; + case SG_PIXELFORMAT_BC4_RSN: + return GL_COMPRESSED_SIGNED_RED_RGTC1; + case SG_PIXELFORMAT_BC5_RG: + return GL_COMPRESSED_RED_GREEN_RGTC2; + case SG_PIXELFORMAT_BC5_RGSN: + return GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2; + case SG_PIXELFORMAT_BC6H_RGBF: + return GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB; + case SG_PIXELFORMAT_BC6H_RGBUF: + return GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB; + case SG_PIXELFORMAT_BC7_RGBA: + return GL_COMPRESSED_RGBA_BPTC_UNORM_ARB; + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: + return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: + return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: + return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: + return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + case SG_PIXELFORMAT_ETC2_RGB8: + return GL_COMPRESSED_RGB8_ETC2; + case SG_PIXELFORMAT_ETC2_RGB8A1: + return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + case SG_PIXELFORMAT_ETC2_RGBA8: + return GL_COMPRESSED_RGBA8_ETC2_EAC; + case SG_PIXELFORMAT_ETC2_RG11: + return GL_COMPRESSED_RG11_EAC; + case SG_PIXELFORMAT_ETC2_RG11SN: + return GL_COMPRESSED_SIGNED_RG11_EAC; + default: + SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_teximage_internal_format(sg_pixel_format fmt) { + #if defined(SOKOL_GLES2) + return _sg_gl_teximage_format(fmt); + #else + if (_sg.gl.gles2) { + return _sg_gl_teximage_format(fmt); + } + else { + switch (fmt) { + case SG_PIXELFORMAT_R8: return GL_R8; + case SG_PIXELFORMAT_R8SN: return GL_R8_SNORM; + case SG_PIXELFORMAT_R8UI: return GL_R8UI; + case SG_PIXELFORMAT_R8SI: return GL_R8I; + #if !defined(SOKOL_GLES3) + case SG_PIXELFORMAT_R16: return GL_R16; + case SG_PIXELFORMAT_R16SN: return GL_R16_SNORM; + #endif + case SG_PIXELFORMAT_R16UI: return GL_R16UI; + case SG_PIXELFORMAT_R16SI: return GL_R16I; + case SG_PIXELFORMAT_R16F: return GL_R16F; + case SG_PIXELFORMAT_RG8: return GL_RG8; + case SG_PIXELFORMAT_RG8SN: return GL_RG8_SNORM; + case SG_PIXELFORMAT_RG8UI: return GL_RG8UI; + case SG_PIXELFORMAT_RG8SI: return GL_RG8I; + case SG_PIXELFORMAT_R32UI: return GL_R32UI; + case SG_PIXELFORMAT_R32SI: return GL_R32I; + case SG_PIXELFORMAT_R32F: return GL_R32F; + #if !defined(SOKOL_GLES3) + case SG_PIXELFORMAT_RG16: return GL_RG16; + case SG_PIXELFORMAT_RG16SN: return GL_RG16_SNORM; + #endif + case SG_PIXELFORMAT_RG16UI: return GL_RG16UI; + case SG_PIXELFORMAT_RG16SI: return GL_RG16I; + case SG_PIXELFORMAT_RG16F: return GL_RG16F; + case SG_PIXELFORMAT_RGBA8: return GL_RGBA8; + case SG_PIXELFORMAT_RGBA8SN: return GL_RGBA8_SNORM; + case SG_PIXELFORMAT_RGBA8UI: return GL_RGBA8UI; + case SG_PIXELFORMAT_RGBA8SI: return GL_RGBA8I; + case SG_PIXELFORMAT_RGB10A2: return GL_RGB10_A2; + case SG_PIXELFORMAT_RG11B10F: return GL_R11F_G11F_B10F; + case SG_PIXELFORMAT_RG32UI: return GL_RG32UI; + case SG_PIXELFORMAT_RG32SI: return GL_RG32I; + case SG_PIXELFORMAT_RG32F: return GL_RG32F; + #if !defined(SOKOL_GLES3) + case SG_PIXELFORMAT_RGBA16: return GL_RGBA16; + case SG_PIXELFORMAT_RGBA16SN: return GL_RGBA16_SNORM; + #endif + case SG_PIXELFORMAT_RGBA16UI: return GL_RGBA16UI; + case SG_PIXELFORMAT_RGBA16SI: return GL_RGBA16I; + case SG_PIXELFORMAT_RGBA16F: return GL_RGBA16F; + case SG_PIXELFORMAT_RGBA32UI: return GL_RGBA32UI; + case SG_PIXELFORMAT_RGBA32SI: return GL_RGBA32I; + case SG_PIXELFORMAT_RGBA32F: return GL_RGBA32F; + case SG_PIXELFORMAT_DEPTH: return GL_DEPTH_COMPONENT16; + case SG_PIXELFORMAT_DEPTH_STENCIL: return GL_DEPTH24_STENCIL8; + case SG_PIXELFORMAT_BC1_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case SG_PIXELFORMAT_BC2_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case SG_PIXELFORMAT_BC3_RGBA: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case SG_PIXELFORMAT_BC4_R: return GL_COMPRESSED_RED_RGTC1; + case SG_PIXELFORMAT_BC4_RSN: return GL_COMPRESSED_SIGNED_RED_RGTC1; + case SG_PIXELFORMAT_BC5_RG: return GL_COMPRESSED_RED_GREEN_RGTC2; + case SG_PIXELFORMAT_BC5_RGSN: return GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2; + case SG_PIXELFORMAT_BC6H_RGBF: return GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB; + case SG_PIXELFORMAT_BC6H_RGBUF: return GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB; + case SG_PIXELFORMAT_BC7_RGBA: return GL_COMPRESSED_RGBA_BPTC_UNORM_ARB; + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + case SG_PIXELFORMAT_ETC2_RGB8: return GL_COMPRESSED_RGB8_ETC2; + case SG_PIXELFORMAT_ETC2_RGB8A1: return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + case SG_PIXELFORMAT_ETC2_RGBA8: return GL_COMPRESSED_RGBA8_ETC2_EAC; + case SG_PIXELFORMAT_ETC2_RG11: return GL_COMPRESSED_RG11_EAC; + case SG_PIXELFORMAT_ETC2_RG11SN: return GL_COMPRESSED_SIGNED_RG11_EAC; + default: SOKOL_UNREACHABLE; return 0; + } + } + #endif +} + +_SOKOL_PRIVATE GLenum _sg_gl_cubeface_target(int face_index) { + switch (face_index) { + case 0: return GL_TEXTURE_CUBE_MAP_POSITIVE_X; + case 1: return GL_TEXTURE_CUBE_MAP_NEGATIVE_X; + case 2: return GL_TEXTURE_CUBE_MAP_POSITIVE_Y; + case 3: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y; + case 4: return GL_TEXTURE_CUBE_MAP_POSITIVE_Z; + case 5: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE GLenum _sg_gl_depth_attachment_format(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_DEPTH: return GL_DEPTH_COMPONENT16; + case SG_PIXELFORMAT_DEPTH_STENCIL: return GL_DEPTH24_STENCIL8; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE void _sg_gl_init_attr(_sg_gl_attr_t* attr) { + attr->vb_index = -1; + attr->divisor = -1; +} + +_SOKOL_PRIVATE void _sg_gl_init_stencil_state(sg_stencil_state* s) { + SOKOL_ASSERT(s); + s->fail_op = SG_STENCILOP_KEEP; + s->depth_fail_op = SG_STENCILOP_KEEP; + s->pass_op = SG_STENCILOP_KEEP; + s->compare_func = SG_COMPAREFUNC_ALWAYS; +} + +_SOKOL_PRIVATE void _sg_gl_init_depth_stencil_state(sg_depth_stencil_state* s) { + SOKOL_ASSERT(s); + _sg_gl_init_stencil_state(&s->stencil_front); + _sg_gl_init_stencil_state(&s->stencil_back); + s->depth_compare_func = SG_COMPAREFUNC_ALWAYS; +} + +_SOKOL_PRIVATE void _sg_gl_init_blend_state(sg_blend_state* s) { + SOKOL_ASSERT(s); + s->src_factor_rgb = SG_BLENDFACTOR_ONE; + s->dst_factor_rgb = SG_BLENDFACTOR_ZERO; + s->op_rgb = SG_BLENDOP_ADD; + s->src_factor_alpha = SG_BLENDFACTOR_ONE; + s->dst_factor_alpha = SG_BLENDFACTOR_ZERO; + s->op_alpha = SG_BLENDOP_ADD; + s->color_write_mask = SG_COLORMASK_RGBA; +} + +_SOKOL_PRIVATE void _sg_gl_init_rasterizer_state(sg_rasterizer_state* s) { + SOKOL_ASSERT(s); + s->cull_mode = SG_CULLMODE_NONE; + s->face_winding = SG_FACEWINDING_CW; + s->sample_count = 1; +} + +/* see: https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml */ +_SOKOL_PRIVATE void _sg_gl_init_pixelformats(bool has_bgra) { + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R8]); + } + else { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R8]); + } + #else + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R8]); + #endif + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R8SN]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R8UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R8SI]); + #if !defined(SOKOL_GLES3) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R16]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R16SN]); + #endif + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R16UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R16SI]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RG8SN]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG8UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG8SI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_R32UI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_R32SI]); + #if !defined(SOKOL_GLES3) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG16]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG16SN]); + #endif + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG16UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG16SI]); + } + #endif + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA8]); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RGBA8SN]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA8UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA8SI]); + } + #endif + if (has_bgra) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_BGRA8]); + } + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGB10A2]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RG11B10F]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG32UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG32SI]); + #if !defined(SOKOL_GLES3) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16SN]); + #endif + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA16UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA16SI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA32UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA32SI]); + } + #endif + // FIXME: WEBGL_depth_texture extension? + _sg_pixelformat_srmd(&_sg.formats[SG_PIXELFORMAT_DEPTH]); + _sg_pixelformat_srmd(&_sg.formats[SG_PIXELFORMAT_DEPTH_STENCIL]); +} + +/* FIXME: OES_half_float_blend */ +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_half_float(bool has_colorbuffer_half_float, bool has_texture_half_float_linear) { + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + if (has_texture_half_float_linear) { + if (has_colorbuffer_half_float) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R16F]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG16F]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + else { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R16F]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RG16F]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + } + else { + if (has_colorbuffer_half_float) { + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_R16F]); + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_RG16F]); + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + else { + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_R16F]); + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_RG16F]); + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + } + } + else { + #endif + /* GLES2 can only render to RGBA, and there's no RG format */ + if (has_texture_half_float_linear) { + if (has_colorbuffer_half_float) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + else { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R16F]); + } + else { + if (has_colorbuffer_half_float) { + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + else { + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + } + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_R16F]); + } + #if !defined(SOKOL_GLES2) + } + #endif +} + +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_float(bool has_colorbuffer_float, bool has_texture_float_linear, bool has_float_blend) { + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + if (has_texture_float_linear) { + if (has_colorbuffer_float) { + if (has_float_blend) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R32F]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG32F]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + else { + _sg_pixelformat_sfrm(&_sg.formats[SG_PIXELFORMAT_R32F]); + _sg_pixelformat_sfrm(&_sg.formats[SG_PIXELFORMAT_RG32F]); + _sg_pixelformat_sfrm(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + } + else { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R32F]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RG32F]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + } + else { + if (has_colorbuffer_float) { + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_R32F]); + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_RG32F]); + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + else { + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_R32F]); + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_RG32F]); + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + } + } + else { + #endif + /* GLES2 can only render to RGBA, and there's no RG format */ + if (has_texture_float_linear) { + if (has_colorbuffer_float) { + if (has_float_blend) { + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + else { + _sg_pixelformat_sfrm(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + } + else { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_R32F]); + } + else { + if (has_colorbuffer_float) { + _sg_pixelformat_sbrm(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + else { + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + } + _sg_pixelformat_s(&_sg.formats[SG_PIXELFORMAT_R32F]); + } + #if !defined(SOKOL_GLES2) + } + #endif +} + +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_s3tc(void) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC1_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC2_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_RGBA]); +} + +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_rgtc(void) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_R]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_RSN]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC5_RG]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC5_RGSN]); +} + +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_bptc(void) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBF]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBUF]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_RGBA]); +} + +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_pvrtc(void) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGB_2BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGB_4BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGBA_2BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGBA_4BPP]); +} + +_SOKOL_PRIVATE void _sg_gl_init_pixelformats_etc2(void) { + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8A1]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGBA8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11SN]); +} + +_SOKOL_PRIVATE void _sg_gl_init_limits(void) { + _SG_GL_CHECK_ERROR(); + GLint gl_int; + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_int); + _SG_GL_CHECK_ERROR(); + _sg.limits.max_image_size_2d = gl_int; + _sg.limits.max_image_size_array = gl_int; + glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &gl_int); + _SG_GL_CHECK_ERROR(); + _sg.limits.max_image_size_cube = gl_int; + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &gl_int); + _SG_GL_CHECK_ERROR(); + if (gl_int > SG_MAX_VERTEX_ATTRIBUTES) { + gl_int = SG_MAX_VERTEX_ATTRIBUTES; + } + _sg.limits.max_vertex_attrs = gl_int; + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &gl_int); + _SG_GL_CHECK_ERROR(); + _sg.limits.max_image_size_3d = gl_int; + glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &gl_int); + _SG_GL_CHECK_ERROR(); + _sg.limits.max_image_array_layers = gl_int; + } + #endif + if (_sg.gl.ext_anisotropic) { + glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_int); + _SG_GL_CHECK_ERROR(); + _sg.gl.max_anisotropy = gl_int; + } + else { + _sg.gl.max_anisotropy = 1; + } + glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &gl_int); + _SG_GL_CHECK_ERROR(); + _sg.gl.max_combined_texture_image_units = gl_int; +} + +#if defined(SOKOL_GLCORE33) +_SOKOL_PRIVATE void _sg_gl_init_caps_glcore33(void) { + _sg.backend = SG_BACKEND_GLCORE33; + + _sg.features.origin_top_left = false; + _sg.features.instancing = true; + _sg.features.multiple_render_targets = true; + _sg.features.msaa_render_targets = true; + _sg.features.imagetype_3d = true; + _sg.features.imagetype_array = true; + _sg.features.image_clamp_to_border = true; + + /* scan extensions */ + bool has_s3tc = false; /* BC1..BC3 */ + bool has_rgtc = false; /* BC4 and BC5 */ + bool has_bptc = false; /* BC6H and BC7 */ + bool has_pvrtc = false; + bool has_etc2 = false; + GLint num_ext = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_ext); + for (int i = 0; i < num_ext; i++) { + const char* ext = (const char*) glGetStringi(GL_EXTENSIONS, i); + if (ext) { + if (strstr(ext, "_texture_compression_s3tc")) { + has_s3tc = true; + } + else if (strstr(ext, "_texture_compression_rgtc")) { + has_rgtc = true; + } + else if (strstr(ext, "_texture_compression_bptc")) { + has_bptc = true; + } + else if (strstr(ext, "_texture_compression_pvrtc")) { + has_pvrtc = true; + } + else if (strstr(ext, "_ES3_compatibility")) { + has_etc2 = true; + } + else if (strstr(ext, "_texture_filter_anisotropic")) { + _sg.gl.ext_anisotropic = true; + } + } + } + + /* limits */ + _sg_gl_init_limits(); + + /* pixel formats */ + const bool has_bgra = false; /* not a bug */ + const bool has_colorbuffer_float = true; + const bool has_colorbuffer_half_float = true; + const bool has_texture_float_linear = true; /* FIXME??? */ + const bool has_texture_half_float_linear = true; + const bool has_float_blend = true; + _sg_gl_init_pixelformats(has_bgra); + _sg_gl_init_pixelformats_float(has_colorbuffer_float, has_texture_float_linear, has_float_blend); + _sg_gl_init_pixelformats_half_float(has_colorbuffer_half_float, has_texture_half_float_linear); + if (has_s3tc) { + _sg_gl_init_pixelformats_s3tc(); + } + if (has_rgtc) { + _sg_gl_init_pixelformats_rgtc(); + } + if (has_bptc) { + _sg_gl_init_pixelformats_bptc(); + } + if (has_pvrtc) { + _sg_gl_init_pixelformats_pvrtc(); + } + if (has_etc2) { + _sg_gl_init_pixelformats_etc2(); + } +} +#endif + +#if defined(SOKOL_GLES3) +_SOKOL_PRIVATE void _sg_gl_init_caps_gles3(void) { + _sg.backend = SG_BACKEND_GLES3; + + _sg.features.origin_top_left = false; + _sg.features.instancing = true; + _sg.features.multiple_render_targets = true; + _sg.features.msaa_render_targets = true; + _sg.features.imagetype_3d = true; + _sg.features.imagetype_array = true; + _sg.features.image_clamp_to_border = false; + + bool has_s3tc = false; /* BC1..BC3 */ + bool has_rgtc = false; /* BC4 and BC5 */ + bool has_bptc = false; /* BC6H and BC7 */ + bool has_pvrtc = false; + #if defined(__EMSCRIPTEN__) + bool has_etc2 = false; + #else + bool has_etc2 = true; + #endif + bool has_colorbuffer_float = false; + bool has_colorbuffer_half_float = false; + bool has_texture_float_linear = false; + bool has_float_blend = false; + GLint num_ext = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_ext); + for (int i = 0; i < num_ext; i++) { + const char* ext = (const char*) glGetStringi(GL_EXTENSIONS, i); + if (ext) { + if (strstr(ext, "_texture_compression_s3tc")) { + has_s3tc = true; + } + else if (strstr(ext, "_compressed_texture_s3tc")) { + has_s3tc = true; + } + else if (strstr(ext, "_texture_compression_rgtc")) { + has_rgtc = true; + } + else if (strstr(ext, "_texture_compression_bptc")) { + has_bptc = true; + } + else if (strstr(ext, "_texture_compression_pvrtc")) { + has_pvrtc = true; + } + else if (strstr(ext, "_compressed_texture_etc")) { + has_etc2 = true; + } + else if (strstr(ext, "_color_buffer_float")) { + has_colorbuffer_float = true; + } + else if (strstr(ext, "_color_buffer_half_float")) { + has_colorbuffer_half_float = true; + } + else if (strstr(ext, "_texture_float_linear")) { + has_texture_float_linear = true; + } + else if (strstr(ext, "_float_blend")) { + has_float_blend = true; + } + else if (strstr(ext, "_texture_filter_anisotropic")) { + _sg.gl.ext_anisotropic = true; + } + } + } + + /* limits */ + _sg_gl_init_limits(); + + /* pixel formats */ + const bool has_texture_half_float_linear = true; + const bool has_bgra = false; /* not a bug */ + _sg_gl_init_pixelformats(has_bgra); + _sg_gl_init_pixelformats_float(has_colorbuffer_float, has_texture_float_linear, has_float_blend); + _sg_gl_init_pixelformats_half_float(has_colorbuffer_half_float, has_texture_half_float_linear); + if (has_s3tc) { + _sg_gl_init_pixelformats_s3tc(); + } + if (has_rgtc) { + _sg_gl_init_pixelformats_rgtc(); + } + if (has_bptc) { + _sg_gl_init_pixelformats_bptc(); + } + if (has_pvrtc) { + _sg_gl_init_pixelformats_pvrtc(); + } + if (has_etc2) { + _sg_gl_init_pixelformats_etc2(); + } +} +#endif + +#if defined(SOKOL_GLES3) || defined(SOKOL_GLES2) +_SOKOL_PRIVATE void _sg_gl_init_caps_gles2(void) { + _sg.backend = SG_BACKEND_GLES2; + + bool has_s3tc = false; /* BC1..BC3 */ + bool has_rgtc = false; /* BC4 and BC5 */ + bool has_bptc = false; /* BC6H and BC7 */ + bool has_pvrtc = false; + bool has_etc2 = false; + bool has_texture_float = false; + bool has_texture_float_linear = false; + bool has_colorbuffer_float = false; + bool has_float_blend = false; + bool has_instancing = false; + const char* ext = (const char*) glGetString(GL_EXTENSIONS); + if (ext) { + has_s3tc = strstr(ext, "_texture_compression_s3tc") || strstr(ext, "_compressed_texture_s3tc"); + has_rgtc = strstr(ext, "_texture_compression_rgtc"); + has_bptc = strstr(ext, "_texture_compression_bptc"); + has_pvrtc = strstr(ext, "_texture_compression_pvrtc"); + has_etc2 = strstr(ext, "_compressed_texture_etc"); + has_texture_float = strstr(ext, "_texture_float"); + has_texture_float_linear = strstr(ext, "_texture_float_linear"); + has_colorbuffer_float = strstr(ext, "_color_buffer_float"); + has_float_blend = strstr(ext, "_float_blend"); + /* don't bother with half_float support on WebGL1 + has_texture_half_float = strstr(ext, "_texture_half_float"); + has_texture_half_float_linear = strstr(ext, "_texture_half_float_linear"); + has_colorbuffer_half_float = strstr(ext, "_color_buffer_half_float"); + */ + has_instancing = strstr(ext, "_instanced_arrays"); + _sg.gl.ext_anisotropic = strstr(ext, "ext_anisotropic"); + } + + _sg.features.origin_top_left = false; + #if defined(SOKOL_INSTANCING_ENABLED) + _sg.features.instancing = has_instancing; + #endif + _sg.features.multiple_render_targets = false; + _sg.features.msaa_render_targets = false; + _sg.features.imagetype_3d = false; + _sg.features.imagetype_array = false; + _sg.features.image_clamp_to_border = false; + + /* limits */ + _sg_gl_init_limits(); + + /* pixel formats */ + const bool has_bgra = false; /* not a bug */ + const bool has_texture_half_float = false; + const bool has_texture_half_float_linear = false; + const bool has_colorbuffer_half_float = false; + _sg_gl_init_pixelformats(has_bgra); + if (has_texture_float) { + _sg_gl_init_pixelformats_float(has_colorbuffer_float, has_texture_float_linear, has_float_blend); + } + if (has_texture_half_float) { + _sg_gl_init_pixelformats_half_float(has_colorbuffer_half_float, has_texture_half_float_linear); + } + if (has_s3tc) { + _sg_gl_init_pixelformats_s3tc(); + } + if (has_rgtc) { + _sg_gl_init_pixelformats_rgtc(); + } + if (has_bptc) { + _sg_gl_init_pixelformats_bptc(); + } + if (has_pvrtc) { + _sg_gl_init_pixelformats_pvrtc(); + } + if (has_etc2) { + _sg_gl_init_pixelformats_etc2(); + } + /* GLES2 doesn't allow multi-sampled render targets at all */ + for (int i = 0; i < _SG_PIXELFORMAT_NUM; i++) { + _sg.formats[i].msaa = false; + } +} +#endif + +/*-- state cache implementation ----------------------------------------------*/ +_SOKOL_PRIVATE void _sg_gl_clear_buffer_bindings(bool force) { + if (force || (_sg.gl.cache.vertex_buffer != 0)) { + glBindBuffer(GL_ARRAY_BUFFER, 0); + _sg.gl.cache.vertex_buffer = 0; + } + if (force || (_sg.gl.cache.index_buffer != 0)) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + _sg.gl.cache.index_buffer = 0; + } +} + +_SOKOL_PRIVATE void _sg_gl_bind_buffer(GLenum target, GLuint buffer) { + SOKOL_ASSERT((GL_ARRAY_BUFFER == target) || (GL_ELEMENT_ARRAY_BUFFER == target)); + if (target == GL_ARRAY_BUFFER) { + if (_sg.gl.cache.vertex_buffer != buffer) { + _sg.gl.cache.vertex_buffer = buffer; + glBindBuffer(target, buffer); + } + } + else { + if (_sg.gl.cache.index_buffer != buffer) { + _sg.gl.cache.index_buffer = buffer; + glBindBuffer(target, buffer); + } + } +} + +_SOKOL_PRIVATE void _sg_gl_store_buffer_binding(GLenum target) { + if (target == GL_ARRAY_BUFFER) { + _sg.gl.cache.stored_vertex_buffer = _sg.gl.cache.vertex_buffer; + } + else { + _sg.gl.cache.stored_index_buffer = _sg.gl.cache.index_buffer; + } +} + +_SOKOL_PRIVATE void _sg_gl_restore_buffer_binding(GLenum target) { + if (target == GL_ARRAY_BUFFER) { + _sg_gl_bind_buffer(target, _sg.gl.cache.stored_vertex_buffer); + } + else { + _sg_gl_bind_buffer(target, _sg.gl.cache.stored_index_buffer); + } +} + +_SOKOL_PRIVATE void _sg_gl_clear_texture_bindings(bool force) { + for (int i = 0; (i < SG_MAX_SHADERSTAGE_IMAGES) && (i < _sg.gl.max_combined_texture_image_units); i++) { + if (force || (_sg.gl.cache.textures[i].texture != 0)) { + glActiveTexture(GL_TEXTURE0 + i); + glBindTexture(GL_TEXTURE_2D, 0); + glBindTexture(GL_TEXTURE_CUBE_MAP, 0); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + glBindTexture(GL_TEXTURE_3D, 0); + glBindTexture(GL_TEXTURE_2D_ARRAY, 0); + } + #endif + _sg.gl.cache.textures[i].target = 0; + _sg.gl.cache.textures[i].texture = 0; + } + } +} + +_SOKOL_PRIVATE void _sg_gl_bind_texture(int slot_index, GLenum target, GLuint texture) { + /* it's valid to call this function with target=0 and/or texture=0 + target=0 will unbind the previous binding, texture=0 will clear + the new binding + */ + SOKOL_ASSERT(slot_index < SG_MAX_SHADERSTAGE_IMAGES); + if (slot_index >= _sg.gl.max_combined_texture_image_units) { + return; + } + _sg_gl_texture_bind_slot* slot = &_sg.gl.cache.textures[slot_index]; + if ((slot->target != target) || (slot->texture != texture)) { + glActiveTexture(GL_TEXTURE0 + slot_index); + /* if the target has changed, clear the previous binding on that target */ + if ((target != slot->target) && (slot->target != 0)) { + glBindTexture(slot->target, 0); + } + /* apply new binding (texture can be 0 to unbind) */ + if (target != 0) { + glBindTexture(target, texture); + } + slot->target = target; + slot->texture = texture; + } +} + +_SOKOL_PRIVATE void _sg_gl_store_texture_binding(int slot_index) { + SOKOL_ASSERT(slot_index < SG_MAX_SHADERSTAGE_IMAGES); + _sg.gl.cache.stored_texture = _sg.gl.cache.textures[slot_index]; +} + +_SOKOL_PRIVATE void _sg_gl_restore_texture_binding(int slot_index) { + SOKOL_ASSERT(slot_index < SG_MAX_SHADERSTAGE_IMAGES); + const _sg_gl_texture_bind_slot* slot = &_sg.gl.cache.stored_texture; + _sg_gl_bind_texture(slot_index, slot->target, slot->texture); +} + +_SOKOL_PRIVATE void _sg_gl_reset_state_cache(void) { + _SG_GL_CHECK_ERROR(); + memset(&_sg.gl.cache, 0, sizeof(_sg.gl.cache)); + _sg_gl_clear_buffer_bindings(true); + _SG_GL_CHECK_ERROR(); + _sg_gl_clear_texture_bindings(true); + _SG_GL_CHECK_ERROR(); + for (uint32_t i = 0; i < _sg.limits.max_vertex_attrs; i++) { + _sg_gl_init_attr(&_sg.gl.cache.attrs[i].gl_attr); + glDisableVertexAttribArray(i); + _SG_GL_CHECK_ERROR(); + } + _sg.gl.cache.cur_primitive_type = GL_TRIANGLES; + + /* depth-stencil state */ + _sg_gl_init_depth_stencil_state(&_sg.gl.cache.ds); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_ALWAYS); + glDepthMask(GL_FALSE); + glDisable(GL_STENCIL_TEST); + glStencilFunc(GL_ALWAYS, 0, 0); + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + glStencilMask(0); + + /* blend state */ + _sg_gl_init_blend_state(&_sg.gl.cache.blend); + glDisable(GL_BLEND); + glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO); + glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glBlendColor(0.0f, 0.0f, 0.0f, 0.0f); + + /* rasterizer state */ + _sg_gl_init_rasterizer_state(&_sg.gl.cache.rast); + glPolygonOffset(0.0f, 0.0f); + glDisable(GL_POLYGON_OFFSET_FILL); + glDisable(GL_CULL_FACE); + glFrontFace(GL_CW); + glCullFace(GL_BACK); + glEnable(GL_SCISSOR_TEST); + glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + glEnable(GL_DITHER); + glDisable(GL_POLYGON_OFFSET_FILL); + #if defined(SOKOL_GLCORE33) + glEnable(GL_MULTISAMPLE); + glEnable(GL_PROGRAM_POINT_SIZE); + #endif +} + +/*-- main GL backend state and functions -------------------------------------*/ + +_SOKOL_PRIVATE void _sg_setup_backend(const sg_desc* desc) { + /* assumes that _sg.gl is already zero-initialized */ + _sg.gl.valid = true; + #if defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + _sg.gl.gles2 = desc->gl_force_gles2; + #else + _SOKOL_UNUSED(desc); + _sg.gl.gles2 = false; + #endif + + /* clear initial GL error state */ + #if defined(SOKOL_DEBUG) + while (glGetError() != GL_NO_ERROR); + #endif + #if defined(SOKOL_GLCORE33) + _sg_gl_init_caps_glcore33(); + #elif defined(SOKOL_GLES3) + if (_sg.gl.gles2) { + _sg_gl_init_caps_gles2(); + } + else { + _sg_gl_init_caps_gles3(); + } + #else + _sg_gl_init_caps_gles2(); + #endif +} + +_SOKOL_PRIVATE void _sg_discard_backend(void) { + SOKOL_ASSERT(_sg.gl.valid); + _sg.gl.valid = false; +} + +_SOKOL_PRIVATE void _sg_reset_state_cache(void) { + if (_sg.gl.cur_context) { + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + _SG_GL_CHECK_ERROR(); + glBindVertexArray(_sg.gl.cur_context->vao); + _SG_GL_CHECK_ERROR(); + } + #endif + _sg_gl_reset_state_cache(); + } +} + +_SOKOL_PRIVATE void _sg_activate_context(_sg_context_t* ctx) { + SOKOL_ASSERT(_sg.gl.valid); + /* NOTE: ctx can be 0 to unset the current context */ + _sg.gl.cur_context = ctx; + _sg_reset_state_cache(); +} + +/*-- GL backend resource creation and destruction ----------------------------*/ +_SOKOL_PRIVATE sg_resource_state _sg_create_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + SOKOL_ASSERT(0 == ctx->default_framebuffer); + _SG_GL_CHECK_ERROR(); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&ctx->default_framebuffer); + _SG_GL_CHECK_ERROR(); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + SOKOL_ASSERT(0 == ctx->vao); + glGenVertexArrays(1, &ctx->vao); + glBindVertexArray(ctx->vao); + _SG_GL_CHECK_ERROR(); + } + #endif + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + if (ctx->vao) { + glDeleteVertexArrays(1, &ctx->vao); + } + _SG_GL_CHECK_ERROR(); + } + #endif +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_buffer(_sg_buffer_t* buf, const sg_buffer_desc* desc) { + SOKOL_ASSERT(buf && desc); + _SG_GL_CHECK_ERROR(); + buf->size = desc->size; + buf->append_pos = 0; + buf->append_overflow = false; + buf->type = desc->type; + buf->usage = desc->usage; + buf->update_frame_index = 0; + buf->append_frame_index = 0; + buf->num_slots = (buf->usage == SG_USAGE_IMMUTABLE) ? 1 : SG_NUM_INFLIGHT_FRAMES; + buf->active_slot = 0; + buf->ext_buffers = (0 != desc->gl_buffers[0]); + GLenum gl_target = _sg_gl_buffer_target(buf->type); + GLenum gl_usage = _sg_gl_usage(buf->usage); + for (int slot = 0; slot < buf->num_slots; slot++) { + GLuint gl_buf = 0; + if (buf->ext_buffers) { + SOKOL_ASSERT(desc->gl_buffers[slot]); + gl_buf = desc->gl_buffers[slot]; + } + else { + glGenBuffers(1, &gl_buf); + _sg_gl_store_buffer_binding(gl_target); + _sg_gl_bind_buffer(gl_target, gl_buf); + glBufferData(gl_target, buf->size, 0, gl_usage); + if (buf->usage == SG_USAGE_IMMUTABLE) { + SOKOL_ASSERT(desc->content); + glBufferSubData(gl_target, 0, buf->size, desc->content); + } + _sg_gl_restore_buffer_binding(gl_target); + } + buf->gl_buf[slot] = gl_buf; + } + _SG_GL_CHECK_ERROR(); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_buffer(_sg_buffer_t* buf) { + SOKOL_ASSERT(buf); + _SG_GL_CHECK_ERROR(); + if (!buf->ext_buffers) { + for (int slot = 0; slot < buf->num_slots; slot++) { + if (buf->gl_buf[slot]) { + glDeleteBuffers(1, &buf->gl_buf[slot]); + } + } + _SG_GL_CHECK_ERROR(); + } +} + +_SOKOL_PRIVATE bool _sg_gl_supported_texture_format(sg_pixel_format fmt) { + const int fmt_index = (int) fmt; + SOKOL_ASSERT((fmt_index > SG_PIXELFORMAT_NONE) && (fmt_index < _SG_PIXELFORMAT_NUM)); + return _sg.formats[fmt_index].sample; +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_image(_sg_image_t* img, const sg_image_desc* desc) { + SOKOL_ASSERT(img && desc); + _SG_GL_CHECK_ERROR(); + img->type = desc->type; + img->render_target = desc->render_target; + img->width = desc->width; + img->height = desc->height; + img->depth = desc->depth; + img->num_mipmaps = desc->num_mipmaps; + img->usage = desc->usage; + img->pixel_format = desc->pixel_format; + img->sample_count = desc->sample_count; + img->min_filter = desc->min_filter; + img->mag_filter = desc->mag_filter; + img->wrap_u = desc->wrap_u; + img->wrap_v = desc->wrap_v; + img->wrap_w = desc->wrap_w; + img->border_color = desc->border_color; + img->max_anisotropy = desc->max_anisotropy; + img->upd_frame_index = 0; + + /* check if texture format is support */ + if (!_sg_gl_supported_texture_format(img->pixel_format)) { + SOKOL_LOG("texture format not supported by GL context\n"); + return SG_RESOURCESTATE_FAILED; + } + /* check for optional texture types */ + if ((img->type == SG_IMAGETYPE_3D) && !_sg.features.imagetype_3d) { + SOKOL_LOG("3D textures not supported by GL context\n"); + return SG_RESOURCESTATE_FAILED; + } + if ((img->type == SG_IMAGETYPE_ARRAY) && !_sg.features.imagetype_array) { + SOKOL_LOG("array textures not supported by GL context\n"); + return SG_RESOURCESTATE_FAILED; + } + + /* create 1 or 2 GL textures, depending on requested update strategy */ + img->num_slots = (img->usage == SG_USAGE_IMMUTABLE) ? 1 : SG_NUM_INFLIGHT_FRAMES; + img->active_slot = 0; + img->ext_textures = (0 != desc->gl_textures[0]); + + #if !defined(SOKOL_GLES2) + bool msaa = false; + if (!_sg.gl.gles2) { + msaa = (img->sample_count > 1) && (_sg.features.msaa_render_targets); + } + #endif + + if (_sg_is_valid_rendertarget_depth_format(img->pixel_format)) { + /* special case depth-stencil-buffer? */ + SOKOL_ASSERT((img->usage == SG_USAGE_IMMUTABLE) && (img->num_slots == 1)); + SOKOL_ASSERT(!img->ext_textures); /* cannot provide external texture for depth images */ + glGenRenderbuffers(1, &img->gl_depth_render_buffer); + glBindRenderbuffer(GL_RENDERBUFFER, img->gl_depth_render_buffer); + GLenum gl_depth_format = _sg_gl_depth_attachment_format(img->pixel_format); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2 && msaa) { + glRenderbufferStorageMultisample(GL_RENDERBUFFER, img->sample_count, gl_depth_format, img->width, img->height); + } + else + #endif + { + glRenderbufferStorage(GL_RENDERBUFFER, gl_depth_format, img->width, img->height); + } + } + else { + /* regular color texture */ + img->gl_target = _sg_gl_texture_target(img->type); + const GLenum gl_internal_format = _sg_gl_teximage_internal_format(img->pixel_format); + + /* if this is a MSAA render target, need to create a separate render buffer */ + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2 && img->render_target && msaa) { + glGenRenderbuffers(1, &img->gl_msaa_render_buffer); + glBindRenderbuffer(GL_RENDERBUFFER, img->gl_msaa_render_buffer); + glRenderbufferStorageMultisample(GL_RENDERBUFFER, img->sample_count, gl_internal_format, img->width, img->height); + } + #endif + + if (img->ext_textures) { + /* inject externally GL textures */ + for (int slot = 0; slot < img->num_slots; slot++) { + SOKOL_ASSERT(desc->gl_textures[slot]); + img->gl_tex[slot] = desc->gl_textures[slot]; + } + } + else { + /* create our own GL texture(s) */ + const GLenum gl_format = _sg_gl_teximage_format(img->pixel_format); + const bool is_compressed = _sg_is_compressed_pixel_format(img->pixel_format); + for (int slot = 0; slot < img->num_slots; slot++) { + glGenTextures(1, &img->gl_tex[slot]); + _sg_gl_store_texture_binding(0); + _sg_gl_bind_texture(0, img->gl_target, img->gl_tex[slot]); + GLenum gl_min_filter = _sg_gl_filter(img->min_filter); + GLenum gl_mag_filter = _sg_gl_filter(img->mag_filter); + glTexParameteri(img->gl_target, GL_TEXTURE_MIN_FILTER, gl_min_filter); + glTexParameteri(img->gl_target, GL_TEXTURE_MAG_FILTER, gl_mag_filter); + if (_sg.gl.ext_anisotropic && (img->max_anisotropy > 1)) { + GLint max_aniso = (GLint) img->max_anisotropy; + if (max_aniso > _sg.gl.max_anisotropy) { + max_aniso = _sg.gl.max_anisotropy; + } + glTexParameteri(img->gl_target, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_aniso); + } + if (img->type == SG_IMAGETYPE_CUBE) { + glTexParameteri(img->gl_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(img->gl_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + } + else { + glTexParameteri(img->gl_target, GL_TEXTURE_WRAP_S, _sg_gl_wrap(img->wrap_u)); + glTexParameteri(img->gl_target, GL_TEXTURE_WRAP_T, _sg_gl_wrap(img->wrap_v)); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2 && (img->type == SG_IMAGETYPE_3D)) { + glTexParameteri(img->gl_target, GL_TEXTURE_WRAP_R, _sg_gl_wrap(img->wrap_w)); + } + #endif + #if defined(SOKOL_GLCORE33) + float border[4]; + switch (img->border_color) { + case SG_BORDERCOLOR_TRANSPARENT_BLACK: + border[0] = 0.0f; border[1] = 0.0f; border[2] = 0.0f; border[3] = 0.0f; + break; + case SG_BORDERCOLOR_OPAQUE_WHITE: + border[0] = 1.0f; border[1] = 1.0f; border[2] = 1.0f; border[3] = 1.0f; + break; + default: + border[0] = 0.0f; border[1] = 0.0f; border[2] = 0.0f; border[3] = 1.0f; + break; + } + glTexParameterfv(img->gl_target, GL_TEXTURE_BORDER_COLOR, border); + #endif + } + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + /* GL spec has strange defaults for mipmap min/max lod: -1000 to +1000 */ + const float min_lod = _sg_clamp(desc->min_lod, 0.0f, 1000.0f); + const float max_lod = _sg_clamp(desc->max_lod, 0.0f, 1000.0f); + glTexParameterf(img->gl_target, GL_TEXTURE_MIN_LOD, min_lod); + glTexParameterf(img->gl_target, GL_TEXTURE_MAX_LOD, max_lod); + } + #endif + const int num_faces = img->type == SG_IMAGETYPE_CUBE ? 6 : 1; + int data_index = 0; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int mip_index = 0; mip_index < img->num_mipmaps; mip_index++, data_index++) { + GLenum gl_img_target = img->gl_target; + if (SG_IMAGETYPE_CUBE == img->type) { + gl_img_target = _sg_gl_cubeface_target(face_index); + } + const GLvoid* data_ptr = desc->content.subimage[face_index][mip_index].ptr; + const int data_size = desc->content.subimage[face_index][mip_index].size; + int mip_width = img->width >> mip_index; + if (mip_width == 0) { + mip_width = 1; + } + int mip_height = img->height >> mip_index; + if (mip_height == 0) { + mip_height = 1; + } + if ((SG_IMAGETYPE_2D == img->type) || (SG_IMAGETYPE_CUBE == img->type)) { + if (is_compressed) { + glCompressedTexImage2D(gl_img_target, mip_index, gl_internal_format, + mip_width, mip_height, 0, data_size, data_ptr); + } + else { + const GLenum gl_type = _sg_gl_teximage_type(img->pixel_format); + glTexImage2D(gl_img_target, mip_index, gl_internal_format, + mip_width, mip_height, 0, gl_format, gl_type, data_ptr); + } + } + #if !defined(SOKOL_GLES2) + else if (!_sg.gl.gles2 && ((SG_IMAGETYPE_3D == img->type) || (SG_IMAGETYPE_ARRAY == img->type))) { + int mip_depth = img->depth; + if (SG_IMAGETYPE_3D == img->type) { + mip_depth >>= mip_index; + } + if (mip_depth == 0) { + mip_depth = 1; + } + if (is_compressed) { + glCompressedTexImage3D(gl_img_target, mip_index, gl_internal_format, + mip_width, mip_height, mip_depth, 0, data_size, data_ptr); + } + else { + const GLenum gl_type = _sg_gl_teximage_type(img->pixel_format); + glTexImage3D(gl_img_target, mip_index, gl_internal_format, + mip_width, mip_height, mip_depth, 0, gl_format, gl_type, data_ptr); + } + } + #endif + } + } + _sg_gl_restore_texture_binding(0); + } + } + } + _SG_GL_CHECK_ERROR(); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_image(_sg_image_t* img) { + SOKOL_ASSERT(img); + _SG_GL_CHECK_ERROR(); + if (!img->ext_textures) { + for (int slot = 0; slot < img->num_slots; slot++) { + if (img->gl_tex[slot]) { + glDeleteTextures(1, &img->gl_tex[slot]); + } + } + } + if (img->gl_depth_render_buffer) { + glDeleteRenderbuffers(1, &img->gl_depth_render_buffer); + } + if (img->gl_msaa_render_buffer) { + glDeleteRenderbuffers(1, &img->gl_msaa_render_buffer); + } + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE GLuint _sg_gl_compile_shader(sg_shader_stage stage, const char* src) { + SOKOL_ASSERT(src); + _SG_GL_CHECK_ERROR(); + GLuint gl_shd = glCreateShader(_sg_gl_shader_stage(stage)); + glShaderSource(gl_shd, 1, &src, 0); + glCompileShader(gl_shd); + GLint compile_status = 0; + glGetShaderiv(gl_shd, GL_COMPILE_STATUS, &compile_status); + if (!compile_status) { + /* compilation failed, log error and delete shader */ + GLint log_len = 0; + glGetShaderiv(gl_shd, GL_INFO_LOG_LENGTH, &log_len); + if (log_len > 0) { + GLchar* log_buf = (GLchar*) SOKOL_MALLOC(log_len); + glGetShaderInfoLog(gl_shd, log_len, &log_len, log_buf); + SOKOL_LOG(log_buf); + SOKOL_FREE(log_buf); + } + glDeleteShader(gl_shd); + gl_shd = 0; + } + _SG_GL_CHECK_ERROR(); + return gl_shd; +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_shader(_sg_shader_t* shd, const sg_shader_desc* desc) { + SOKOL_ASSERT(shd && desc); + SOKOL_ASSERT(!shd->gl_prog); + _SG_GL_CHECK_ERROR(); + + /* copy vertex attribute names over, these are required for GLES2, and optional for GLES3 and GL3.x */ + for (int i = 0; i < SG_MAX_VERTEX_ATTRIBUTES; i++) { + _sg_strcpy(&shd->attrs[i].name, desc->attrs[i].name); + } + + GLuint gl_vs = _sg_gl_compile_shader(SG_SHADERSTAGE_VS, desc->vs.source); + GLuint gl_fs = _sg_gl_compile_shader(SG_SHADERSTAGE_FS, desc->fs.source); + if (!(gl_vs && gl_fs)) { + return SG_RESOURCESTATE_FAILED; + } + GLuint gl_prog = glCreateProgram(); + glAttachShader(gl_prog, gl_vs); + glAttachShader(gl_prog, gl_fs); + glLinkProgram(gl_prog); + glDeleteShader(gl_vs); + glDeleteShader(gl_fs); + _SG_GL_CHECK_ERROR(); + + GLint link_status; + glGetProgramiv(gl_prog, GL_LINK_STATUS, &link_status); + if (!link_status) { + GLint log_len = 0; + glGetProgramiv(gl_prog, GL_INFO_LOG_LENGTH, &log_len); + if (log_len > 0) { + GLchar* log_buf = (GLchar*) SOKOL_MALLOC(log_len); + glGetProgramInfoLog(gl_prog, log_len, &log_len, log_buf); + SOKOL_LOG(log_buf); + SOKOL_FREE(log_buf); + } + glDeleteProgram(gl_prog); + return SG_RESOURCESTATE_FAILED; + } + shd->gl_prog = gl_prog; + + /* resolve uniforms */ + _SG_GL_CHECK_ERROR(); + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const sg_shader_stage_desc* stage_desc = (stage_index == SG_SHADERSTAGE_VS)? &desc->vs : &desc->fs; + _sg_shader_stage_t* stage = &shd->stage[stage_index]; + SOKOL_ASSERT(stage->num_uniform_blocks == 0); + for (int ub_index = 0; ub_index < SG_MAX_SHADERSTAGE_UBS; ub_index++) { + const sg_shader_uniform_block_desc* ub_desc = &stage_desc->uniform_blocks[ub_index]; + if (0 == ub_desc->size) { + break; + } + _sg_uniform_block_t* ub = &stage->uniform_blocks[ub_index]; + ub->size = ub_desc->size; + SOKOL_ASSERT(ub->num_uniforms == 0); + int cur_uniform_offset = 0; + for (int u_index = 0; u_index < SG_MAX_UB_MEMBERS; u_index++) { + const sg_shader_uniform_desc* u_desc = &ub_desc->uniforms[u_index]; + if (u_desc->type == SG_UNIFORMTYPE_INVALID) { + break; + } + _sg_uniform_t* u = &ub->uniforms[u_index]; + u->type = u_desc->type; + u->count = (uint8_t) u_desc->array_count; + u->offset = (uint16_t) cur_uniform_offset; + cur_uniform_offset += _sg_uniform_size(u->type, u->count); + if (u_desc->name) { + u->gl_loc = glGetUniformLocation(gl_prog, u_desc->name); + } + else { + u->gl_loc = u_index; + } + ub->num_uniforms++; + } + SOKOL_ASSERT(ub_desc->size == cur_uniform_offset); + stage->num_uniform_blocks++; + } + } + + /* resolve image locations */ + _SG_GL_CHECK_ERROR(); + int gl_tex_slot = 0; + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const sg_shader_stage_desc* stage_desc = (stage_index == SG_SHADERSTAGE_VS)? &desc->vs : &desc->fs; + _sg_shader_stage_t* stage = &shd->stage[stage_index]; + SOKOL_ASSERT(stage->num_images == 0); + for (int img_index = 0; img_index < SG_MAX_SHADERSTAGE_IMAGES; img_index++) { + const sg_shader_image_desc* img_desc = &stage_desc->images[img_index]; + if (img_desc->type == _SG_IMAGETYPE_DEFAULT) { + break; + } + _sg_shader_image_t* img = &stage->images[img_index]; + img->type = img_desc->type; + img->gl_loc = img_index; + if (img_desc->name) { + img->gl_loc = glGetUniformLocation(gl_prog, img_desc->name); + } + if (img->gl_loc != -1) { + img->gl_tex_slot = gl_tex_slot++; + } + else { + img->gl_tex_slot = -1; + } + stage->num_images++; + } + } + _SG_GL_CHECK_ERROR(); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_shader(_sg_shader_t* shd) { + SOKOL_ASSERT(shd); + _SG_GL_CHECK_ERROR(); + if (shd->gl_prog) { + glDeleteProgram(shd->gl_prog); + } + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pipeline(_sg_pipeline_t* pip, _sg_shader_t* shd, const sg_pipeline_desc* desc) { + SOKOL_ASSERT(pip && shd && desc); + SOKOL_ASSERT(!pip->shader && pip->shader_id.id == SG_INVALID_ID); + SOKOL_ASSERT(desc->shader.id == shd->slot.id); + SOKOL_ASSERT(shd->gl_prog); + pip->shader = shd; + pip->shader_id = desc->shader; + pip->primitive_type = desc->primitive_type; + pip->index_type = desc->index_type; + pip->color_attachment_count = desc->blend.color_attachment_count; + pip->color_format = desc->blend.color_format; + pip->depth_format = desc->blend.depth_format; + pip->sample_count = desc->rasterizer.sample_count; + pip->depth_stencil = desc->depth_stencil; + pip->blend = desc->blend; + pip->rast = desc->rasterizer; + + /* resolve vertex attributes */ + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + pip->gl_attrs[attr_index].vb_index = -1; + } + for (uint32_t attr_index = 0; attr_index < _sg.limits.max_vertex_attrs; attr_index++) { + const sg_vertex_attr_desc* a_desc = &desc->layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + break; + } + SOKOL_ASSERT((a_desc->buffer_index >= 0) && (a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS)); + const sg_buffer_layout_desc* l_desc = &desc->layout.buffers[a_desc->buffer_index]; + const sg_vertex_step step_func = l_desc->step_func; + const int step_rate = l_desc->step_rate; + GLint attr_loc = attr_index; + if (!_sg_strempty(&shd->attrs[attr_index].name)) { + attr_loc = glGetAttribLocation(pip->shader->gl_prog, _sg_strptr(&shd->attrs[attr_index].name)); + } + SOKOL_ASSERT(attr_loc < (GLint)_sg.limits.max_vertex_attrs); + if (attr_loc != -1) { + _sg_gl_attr_t* gl_attr = &pip->gl_attrs[attr_loc]; + SOKOL_ASSERT(gl_attr->vb_index == -1); + gl_attr->vb_index = (int8_t) a_desc->buffer_index; + if (step_func == SG_VERTEXSTEP_PER_VERTEX) { + gl_attr->divisor = 0; + } + else { + gl_attr->divisor = (int8_t) step_rate; + } + SOKOL_ASSERT(l_desc->stride > 0); + gl_attr->stride = (uint8_t) l_desc->stride; + gl_attr->offset = a_desc->offset; + gl_attr->size = (uint8_t) _sg_gl_vertexformat_size(a_desc->format); + gl_attr->type = _sg_gl_vertexformat_type(a_desc->format); + gl_attr->normalized = _sg_gl_vertexformat_normalized(a_desc->format); + pip->vertex_layout_valid[a_desc->buffer_index] = true; + } + else { + SOKOL_LOG("Vertex attribute not found in shader: "); + SOKOL_LOG(_sg_strptr(&shd->attrs[attr_index].name)); + } + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + /* empty */ +} + +/* + _sg_create_pass + + att_imgs must point to a _sg_image* att_imgs[SG_MAX_COLOR_ATTACHMENTS+1] array, + first entries are the color attachment images (or nullptr), last entry + is the depth-stencil image (or nullptr). +*/ +_SOKOL_PRIVATE sg_resource_state _sg_create_pass(_sg_pass_t* pass, _sg_image_t** att_images, const sg_pass_desc* desc) { + SOKOL_ASSERT(pass && att_images && desc); + SOKOL_ASSERT(att_images && att_images[0]); + _SG_GL_CHECK_ERROR(); + + /* copy image pointers and desc attributes */ + const sg_attachment_desc* att_desc; + _sg_attachment_t* att; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + SOKOL_ASSERT(0 == pass->color_atts[i].image); + att_desc = &desc->color_attachments[i]; + if (att_desc->image.id != SG_INVALID_ID) { + pass->num_color_atts++; + SOKOL_ASSERT(att_images[i] && (att_images[i]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_color_format(att_images[i]->pixel_format)); + att = &pass->color_atts[i]; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[i]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + } + } + SOKOL_ASSERT(0 == pass->ds_att.image); + att_desc = &desc->depth_stencil_attachment; + const int ds_img_index = SG_MAX_COLOR_ATTACHMENTS; + if (att_desc->image.id != SG_INVALID_ID) { + SOKOL_ASSERT(att_images[ds_img_index] && (att_images[ds_img_index]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_depth_format(att_images[ds_img_index]->pixel_format)); + att = &pass->ds_att; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[ds_img_index]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + } + + /* store current framebuffer binding (restored at end of function) */ + GLuint gl_orig_fb; + glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&gl_orig_fb); + + /* create a framebuffer object */ + glGenFramebuffers(1, &pass->gl_fb); + glBindFramebuffer(GL_FRAMEBUFFER, pass->gl_fb); + + /* attach msaa render buffer or textures */ + const bool is_msaa = (0 != att_images[0]->gl_msaa_render_buffer); + if (is_msaa) { + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + const _sg_image_t* att_img = pass->color_atts[i].image; + if (att_img) { + const GLuint gl_render_buffer = att_img->gl_msaa_render_buffer; + SOKOL_ASSERT(gl_render_buffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+i, GL_RENDERBUFFER, gl_render_buffer); + } + } + } + else { + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + const _sg_image_t* att_img = pass->color_atts[i].image; + const int mip_level = pass->color_atts[i].mip_level; + const int slice = pass->color_atts[i].slice; + if (att_img) { + const GLuint gl_tex = att_img->gl_tex[0]; + SOKOL_ASSERT(gl_tex); + const GLenum gl_att = GL_COLOR_ATTACHMENT0 + i; + switch (att_img->type) { + case SG_IMAGETYPE_2D: + glFramebufferTexture2D(GL_FRAMEBUFFER, gl_att, GL_TEXTURE_2D, gl_tex, mip_level); + break; + case SG_IMAGETYPE_CUBE: + glFramebufferTexture2D(GL_FRAMEBUFFER, gl_att, _sg_gl_cubeface_target(slice), gl_tex, mip_level); + break; + default: + /* 3D- or array-texture */ + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + glFramebufferTextureLayer(GL_FRAMEBUFFER, gl_att, gl_tex, mip_level, slice); + } + #endif + break; + } + } + } + } + + /* attach depth-stencil buffer to framebuffer */ + if (pass->ds_att.image) { + const GLuint gl_render_buffer = pass->ds_att.image->gl_depth_render_buffer; + SOKOL_ASSERT(gl_render_buffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, gl_render_buffer); + if (_sg_is_depth_stencil_format(pass->ds_att.image->pixel_format)) { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, gl_render_buffer); + } + } + + /* check if framebuffer is complete */ + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + SOKOL_LOG("Framebuffer completeness check failed!\n"); + return SG_RESOURCESTATE_FAILED; + } + + /* create MSAA resolve framebuffers if necessary */ + if (is_msaa) { + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + att = &pass->color_atts[i]; + if (att->image) { + SOKOL_ASSERT(0 == att->gl_msaa_resolve_buffer); + glGenFramebuffers(1, &att->gl_msaa_resolve_buffer); + glBindFramebuffer(GL_FRAMEBUFFER, att->gl_msaa_resolve_buffer); + const GLuint gl_tex = att->image->gl_tex[0]; + SOKOL_ASSERT(gl_tex); + switch (att->image->type) { + case SG_IMAGETYPE_2D: + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, gl_tex, att->mip_level); + break; + case SG_IMAGETYPE_CUBE: + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + _sg_gl_cubeface_target(att->slice), gl_tex, att->mip_level); + break; + default: + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, gl_tex, att->mip_level, att->slice); + } + #endif + break; + } + /* check if framebuffer is complete */ + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { + SOKOL_LOG("Framebuffer completeness check failed (msaa resolve buffer)!\n"); + return SG_RESOURCESTATE_FAILED; + } + } + } + } + + /* restore original framebuffer binding */ + glBindFramebuffer(GL_FRAMEBUFFER, gl_orig_fb); + _SG_GL_CHECK_ERROR(); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pass(_sg_pass_t* pass) { + SOKOL_ASSERT(pass); + _SG_GL_CHECK_ERROR(); + if (0 != pass->gl_fb) { + glDeleteFramebuffers(1, &pass->gl_fb); + } + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (pass->color_atts[i].gl_msaa_resolve_buffer) { + glDeleteFramebuffers(1, &pass->color_atts[i].gl_msaa_resolve_buffer); + } + } + if (pass->ds_att.gl_msaa_resolve_buffer) { + glDeleteFramebuffers(1, &pass->ds_att.gl_msaa_resolve_buffer); + } + _SG_GL_CHECK_ERROR(); +} + +/*-- GL backend rendering functions ------------------------------------------*/ +_SOKOL_PRIVATE void _sg_begin_pass(_sg_pass_t* pass, const sg_pass_action* action, int w, int h) { + /* FIXME: what if a texture used as render target is still bound, should we + unbind all currently bound textures in begin pass? */ + SOKOL_ASSERT(action); + SOKOL_ASSERT(!_sg.gl.in_pass); + _SG_GL_CHECK_ERROR(); + _sg.gl.in_pass = true; + _sg.gl.cur_pass = pass; /* can be 0 */ + if (pass) { + _sg.gl.cur_pass_id.id = pass->slot.id; + } + else { + _sg.gl.cur_pass_id.id = SG_INVALID_ID; + } + _sg.gl.cur_pass_width = w; + _sg.gl.cur_pass_height = h; + if (pass) { + /* offscreen pass */ + SOKOL_ASSERT(pass->gl_fb); + glBindFramebuffer(GL_FRAMEBUFFER, pass->gl_fb); + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2) { + GLenum att[SG_MAX_COLOR_ATTACHMENTS] = { + GL_COLOR_ATTACHMENT0, + GL_COLOR_ATTACHMENT1, + GL_COLOR_ATTACHMENT2, + GL_COLOR_ATTACHMENT3 + }; + int num_attrs = 0; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (pass->color_atts[num_attrs].image) { + num_attrs++; + } + else { + break; + } + } + glDrawBuffers(num_attrs, att); + } + #endif + } + else { + /* default pass */ + SOKOL_ASSERT(_sg.gl.cur_context); + glBindFramebuffer(GL_FRAMEBUFFER, _sg.gl.cur_context->default_framebuffer); + } + glViewport(0, 0, w, h); + glScissor(0, 0, w, h); + bool need_pip_cache_flush = false; + if (_sg.gl.cache.blend.color_write_mask != SG_COLORMASK_RGBA) { + need_pip_cache_flush = true; + _sg.gl.cache.blend.color_write_mask = SG_COLORMASK_RGBA; + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + } + if (!_sg.gl.cache.ds.depth_write_enabled) { + need_pip_cache_flush = true; + _sg.gl.cache.ds.depth_write_enabled = true; + glDepthMask(GL_TRUE); + } + if (_sg.gl.cache.ds.depth_compare_func != SG_COMPAREFUNC_ALWAYS) { + need_pip_cache_flush = true; + _sg.gl.cache.ds.depth_compare_func = SG_COMPAREFUNC_ALWAYS; + glDepthFunc(GL_ALWAYS); + } + if (_sg.gl.cache.ds.stencil_write_mask != 0xFF) { + need_pip_cache_flush = true; + _sg.gl.cache.ds.stencil_write_mask = 0xFF; + glStencilMask(0xFF); + } + if (need_pip_cache_flush) { + /* we messed with the state cache directly, need to clear cached + pipeline to force re-evaluation in next sg_apply_pipeline() */ + _sg.gl.cache.cur_pipeline = 0; + _sg.gl.cache.cur_pipeline_id.id = SG_INVALID_ID; + } + bool use_mrt_clear = (0 != pass); + #if defined(SOKOL_GLES2) + use_mrt_clear = false; + #else + if (_sg.gl.gles2) { + use_mrt_clear = false; + } + #endif + if (!use_mrt_clear) { + GLbitfield clear_mask = 0; + if (action->colors[0].action == SG_ACTION_CLEAR) { + clear_mask |= GL_COLOR_BUFFER_BIT; + const float* c = action->colors[0].val; + glClearColor(c[0], c[1], c[2], c[3]); + } + if (action->depth.action == SG_ACTION_CLEAR) { + clear_mask |= GL_DEPTH_BUFFER_BIT; + #ifdef SOKOL_GLCORE33 + glClearDepth(action->depth.val); + #else + glClearDepthf(action->depth.val); + #endif + } + if (action->stencil.action == SG_ACTION_CLEAR) { + clear_mask |= GL_STENCIL_BUFFER_BIT; + glClearStencil(action->stencil.val); + } + if (0 != clear_mask) { + glClear(clear_mask); + } + } + #if !defined SOKOL_GLES2 + else { + SOKOL_ASSERT(pass); + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (pass->color_atts[i].image) { + if (action->colors[i].action == SG_ACTION_CLEAR) { + glClearBufferfv(GL_COLOR, i, action->colors[i].val); + } + } + else { + break; + } + } + if (pass->ds_att.image) { + if ((action->depth.action == SG_ACTION_CLEAR) && (action->stencil.action == SG_ACTION_CLEAR)) { + glClearBufferfi(GL_DEPTH_STENCIL, 0, action->depth.val, action->stencil.val); + } + else if (action->depth.action == SG_ACTION_CLEAR) { + glClearBufferfv(GL_DEPTH, 0, &action->depth.val); + } + else if (action->stencil.action == SG_ACTION_CLEAR) { + GLuint val = action->stencil.val; + glClearBufferuiv(GL_STENCIL, 0, &val); + } + } + } + #endif + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE void _sg_end_pass(void) { + SOKOL_ASSERT(_sg.gl.in_pass); + _SG_GL_CHECK_ERROR(); + + /* if this was an offscreen pass, and MSAA rendering was used, need + to resolve into the pass images */ + #if !defined(SOKOL_GLES2) + if (!_sg.gl.gles2 && _sg.gl.cur_pass) { + /* check if the pass object is still valid */ + const _sg_pass_t* pass = _sg.gl.cur_pass; + SOKOL_ASSERT(pass->slot.id == _sg.gl.cur_pass_id.id); + bool is_msaa = (0 != _sg.gl.cur_pass->color_atts[0].gl_msaa_resolve_buffer); + if (is_msaa) { + SOKOL_ASSERT(pass->gl_fb); + glBindFramebuffer(GL_READ_FRAMEBUFFER, pass->gl_fb); + SOKOL_ASSERT(pass->color_atts[0].image); + const int w = pass->color_atts[0].image->width; + const int h = pass->color_atts[0].image->height; + for (int att_index = 0; att_index < SG_MAX_COLOR_ATTACHMENTS; att_index++) { + const _sg_attachment_t* att = &pass->color_atts[att_index]; + if (att->image) { + SOKOL_ASSERT(att->gl_msaa_resolve_buffer); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, att->gl_msaa_resolve_buffer); + glReadBuffer(GL_COLOR_ATTACHMENT0 + att_index); + const GLenum gl_att = GL_COLOR_ATTACHMENT0; + glDrawBuffers(1, &gl_att); + glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST); + } + else { + break; + } + } + } + } + #endif + _sg.gl.cur_pass = 0; + _sg.gl.cur_pass_id.id = SG_INVALID_ID; + _sg.gl.cur_pass_width = 0; + _sg.gl.cur_pass_height = 0; + + SOKOL_ASSERT(_sg.gl.cur_context); + glBindFramebuffer(GL_FRAMEBUFFER, _sg.gl.cur_context->default_framebuffer); + _sg.gl.in_pass = false; + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE void _sg_apply_viewport(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_sg.gl.in_pass); + y = origin_top_left ? (_sg.gl.cur_pass_height - (y+h)) : y; + glViewport(x, y, w, h); +} + +_SOKOL_PRIVATE void _sg_apply_scissor_rect(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_sg.gl.in_pass); + y = origin_top_left ? (_sg.gl.cur_pass_height - (y+h)) : y; + glScissor(x, y, w, h); +} + +_SOKOL_PRIVATE void _sg_apply_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + SOKOL_ASSERT(pip->shader); + _SG_GL_CHECK_ERROR(); + if ((_sg.gl.cache.cur_pipeline != pip) || (_sg.gl.cache.cur_pipeline_id.id != pip->slot.id)) { + _sg.gl.cache.cur_pipeline = pip; + _sg.gl.cache.cur_pipeline_id.id = pip->slot.id; + _sg.gl.cache.cur_primitive_type = _sg_gl_primitive_type(pip->primitive_type); + _sg.gl.cache.cur_index_type = _sg_gl_index_type(pip->index_type); + + /* update depth-stencil state */ + const sg_depth_stencil_state* new_ds = &pip->depth_stencil; + sg_depth_stencil_state* cache_ds = &_sg.gl.cache.ds; + if (new_ds->depth_compare_func != cache_ds->depth_compare_func) { + cache_ds->depth_compare_func = new_ds->depth_compare_func; + glDepthFunc(_sg_gl_compare_func(new_ds->depth_compare_func)); + } + if (new_ds->depth_write_enabled != cache_ds->depth_write_enabled) { + cache_ds->depth_write_enabled = new_ds->depth_write_enabled; + glDepthMask(new_ds->depth_write_enabled); + } + if (new_ds->stencil_enabled != cache_ds->stencil_enabled) { + cache_ds->stencil_enabled = new_ds->stencil_enabled; + if (new_ds->stencil_enabled) glEnable(GL_STENCIL_TEST); + else glDisable(GL_STENCIL_TEST); + } + if (new_ds->stencil_write_mask != cache_ds->stencil_write_mask) { + cache_ds->stencil_write_mask = new_ds->stencil_write_mask; + glStencilMask(new_ds->stencil_write_mask); + } + for (int i = 0; i < 2; i++) { + const sg_stencil_state* new_ss = (i==0)? &new_ds->stencil_front : &new_ds->stencil_back; + sg_stencil_state* cache_ss = (i==0)? &cache_ds->stencil_front : &cache_ds->stencil_back; + GLenum gl_face = (i==0)? GL_FRONT : GL_BACK; + if ((new_ss->compare_func != cache_ss->compare_func) || + (new_ds->stencil_read_mask != cache_ds->stencil_read_mask) || + (new_ds->stencil_ref != cache_ds->stencil_ref)) + { + cache_ss->compare_func = new_ss->compare_func; + glStencilFuncSeparate(gl_face, + _sg_gl_compare_func(new_ss->compare_func), + new_ds->stencil_ref, + new_ds->stencil_read_mask); + } + if ((new_ss->fail_op != cache_ss->fail_op) || + (new_ss->depth_fail_op != cache_ss->depth_fail_op) || + (new_ss->pass_op != cache_ss->pass_op)) + { + cache_ss->fail_op = new_ss->fail_op; + cache_ss->depth_fail_op = new_ss->depth_fail_op; + cache_ss->pass_op = new_ss->pass_op; + glStencilOpSeparate(gl_face, + _sg_gl_stencil_op(new_ss->fail_op), + _sg_gl_stencil_op(new_ss->depth_fail_op), + _sg_gl_stencil_op(new_ss->pass_op)); + } + } + cache_ds->stencil_read_mask = new_ds->stencil_read_mask; + cache_ds->stencil_ref = new_ds->stencil_ref; + + /* update blend state */ + const sg_blend_state* new_b = &pip->blend; + sg_blend_state* cache_b = &_sg.gl.cache.blend; + if (new_b->enabled != cache_b->enabled) { + cache_b->enabled = new_b->enabled; + if (new_b->enabled) glEnable(GL_BLEND); + else glDisable(GL_BLEND); + } + if ((new_b->src_factor_rgb != cache_b->src_factor_rgb) || + (new_b->dst_factor_rgb != cache_b->dst_factor_rgb) || + (new_b->src_factor_alpha != cache_b->src_factor_alpha) || + (new_b->dst_factor_alpha != cache_b->dst_factor_alpha)) + { + cache_b->src_factor_rgb = new_b->src_factor_rgb; + cache_b->dst_factor_rgb = new_b->dst_factor_rgb; + cache_b->src_factor_alpha = new_b->src_factor_alpha; + cache_b->dst_factor_alpha = new_b->dst_factor_alpha; + glBlendFuncSeparate(_sg_gl_blend_factor(new_b->src_factor_rgb), + _sg_gl_blend_factor(new_b->dst_factor_rgb), + _sg_gl_blend_factor(new_b->src_factor_alpha), + _sg_gl_blend_factor(new_b->dst_factor_alpha)); + } + if ((new_b->op_rgb != cache_b->op_rgb) || (new_b->op_alpha != cache_b->op_alpha)) { + cache_b->op_rgb = new_b->op_rgb; + cache_b->op_alpha = new_b->op_alpha; + glBlendEquationSeparate(_sg_gl_blend_op(new_b->op_rgb), _sg_gl_blend_op(new_b->op_alpha)); + } + if (new_b->color_write_mask != cache_b->color_write_mask) { + cache_b->color_write_mask = new_b->color_write_mask; + glColorMask((new_b->color_write_mask & SG_COLORMASK_R) != 0, + (new_b->color_write_mask & SG_COLORMASK_G) != 0, + (new_b->color_write_mask & SG_COLORMASK_B) != 0, + (new_b->color_write_mask & SG_COLORMASK_A) != 0); + } + if (!_sg_fequal(new_b->blend_color[0], cache_b->blend_color[0], 0.0001f) || + !_sg_fequal(new_b->blend_color[1], cache_b->blend_color[1], 0.0001f) || + !_sg_fequal(new_b->blend_color[2], cache_b->blend_color[2], 0.0001f) || + !_sg_fequal(new_b->blend_color[3], cache_b->blend_color[3], 0.0001f)) + { + const float* bc = new_b->blend_color; + for (int i=0; i<4; i++) { + cache_b->blend_color[i] = bc[i]; + } + glBlendColor(bc[0], bc[1], bc[2], bc[3]); + } + + /* update rasterizer state */ + const sg_rasterizer_state* new_r = &pip->rast; + sg_rasterizer_state* cache_r = &_sg.gl.cache.rast; + if (new_r->cull_mode != cache_r->cull_mode) { + cache_r->cull_mode = new_r->cull_mode; + if (SG_CULLMODE_NONE == new_r->cull_mode) { + glDisable(GL_CULL_FACE); + } + else { + glEnable(GL_CULL_FACE); + GLenum gl_mode = (SG_CULLMODE_FRONT == new_r->cull_mode) ? GL_FRONT : GL_BACK; + glCullFace(gl_mode); + } + } + if (new_r->face_winding != cache_r->face_winding) { + cache_r->face_winding = new_r->face_winding; + GLenum gl_winding = (SG_FACEWINDING_CW == new_r->face_winding) ? GL_CW : GL_CCW; + glFrontFace(gl_winding); + } + if (new_r->alpha_to_coverage_enabled != cache_r->alpha_to_coverage_enabled) { + cache_r->alpha_to_coverage_enabled = new_r->alpha_to_coverage_enabled; + if (new_r->alpha_to_coverage_enabled) glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); + else glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + } + #ifdef SOKOL_GLCORE33 + if (new_r->sample_count != cache_r->sample_count) { + cache_r->sample_count = new_r->sample_count; + if (new_r->sample_count > 1) glEnable(GL_MULTISAMPLE); + else glDisable(GL_MULTISAMPLE); + } + #endif + if (!_sg_fequal(new_r->depth_bias, cache_r->depth_bias, 0.000001f) || + !_sg_fequal(new_r->depth_bias_slope_scale, cache_r->depth_bias_slope_scale, 0.000001f)) + { + /* according to ANGLE's D3D11 backend: + D3D11 SlopeScaledDepthBias ==> GL polygonOffsetFactor + D3D11 DepthBias ==> GL polygonOffsetUnits + DepthBiasClamp has no meaning on GL + */ + cache_r->depth_bias = new_r->depth_bias; + cache_r->depth_bias_slope_scale = new_r->depth_bias_slope_scale; + glPolygonOffset(new_r->depth_bias_slope_scale, new_r->depth_bias); + bool po_enabled = true; + if (_sg_fequal(new_r->depth_bias, 0.0f, 0.000001f) && + _sg_fequal(new_r->depth_bias_slope_scale, 0.0f, 0.000001f)) + { + po_enabled = false; + } + if (po_enabled != _sg.gl.cache.polygon_offset_enabled) { + _sg.gl.cache.polygon_offset_enabled = po_enabled; + if (po_enabled) glEnable(GL_POLYGON_OFFSET_FILL); + else glDisable(GL_POLYGON_OFFSET_FILL); + } + } + + /* bind shader program */ + glUseProgram(pip->shader->gl_prog); + } +} + +_SOKOL_PRIVATE void _sg_apply_bindings( + _sg_pipeline_t* pip, + _sg_buffer_t** vbs, const int* vb_offsets, int num_vbs, + _sg_buffer_t* ib, int ib_offset, + _sg_image_t** vs_imgs, int num_vs_imgs, + _sg_image_t** fs_imgs, int num_fs_imgs) +{ + SOKOL_ASSERT(pip); + _SOKOL_UNUSED(num_fs_imgs); + _SOKOL_UNUSED(num_vs_imgs); + _SOKOL_UNUSED(num_vbs); + _SG_GL_CHECK_ERROR(); + + /* bind textures */ + _SG_GL_CHECK_ERROR(); + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const _sg_shader_stage_t* stage = &pip->shader->stage[stage_index]; + _sg_image_t** imgs = (stage_index == SG_SHADERSTAGE_VS)? vs_imgs : fs_imgs; + SOKOL_ASSERT(((stage_index == SG_SHADERSTAGE_VS)? num_vs_imgs : num_fs_imgs) == stage->num_images); + for (int img_index = 0; img_index < stage->num_images; img_index++) { + const _sg_shader_image_t* shd_img = &stage->images[img_index]; + if (shd_img->gl_loc != -1) { + _sg_image_t* img = imgs[img_index]; + const GLuint gl_tex = img->gl_tex[img->active_slot]; + SOKOL_ASSERT(img && img->gl_target); + SOKOL_ASSERT((shd_img->gl_tex_slot != -1) && gl_tex); + glUniform1i(shd_img->gl_loc, shd_img->gl_tex_slot); + _sg_gl_bind_texture(shd_img->gl_tex_slot, img->gl_target, gl_tex); + } + } + } + _SG_GL_CHECK_ERROR(); + + /* index buffer (can be 0) */ + const GLuint gl_ib = ib ? ib->gl_buf[ib->active_slot] : 0; + _sg_gl_bind_buffer(GL_ELEMENT_ARRAY_BUFFER, gl_ib); + _sg.gl.cache.cur_ib_offset = ib_offset; + + /* vertex attributes */ + for (uint32_t attr_index = 0; attr_index < _sg.limits.max_vertex_attrs; attr_index++) { + _sg_gl_attr_t* attr = &pip->gl_attrs[attr_index]; + _sg_gl_cache_attr_t* cache_attr = &_sg.gl.cache.attrs[attr_index]; + bool cache_attr_dirty = false; + int vb_offset = 0; + GLuint gl_vb = 0; + if (attr->vb_index >= 0) { + /* attribute is enabled */ + SOKOL_ASSERT(attr->vb_index < num_vbs); + _sg_buffer_t* vb = vbs[attr->vb_index]; + SOKOL_ASSERT(vb); + gl_vb = vb->gl_buf[vb->active_slot]; + vb_offset = vb_offsets[attr->vb_index] + attr->offset; + if ((gl_vb != cache_attr->gl_vbuf) || + (attr->size != cache_attr->gl_attr.size) || + (attr->type != cache_attr->gl_attr.type) || + (attr->normalized != cache_attr->gl_attr.normalized) || + (attr->stride != cache_attr->gl_attr.stride) || + (vb_offset != cache_attr->gl_attr.offset) || + (cache_attr->gl_attr.divisor != attr->divisor)) + { + _sg_gl_bind_buffer(GL_ARRAY_BUFFER, gl_vb); + glVertexAttribPointer(attr_index, attr->size, attr->type, + attr->normalized, attr->stride, + (const GLvoid*)(GLintptr)vb_offset); + #ifdef SOKOL_INSTANCING_ENABLED + if (_sg.features.instancing) { + glVertexAttribDivisor(attr_index, attr->divisor); + } + #endif + cache_attr_dirty = true; + } + if (cache_attr->gl_attr.vb_index == -1) { + glEnableVertexAttribArray(attr_index); + cache_attr_dirty = true; + } + } + else { + /* attribute is disabled */ + if (cache_attr->gl_attr.vb_index != -1) { + glDisableVertexAttribArray(attr_index); + cache_attr_dirty = true; + } + } + if (cache_attr_dirty) { + cache_attr->gl_attr = *attr; + cache_attr->gl_attr.offset = vb_offset; + cache_attr->gl_vbuf = gl_vb; + } + } + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE void _sg_apply_uniforms(sg_shader_stage stage_index, int ub_index, const void* data, int num_bytes) { + _SOKOL_UNUSED(num_bytes); + SOKOL_ASSERT(data && (num_bytes > 0)); + SOKOL_ASSERT((stage_index >= 0) && ((int)stage_index < SG_NUM_SHADER_STAGES)); + SOKOL_ASSERT(_sg.gl.cache.cur_pipeline); + SOKOL_ASSERT(_sg.gl.cache.cur_pipeline->slot.id == _sg.gl.cache.cur_pipeline_id.id); + SOKOL_ASSERT(_sg.gl.cache.cur_pipeline->shader->slot.id == _sg.gl.cache.cur_pipeline->shader_id.id); + _sg_shader_stage_t* stage = &_sg.gl.cache.cur_pipeline->shader->stage[stage_index]; + SOKOL_ASSERT(ub_index < stage->num_uniform_blocks); + _sg_uniform_block_t* ub = &stage->uniform_blocks[ub_index]; + SOKOL_ASSERT(ub->size == num_bytes); + for (int u_index = 0; u_index < ub->num_uniforms; u_index++) { + _sg_uniform_t* u = &ub->uniforms[u_index]; + SOKOL_ASSERT(u->type != SG_UNIFORMTYPE_INVALID); + if (u->gl_loc == -1) { + continue; + } + GLfloat* ptr = (GLfloat*) (((uint8_t*)data) + u->offset); + switch (u->type) { + case SG_UNIFORMTYPE_INVALID: + break; + case SG_UNIFORMTYPE_FLOAT: + glUniform1fv(u->gl_loc, u->count, ptr); + break; + case SG_UNIFORMTYPE_FLOAT2: + glUniform2fv(u->gl_loc, u->count, ptr); + break; + case SG_UNIFORMTYPE_FLOAT3: + glUniform3fv(u->gl_loc, u->count, ptr); + break; + case SG_UNIFORMTYPE_FLOAT4: + glUniform4fv(u->gl_loc, u->count, ptr); + break; + case SG_UNIFORMTYPE_MAT4: + glUniformMatrix4fv(u->gl_loc, u->count, GL_FALSE, ptr); + break; + default: + SOKOL_UNREACHABLE; + break; + } + } +} + +_SOKOL_PRIVATE void _sg_draw(int base_element, int num_elements, int num_instances) { + const GLenum i_type = _sg.gl.cache.cur_index_type; + const GLenum p_type = _sg.gl.cache.cur_primitive_type; + if (0 != i_type) { + /* indexed rendering */ + const int i_size = (i_type == GL_UNSIGNED_SHORT) ? 2 : 4; + const int ib_offset = _sg.gl.cache.cur_ib_offset; + const GLvoid* indices = (const GLvoid*)(GLintptr)(base_element*i_size+ib_offset); + if (num_instances == 1) { + glDrawElements(p_type, num_elements, i_type, indices); + } + else { + if (_sg.features.instancing) { + glDrawElementsInstanced(p_type, num_elements, i_type, indices, num_instances); + } + } + } + else { + /* non-indexed rendering */ + if (num_instances == 1) { + glDrawArrays(p_type, base_element, num_elements); + } + else { + if (_sg.features.instancing) { + glDrawArraysInstanced(p_type, base_element, num_elements, num_instances); + } + } + } +} + +_SOKOL_PRIVATE void _sg_commit(void) { + SOKOL_ASSERT(!_sg.gl.in_pass); + /* "soft" clear bindings (only those that are actually bound) */ + _sg_gl_clear_buffer_bindings(false); + _sg_gl_clear_texture_bindings(false); +} + +_SOKOL_PRIVATE void _sg_update_buffer(_sg_buffer_t* buf, const void* data_ptr, int data_size) { + SOKOL_ASSERT(buf && data_ptr && (data_size > 0)); + /* only one update per buffer per frame allowed */ + if (++buf->active_slot >= buf->num_slots) { + buf->active_slot = 0; + } + GLenum gl_tgt = _sg_gl_buffer_target(buf->type); + SOKOL_ASSERT(buf->active_slot < SG_NUM_INFLIGHT_FRAMES); + GLuint gl_buf = buf->gl_buf[buf->active_slot]; + SOKOL_ASSERT(gl_buf); + _SG_GL_CHECK_ERROR(); + _sg_gl_store_buffer_binding(gl_tgt); + _sg_gl_bind_buffer(gl_tgt, gl_buf); + glBufferSubData(gl_tgt, 0, data_size, data_ptr); + _sg_gl_restore_buffer_binding(gl_tgt); + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE void _sg_append_buffer(_sg_buffer_t* buf, const void* data_ptr, int data_size, bool new_frame) { + SOKOL_ASSERT(buf && data_ptr && (data_size > 0)); + if (new_frame) { + if (++buf->active_slot >= buf->num_slots) { + buf->active_slot = 0; + } + } + GLenum gl_tgt = _sg_gl_buffer_target(buf->type); + SOKOL_ASSERT(buf->active_slot < SG_NUM_INFLIGHT_FRAMES); + GLuint gl_buf = buf->gl_buf[buf->active_slot]; + SOKOL_ASSERT(gl_buf); + _SG_GL_CHECK_ERROR(); + _sg_gl_store_buffer_binding(gl_tgt); + _sg_gl_bind_buffer(gl_tgt, gl_buf); + glBufferSubData(gl_tgt, buf->append_pos, data_size, data_ptr); + _sg_gl_restore_buffer_binding(gl_tgt); + _SG_GL_CHECK_ERROR(); +} + +_SOKOL_PRIVATE void _sg_update_image(_sg_image_t* img, const sg_image_content* data) { + SOKOL_ASSERT(img && data); + /* only one update per image per frame allowed */ + if (++img->active_slot >= img->num_slots) { + img->active_slot = 0; + } + SOKOL_ASSERT(img->active_slot < SG_NUM_INFLIGHT_FRAMES); + SOKOL_ASSERT(0 != img->gl_tex[img->active_slot]); + _sg_gl_store_texture_binding(0); + _sg_gl_bind_texture(0, img->gl_target, img->gl_tex[img->active_slot]); + const GLenum gl_img_format = _sg_gl_teximage_format(img->pixel_format); + const GLenum gl_img_type = _sg_gl_teximage_type(img->pixel_format); + const int num_faces = img->type == SG_IMAGETYPE_CUBE ? 6 : 1; + const int num_mips = img->num_mipmaps; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int mip_index = 0; mip_index < num_mips; mip_index++) { + GLenum gl_img_target = img->gl_target; + if (SG_IMAGETYPE_CUBE == img->type) { + gl_img_target = _sg_gl_cubeface_target(face_index); + } + const GLvoid* data_ptr = data->subimage[face_index][mip_index].ptr; + int mip_width = img->width >> mip_index; + if (mip_width == 0) { + mip_width = 1; + } + int mip_height = img->height >> mip_index; + if (mip_height == 0) { + mip_height = 1; + } + if ((SG_IMAGETYPE_2D == img->type) || (SG_IMAGETYPE_CUBE == img->type)) { + glTexSubImage2D(gl_img_target, mip_index, + 0, 0, + mip_width, mip_height, + gl_img_format, gl_img_type, + data_ptr); + } + #if !defined(SOKOL_GLES2) + else if (!_sg.gl.gles2 && ((SG_IMAGETYPE_3D == img->type) || (SG_IMAGETYPE_ARRAY == img->type))) { + int mip_depth = img->depth >> mip_index; + if (mip_depth == 0) { + mip_depth = 1; + } + glTexSubImage3D(gl_img_target, mip_index, + 0, 0, 0, + mip_width, mip_height, mip_depth, + gl_img_format, gl_img_type, + data_ptr); + + } + #endif + } + } + _sg_gl_restore_texture_binding(0); +} + +/*== D3D11 BACKEND IMPLEMENTATION ============================================*/ +#elif defined(SOKOL_D3D11) + +/*-- enum translation functions ----------------------------------------------*/ +_SOKOL_PRIVATE D3D11_USAGE _sg_d3d11_usage(sg_usage usg) { + switch (usg) { + case SG_USAGE_IMMUTABLE: + return D3D11_USAGE_IMMUTABLE; + case SG_USAGE_DYNAMIC: + case SG_USAGE_STREAM: + return D3D11_USAGE_DYNAMIC; + default: + SOKOL_UNREACHABLE; + return (D3D11_USAGE) 0; + } +} + +_SOKOL_PRIVATE UINT _sg_d3d11_cpu_access_flags(sg_usage usg) { + switch (usg) { + case SG_USAGE_IMMUTABLE: + return 0; + case SG_USAGE_DYNAMIC: + case SG_USAGE_STREAM: + return D3D11_CPU_ACCESS_WRITE; + default: + SOKOL_UNREACHABLE; + return 0; + } +} + +_SOKOL_PRIVATE DXGI_FORMAT _sg_d3d11_pixel_format(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_R8: return DXGI_FORMAT_R8_UNORM; + case SG_PIXELFORMAT_R8SN: return DXGI_FORMAT_R8_SNORM; + case SG_PIXELFORMAT_R8UI: return DXGI_FORMAT_R8_UINT; + case SG_PIXELFORMAT_R8SI: return DXGI_FORMAT_R8_SINT; + case SG_PIXELFORMAT_R16: return DXGI_FORMAT_R16_UNORM; + case SG_PIXELFORMAT_R16SN: return DXGI_FORMAT_R16_SNORM; + case SG_PIXELFORMAT_R16UI: return DXGI_FORMAT_R16_UINT; + case SG_PIXELFORMAT_R16SI: return DXGI_FORMAT_R16_SINT; + case SG_PIXELFORMAT_R16F: return DXGI_FORMAT_R16_FLOAT; + case SG_PIXELFORMAT_RG8: return DXGI_FORMAT_R8G8_UNORM; + case SG_PIXELFORMAT_RG8SN: return DXGI_FORMAT_R8G8_SNORM; + case SG_PIXELFORMAT_RG8UI: return DXGI_FORMAT_R8G8_UINT; + case SG_PIXELFORMAT_RG8SI: return DXGI_FORMAT_R8G8_SINT; + case SG_PIXELFORMAT_R32UI: return DXGI_FORMAT_R32_UINT; + case SG_PIXELFORMAT_R32SI: return DXGI_FORMAT_R32_SINT; + case SG_PIXELFORMAT_R32F: return DXGI_FORMAT_R32_FLOAT; + case SG_PIXELFORMAT_RG16: return DXGI_FORMAT_R16G16_UNORM; + case SG_PIXELFORMAT_RG16SN: return DXGI_FORMAT_R16G16_SNORM; + case SG_PIXELFORMAT_RG16UI: return DXGI_FORMAT_R16G16_UINT; + case SG_PIXELFORMAT_RG16SI: return DXGI_FORMAT_R16G16_SINT; + case SG_PIXELFORMAT_RG16F: return DXGI_FORMAT_R16G16_FLOAT; + case SG_PIXELFORMAT_RGBA8: return DXGI_FORMAT_R8G8B8A8_UNORM; + case SG_PIXELFORMAT_RGBA8SN: return DXGI_FORMAT_R8G8B8A8_SNORM; + case SG_PIXELFORMAT_RGBA8UI: return DXGI_FORMAT_R8G8B8A8_UINT; + case SG_PIXELFORMAT_RGBA8SI: return DXGI_FORMAT_R8G8B8A8_SINT; + case SG_PIXELFORMAT_BGRA8: return DXGI_FORMAT_B8G8R8A8_UNORM; + case SG_PIXELFORMAT_RGB10A2: return DXGI_FORMAT_R10G10B10A2_UNORM; + case SG_PIXELFORMAT_RG11B10F: return DXGI_FORMAT_R11G11B10_FLOAT; + case SG_PIXELFORMAT_RG32UI: return DXGI_FORMAT_R32G32_UINT; + case SG_PIXELFORMAT_RG32SI: return DXGI_FORMAT_R32G32_SINT; + case SG_PIXELFORMAT_RG32F: return DXGI_FORMAT_R32G32_FLOAT; + case SG_PIXELFORMAT_RGBA16: return DXGI_FORMAT_R16G16B16A16_UNORM; + case SG_PIXELFORMAT_RGBA16SN: return DXGI_FORMAT_R16G16B16A16_SNORM; + case SG_PIXELFORMAT_RGBA16UI: return DXGI_FORMAT_R16G16B16A16_UINT; + case SG_PIXELFORMAT_RGBA16SI: return DXGI_FORMAT_R16G16B16A16_SINT; + case SG_PIXELFORMAT_RGBA16F: return DXGI_FORMAT_R16G16B16A16_FLOAT; + case SG_PIXELFORMAT_RGBA32UI: return DXGI_FORMAT_R32G32B32A32_UINT; + case SG_PIXELFORMAT_RGBA32SI: return DXGI_FORMAT_R32G32B32A32_SINT; + case SG_PIXELFORMAT_RGBA32F: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case SG_PIXELFORMAT_DEPTH: return DXGI_FORMAT_D32_FLOAT; + case SG_PIXELFORMAT_DEPTH_STENCIL: return DXGI_FORMAT_D24_UNORM_S8_UINT; + case SG_PIXELFORMAT_BC1_RGBA: return DXGI_FORMAT_BC1_UNORM; + case SG_PIXELFORMAT_BC2_RGBA: return DXGI_FORMAT_BC2_UNORM; + case SG_PIXELFORMAT_BC3_RGBA: return DXGI_FORMAT_BC3_UNORM; + case SG_PIXELFORMAT_BC4_R: return DXGI_FORMAT_BC4_UNORM; + case SG_PIXELFORMAT_BC4_RSN: return DXGI_FORMAT_BC4_SNORM; + case SG_PIXELFORMAT_BC5_RG: return DXGI_FORMAT_BC5_UNORM; + case SG_PIXELFORMAT_BC5_RGSN: return DXGI_FORMAT_BC5_SNORM; + case SG_PIXELFORMAT_BC6H_RGBF: return DXGI_FORMAT_BC6H_SF16; + case SG_PIXELFORMAT_BC6H_RGBUF: return DXGI_FORMAT_BC6H_UF16; + case SG_PIXELFORMAT_BC7_RGBA: return DXGI_FORMAT_BC7_UNORM; + default: return DXGI_FORMAT_UNKNOWN; + }; +} + +_SOKOL_PRIVATE D3D11_PRIMITIVE_TOPOLOGY _sg_d3d11_primitive_topology(sg_primitive_type prim_type) { + switch (prim_type) { + case SG_PRIMITIVETYPE_POINTS: return D3D11_PRIMITIVE_TOPOLOGY_POINTLIST; + case SG_PRIMITIVETYPE_LINES: return D3D11_PRIMITIVE_TOPOLOGY_LINELIST; + case SG_PRIMITIVETYPE_LINE_STRIP: return D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP; + case SG_PRIMITIVETYPE_TRIANGLES: return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + case SG_PRIMITIVETYPE_TRIANGLE_STRIP: return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; + default: SOKOL_UNREACHABLE; return (D3D11_PRIMITIVE_TOPOLOGY) 0; + } +} + +_SOKOL_PRIVATE DXGI_FORMAT _sg_d3d11_index_format(sg_index_type index_type) { + switch (index_type) { + case SG_INDEXTYPE_NONE: return DXGI_FORMAT_UNKNOWN; + case SG_INDEXTYPE_UINT16: return DXGI_FORMAT_R16_UINT; + case SG_INDEXTYPE_UINT32: return DXGI_FORMAT_R32_UINT; + default: SOKOL_UNREACHABLE; return (DXGI_FORMAT) 0; + } +} + +_SOKOL_PRIVATE D3D11_FILTER _sg_d3d11_filter(sg_filter min_f, sg_filter mag_f, uint32_t max_anisotropy) { + if (max_anisotropy > 1) { + return D3D11_FILTER_ANISOTROPIC; + } + else if (mag_f == SG_FILTER_NEAREST) { + switch (min_f) { + case SG_FILTER_NEAREST: + case SG_FILTER_NEAREST_MIPMAP_NEAREST: + return D3D11_FILTER_MIN_MAG_MIP_POINT; + case SG_FILTER_LINEAR: + case SG_FILTER_LINEAR_MIPMAP_NEAREST: + return D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT; + case SG_FILTER_NEAREST_MIPMAP_LINEAR: + return D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR; + case SG_FILTER_LINEAR_MIPMAP_LINEAR: + return D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR; + default: + SOKOL_UNREACHABLE; break; + } + } + else if (mag_f == SG_FILTER_LINEAR) { + switch (min_f) { + case SG_FILTER_NEAREST: + case SG_FILTER_NEAREST_MIPMAP_NEAREST: + return D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT; + case SG_FILTER_LINEAR: + case SG_FILTER_LINEAR_MIPMAP_NEAREST: + return D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT; + case SG_FILTER_NEAREST_MIPMAP_LINEAR: + return D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR; + case SG_FILTER_LINEAR_MIPMAP_LINEAR: + return D3D11_FILTER_MIN_MAG_MIP_LINEAR; + default: + SOKOL_UNREACHABLE; break; + } + } + /* invalid value for mag filter */ + SOKOL_UNREACHABLE; + return D3D11_FILTER_MIN_MAG_MIP_POINT; +} + +_SOKOL_PRIVATE D3D11_TEXTURE_ADDRESS_MODE _sg_d3d11_address_mode(sg_wrap m) { + switch (m) { + case SG_WRAP_REPEAT: return D3D11_TEXTURE_ADDRESS_WRAP; + case SG_WRAP_CLAMP_TO_EDGE: return D3D11_TEXTURE_ADDRESS_CLAMP; + case SG_WRAP_CLAMP_TO_BORDER: return D3D11_TEXTURE_ADDRESS_BORDER; + case SG_WRAP_MIRRORED_REPEAT: return D3D11_TEXTURE_ADDRESS_MIRROR; + default: SOKOL_UNREACHABLE; return (D3D11_TEXTURE_ADDRESS_MODE) 0; + } +} + +_SOKOL_PRIVATE DXGI_FORMAT _sg_d3d11_vertex_format(sg_vertex_format fmt) { + switch (fmt) { + case SG_VERTEXFORMAT_FLOAT: return DXGI_FORMAT_R32_FLOAT; + case SG_VERTEXFORMAT_FLOAT2: return DXGI_FORMAT_R32G32_FLOAT; + case SG_VERTEXFORMAT_FLOAT3: return DXGI_FORMAT_R32G32B32_FLOAT; + case SG_VERTEXFORMAT_FLOAT4: return DXGI_FORMAT_R32G32B32A32_FLOAT; + case SG_VERTEXFORMAT_BYTE4: return DXGI_FORMAT_R8G8B8A8_SINT; + case SG_VERTEXFORMAT_BYTE4N: return DXGI_FORMAT_R8G8B8A8_SNORM; + case SG_VERTEXFORMAT_UBYTE4: return DXGI_FORMAT_R8G8B8A8_UINT; + case SG_VERTEXFORMAT_UBYTE4N: return DXGI_FORMAT_R8G8B8A8_UNORM; + case SG_VERTEXFORMAT_SHORT2: return DXGI_FORMAT_R16G16_SINT; + case SG_VERTEXFORMAT_SHORT2N: return DXGI_FORMAT_R16G16_SNORM; + case SG_VERTEXFORMAT_USHORT2N: return DXGI_FORMAT_R16G16_UNORM; + case SG_VERTEXFORMAT_SHORT4: return DXGI_FORMAT_R16G16B16A16_SINT; + case SG_VERTEXFORMAT_SHORT4N: return DXGI_FORMAT_R16G16B16A16_SNORM; + case SG_VERTEXFORMAT_USHORT4N: return DXGI_FORMAT_R16G16B16A16_UNORM; + case SG_VERTEXFORMAT_UINT10_N2: return DXGI_FORMAT_R10G10B10A2_UNORM; + default: SOKOL_UNREACHABLE; return (DXGI_FORMAT) 0; + } +} + +_SOKOL_PRIVATE D3D11_INPUT_CLASSIFICATION _sg_d3d11_input_classification(sg_vertex_step step) { + switch (step) { + case SG_VERTEXSTEP_PER_VERTEX: return D3D11_INPUT_PER_VERTEX_DATA; + case SG_VERTEXSTEP_PER_INSTANCE: return D3D11_INPUT_PER_INSTANCE_DATA; + default: SOKOL_UNREACHABLE; return (D3D11_INPUT_CLASSIFICATION) 0; + } +} + +_SOKOL_PRIVATE D3D11_CULL_MODE _sg_d3d11_cull_mode(sg_cull_mode m) { + switch (m) { + case SG_CULLMODE_NONE: return D3D11_CULL_NONE; + case SG_CULLMODE_FRONT: return D3D11_CULL_FRONT; + case SG_CULLMODE_BACK: return D3D11_CULL_BACK; + default: SOKOL_UNREACHABLE; return (D3D11_CULL_MODE) 0; + } +} + +_SOKOL_PRIVATE D3D11_COMPARISON_FUNC _sg_d3d11_compare_func(sg_compare_func f) { + switch (f) { + case SG_COMPAREFUNC_NEVER: return D3D11_COMPARISON_NEVER; + case SG_COMPAREFUNC_LESS: return D3D11_COMPARISON_LESS; + case SG_COMPAREFUNC_EQUAL: return D3D11_COMPARISON_EQUAL; + case SG_COMPAREFUNC_LESS_EQUAL: return D3D11_COMPARISON_LESS_EQUAL; + case SG_COMPAREFUNC_GREATER: return D3D11_COMPARISON_GREATER; + case SG_COMPAREFUNC_NOT_EQUAL: return D3D11_COMPARISON_NOT_EQUAL; + case SG_COMPAREFUNC_GREATER_EQUAL: return D3D11_COMPARISON_GREATER_EQUAL; + case SG_COMPAREFUNC_ALWAYS: return D3D11_COMPARISON_ALWAYS; + default: SOKOL_UNREACHABLE; return (D3D11_COMPARISON_FUNC) 0; + } +} + +_SOKOL_PRIVATE D3D11_STENCIL_OP _sg_d3d11_stencil_op(sg_stencil_op op) { + switch (op) { + case SG_STENCILOP_KEEP: return D3D11_STENCIL_OP_KEEP; + case SG_STENCILOP_ZERO: return D3D11_STENCIL_OP_ZERO; + case SG_STENCILOP_REPLACE: return D3D11_STENCIL_OP_REPLACE; + case SG_STENCILOP_INCR_CLAMP: return D3D11_STENCIL_OP_INCR_SAT; + case SG_STENCILOP_DECR_CLAMP: return D3D11_STENCIL_OP_DECR_SAT; + case SG_STENCILOP_INVERT: return D3D11_STENCIL_OP_INVERT; + case SG_STENCILOP_INCR_WRAP: return D3D11_STENCIL_OP_INCR; + case SG_STENCILOP_DECR_WRAP: return D3D11_STENCIL_OP_DECR; + default: SOKOL_UNREACHABLE; return (D3D11_STENCIL_OP) 0; + } +} + +_SOKOL_PRIVATE D3D11_BLEND _sg_d3d11_blend_factor(sg_blend_factor f) { + switch (f) { + case SG_BLENDFACTOR_ZERO: return D3D11_BLEND_ZERO; + case SG_BLENDFACTOR_ONE: return D3D11_BLEND_ONE; + case SG_BLENDFACTOR_SRC_COLOR: return D3D11_BLEND_SRC_COLOR; + case SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR: return D3D11_BLEND_INV_SRC_COLOR; + case SG_BLENDFACTOR_SRC_ALPHA: return D3D11_BLEND_SRC_ALPHA; + case SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA: return D3D11_BLEND_INV_SRC_ALPHA; + case SG_BLENDFACTOR_DST_COLOR: return D3D11_BLEND_DEST_COLOR; + case SG_BLENDFACTOR_ONE_MINUS_DST_COLOR: return D3D11_BLEND_INV_DEST_COLOR; + case SG_BLENDFACTOR_DST_ALPHA: return D3D11_BLEND_DEST_ALPHA; + case SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA: return D3D11_BLEND_INV_DEST_ALPHA; + case SG_BLENDFACTOR_SRC_ALPHA_SATURATED: return D3D11_BLEND_SRC_ALPHA_SAT; + case SG_BLENDFACTOR_BLEND_COLOR: return D3D11_BLEND_BLEND_FACTOR; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_COLOR: return D3D11_BLEND_INV_BLEND_FACTOR; + case SG_BLENDFACTOR_BLEND_ALPHA: return D3D11_BLEND_BLEND_FACTOR; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_ALPHA: return D3D11_BLEND_INV_BLEND_FACTOR; + default: SOKOL_UNREACHABLE; return (D3D11_BLEND) 0; + } +} + +_SOKOL_PRIVATE D3D11_BLEND_OP _sg_d3d11_blend_op(sg_blend_op op) { + switch (op) { + case SG_BLENDOP_ADD: return D3D11_BLEND_OP_ADD; + case SG_BLENDOP_SUBTRACT: return D3D11_BLEND_OP_SUBTRACT; + case SG_BLENDOP_REVERSE_SUBTRACT: return D3D11_BLEND_OP_REV_SUBTRACT; + default: SOKOL_UNREACHABLE; return (D3D11_BLEND_OP) 0; + } +} + +_SOKOL_PRIVATE UINT8 _sg_d3d11_color_write_mask(sg_color_mask m) { + UINT8 res = 0; + if (m & SG_COLORMASK_R) { + res |= D3D11_COLOR_WRITE_ENABLE_RED; + } + if (m & SG_COLORMASK_G) { + res |= D3D11_COLOR_WRITE_ENABLE_GREEN; + } + if (m & SG_COLORMASK_B) { + res |= D3D11_COLOR_WRITE_ENABLE_BLUE; + } + if (m & SG_COLORMASK_A) { + res |= D3D11_COLOR_WRITE_ENABLE_ALPHA; + } + return res; +} + +/* see: https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-resources-limits#resource-limits-for-feature-level-11-hardware */ +_SOKOL_PRIVATE void _sg_d3d11_init_caps(void) { + _sg.backend = SG_BACKEND_D3D11; + + _sg.features.instancing = true; + _sg.features.origin_top_left = true; + _sg.features.multiple_render_targets = true; + _sg.features.msaa_render_targets = true; + _sg.features.imagetype_3d = true; + _sg.features.imagetype_array = true; + _sg.features.image_clamp_to_border = true; + + _sg.limits.max_image_size_2d = 16 * 1024; + _sg.limits.max_image_size_cube = 16 * 1024; + _sg.limits.max_image_size_3d = 2 * 1024; + _sg.limits.max_image_size_array = 16 * 1024; + _sg.limits.max_image_array_layers = 2 * 1024; + _sg.limits.max_vertex_attrs = SG_MAX_VERTEX_ATTRIBUTES; + + /* see: https://docs.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_format_support */ + UINT dxgi_fmt_caps = 0; + for (int fmt = (SG_PIXELFORMAT_NONE+1); fmt < _SG_PIXELFORMAT_NUM; fmt++) { + DXGI_FORMAT dxgi_fmt = _sg_d3d11_pixel_format((sg_pixel_format)fmt); + HRESULT hr = ID3D11Device_CheckFormatSupport(_sg.d3d11.dev, dxgi_fmt, &dxgi_fmt_caps); + SOKOL_ASSERT(SUCCEEDED(hr)); + sg_pixelformat_info* info = &_sg.formats[fmt]; + info->sample = 0 != (dxgi_fmt_caps & D3D11_FORMAT_SUPPORT_TEXTURE2D); + info->filter = 0 != (dxgi_fmt_caps & D3D11_FORMAT_SUPPORT_SHADER_SAMPLE); + info->render = 0 != (dxgi_fmt_caps & D3D11_FORMAT_SUPPORT_RENDER_TARGET); + info->blend = 0 != (dxgi_fmt_caps & D3D11_FORMAT_SUPPORT_BLENDABLE); + info->msaa = 0 != (dxgi_fmt_caps & D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET); + info->depth = 0 != (dxgi_fmt_caps & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL); + if (info->depth) { + info->render = true; + } + } +} + +_SOKOL_PRIVATE void _sg_setup_backend(const sg_desc* desc) { + /* assume _sg.d3d11 already is zero-initialized */ + SOKOL_ASSERT(desc); + SOKOL_ASSERT(desc->d3d11_device); + SOKOL_ASSERT(desc->d3d11_device_context); + SOKOL_ASSERT(desc->d3d11_render_target_view_cb); + SOKOL_ASSERT(desc->d3d11_depth_stencil_view_cb); + SOKOL_ASSERT(desc->d3d11_render_target_view_cb != desc->d3d11_depth_stencil_view_cb); + _sg.d3d11.valid = true; + _sg.d3d11.dev = (ID3D11Device*) desc->d3d11_device; + _sg.d3d11.ctx = (ID3D11DeviceContext*) desc->d3d11_device_context; + _sg.d3d11.rtv_cb = desc->d3d11_render_target_view_cb; + _sg.d3d11.dsv_cb = desc->d3d11_depth_stencil_view_cb; + _sg_d3d11_init_caps(); +} + +_SOKOL_PRIVATE void _sg_discard_backend(void) { + SOKOL_ASSERT(_sg.d3d11.valid); + _sg.d3d11.valid = false; +} + +_SOKOL_PRIVATE void _sg_d3d11_clear_state(void) { + /* clear all the device context state, so that resource refs don't keep stuck in the d3d device context */ + ID3D11DeviceContext_OMSetRenderTargets(_sg.d3d11.ctx, SG_MAX_COLOR_ATTACHMENTS, _sg.d3d11.zero_rtvs, NULL); + ID3D11DeviceContext_RSSetState(_sg.d3d11.ctx, NULL); + ID3D11DeviceContext_OMSetDepthStencilState(_sg.d3d11.ctx, NULL, 0); + ID3D11DeviceContext_OMSetBlendState(_sg.d3d11.ctx, NULL, NULL, 0xFFFFFFFF); + ID3D11DeviceContext_IASetVertexBuffers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_BUFFERS, _sg.d3d11.zero_vbs, _sg.d3d11.zero_vb_strides, _sg.d3d11.zero_vb_offsets); + ID3D11DeviceContext_IASetIndexBuffer(_sg.d3d11.ctx, NULL, DXGI_FORMAT_UNKNOWN, 0); + ID3D11DeviceContext_IASetInputLayout(_sg.d3d11.ctx, NULL); + ID3D11DeviceContext_VSSetShader(_sg.d3d11.ctx, NULL, NULL, 0); + ID3D11DeviceContext_PSSetShader(_sg.d3d11.ctx, NULL, NULL, 0); + ID3D11DeviceContext_VSSetConstantBuffers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_UBS, _sg.d3d11.zero_cbs); + ID3D11DeviceContext_PSSetConstantBuffers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_UBS, _sg.d3d11.zero_cbs); + ID3D11DeviceContext_VSSetShaderResources(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, _sg.d3d11.zero_srvs); + ID3D11DeviceContext_PSSetShaderResources(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, _sg.d3d11.zero_srvs); + ID3D11DeviceContext_VSSetSamplers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, _sg.d3d11.zero_smps); + ID3D11DeviceContext_PSSetSamplers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, _sg.d3d11.zero_smps); +} + +_SOKOL_PRIVATE void _sg_reset_state_cache(void) { + /* just clear the d3d11 device context state */ + _sg_d3d11_clear_state(); +} + +_SOKOL_PRIVATE void _sg_activate_context(_sg_context_t* ctx) { + _SOKOL_UNUSED(ctx); + _sg_reset_state_cache(); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); + /* empty */ +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_buffer(_sg_buffer_t* buf, const sg_buffer_desc* desc) { + SOKOL_ASSERT(buf && desc); + SOKOL_ASSERT(!buf->d3d11_buf); + buf->size = desc->size; + buf->append_pos = 0; + buf->append_overflow = false; + buf->type = desc->type; + buf->usage = desc->usage; + buf->update_frame_index = 0; + buf->append_frame_index = 0; + const bool injected = (0 != desc->d3d11_buffer); + if (injected) { + buf->d3d11_buf = (ID3D11Buffer*) desc->d3d11_buffer; + ID3D11Buffer_AddRef(buf->d3d11_buf); + } + else { + D3D11_BUFFER_DESC d3d11_desc; + memset(&d3d11_desc, 0, sizeof(d3d11_desc)); + d3d11_desc.ByteWidth = buf->size; + d3d11_desc.Usage = _sg_d3d11_usage(buf->usage); + d3d11_desc.BindFlags = buf->type == SG_BUFFERTYPE_VERTEXBUFFER ? D3D11_BIND_VERTEX_BUFFER : D3D11_BIND_INDEX_BUFFER; + d3d11_desc.CPUAccessFlags = _sg_d3d11_cpu_access_flags(buf->usage); + D3D11_SUBRESOURCE_DATA* init_data_ptr = 0; + D3D11_SUBRESOURCE_DATA init_data; + memset(&init_data, 0, sizeof(init_data)); + if (buf->usage == SG_USAGE_IMMUTABLE) { + SOKOL_ASSERT(desc->content); + init_data.pSysMem = desc->content; + init_data_ptr = &init_data; + } + HRESULT hr = ID3D11Device_CreateBuffer(_sg.d3d11.dev, &d3d11_desc, init_data_ptr, &buf->d3d11_buf); + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr) && buf->d3d11_buf); + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_buffer(_sg_buffer_t* buf) { + SOKOL_ASSERT(buf); + if (buf->d3d11_buf) { + ID3D11Buffer_Release(buf->d3d11_buf); + } +} + +_SOKOL_PRIVATE void _sg_d3d11_fill_subres_data(const _sg_image_t* img, const sg_image_content* content) { + const int num_faces = (img->type == SG_IMAGETYPE_CUBE) ? 6:1; + const int num_slices = (img->type == SG_IMAGETYPE_ARRAY) ? img->depth:1; + int subres_index = 0; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int slice_index = 0; slice_index < num_slices; slice_index++) { + for (int mip_index = 0; mip_index < img->num_mipmaps; mip_index++, subres_index++) { + SOKOL_ASSERT(subres_index < (SG_MAX_MIPMAPS * SG_MAX_TEXTUREARRAY_LAYERS)); + D3D11_SUBRESOURCE_DATA* subres_data = &_sg.d3d11.subres_data[subres_index]; + const int mip_width = ((img->width>>mip_index)>0) ? img->width>>mip_index : 1; + const int mip_height = ((img->height>>mip_index)>0) ? img->height>>mip_index : 1; + const sg_subimage_content* subimg_content = &(content->subimage[face_index][mip_index]); + const int slice_size = subimg_content->size / num_slices; + const int slice_offset = slice_size * slice_index; + const uint8_t* ptr = (const uint8_t*) subimg_content->ptr; + subres_data->pSysMem = ptr + slice_offset; + subres_data->SysMemPitch = _sg_row_pitch(img->pixel_format, mip_width); + if (img->type == SG_IMAGETYPE_3D) { + /* FIXME? const int mip_depth = ((img->depth>>mip_index)>0) ? img->depth>>mip_index : 1; */ + subres_data->SysMemSlicePitch = _sg_surface_pitch(img->pixel_format, mip_width, mip_height); + } + else { + subres_data->SysMemSlicePitch = 0; + } + } + } + } +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_image(_sg_image_t* img, const sg_image_desc* desc) { + SOKOL_ASSERT(img && desc); + SOKOL_ASSERT(!img->d3d11_tex2d && !img->d3d11_tex3d && !img->d3d11_texds && !img->d3d11_texmsaa); + SOKOL_ASSERT(!img->d3d11_srv && !img->d3d11_smp); + HRESULT hr; + + img->type = desc->type; + img->render_target = desc->render_target; + img->width = desc->width; + img->height = desc->height; + img->depth = desc->depth; + img->num_mipmaps = desc->num_mipmaps; + img->usage = desc->usage; + img->pixel_format = desc->pixel_format; + img->sample_count = desc->sample_count; + img->min_filter = desc->min_filter; + img->mag_filter = desc->mag_filter; + img->wrap_u = desc->wrap_u; + img->wrap_v = desc->wrap_v; + img->wrap_w = desc->wrap_w; + img->border_color = desc->border_color; + img->max_anisotropy = desc->max_anisotropy; + img->upd_frame_index = 0; + const bool injected = (0 != desc->d3d11_texture); + const bool msaa = (img->sample_count > 1); + + /* special case depth-stencil buffer? */ + if (_sg_is_valid_rendertarget_depth_format(img->pixel_format)) { + /* create only a depth-texture */ + SOKOL_ASSERT(!injected); + img->d3d11_format = _sg_d3d11_pixel_format(img->pixel_format); + if (img->d3d11_format == DXGI_FORMAT_UNKNOWN) { + SOKOL_LOG("trying to create a D3D11 depth-texture with unsupported pixel format\n"); + return SG_RESOURCESTATE_FAILED; + } + D3D11_TEXTURE2D_DESC d3d11_desc; + memset(&d3d11_desc, 0, sizeof(d3d11_desc)); + d3d11_desc.Width = img->width; + d3d11_desc.Height = img->height; + d3d11_desc.MipLevels = 1; + d3d11_desc.ArraySize = 1; + d3d11_desc.Format = img->d3d11_format; + d3d11_desc.Usage = D3D11_USAGE_DEFAULT; + d3d11_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + d3d11_desc.SampleDesc.Count = img->sample_count; + d3d11_desc.SampleDesc.Quality = msaa ? D3D11_STANDARD_MULTISAMPLE_PATTERN : 0; + hr = ID3D11Device_CreateTexture2D(_sg.d3d11.dev, &d3d11_desc, NULL, &img->d3d11_texds); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_texds); + } + else { + /* create (or inject) color texture */ + + /* prepare initial content pointers */ + D3D11_SUBRESOURCE_DATA* init_data = 0; + if (!injected && (img->usage == SG_USAGE_IMMUTABLE) && !img->render_target) { + _sg_d3d11_fill_subres_data(img, &desc->content); + init_data = _sg.d3d11.subres_data; + } + if (img->type != SG_IMAGETYPE_3D) { + /* 2D-, cube- or array-texture */ + /* if this is an MSAA render target, the following texture will be the 'resolve-texture' */ + D3D11_TEXTURE2D_DESC d3d11_tex_desc; + memset(&d3d11_tex_desc, 0, sizeof(d3d11_tex_desc)); + d3d11_tex_desc.Width = img->width; + d3d11_tex_desc.Height = img->height; + d3d11_tex_desc.MipLevels = img->num_mipmaps; + switch (img->type) { + case SG_IMAGETYPE_ARRAY: d3d11_tex_desc.ArraySize = img->depth; break; + case SG_IMAGETYPE_CUBE: d3d11_tex_desc.ArraySize = 6; break; + default: d3d11_tex_desc.ArraySize = 1; break; + } + d3d11_tex_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + if (img->render_target) { + img->d3d11_format = _sg_d3d11_pixel_format(img->pixel_format); + d3d11_tex_desc.Format = img->d3d11_format; + d3d11_tex_desc.Usage = D3D11_USAGE_DEFAULT; + if (!msaa) { + d3d11_tex_desc.BindFlags |= D3D11_BIND_RENDER_TARGET; + } + d3d11_tex_desc.CPUAccessFlags = 0; + } + else { + img->d3d11_format = _sg_d3d11_pixel_format(img->pixel_format); + d3d11_tex_desc.Format = img->d3d11_format; + d3d11_tex_desc.Usage = _sg_d3d11_usage(img->usage); + d3d11_tex_desc.CPUAccessFlags = _sg_d3d11_cpu_access_flags(img->usage); + } + if (img->d3d11_format == DXGI_FORMAT_UNKNOWN) { + /* trying to create a texture format that's not supported by D3D */ + SOKOL_LOG("trying to create a D3D11 texture with unsupported pixel format\n"); + return SG_RESOURCESTATE_FAILED; + } + d3d11_tex_desc.SampleDesc.Count = 1; + d3d11_tex_desc.SampleDesc.Quality = 0; + d3d11_tex_desc.MiscFlags = (img->type == SG_IMAGETYPE_CUBE) ? D3D11_RESOURCE_MISC_TEXTURECUBE : 0; + if (injected) { + img->d3d11_tex2d = (ID3D11Texture2D*) desc->d3d11_texture; + ID3D11Texture2D_AddRef(img->d3d11_tex2d); + } + else { + hr = ID3D11Device_CreateTexture2D(_sg.d3d11.dev, &d3d11_tex_desc, init_data, &img->d3d11_tex2d); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_tex2d); + } + + /* shader-resource-view */ + D3D11_SHADER_RESOURCE_VIEW_DESC d3d11_srv_desc; + memset(&d3d11_srv_desc, 0, sizeof(d3d11_srv_desc)); + d3d11_srv_desc.Format = d3d11_tex_desc.Format; + switch (img->type) { + case SG_IMAGETYPE_2D: + d3d11_srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; + d3d11_srv_desc.Texture2D.MipLevels = img->num_mipmaps; + break; + case SG_IMAGETYPE_CUBE: + d3d11_srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE; + d3d11_srv_desc.TextureCube.MipLevels = img->num_mipmaps; + break; + case SG_IMAGETYPE_ARRAY: + d3d11_srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY; + d3d11_srv_desc.Texture2DArray.MipLevels = img->num_mipmaps; + d3d11_srv_desc.Texture2DArray.ArraySize = img->depth; + break; + default: + SOKOL_UNREACHABLE; break; + } + hr = ID3D11Device_CreateShaderResourceView(_sg.d3d11.dev, (ID3D11Resource*)img->d3d11_tex2d, &d3d11_srv_desc, &img->d3d11_srv); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_srv); + } + else { + /* 3D texture */ + D3D11_TEXTURE3D_DESC d3d11_tex_desc; + memset(&d3d11_tex_desc, 0, sizeof(d3d11_tex_desc)); + d3d11_tex_desc.Width = img->width; + d3d11_tex_desc.Height = img->height; + d3d11_tex_desc.Depth = img->depth; + d3d11_tex_desc.MipLevels = img->num_mipmaps; + d3d11_tex_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + if (img->render_target) { + img->d3d11_format = _sg_d3d11_pixel_format(img->pixel_format); + d3d11_tex_desc.Format = img->d3d11_format; + d3d11_tex_desc.Usage = D3D11_USAGE_DEFAULT; + if (!msaa) { + d3d11_tex_desc.BindFlags |= D3D11_BIND_RENDER_TARGET; + } + d3d11_tex_desc.CPUAccessFlags = 0; + } + else { + img->d3d11_format = _sg_d3d11_pixel_format(img->pixel_format); + d3d11_tex_desc.Format = img->d3d11_format; + d3d11_tex_desc.Usage = _sg_d3d11_usage(img->usage); + d3d11_tex_desc.CPUAccessFlags = _sg_d3d11_cpu_access_flags(img->usage); + } + if (img->d3d11_format == DXGI_FORMAT_UNKNOWN) { + /* trying to create a texture format that's not supported by D3D */ + SOKOL_LOG("trying to create a D3D11 texture with unsupported pixel format\n"); + return SG_RESOURCESTATE_FAILED; + } + if (injected) { + img->d3d11_tex3d = (ID3D11Texture3D*) desc->d3d11_texture; + ID3D11Texture3D_AddRef(img->d3d11_tex3d); + } + else { + hr = ID3D11Device_CreateTexture3D(_sg.d3d11.dev, &d3d11_tex_desc, init_data, &img->d3d11_tex3d); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_tex3d); + } + + /* shader resource view for 3d texture */ + D3D11_SHADER_RESOURCE_VIEW_DESC d3d11_srv_desc; + memset(&d3d11_srv_desc, 0, sizeof(d3d11_srv_desc)); + d3d11_srv_desc.Format = d3d11_tex_desc.Format; + d3d11_srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D; + d3d11_srv_desc.Texture3D.MipLevels = img->num_mipmaps; + hr = ID3D11Device_CreateShaderResourceView(_sg.d3d11.dev, (ID3D11Resource*)img->d3d11_tex3d, &d3d11_srv_desc, &img->d3d11_srv); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_srv); + } + + /* also need to create a separate MSAA render target texture? */ + if (msaa) { + D3D11_TEXTURE2D_DESC d3d11_tex_desc; + memset(&d3d11_tex_desc, 0, sizeof(d3d11_tex_desc)); + d3d11_tex_desc.Width = img->width; + d3d11_tex_desc.Height = img->height; + d3d11_tex_desc.MipLevels = 1; + d3d11_tex_desc.ArraySize = 1; + d3d11_tex_desc.Format = img->d3d11_format; + d3d11_tex_desc.Usage = D3D11_USAGE_DEFAULT; + d3d11_tex_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + d3d11_tex_desc.CPUAccessFlags = 0; + d3d11_tex_desc.SampleDesc.Count = img->sample_count; + d3d11_tex_desc.SampleDesc.Quality = (UINT)D3D11_STANDARD_MULTISAMPLE_PATTERN; + hr = ID3D11Device_CreateTexture2D(_sg.d3d11.dev, &d3d11_tex_desc, NULL, &img->d3d11_texmsaa); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_texmsaa); + } + + /* sampler state object, note D3D11 implements an internal shared-pool for sampler objects */ + D3D11_SAMPLER_DESC d3d11_smp_desc; + memset(&d3d11_smp_desc, 0, sizeof(d3d11_smp_desc)); + d3d11_smp_desc.Filter = _sg_d3d11_filter(img->min_filter, img->mag_filter, img->max_anisotropy); + d3d11_smp_desc.AddressU = _sg_d3d11_address_mode(img->wrap_u); + d3d11_smp_desc.AddressV = _sg_d3d11_address_mode(img->wrap_v); + d3d11_smp_desc.AddressW = _sg_d3d11_address_mode(img->wrap_w); + switch (img->border_color) { + case SG_BORDERCOLOR_TRANSPARENT_BLACK: + /* all 0.0f */ + break; + case SG_BORDERCOLOR_OPAQUE_WHITE: + for (int i = 0; i < 4; i++) { + d3d11_smp_desc.BorderColor[i] = 1.0f; + } + break; + default: + /* opaque black */ + d3d11_smp_desc.BorderColor[3] = 1.0f; + break; + } + d3d11_smp_desc.MaxAnisotropy = img->max_anisotropy; + d3d11_smp_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + d3d11_smp_desc.MinLOD = desc->min_lod; + d3d11_smp_desc.MaxLOD = desc->max_lod; + hr = ID3D11Device_CreateSamplerState(_sg.d3d11.dev, &d3d11_smp_desc, &img->d3d11_smp); + SOKOL_ASSERT(SUCCEEDED(hr) && img->d3d11_smp); + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_image(_sg_image_t* img) { + SOKOL_ASSERT(img); + if (img->d3d11_tex2d) { + ID3D11Texture2D_Release(img->d3d11_tex2d); + } + if (img->d3d11_tex3d) { + ID3D11Texture3D_Release(img->d3d11_tex3d); + } + if (img->d3d11_texds) { + ID3D11Texture2D_Release(img->d3d11_texds); + } + if (img->d3d11_texmsaa) { + ID3D11Texture2D_Release(img->d3d11_texmsaa); + } + if (img->d3d11_srv) { + ID3D11ShaderResourceView_Release(img->d3d11_srv); + } + if (img->d3d11_smp) { + ID3D11SamplerState_Release(img->d3d11_smp); + } +} + +_SOKOL_PRIVATE bool _sg_d3d11_load_d3dcompiler_dll(void) { + /* on UWP, don't do anything (not tested) */ + #if (defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) + return true; + #else + /* load DLL on demand */ + if ((0 == _sg.d3d11.d3dcompiler_dll) && !_sg.d3d11.d3dcompiler_dll_load_failed) { + _sg.d3d11.d3dcompiler_dll = LoadLibraryA("d3dcompiler_47.dll"); + if (0 == _sg.d3d11.d3dcompiler_dll) { + /* don't attempt to load missing DLL in the future */ + SOKOL_LOG("failed to load d3dcompiler_47.dll!\n"); + _sg.d3d11.d3dcompiler_dll_load_failed = true; + return false; + } + /* look up function pointers */ + _sg.d3d11.D3DCompile_func = (pD3DCompile) GetProcAddress(_sg.d3d11.d3dcompiler_dll, "D3DCompile"); + SOKOL_ASSERT(_sg.d3d11.D3DCompile_func); + } + return 0 != _sg.d3d11.d3dcompiler_dll; + #endif +} + +#if (defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)) +#define _sg_d3d11_D3DCompile D3DCompile +#else +#define _sg_d3d11_D3DCompile _sg.d3d11.D3DCompile_func +#endif + +_SOKOL_PRIVATE ID3DBlob* _sg_d3d11_compile_shader(const sg_shader_stage_desc* stage_desc, const char* target) { + if (!_sg_d3d11_load_d3dcompiler_dll()) { + return NULL; + } + ID3DBlob* output = NULL; + ID3DBlob* errors = NULL; + _sg_d3d11_D3DCompile( + stage_desc->source, /* pSrcData */ + strlen(stage_desc->source), /* SrcDataSize */ + NULL, /* pSourceName */ + NULL, /* pDefines */ + NULL, /* pInclude */ + stage_desc->entry ? stage_desc->entry : "main", /* pEntryPoint */ + target, /* pTarget (vs_5_0 or ps_5_0) */ + D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR | D3DCOMPILE_OPTIMIZATION_LEVEL3, /* Flags1 */ + 0, /* Flags2 */ + &output, /* ppCode */ + &errors); /* ppErrorMsgs */ + if (errors) { + SOKOL_LOG((LPCSTR)ID3D10Blob_GetBufferPointer(errors)); + ID3D10Blob_Release(errors); errors = NULL; + return NULL; + } + return output; +} + +#define _sg_d3d11_roundup(val, round_to) (((val)+((round_to)-1))&~((round_to)-1)) + +_SOKOL_PRIVATE sg_resource_state _sg_create_shader(_sg_shader_t* shd, const sg_shader_desc* desc) { + SOKOL_ASSERT(shd && desc); + SOKOL_ASSERT(!shd->d3d11_vs && !shd->d3d11_fs && !shd->d3d11_vs_blob); + HRESULT hr; + sg_resource_state result = SG_RESOURCESTATE_FAILED; + + /* copy vertex attribute semantic names and indices */ + for (int i = 0; i < SG_MAX_VERTEX_ATTRIBUTES; i++) { + _sg_strcpy(&shd->attrs[i].sem_name, desc->attrs[i].sem_name); + shd->attrs[i].sem_index = desc->attrs[i].sem_index; + } + + /* shader stage uniform blocks and image slots */ + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const sg_shader_stage_desc* stage_desc = (stage_index == SG_SHADERSTAGE_VS) ? &desc->vs : &desc->fs; + _sg_shader_stage_t* stage = &shd->stage[stage_index]; + SOKOL_ASSERT(stage->num_uniform_blocks == 0); + for (int ub_index = 0; ub_index < SG_MAX_SHADERSTAGE_UBS; ub_index++) { + const sg_shader_uniform_block_desc* ub_desc = &stage_desc->uniform_blocks[ub_index]; + if (0 == ub_desc->size) { + break; + } + _sg_uniform_block_t* ub = &stage->uniform_blocks[ub_index]; + ub->size = ub_desc->size; + + /* create a D3D constant buffer */ + SOKOL_ASSERT(!stage->d3d11_cbs[ub_index]); + D3D11_BUFFER_DESC cb_desc; + memset(&cb_desc, 0, sizeof(cb_desc)); + cb_desc.ByteWidth = _sg_d3d11_roundup(ub->size, 16); + cb_desc.Usage = D3D11_USAGE_DEFAULT; + cb_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + hr = ID3D11Device_CreateBuffer(_sg.d3d11.dev, &cb_desc, NULL, &stage->d3d11_cbs[ub_index]); + SOKOL_ASSERT(SUCCEEDED(hr) && stage->d3d11_cbs[ub_index]); + + stage->num_uniform_blocks++; + } + SOKOL_ASSERT(stage->num_images == 0); + for (int img_index = 0; img_index < SG_MAX_SHADERSTAGE_IMAGES; img_index++) { + const sg_shader_image_desc* img_desc = &stage_desc->images[img_index]; + if (img_desc->type == _SG_IMAGETYPE_DEFAULT) { + break; + } + stage->images[img_index].type = img_desc->type; + stage->num_images++; + } + } + + const void* vs_ptr = 0, *fs_ptr = 0; + SIZE_T vs_length = 0, fs_length = 0; + ID3DBlob* vs_blob = 0, *fs_blob = 0; + if (desc->vs.byte_code && desc->fs.byte_code) { + /* create from byte code */ + vs_ptr = desc->vs.byte_code; + fs_ptr = desc->fs.byte_code; + vs_length = desc->vs.byte_code_size; + fs_length = desc->fs.byte_code_size; + } + else { + /* compile shader code */ + vs_blob = _sg_d3d11_compile_shader(&desc->vs, "vs_5_0"); + fs_blob = _sg_d3d11_compile_shader(&desc->fs, "ps_5_0"); + if (vs_blob && fs_blob) { + vs_ptr = ID3D10Blob_GetBufferPointer(vs_blob); + vs_length = ID3D10Blob_GetBufferSize(vs_blob); + fs_ptr = ID3D10Blob_GetBufferPointer(fs_blob); + fs_length = ID3D10Blob_GetBufferSize(fs_blob); + } + } + if (vs_ptr && fs_ptr && (vs_length > 0) && (fs_length > 0)) { + /* create the D3D vertex- and pixel-shader objects */ + hr = ID3D11Device_CreateVertexShader(_sg.d3d11.dev, vs_ptr, vs_length, NULL, &shd->d3d11_vs); + SOKOL_ASSERT(SUCCEEDED(hr) && shd->d3d11_vs); + hr = ID3D11Device_CreatePixelShader(_sg.d3d11.dev, fs_ptr, fs_length, NULL, &shd->d3d11_fs); + SOKOL_ASSERT(SUCCEEDED(hr) && shd->d3d11_fs); + + /* need to store the vertex shader byte code, this is needed later in sg_create_pipeline */ + shd->d3d11_vs_blob_length = (int)vs_length; + shd->d3d11_vs_blob = SOKOL_MALLOC((int)vs_length); + SOKOL_ASSERT(shd->d3d11_vs_blob); + memcpy(shd->d3d11_vs_blob, vs_ptr, vs_length); + + result = SG_RESOURCESTATE_VALID; + } + if (vs_blob) { + ID3D10Blob_Release(vs_blob); vs_blob = 0; + } + if (fs_blob) { + ID3D10Blob_Release(fs_blob); fs_blob = 0; + } + return result; +} + +_SOKOL_PRIVATE void _sg_destroy_shader(_sg_shader_t* shd) { + SOKOL_ASSERT(shd); + if (shd->d3d11_vs) { + ID3D11VertexShader_Release(shd->d3d11_vs); + } + if (shd->d3d11_fs) { + ID3D11PixelShader_Release(shd->d3d11_fs); + } + if (shd->d3d11_vs_blob) { + SOKOL_FREE(shd->d3d11_vs_blob); + } + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + _sg_shader_stage_t* stage = &shd->stage[stage_index]; + for (int ub_index = 0; ub_index < stage->num_uniform_blocks; ub_index++) { + if (stage->d3d11_cbs[ub_index]) { + ID3D11Buffer_Release(stage->d3d11_cbs[ub_index]); + } + } + } +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pipeline(_sg_pipeline_t* pip, _sg_shader_t* shd, const sg_pipeline_desc* desc) { + SOKOL_ASSERT(pip && shd && desc); + SOKOL_ASSERT(desc->shader.id == shd->slot.id); + SOKOL_ASSERT(shd->slot.state == SG_RESOURCESTATE_VALID); + SOKOL_ASSERT(shd->d3d11_vs_blob && shd->d3d11_vs_blob_length > 0); + SOKOL_ASSERT(!pip->d3d11_il && !pip->d3d11_rs && !pip->d3d11_dss && !pip->d3d11_bs); + HRESULT hr; + + pip->shader = shd; + pip->shader_id = desc->shader; + pip->index_type = desc->index_type; + pip->color_attachment_count = desc->blend.color_attachment_count; + pip->color_format = desc->blend.color_format; + pip->depth_format = desc->blend.depth_format; + pip->sample_count = desc->rasterizer.sample_count; + pip->d3d11_index_format = _sg_d3d11_index_format(pip->index_type); + pip->d3d11_topology = _sg_d3d11_primitive_topology(desc->primitive_type); + for (int i = 0; i < 4; i++) { + pip->blend_color[i] = desc->blend.blend_color[i]; + } + pip->d3d11_stencil_ref = desc->depth_stencil.stencil_ref; + + /* create input layout object */ + D3D11_INPUT_ELEMENT_DESC d3d11_comps[SG_MAX_VERTEX_ATTRIBUTES]; + memset(d3d11_comps, 0, sizeof(d3d11_comps)); + int attr_index = 0; + for (; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + const sg_vertex_attr_desc* a_desc = &desc->layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + break; + } + SOKOL_ASSERT((a_desc->buffer_index >= 0) && (a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS)); + const sg_buffer_layout_desc* l_desc = &desc->layout.buffers[a_desc->buffer_index]; + const sg_vertex_step step_func = l_desc->step_func; + const int step_rate = l_desc->step_rate; + D3D11_INPUT_ELEMENT_DESC* d3d11_comp = &d3d11_comps[attr_index]; + d3d11_comp->SemanticName = _sg_strptr(&shd->attrs[attr_index].sem_name); + d3d11_comp->SemanticIndex = shd->attrs[attr_index].sem_index; + d3d11_comp->Format = _sg_d3d11_vertex_format(a_desc->format); + d3d11_comp->InputSlot = a_desc->buffer_index; + d3d11_comp->AlignedByteOffset = a_desc->offset; + d3d11_comp->InputSlotClass = _sg_d3d11_input_classification(step_func); + if (SG_VERTEXSTEP_PER_INSTANCE == step_func) { + d3d11_comp->InstanceDataStepRate = step_rate; + } + pip->vertex_layout_valid[a_desc->buffer_index] = true; + } + for (int layout_index = 0; layout_index < SG_MAX_SHADERSTAGE_BUFFERS; layout_index++) { + if (pip->vertex_layout_valid[layout_index]) { + const sg_buffer_layout_desc* l_desc = &desc->layout.buffers[layout_index]; + SOKOL_ASSERT(l_desc->stride > 0); + pip->d3d11_vb_strides[layout_index] = l_desc->stride; + } + else { + pip->d3d11_vb_strides[layout_index] = 0; + } + } + hr = ID3D11Device_CreateInputLayout(_sg.d3d11.dev, + d3d11_comps, /* pInputElementDesc */ + attr_index, /* NumElements */ + shd->d3d11_vs_blob, /* pShaderByteCodeWithInputSignature */ + shd->d3d11_vs_blob_length, /* BytecodeLength */ + &pip->d3d11_il); + SOKOL_ASSERT(SUCCEEDED(hr) && pip->d3d11_il); + + /* create rasterizer state */ + D3D11_RASTERIZER_DESC rs_desc; + memset(&rs_desc, 0, sizeof(rs_desc)); + rs_desc.FillMode = D3D11_FILL_SOLID; + rs_desc.CullMode = _sg_d3d11_cull_mode(desc->rasterizer.cull_mode); + rs_desc.FrontCounterClockwise = desc->rasterizer.face_winding == SG_FACEWINDING_CCW; + rs_desc.DepthBias = (INT) desc->rasterizer.depth_bias; + rs_desc.DepthBiasClamp = desc->rasterizer.depth_bias_clamp; + rs_desc.SlopeScaledDepthBias = desc->rasterizer.depth_bias_slope_scale; + rs_desc.DepthClipEnable = TRUE; + rs_desc.ScissorEnable = TRUE; + rs_desc.MultisampleEnable = desc->rasterizer.sample_count > 1; + rs_desc.AntialiasedLineEnable = FALSE; + hr = ID3D11Device_CreateRasterizerState(_sg.d3d11.dev, &rs_desc, &pip->d3d11_rs); + SOKOL_ASSERT(SUCCEEDED(hr) && pip->d3d11_rs); + + /* create depth-stencil state */ + D3D11_DEPTH_STENCIL_DESC dss_desc; + memset(&dss_desc, 0, sizeof(dss_desc)); + dss_desc.DepthEnable = TRUE; + dss_desc.DepthWriteMask = desc->depth_stencil.depth_write_enabled ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO; + dss_desc.DepthFunc = _sg_d3d11_compare_func(desc->depth_stencil.depth_compare_func); + dss_desc.StencilEnable = desc->depth_stencil.stencil_enabled; + dss_desc.StencilReadMask = desc->depth_stencil.stencil_read_mask; + dss_desc.StencilWriteMask = desc->depth_stencil.stencil_write_mask; + const sg_stencil_state* sf = &desc->depth_stencil.stencil_front; + dss_desc.FrontFace.StencilFailOp = _sg_d3d11_stencil_op(sf->fail_op); + dss_desc.FrontFace.StencilDepthFailOp = _sg_d3d11_stencil_op(sf->depth_fail_op); + dss_desc.FrontFace.StencilPassOp = _sg_d3d11_stencil_op(sf->pass_op); + dss_desc.FrontFace.StencilFunc = _sg_d3d11_compare_func(sf->compare_func); + const sg_stencil_state* sb = &desc->depth_stencil.stencil_back; + dss_desc.BackFace.StencilFailOp = _sg_d3d11_stencil_op(sb->fail_op); + dss_desc.BackFace.StencilDepthFailOp = _sg_d3d11_stencil_op(sb->depth_fail_op); + dss_desc.BackFace.StencilPassOp = _sg_d3d11_stencil_op(sb->pass_op); + dss_desc.BackFace.StencilFunc = _sg_d3d11_compare_func(sb->compare_func); + hr = ID3D11Device_CreateDepthStencilState(_sg.d3d11.dev, &dss_desc, &pip->d3d11_dss); + SOKOL_ASSERT(SUCCEEDED(hr) && pip->d3d11_dss); + + /* create blend state */ + D3D11_BLEND_DESC bs_desc; + memset(&bs_desc, 0, sizeof(bs_desc)); + bs_desc.AlphaToCoverageEnable = desc->rasterizer.alpha_to_coverage_enabled; + bs_desc.IndependentBlendEnable = FALSE; + bs_desc.RenderTarget[0].BlendEnable = desc->blend.enabled; + bs_desc.RenderTarget[0].SrcBlend = _sg_d3d11_blend_factor(desc->blend.src_factor_rgb); + bs_desc.RenderTarget[0].DestBlend = _sg_d3d11_blend_factor(desc->blend.dst_factor_rgb); + bs_desc.RenderTarget[0].BlendOp = _sg_d3d11_blend_op(desc->blend.op_rgb); + bs_desc.RenderTarget[0].SrcBlendAlpha = _sg_d3d11_blend_factor(desc->blend.src_factor_alpha); + bs_desc.RenderTarget[0].DestBlendAlpha = _sg_d3d11_blend_factor(desc->blend.dst_factor_alpha); + bs_desc.RenderTarget[0].BlendOpAlpha = _sg_d3d11_blend_op(desc->blend.op_alpha); + bs_desc.RenderTarget[0].RenderTargetWriteMask = _sg_d3d11_color_write_mask((sg_color_mask)desc->blend.color_write_mask); + hr = ID3D11Device_CreateBlendState(_sg.d3d11.dev, &bs_desc, &pip->d3d11_bs); + SOKOL_ASSERT(SUCCEEDED(hr) && pip->d3d11_bs); + + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + if (pip->d3d11_il) { + ID3D11InputLayout_Release(pip->d3d11_il); + } + if (pip->d3d11_rs) { + ID3D11RasterizerState_Release(pip->d3d11_rs); + } + if (pip->d3d11_dss) { + ID3D11DepthStencilState_Release(pip->d3d11_dss); + } + if (pip->d3d11_bs) { + ID3D11BlendState_Release(pip->d3d11_bs); + } +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pass(_sg_pass_t* pass, _sg_image_t** att_images, const sg_pass_desc* desc) { + SOKOL_ASSERT(pass && desc); + SOKOL_ASSERT(att_images && att_images[0]); + SOKOL_ASSERT(_sg.d3d11.dev); + + const sg_attachment_desc* att_desc; + _sg_attachment_t* att; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + SOKOL_ASSERT(0 == pass->color_atts[i].image); + SOKOL_ASSERT(pass->d3d11_rtvs[i] == 0); + att_desc = &desc->color_attachments[i]; + if (att_desc->image.id != SG_INVALID_ID) { + pass->num_color_atts++; + SOKOL_ASSERT(att_images[i] && (att_images[i]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_color_format(att_images[i]->pixel_format)); + att = &pass->color_atts[i]; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[i]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + + /* create D3D11 render-target-view */ + ID3D11Resource* d3d11_res = 0; + const bool is_msaa = att->image->sample_count > 1; + D3D11_RENDER_TARGET_VIEW_DESC d3d11_rtv_desc; + memset(&d3d11_rtv_desc, 0, sizeof(d3d11_rtv_desc)); + d3d11_rtv_desc.Format = att->image->d3d11_format; + if ((att->image->type == SG_IMAGETYPE_2D) || is_msaa) { + if (is_msaa) { + d3d11_res = (ID3D11Resource*) att->image->d3d11_texmsaa; + d3d11_rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS; + } + else { + d3d11_res = (ID3D11Resource*) att->image->d3d11_tex2d; + d3d11_rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; + d3d11_rtv_desc.Texture2D.MipSlice = att->mip_level; + } + } + else if ((att->image->type == SG_IMAGETYPE_CUBE) || (att->image->type == SG_IMAGETYPE_ARRAY)) { + d3d11_res = (ID3D11Resource*) att->image->d3d11_tex2d; + d3d11_rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY; + d3d11_rtv_desc.Texture2DArray.MipSlice = att->mip_level; + d3d11_rtv_desc.Texture2DArray.FirstArraySlice = att->slice; + d3d11_rtv_desc.Texture2DArray.ArraySize = 1; + } + else { + SOKOL_ASSERT(att->image->type == SG_IMAGETYPE_3D); + d3d11_res = (ID3D11Resource*) att->image->d3d11_tex3d; + d3d11_rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D; + d3d11_rtv_desc.Texture3D.MipSlice = att->mip_level; + d3d11_rtv_desc.Texture3D.FirstWSlice = att->slice; + d3d11_rtv_desc.Texture3D.WSize = 1; + } + SOKOL_ASSERT(d3d11_res); + HRESULT hr = ID3D11Device_CreateRenderTargetView(_sg.d3d11.dev, d3d11_res, &d3d11_rtv_desc, &pass->d3d11_rtvs[i]); + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr) && pass->d3d11_rtvs[i]); + } + } + + /* optional depth-stencil image */ + SOKOL_ASSERT(0 == pass->ds_att.image); + SOKOL_ASSERT(pass->d3d11_dsv == 0); + att_desc = &desc->depth_stencil_attachment; + const int ds_img_index = SG_MAX_COLOR_ATTACHMENTS; + if (att_desc->image.id != SG_INVALID_ID) { + SOKOL_ASSERT(att_images[ds_img_index] && (att_images[ds_img_index]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_depth_format(att_images[ds_img_index]->pixel_format)); + att = &pass->ds_att; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[ds_img_index]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + + /* create D3D11 depth-stencil-view */ + D3D11_DEPTH_STENCIL_VIEW_DESC d3d11_dsv_desc; + memset(&d3d11_dsv_desc, 0, sizeof(d3d11_dsv_desc)); + d3d11_dsv_desc.Format = att->image->d3d11_format; + const bool is_msaa = att->image->sample_count > 1; + if (is_msaa) { + d3d11_dsv_desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMS; + } + else { + d3d11_dsv_desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + } + ID3D11Resource* d3d11_res = (ID3D11Resource*) att->image->d3d11_texds; + SOKOL_ASSERT(d3d11_res); + HRESULT hr = ID3D11Device_CreateDepthStencilView(_sg.d3d11.dev, d3d11_res, &d3d11_dsv_desc, &pass->d3d11_dsv); + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr) && pass->d3d11_dsv); + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pass(_sg_pass_t* pass) { + SOKOL_ASSERT(pass); + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (pass->d3d11_rtvs[i]) { + ID3D11RenderTargetView_Release(pass->d3d11_rtvs[i]); + } + } + if (pass->d3d11_dsv) { + ID3D11DepthStencilView_Release(pass->d3d11_dsv); + } +} + +_SOKOL_PRIVATE void _sg_begin_pass(_sg_pass_t* pass, const sg_pass_action* action, int w, int h) { + SOKOL_ASSERT(action); + SOKOL_ASSERT(!_sg.d3d11.in_pass); + _sg.d3d11.in_pass = true; + _sg.d3d11.cur_width = w; + _sg.d3d11.cur_height = h; + if (pass) { + _sg.d3d11.cur_pass = pass; + _sg.d3d11.cur_pass_id.id = pass->slot.id; + _sg.d3d11.num_rtvs = 0; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + _sg.d3d11.cur_rtvs[i] = pass->d3d11_rtvs[i]; + if (_sg.d3d11.cur_rtvs[i]) { + _sg.d3d11.num_rtvs++; + } + } + _sg.d3d11.cur_dsv = pass->d3d11_dsv; + } + else { + /* render to default frame buffer */ + _sg.d3d11.cur_pass = 0; + _sg.d3d11.cur_pass_id.id = SG_INVALID_ID; + _sg.d3d11.num_rtvs = 1; + _sg.d3d11.cur_rtvs[0] = (ID3D11RenderTargetView*) _sg.d3d11.rtv_cb(); + for (int i = 1; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + _sg.d3d11.cur_rtvs[i] = 0; + } + _sg.d3d11.cur_dsv = (ID3D11DepthStencilView*) _sg.d3d11.dsv_cb(); + SOKOL_ASSERT(_sg.d3d11.cur_rtvs[0] && _sg.d3d11.cur_dsv); + } + /* apply the render-target- and depth-stencil-views */ + ID3D11DeviceContext_OMSetRenderTargets(_sg.d3d11.ctx, SG_MAX_COLOR_ATTACHMENTS, _sg.d3d11.cur_rtvs, _sg.d3d11.cur_dsv); + + /* set viewport and scissor rect to cover whole screen */ + D3D11_VIEWPORT vp; + memset(&vp, 0, sizeof(vp)); + vp.Width = (FLOAT) w; + vp.Height = (FLOAT) h; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(_sg.d3d11.ctx, 1, &vp); + D3D11_RECT rect; + rect.left = 0; + rect.top = 0; + rect.right = w; + rect.bottom = h; + ID3D11DeviceContext_RSSetScissorRects(_sg.d3d11.ctx, 1, &rect); + + /* perform clear action */ + for (int i = 0; i < _sg.d3d11.num_rtvs; i++) { + if (action->colors[i].action == SG_ACTION_CLEAR) { + ID3D11DeviceContext_ClearRenderTargetView(_sg.d3d11.ctx, _sg.d3d11.cur_rtvs[i], action->colors[i].val); + } + } + UINT ds_flags = 0; + if (action->depth.action == SG_ACTION_CLEAR) { + ds_flags |= D3D11_CLEAR_DEPTH; + } + if (action->stencil.action == SG_ACTION_CLEAR) { + ds_flags |= D3D11_CLEAR_STENCIL; + } + if ((0 != ds_flags) && _sg.d3d11.cur_dsv) { + ID3D11DeviceContext_ClearDepthStencilView(_sg.d3d11.ctx, _sg.d3d11.cur_dsv, ds_flags, action->depth.val, action->stencil.val); + } +} + +/* D3D11CalcSubresource only exists for C++ */ +_SOKOL_PRIVATE UINT _sg_d3d11_calcsubresource(UINT mip_slice, UINT array_slice, UINT mip_levels) { + return mip_slice + array_slice * mip_levels; +} + +_SOKOL_PRIVATE void _sg_end_pass(void) { + SOKOL_ASSERT(_sg.d3d11.in_pass && _sg.d3d11.ctx); + _sg.d3d11.in_pass = false; + + /* need to resolve MSAA render target into texture? */ + if (_sg.d3d11.cur_pass) { + SOKOL_ASSERT(_sg.d3d11.cur_pass->slot.id == _sg.d3d11.cur_pass_id.id); + for (int i = 0; i < _sg.d3d11.num_rtvs; i++) { + _sg_attachment_t* att = &_sg.d3d11.cur_pass->color_atts[i]; + SOKOL_ASSERT(att->image && (att->image->slot.id == att->image_id.id)); + if (att->image->sample_count > 1) { + /* FIXME: support MSAA resolve into 3D texture */ + SOKOL_ASSERT(att->image->d3d11_tex2d && att->image->d3d11_texmsaa && !att->image->d3d11_tex3d); + SOKOL_ASSERT(DXGI_FORMAT_UNKNOWN != att->image->d3d11_format); + const _sg_image_t* img = att->image; + UINT dst_subres = _sg_d3d11_calcsubresource(att->mip_level, att->slice, img->num_mipmaps); + ID3D11DeviceContext_ResolveSubresource(_sg.d3d11.ctx, + (ID3D11Resource*) img->d3d11_tex2d, /* pDstResource */ + dst_subres, /* DstSubresource */ + (ID3D11Resource*) img->d3d11_texmsaa, /* pSrcResource */ + 0, /* SrcSubresource */ + img->d3d11_format); + } + } + } + _sg.d3d11.cur_pass = 0; + _sg.d3d11.cur_pass_id.id = SG_INVALID_ID; + _sg.d3d11.cur_pipeline = 0; + _sg.d3d11.cur_pipeline_id.id = SG_INVALID_ID; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + _sg.d3d11.cur_rtvs[i] = 0; + } + _sg.d3d11.cur_dsv = 0; + _sg_d3d11_clear_state(); +} + +_SOKOL_PRIVATE void _sg_apply_viewport(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(_sg.d3d11.in_pass); + D3D11_VIEWPORT vp; + vp.TopLeftX = (FLOAT) x; + vp.TopLeftY = (FLOAT) (origin_top_left ? y : (_sg.d3d11.cur_height - (y + h))); + vp.Width = (FLOAT) w; + vp.Height = (FLOAT) h; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(_sg.d3d11.ctx, 1, &vp); +} + +_SOKOL_PRIVATE void _sg_apply_scissor_rect(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(_sg.d3d11.in_pass); + D3D11_RECT rect; + rect.left = x; + rect.top = (origin_top_left ? y : (_sg.d3d11.cur_height - (y + h))); + rect.right = x + w; + rect.bottom = origin_top_left ? (y + h) : (_sg.d3d11.cur_height - y); + ID3D11DeviceContext_RSSetScissorRects(_sg.d3d11.ctx, 1, &rect); +} + +_SOKOL_PRIVATE void _sg_apply_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + SOKOL_ASSERT(pip->shader); + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(_sg.d3d11.in_pass); + SOKOL_ASSERT(pip->d3d11_rs && pip->d3d11_bs && pip->d3d11_dss && pip->d3d11_il); + + _sg.d3d11.cur_pipeline = pip; + _sg.d3d11.cur_pipeline_id.id = pip->slot.id; + _sg.d3d11.use_indexed_draw = (pip->d3d11_index_format != DXGI_FORMAT_UNKNOWN); + + ID3D11DeviceContext_RSSetState(_sg.d3d11.ctx, pip->d3d11_rs); + ID3D11DeviceContext_OMSetDepthStencilState(_sg.d3d11.ctx, pip->d3d11_dss, pip->d3d11_stencil_ref); + ID3D11DeviceContext_OMSetBlendState(_sg.d3d11.ctx, pip->d3d11_bs, pip->blend_color, 0xFFFFFFFF); + ID3D11DeviceContext_IASetPrimitiveTopology(_sg.d3d11.ctx, pip->d3d11_topology); + ID3D11DeviceContext_IASetInputLayout(_sg.d3d11.ctx, pip->d3d11_il); + ID3D11DeviceContext_VSSetShader(_sg.d3d11.ctx, pip->shader->d3d11_vs, NULL, 0); + ID3D11DeviceContext_VSSetConstantBuffers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_UBS, pip->shader->stage[SG_SHADERSTAGE_VS].d3d11_cbs); + ID3D11DeviceContext_PSSetShader(_sg.d3d11.ctx, pip->shader->d3d11_fs, NULL, 0); + ID3D11DeviceContext_PSSetConstantBuffers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_UBS, pip->shader->stage[SG_SHADERSTAGE_FS].d3d11_cbs); +} + +_SOKOL_PRIVATE void _sg_apply_bindings( + _sg_pipeline_t* pip, + _sg_buffer_t** vbs, const int* vb_offsets, int num_vbs, + _sg_buffer_t* ib, int ib_offset, + _sg_image_t** vs_imgs, int num_vs_imgs, + _sg_image_t** fs_imgs, int num_fs_imgs) +{ + SOKOL_ASSERT(pip); + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(_sg.d3d11.in_pass); + + /* gather all the D3D11 resources into arrays */ + ID3D11Buffer* d3d11_ib = ib ? ib->d3d11_buf : 0; + ID3D11Buffer* d3d11_vbs[SG_MAX_SHADERSTAGE_BUFFERS]; + UINT d3d11_vb_offsets[SG_MAX_SHADERSTAGE_BUFFERS]; + ID3D11ShaderResourceView* d3d11_vs_srvs[SG_MAX_SHADERSTAGE_IMAGES]; + ID3D11SamplerState* d3d11_vs_smps[SG_MAX_SHADERSTAGE_IMAGES]; + ID3D11ShaderResourceView* d3d11_fs_srvs[SG_MAX_SHADERSTAGE_IMAGES]; + ID3D11SamplerState* d3d11_fs_smps[SG_MAX_SHADERSTAGE_IMAGES]; + int i; + for (i = 0; i < num_vbs; i++) { + SOKOL_ASSERT(vbs[i]->d3d11_buf); + d3d11_vbs[i] = vbs[i]->d3d11_buf; + d3d11_vb_offsets[i] = vb_offsets[i]; + } + for (; i < SG_MAX_SHADERSTAGE_BUFFERS; i++) { + d3d11_vbs[i] = 0; + d3d11_vb_offsets[i] = 0; + } + for (i = 0; i < num_vs_imgs; i++) { + SOKOL_ASSERT(vs_imgs[i]->d3d11_srv); + SOKOL_ASSERT(vs_imgs[i]->d3d11_smp); + d3d11_vs_srvs[i] = vs_imgs[i]->d3d11_srv; + d3d11_vs_smps[i] = vs_imgs[i]->d3d11_smp; + } + for (; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + d3d11_vs_srvs[i] = 0; + d3d11_vs_smps[i] = 0; + } + for (i = 0; i < num_fs_imgs; i++) { + SOKOL_ASSERT(fs_imgs[i]->d3d11_srv); + SOKOL_ASSERT(fs_imgs[i]->d3d11_smp); + d3d11_fs_srvs[i] = fs_imgs[i]->d3d11_srv; + d3d11_fs_smps[i] = fs_imgs[i]->d3d11_smp; + } + for (; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + d3d11_fs_srvs[i] = 0; + d3d11_fs_smps[i] = 0; + } + + ID3D11DeviceContext_IASetVertexBuffers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_BUFFERS, d3d11_vbs, pip->d3d11_vb_strides, d3d11_vb_offsets); + ID3D11DeviceContext_IASetIndexBuffer(_sg.d3d11.ctx, d3d11_ib, pip->d3d11_index_format, ib_offset); + ID3D11DeviceContext_VSSetShaderResources(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, d3d11_vs_srvs); + ID3D11DeviceContext_VSSetSamplers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, d3d11_vs_smps); + ID3D11DeviceContext_PSSetShaderResources(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, d3d11_fs_srvs); + ID3D11DeviceContext_PSSetSamplers(_sg.d3d11.ctx, 0, SG_MAX_SHADERSTAGE_IMAGES, d3d11_fs_smps); +} + +_SOKOL_PRIVATE void _sg_apply_uniforms(sg_shader_stage stage_index, int ub_index, const void* data, int num_bytes) { + _SOKOL_UNUSED(num_bytes); + SOKOL_ASSERT(_sg.d3d11.ctx && _sg.d3d11.in_pass); + SOKOL_ASSERT(data && (num_bytes > 0)); + SOKOL_ASSERT((stage_index >= 0) && ((int)stage_index < SG_NUM_SHADER_STAGES)); + SOKOL_ASSERT((ub_index >= 0) && (ub_index < SG_MAX_SHADERSTAGE_UBS)); + SOKOL_ASSERT(_sg.d3d11.cur_pipeline && _sg.d3d11.cur_pipeline->slot.id == _sg.d3d11.cur_pipeline_id.id); + SOKOL_ASSERT(_sg.d3d11.cur_pipeline->shader && _sg.d3d11.cur_pipeline->shader->slot.id == _sg.d3d11.cur_pipeline->shader_id.id); + SOKOL_ASSERT(ub_index < _sg.d3d11.cur_pipeline->shader->stage[stage_index].num_uniform_blocks); + SOKOL_ASSERT(num_bytes == _sg.d3d11.cur_pipeline->shader->stage[stage_index].uniform_blocks[ub_index].size); + ID3D11Buffer* cb = _sg.d3d11.cur_pipeline->shader->stage[stage_index].d3d11_cbs[ub_index]; + SOKOL_ASSERT(cb); + ID3D11DeviceContext_UpdateSubresource(_sg.d3d11.ctx, (ID3D11Resource*)cb, 0, NULL, data, 0, 0); +} + +_SOKOL_PRIVATE void _sg_draw(int base_element, int num_elements, int num_instances) { + SOKOL_ASSERT(_sg.d3d11.in_pass); + if (_sg.d3d11.use_indexed_draw) { + if (1 == num_instances) { + ID3D11DeviceContext_DrawIndexed(_sg.d3d11.ctx, num_elements, base_element, 0); + } + else { + ID3D11DeviceContext_DrawIndexedInstanced(_sg.d3d11.ctx, num_elements, num_instances, base_element, 0, 0); + } + } + else { + if (1 == num_instances) { + ID3D11DeviceContext_Draw(_sg.d3d11.ctx, num_elements, base_element); + } + else { + ID3D11DeviceContext_DrawInstanced(_sg.d3d11.ctx, num_elements, num_instances, base_element, 0); + } + } +} + +_SOKOL_PRIVATE void _sg_commit(void) { + SOKOL_ASSERT(!_sg.d3d11.in_pass); +} + +_SOKOL_PRIVATE void _sg_update_buffer(_sg_buffer_t* buf, const void* data_ptr, int data_size) { + SOKOL_ASSERT(buf && data_ptr && (data_size > 0)); + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(buf->d3d11_buf); + D3D11_MAPPED_SUBRESOURCE d3d11_msr; + HRESULT hr = ID3D11DeviceContext_Map(_sg.d3d11.ctx, (ID3D11Resource*)buf->d3d11_buf, 0, D3D11_MAP_WRITE_DISCARD, 0, &d3d11_msr); + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr)); + memcpy(d3d11_msr.pData, data_ptr, data_size); + ID3D11DeviceContext_Unmap(_sg.d3d11.ctx, (ID3D11Resource*)buf->d3d11_buf, 0); +} + +_SOKOL_PRIVATE void _sg_append_buffer(_sg_buffer_t* buf, const void* data_ptr, int data_size, bool new_frame) { + SOKOL_ASSERT(buf && data_ptr && (data_size > 0)); + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(buf->d3d11_buf); + D3D11_MAP map_type = new_frame ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE; + D3D11_MAPPED_SUBRESOURCE d3d11_msr; + HRESULT hr = ID3D11DeviceContext_Map(_sg.d3d11.ctx, (ID3D11Resource*)buf->d3d11_buf, 0, map_type, 0, &d3d11_msr); + _SOKOL_UNUSED(hr); + SOKOL_ASSERT(SUCCEEDED(hr)); + uint8_t* dst_ptr = (uint8_t*)d3d11_msr.pData + buf->append_pos; + memcpy(dst_ptr, data_ptr, data_size); + ID3D11DeviceContext_Unmap(_sg.d3d11.ctx, (ID3D11Resource*)buf->d3d11_buf, 0); +} + +_SOKOL_PRIVATE void _sg_update_image(_sg_image_t* img, const sg_image_content* data) { + SOKOL_ASSERT(img && data); + SOKOL_ASSERT(_sg.d3d11.ctx); + SOKOL_ASSERT(img->d3d11_tex2d || img->d3d11_tex3d); + ID3D11Resource* d3d11_res = 0; + if (img->d3d11_tex3d) { + d3d11_res = (ID3D11Resource*) img->d3d11_tex3d; + } + else { + d3d11_res = (ID3D11Resource*) img->d3d11_tex2d; + } + SOKOL_ASSERT(d3d11_res); + const int num_faces = (img->type == SG_IMAGETYPE_CUBE) ? 6:1; + const int num_slices = (img->type == SG_IMAGETYPE_ARRAY) ? img->depth:1; + int subres_index = 0; + HRESULT hr; + D3D11_MAPPED_SUBRESOURCE d3d11_msr; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int slice_index = 0; slice_index < num_slices; slice_index++) { + for (int mip_index = 0; mip_index < img->num_mipmaps; mip_index++, subres_index++) { + SOKOL_ASSERT(subres_index < (SG_MAX_MIPMAPS * SG_MAX_TEXTUREARRAY_LAYERS)); + const int mip_width = ((img->width>>mip_index)>0) ? img->width>>mip_index : 1; + const int mip_height = ((img->height>>mip_index)>0) ? img->height>>mip_index : 1; + const int src_pitch = _sg_row_pitch(img->pixel_format, mip_width); + const sg_subimage_content* subimg_content = &(data->subimage[face_index][mip_index]); + const int slice_size = subimg_content->size / num_slices; + const int slice_offset = slice_size * slice_index; + const uint8_t* slice_ptr = ((const uint8_t*)subimg_content->ptr) + slice_offset; + hr = ID3D11DeviceContext_Map(_sg.d3d11.ctx, d3d11_res, subres_index, D3D11_MAP_WRITE_DISCARD, 0, &d3d11_msr); + SOKOL_ASSERT(SUCCEEDED(hr)); + /* FIXME: need to handle difference in depth-pitch for 3D textures as well! */ + if (src_pitch == (int)d3d11_msr.RowPitch) { + memcpy(d3d11_msr.pData, slice_ptr, slice_size); + } + else { + SOKOL_ASSERT(src_pitch < (int)d3d11_msr.RowPitch); + const uint8_t* src_ptr = slice_ptr; + uint8_t* dst_ptr = (uint8_t*) d3d11_msr.pData; + for (int row_index = 0; row_index < mip_height; row_index++) { + memcpy(dst_ptr, src_ptr, src_pitch); + src_ptr += src_pitch; + dst_ptr += d3d11_msr.RowPitch; + } + } + ID3D11DeviceContext_Unmap(_sg.d3d11.ctx, d3d11_res, subres_index); + } + } + } +} + +/*== METAL BACKEND IMPLEMENTATION ============================================*/ +#elif defined(SOKOL_METAL) + +/*-- enum translation functions ----------------------------------------------*/ +_SOKOL_PRIVATE MTLLoadAction _sg_mtl_load_action(sg_action a) { + switch (a) { + case SG_ACTION_CLEAR: return MTLLoadActionClear; + case SG_ACTION_LOAD: return MTLLoadActionLoad; + case SG_ACTION_DONTCARE: return MTLLoadActionDontCare; + default: SOKOL_UNREACHABLE; return (MTLLoadAction)0; + } +} + +_SOKOL_PRIVATE MTLResourceOptions _sg_mtl_buffer_resource_options(sg_usage usg) { + switch (usg) { + case SG_USAGE_IMMUTABLE: + return MTLResourceStorageModeShared; + case SG_USAGE_DYNAMIC: + case SG_USAGE_STREAM: + #if defined(_SG_TARGET_MACOS) + return MTLCPUCacheModeWriteCombined|MTLResourceStorageModeManaged; + #else + return MTLCPUCacheModeWriteCombined; + #endif + default: + SOKOL_UNREACHABLE; + return 0; + } +} + +_SOKOL_PRIVATE MTLVertexStepFunction _sg_mtl_step_function(sg_vertex_step step) { + switch (step) { + case SG_VERTEXSTEP_PER_VERTEX: return MTLVertexStepFunctionPerVertex; + case SG_VERTEXSTEP_PER_INSTANCE: return MTLVertexStepFunctionPerInstance; + default: SOKOL_UNREACHABLE; return (MTLVertexStepFunction)0; + } +} + +_SOKOL_PRIVATE MTLVertexFormat _sg_mtl_vertex_format(sg_vertex_format fmt) { + switch (fmt) { + case SG_VERTEXFORMAT_FLOAT: return MTLVertexFormatFloat; + case SG_VERTEXFORMAT_FLOAT2: return MTLVertexFormatFloat2; + case SG_VERTEXFORMAT_FLOAT3: return MTLVertexFormatFloat3; + case SG_VERTEXFORMAT_FLOAT4: return MTLVertexFormatFloat4; + case SG_VERTEXFORMAT_BYTE4: return MTLVertexFormatChar4; + case SG_VERTEXFORMAT_BYTE4N: return MTLVertexFormatChar4Normalized; + case SG_VERTEXFORMAT_UBYTE4: return MTLVertexFormatUChar4; + case SG_VERTEXFORMAT_UBYTE4N: return MTLVertexFormatUChar4Normalized; + case SG_VERTEXFORMAT_SHORT2: return MTLVertexFormatShort2; + case SG_VERTEXFORMAT_SHORT2N: return MTLVertexFormatShort2Normalized; + case SG_VERTEXFORMAT_USHORT2N: return MTLVertexFormatUShort2Normalized; + case SG_VERTEXFORMAT_SHORT4: return MTLVertexFormatShort4; + case SG_VERTEXFORMAT_SHORT4N: return MTLVertexFormatShort4Normalized; + case SG_VERTEXFORMAT_USHORT4N: return MTLVertexFormatUShort4Normalized; + case SG_VERTEXFORMAT_UINT10_N2: return MTLVertexFormatUInt1010102Normalized; + default: SOKOL_UNREACHABLE; return (MTLVertexFormat)0; + } +} + +_SOKOL_PRIVATE MTLPrimitiveType _sg_mtl_primitive_type(sg_primitive_type t) { + switch (t) { + case SG_PRIMITIVETYPE_POINTS: return MTLPrimitiveTypePoint; + case SG_PRIMITIVETYPE_LINES: return MTLPrimitiveTypeLine; + case SG_PRIMITIVETYPE_LINE_STRIP: return MTLPrimitiveTypeLineStrip; + case SG_PRIMITIVETYPE_TRIANGLES: return MTLPrimitiveTypeTriangle; + case SG_PRIMITIVETYPE_TRIANGLE_STRIP: return MTLPrimitiveTypeTriangleStrip; + default: SOKOL_UNREACHABLE; return (MTLPrimitiveType)0; + } +} + +_SOKOL_PRIVATE MTLPixelFormat _sg_mtl_pixel_format(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_R8: return MTLPixelFormatR8Unorm; + case SG_PIXELFORMAT_R8SN: return MTLPixelFormatR8Snorm; + case SG_PIXELFORMAT_R8UI: return MTLPixelFormatR8Uint; + case SG_PIXELFORMAT_R8SI: return MTLPixelFormatR8Sint; + case SG_PIXELFORMAT_R16: return MTLPixelFormatR16Unorm; + case SG_PIXELFORMAT_R16SN: return MTLPixelFormatR16Snorm; + case SG_PIXELFORMAT_R16UI: return MTLPixelFormatR16Uint; + case SG_PIXELFORMAT_R16SI: return MTLPixelFormatR16Sint; + case SG_PIXELFORMAT_R16F: return MTLPixelFormatR16Float; + case SG_PIXELFORMAT_RG8: return MTLPixelFormatRG8Unorm; + case SG_PIXELFORMAT_RG8SN: return MTLPixelFormatRG8Snorm; + case SG_PIXELFORMAT_RG8UI: return MTLPixelFormatRG8Uint; + case SG_PIXELFORMAT_RG8SI: return MTLPixelFormatRG8Sint; + case SG_PIXELFORMAT_R32UI: return MTLPixelFormatR32Uint; + case SG_PIXELFORMAT_R32SI: return MTLPixelFormatR32Sint; + case SG_PIXELFORMAT_R32F: return MTLPixelFormatR32Float; + case SG_PIXELFORMAT_RG16: return MTLPixelFormatRG16Unorm; + case SG_PIXELFORMAT_RG16SN: return MTLPixelFormatRG16Snorm; + case SG_PIXELFORMAT_RG16UI: return MTLPixelFormatRG16Uint; + case SG_PIXELFORMAT_RG16SI: return MTLPixelFormatRG16Sint; + case SG_PIXELFORMAT_RG16F: return MTLPixelFormatRG16Float; + case SG_PIXELFORMAT_RGBA8: return MTLPixelFormatRGBA8Unorm; + case SG_PIXELFORMAT_RGBA8SN: return MTLPixelFormatRGBA8Snorm; + case SG_PIXELFORMAT_RGBA8UI: return MTLPixelFormatRGBA8Uint; + case SG_PIXELFORMAT_RGBA8SI: return MTLPixelFormatRGBA8Sint; + case SG_PIXELFORMAT_BGRA8: return MTLPixelFormatBGRA8Unorm; + case SG_PIXELFORMAT_RGB10A2: return MTLPixelFormatRGB10A2Unorm; + case SG_PIXELFORMAT_RG11B10F: return MTLPixelFormatRG11B10Float; + case SG_PIXELFORMAT_RG32UI: return MTLPixelFormatRG32Uint; + case SG_PIXELFORMAT_RG32SI: return MTLPixelFormatRG32Sint; + case SG_PIXELFORMAT_RG32F: return MTLPixelFormatRG32Float; + case SG_PIXELFORMAT_RGBA16: return MTLPixelFormatRGBA16Unorm; + case SG_PIXELFORMAT_RGBA16SN: return MTLPixelFormatRGBA16Snorm; + case SG_PIXELFORMAT_RGBA16UI: return MTLPixelFormatRGBA16Uint; + case SG_PIXELFORMAT_RGBA16SI: return MTLPixelFormatRGBA16Sint; + case SG_PIXELFORMAT_RGBA16F: return MTLPixelFormatRGBA16Float; + case SG_PIXELFORMAT_RGBA32UI: return MTLPixelFormatRGBA32Uint; + case SG_PIXELFORMAT_RGBA32SI: return MTLPixelFormatRGBA32Sint; + case SG_PIXELFORMAT_RGBA32F: return MTLPixelFormatRGBA32Float; + case SG_PIXELFORMAT_DEPTH: return MTLPixelFormatDepth32Float; + case SG_PIXELFORMAT_DEPTH_STENCIL: return MTLPixelFormatDepth32Float_Stencil8; + #if defined(_SG_TARGET_MACOS) + case SG_PIXELFORMAT_BC1_RGBA: return MTLPixelFormatBC1_RGBA; + case SG_PIXELFORMAT_BC2_RGBA: return MTLPixelFormatBC2_RGBA; + case SG_PIXELFORMAT_BC3_RGBA: return MTLPixelFormatBC3_RGBA; + case SG_PIXELFORMAT_BC4_R: return MTLPixelFormatBC4_RUnorm; + case SG_PIXELFORMAT_BC4_RSN: return MTLPixelFormatBC4_RSnorm; + case SG_PIXELFORMAT_BC5_RG: return MTLPixelFormatBC5_RGUnorm; + case SG_PIXELFORMAT_BC5_RGSN: return MTLPixelFormatBC5_RGSnorm; + case SG_PIXELFORMAT_BC6H_RGBF: return MTLPixelFormatBC6H_RGBFloat; + case SG_PIXELFORMAT_BC6H_RGBUF: return MTLPixelFormatBC6H_RGBUfloat; + case SG_PIXELFORMAT_BC7_RGBA: return MTLPixelFormatBC7_RGBAUnorm; + #else + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: return MTLPixelFormatPVRTC_RGB_2BPP; + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: return MTLPixelFormatPVRTC_RGB_4BPP; + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: return MTLPixelFormatPVRTC_RGBA_2BPP; + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: return MTLPixelFormatPVRTC_RGBA_4BPP; + case SG_PIXELFORMAT_ETC2_RGB8: return MTLPixelFormatETC2_RGB8; + case SG_PIXELFORMAT_ETC2_RGB8A1: return MTLPixelFormatETC2_RGB8A1; + case SG_PIXELFORMAT_ETC2_RGBA8: return MTLPixelFormatEAC_RGBA8; + case SG_PIXELFORMAT_ETC2_RG11: return MTLPixelFormatEAC_RG11Unorm; + case SG_PIXELFORMAT_ETC2_RG11SN: return MTLPixelFormatEAC_RG11Snorm; + #endif + default: return MTLPixelFormatInvalid; + } +} + +_SOKOL_PRIVATE MTLColorWriteMask _sg_mtl_color_write_mask(sg_color_mask m) { + MTLColorWriteMask mtl_mask = MTLColorWriteMaskNone; + if (m & SG_COLORMASK_R) { + mtl_mask |= MTLColorWriteMaskRed; + } + if (m & SG_COLORMASK_G) { + mtl_mask |= MTLColorWriteMaskGreen; + } + if (m & SG_COLORMASK_B) { + mtl_mask |= MTLColorWriteMaskBlue; + } + if (m & SG_COLORMASK_A) { + mtl_mask |= MTLColorWriteMaskAlpha; + } + return mtl_mask; +} + +_SOKOL_PRIVATE MTLBlendOperation _sg_mtl_blend_op(sg_blend_op op) { + switch (op) { + case SG_BLENDOP_ADD: return MTLBlendOperationAdd; + case SG_BLENDOP_SUBTRACT: return MTLBlendOperationSubtract; + case SG_BLENDOP_REVERSE_SUBTRACT: return MTLBlendOperationReverseSubtract; + default: SOKOL_UNREACHABLE; return (MTLBlendOperation)0; + } +} + +_SOKOL_PRIVATE MTLBlendFactor _sg_mtl_blend_factor(sg_blend_factor f) { + switch (f) { + case SG_BLENDFACTOR_ZERO: return MTLBlendFactorZero; + case SG_BLENDFACTOR_ONE: return MTLBlendFactorOne; + case SG_BLENDFACTOR_SRC_COLOR: return MTLBlendFactorSourceColor; + case SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR: return MTLBlendFactorOneMinusSourceColor; + case SG_BLENDFACTOR_SRC_ALPHA: return MTLBlendFactorSourceAlpha; + case SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA: return MTLBlendFactorOneMinusSourceAlpha; + case SG_BLENDFACTOR_DST_COLOR: return MTLBlendFactorDestinationColor; + case SG_BLENDFACTOR_ONE_MINUS_DST_COLOR: return MTLBlendFactorOneMinusDestinationColor; + case SG_BLENDFACTOR_DST_ALPHA: return MTLBlendFactorDestinationAlpha; + case SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA: return MTLBlendFactorOneMinusDestinationAlpha; + case SG_BLENDFACTOR_SRC_ALPHA_SATURATED: return MTLBlendFactorSourceAlphaSaturated; + case SG_BLENDFACTOR_BLEND_COLOR: return MTLBlendFactorBlendColor; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_COLOR: return MTLBlendFactorOneMinusBlendColor; + case SG_BLENDFACTOR_BLEND_ALPHA: return MTLBlendFactorBlendAlpha; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_ALPHA: return MTLBlendFactorOneMinusBlendAlpha; + default: SOKOL_UNREACHABLE; return (MTLBlendFactor)0; + } +} + +_SOKOL_PRIVATE MTLCompareFunction _sg_mtl_compare_func(sg_compare_func f) { + switch (f) { + case SG_COMPAREFUNC_NEVER: return MTLCompareFunctionNever; + case SG_COMPAREFUNC_LESS: return MTLCompareFunctionLess; + case SG_COMPAREFUNC_EQUAL: return MTLCompareFunctionEqual; + case SG_COMPAREFUNC_LESS_EQUAL: return MTLCompareFunctionLessEqual; + case SG_COMPAREFUNC_GREATER: return MTLCompareFunctionGreater; + case SG_COMPAREFUNC_NOT_EQUAL: return MTLCompareFunctionNotEqual; + case SG_COMPAREFUNC_GREATER_EQUAL: return MTLCompareFunctionGreaterEqual; + case SG_COMPAREFUNC_ALWAYS: return MTLCompareFunctionAlways; + default: SOKOL_UNREACHABLE; return (MTLCompareFunction)0; + } +} + +_SOKOL_PRIVATE MTLStencilOperation _sg_mtl_stencil_op(sg_stencil_op op) { + switch (op) { + case SG_STENCILOP_KEEP: return MTLStencilOperationKeep; + case SG_STENCILOP_ZERO: return MTLStencilOperationZero; + case SG_STENCILOP_REPLACE: return MTLStencilOperationReplace; + case SG_STENCILOP_INCR_CLAMP: return MTLStencilOperationIncrementClamp; + case SG_STENCILOP_DECR_CLAMP: return MTLStencilOperationDecrementClamp; + case SG_STENCILOP_INVERT: return MTLStencilOperationInvert; + case SG_STENCILOP_INCR_WRAP: return MTLStencilOperationIncrementWrap; + case SG_STENCILOP_DECR_WRAP: return MTLStencilOperationDecrementWrap; + default: SOKOL_UNREACHABLE; return (MTLStencilOperation)0; + } +} + +_SOKOL_PRIVATE MTLCullMode _sg_mtl_cull_mode(sg_cull_mode m) { + switch (m) { + case SG_CULLMODE_NONE: return MTLCullModeNone; + case SG_CULLMODE_FRONT: return MTLCullModeFront; + case SG_CULLMODE_BACK: return MTLCullModeBack; + default: SOKOL_UNREACHABLE; return (MTLCullMode)0; + } +} + +_SOKOL_PRIVATE MTLWinding _sg_mtl_winding(sg_face_winding w) { + switch (w) { + case SG_FACEWINDING_CW: return MTLWindingClockwise; + case SG_FACEWINDING_CCW: return MTLWindingCounterClockwise; + default: SOKOL_UNREACHABLE; return (MTLWinding)0; + } +} + +_SOKOL_PRIVATE MTLIndexType _sg_mtl_index_type(sg_index_type t) { + switch (t) { + case SG_INDEXTYPE_UINT16: return MTLIndexTypeUInt16; + case SG_INDEXTYPE_UINT32: return MTLIndexTypeUInt32; + default: SOKOL_UNREACHABLE; return (MTLIndexType)0; + } +} + +_SOKOL_PRIVATE NSUInteger _sg_mtl_index_size(sg_index_type t) { + switch (t) { + case SG_INDEXTYPE_NONE: return 0; + case SG_INDEXTYPE_UINT16: return 2; + case SG_INDEXTYPE_UINT32: return 4; + default: SOKOL_UNREACHABLE; return 0; + } +} + +_SOKOL_PRIVATE MTLTextureType _sg_mtl_texture_type(sg_image_type t) { + switch (t) { + case SG_IMAGETYPE_2D: return MTLTextureType2D; + case SG_IMAGETYPE_CUBE: return MTLTextureTypeCube; + case SG_IMAGETYPE_3D: return MTLTextureType3D; + case SG_IMAGETYPE_ARRAY: return MTLTextureType2DArray; + default: SOKOL_UNREACHABLE; return (MTLTextureType)0; + } +} + +_SOKOL_PRIVATE bool _sg_mtl_is_pvrtc(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: + return true; + default: + return false; + } +} + +_SOKOL_PRIVATE MTLSamplerAddressMode _sg_mtl_address_mode(sg_wrap w) { + switch (w) { + case SG_WRAP_REPEAT: return MTLSamplerAddressModeRepeat; + case SG_WRAP_CLAMP_TO_EDGE: return MTLSamplerAddressModeClampToEdge; + #if defined(_SG_TARGET_MACOS) + case SG_WRAP_CLAMP_TO_BORDER: return MTLSamplerAddressModeClampToBorderColor; + #else + /* clamp-to-border not supported on iOS, fall back to clamp-to-edge */ + case SG_WRAP_CLAMP_TO_BORDER: return MTLSamplerAddressModeClampToEdge; + #endif + case SG_WRAP_MIRRORED_REPEAT: return MTLSamplerAddressModeMirrorRepeat; + default: SOKOL_UNREACHABLE; return (MTLSamplerAddressMode)0; + } +} + +#if defined(_SG_TARGET_MACOS) +_SOKOL_PRIVATE MTLSamplerBorderColor _sg_mtl_border_color(sg_border_color c) { + switch (c) { + case SG_BORDERCOLOR_TRANSPARENT_BLACK: return MTLSamplerBorderColorTransparentBlack; + case SG_BORDERCOLOR_OPAQUE_BLACK: return MTLSamplerBorderColorOpaqueBlack; + case SG_BORDERCOLOR_OPAQUE_WHITE: return MTLSamplerBorderColorOpaqueWhite; + default: SOKOL_UNREACHABLE; return (MTLSamplerBorderColor)0; + } +} +#endif + +_SOKOL_PRIVATE MTLSamplerMinMagFilter _sg_mtl_minmag_filter(sg_filter f) { + switch (f) { + case SG_FILTER_NEAREST: + case SG_FILTER_NEAREST_MIPMAP_NEAREST: + case SG_FILTER_NEAREST_MIPMAP_LINEAR: + return MTLSamplerMinMagFilterNearest; + case SG_FILTER_LINEAR: + case SG_FILTER_LINEAR_MIPMAP_NEAREST: + case SG_FILTER_LINEAR_MIPMAP_LINEAR: + return MTLSamplerMinMagFilterLinear; + default: + SOKOL_UNREACHABLE; return (MTLSamplerMinMagFilter)0; + } +} + +_SOKOL_PRIVATE MTLSamplerMipFilter _sg_mtl_mip_filter(sg_filter f) { + switch (f) { + case SG_FILTER_NEAREST: + case SG_FILTER_LINEAR: + return MTLSamplerMipFilterNotMipmapped; + case SG_FILTER_NEAREST_MIPMAP_NEAREST: + case SG_FILTER_LINEAR_MIPMAP_NEAREST: + return MTLSamplerMipFilterNearest; + case SG_FILTER_NEAREST_MIPMAP_LINEAR: + case SG_FILTER_LINEAR_MIPMAP_LINEAR: + return MTLSamplerMipFilterLinear; + default: + SOKOL_UNREACHABLE; return (MTLSamplerMipFilter)0; + } +} + +/*-- a pool for all Metal resource objects, with deferred release queue -------*/ + +_SOKOL_PRIVATE void _sg_mtl_init_pool(const sg_desc* desc) { + _sg.mtl.idpool.num_slots = 2 * + ( + 2 * desc->buffer_pool_size + + 5 * desc->image_pool_size + + 4 * desc->shader_pool_size + + 2 * desc->pipeline_pool_size + + desc->pass_pool_size + ); + _sg_mtl_idpool = [NSMutableArray arrayWithCapacity:_sg.mtl.idpool.num_slots]; + NSNull* null = [NSNull null]; + for (uint32_t i = 0; i < _sg.mtl.idpool.num_slots; i++) { + [_sg_mtl_idpool addObject:null]; + } + SOKOL_ASSERT([_sg_mtl_idpool count] == _sg.mtl.idpool.num_slots); + /* a queue of currently free slot indices */ + _sg.mtl.idpool.free_queue_top = 0; + _sg.mtl.idpool.free_queue = (uint32_t*)SOKOL_MALLOC(_sg.mtl.idpool.num_slots * sizeof(uint32_t)); + /* pool slot 0 is reserved! */ + for (int i = _sg.mtl.idpool.num_slots-1; i >= 1; i--) { + _sg.mtl.idpool.free_queue[_sg.mtl.idpool.free_queue_top++] = (uint32_t)i; + } + /* a circular queue which holds release items (frame index + when a resource is to be released, and the resource's + pool index + */ + _sg.mtl.idpool.release_queue_front = 0; + _sg.mtl.idpool.release_queue_back = 0; + _sg.mtl.idpool.release_queue = (_sg_mtl_release_item_t*)SOKOL_MALLOC(_sg.mtl.idpool.num_slots * sizeof(_sg_mtl_release_item_t)); + for (uint32_t i = 0; i < _sg.mtl.idpool.num_slots; i++) { + _sg.mtl.idpool.release_queue[i].frame_index = 0; + _sg.mtl.idpool.release_queue[i].slot_index = _SG_MTL_INVALID_SLOT_INDEX; + } +} + +_SOKOL_PRIVATE void _sg_mtl_destroy_pool(void) { + SOKOL_FREE(_sg.mtl.idpool.release_queue); _sg.mtl.idpool.release_queue = 0; + SOKOL_FREE(_sg.mtl.idpool.free_queue); _sg.mtl.idpool.free_queue = 0; + _sg_mtl_idpool = nil; +} + +/* get a new free resource pool slot */ +_SOKOL_PRIVATE uint32_t _sg_mtl_alloc_pool_slot(void) { + SOKOL_ASSERT(_sg.mtl.idpool.free_queue_top > 0); + const uint32_t slot_index = _sg.mtl.idpool.free_queue[--_sg.mtl.idpool.free_queue_top]; + SOKOL_ASSERT((slot_index > 0) && (slot_index < _sg.mtl.idpool.num_slots)); + return slot_index; +} + +/* put a free resource pool slot back into the free-queue */ +_SOKOL_PRIVATE void _sg_mtl_free_pool_slot(uint32_t slot_index) { + SOKOL_ASSERT(_sg.mtl.idpool.free_queue_top < _sg.mtl.idpool.num_slots); + SOKOL_ASSERT((slot_index > 0) && (slot_index < _sg.mtl.idpool.num_slots)); + _sg.mtl.idpool.free_queue[_sg.mtl.idpool.free_queue_top++] = slot_index; +} + +/* add an MTLResource to the pool, return pool index or 0 if input was 'nil' */ +_SOKOL_PRIVATE uint32_t _sg_mtl_add_resource(id res) { + if (nil == res) { + return _SG_MTL_INVALID_SLOT_INDEX; + } + const uint32_t slot_index = _sg_mtl_alloc_pool_slot(); + SOKOL_ASSERT([NSNull null] == _sg_mtl_idpool[slot_index]); + _sg_mtl_idpool[slot_index] = res; + return slot_index; +} + +/* mark an MTLResource for release, this will put the resource into the + deferred-release queue, and the resource will then be released N frames later, + the special pool index 0 will be ignored (this means that a nil + value was provided to _sg_mtl_add_resource() +*/ +_SOKOL_PRIVATE void _sg_mtl_release_resource(uint32_t frame_index, uint32_t slot_index) { + if (slot_index == _SG_MTL_INVALID_SLOT_INDEX) { + return; + } + SOKOL_ASSERT((slot_index > 0) && (slot_index < _sg.mtl.idpool.num_slots)); + SOKOL_ASSERT([NSNull null] != _sg_mtl_idpool[slot_index]); + int release_index = _sg.mtl.idpool.release_queue_front++; + if (_sg.mtl.idpool.release_queue_front >= _sg.mtl.idpool.num_slots) { + /* wrap-around */ + _sg.mtl.idpool.release_queue_front = 0; + } + /* release queue full? */ + SOKOL_ASSERT(_sg.mtl.idpool.release_queue_front != _sg.mtl.idpool.release_queue_back); + SOKOL_ASSERT(0 == _sg.mtl.idpool.release_queue[release_index].frame_index); + const uint32_t safe_to_release_frame_index = frame_index + SG_NUM_INFLIGHT_FRAMES + 1; + _sg.mtl.idpool.release_queue[release_index].frame_index = safe_to_release_frame_index; + _sg.mtl.idpool.release_queue[release_index].slot_index = slot_index; +} + +/* run garbage-collection pass on all resources in the release-queue */ +_SOKOL_PRIVATE void _sg_mtl_garbage_collect(uint32_t frame_index) { + while (_sg.mtl.idpool.release_queue_back != _sg.mtl.idpool.release_queue_front) { + if (frame_index < _sg.mtl.idpool.release_queue[_sg.mtl.idpool.release_queue_back].frame_index) { + /* don't need to check further, release-items past this are too young */ + break; + } + /* safe to release this resource */ + const uint32_t slot_index = _sg.mtl.idpool.release_queue[_sg.mtl.idpool.release_queue_back].slot_index; + SOKOL_ASSERT((slot_index > 0) && (slot_index < _sg.mtl.idpool.num_slots)); + SOKOL_ASSERT(_sg_mtl_idpool[slot_index] != [NSNull null]); + _sg_mtl_idpool[slot_index] = [NSNull null]; + /* put the now free pool index back on the free queue */ + _sg_mtl_free_pool_slot(slot_index); + /* reset the release queue slot and advance the back index */ + _sg.mtl.idpool.release_queue[_sg.mtl.idpool.release_queue_back].frame_index = 0; + _sg.mtl.idpool.release_queue[_sg.mtl.idpool.release_queue_back].slot_index = _SG_MTL_INVALID_SLOT_INDEX; + _sg.mtl.idpool.release_queue_back++; + if (_sg.mtl.idpool.release_queue_back >= _sg.mtl.idpool.num_slots) { + /* wrap-around */ + _sg.mtl.idpool.release_queue_back = 0; + } + } +} + +/*-- a very simple sampler cache ----------------------------------------------- + + since there's only a small number of different samplers, sampler objects + will never be deleted (except on shutdown), and searching an identical + sampler is a simple linear search +*/ +/* initialize the sampler cache */ +_SOKOL_PRIVATE void _sg_mtl_init_sampler_cache(const sg_desc* desc) { + SOKOL_ASSERT(desc->mtl_sampler_cache_size > 0); + _sg.mtl.sampler_cache.capacity = desc->mtl_sampler_cache_size; + _sg.mtl.sampler_cache.num_items = 0; + const int size = _sg.mtl.sampler_cache.capacity * sizeof(_sg_mtl_sampler_cache_item_t); + _sg.mtl.sampler_cache.items = (_sg_mtl_sampler_cache_item_t*)SOKOL_MALLOC(size); + memset(_sg.mtl.sampler_cache.items, 0, size); +} + +/* destroy the sampler cache, and release all sampler objects */ +_SOKOL_PRIVATE void _sg_mtl_destroy_sampler_cache(uint32_t frame_index) { + SOKOL_ASSERT(_sg.mtl.sampler_cache.items); + SOKOL_ASSERT(_sg.mtl.sampler_cache.num_items <= _sg.mtl.sampler_cache.capacity); + for (int i = 0; i < _sg.mtl.sampler_cache.num_items; i++) { + _sg_mtl_release_resource(frame_index, _sg.mtl.sampler_cache.items[i].mtl_sampler_state); + } + SOKOL_FREE(_sg.mtl.sampler_cache.items); _sg.mtl.sampler_cache.items = 0; + _sg.mtl.sampler_cache.num_items = 0; + _sg.mtl.sampler_cache.capacity = 0; +} + +/* + create and add an MTLSamplerStateObject and return its resource pool index, + reuse identical sampler state if one exists +*/ +_SOKOL_PRIVATE uint32_t _sg_mtl_create_sampler(id mtl_device, const sg_image_desc* img_desc) { + SOKOL_ASSERT(img_desc); + SOKOL_ASSERT(_sg.mtl.sampler_cache.items); + /* sampler state cache is full */ + const sg_filter min_filter = img_desc->min_filter; + const sg_filter mag_filter = img_desc->mag_filter; + const sg_wrap wrap_u = img_desc->wrap_u; + const sg_wrap wrap_v = img_desc->wrap_v; + const sg_wrap wrap_w = img_desc->wrap_w; + const sg_border_color border_color = img_desc->border_color; + const uint32_t max_anisotropy = img_desc->max_anisotropy; + /* convert floats to valid int for proper comparison */ + const int min_lod = (int)(img_desc->min_lod * 1000.0f); + const int max_lod = (int)(_sg_clamp(img_desc->max_lod, 0.0f, 1000.0f) * 1000.0f); + /* first try to find identical sampler, number of samplers will be small, so linear search is ok */ + for (int i = 0; i < _sg.mtl.sampler_cache.num_items; i++) { + _sg_mtl_sampler_cache_item_t* item = &_sg.mtl.sampler_cache.items[i]; + if ((min_filter == item->min_filter) && + (mag_filter == item->mag_filter) && + (wrap_u == item->wrap_u) && + (wrap_v == item->wrap_v) && + (wrap_w == item->wrap_w) && + (max_anisotropy == item->max_anisotropy) && + (border_color == item->border_color) && + (min_lod == item->min_lod) && + (max_lod == item->max_lod)) + { + return item->mtl_sampler_state; + } + } + /* fallthrough: need to create a new MTLSamplerState object */ + SOKOL_ASSERT(_sg.mtl.sampler_cache.num_items < _sg.mtl.sampler_cache.capacity); + _sg_mtl_sampler_cache_item_t* new_item = &_sg.mtl.sampler_cache.items[_sg.mtl.sampler_cache.num_items++]; + new_item->min_filter = min_filter; + new_item->mag_filter = mag_filter; + new_item->wrap_u = wrap_u; + new_item->wrap_v = wrap_v; + new_item->wrap_w = wrap_w; + new_item->min_lod = min_lod; + new_item->max_lod = max_lod; + new_item->max_anisotropy = max_anisotropy; + new_item->border_color = border_color; + MTLSamplerDescriptor* mtl_desc = [[MTLSamplerDescriptor alloc] init]; + mtl_desc.sAddressMode = _sg_mtl_address_mode(wrap_u); + mtl_desc.tAddressMode = _sg_mtl_address_mode(wrap_v); + if (SG_IMAGETYPE_3D == img_desc->type) { + mtl_desc.rAddressMode = _sg_mtl_address_mode(wrap_w); + } + #if defined(_SG_TARGET_MACOS) + mtl_desc.borderColor = _sg_mtl_border_color(border_color); + #endif + mtl_desc.minFilter = _sg_mtl_minmag_filter(min_filter); + mtl_desc.magFilter = _sg_mtl_minmag_filter(mag_filter); + mtl_desc.mipFilter = _sg_mtl_mip_filter(min_filter); + mtl_desc.lodMinClamp = img_desc->min_lod; + mtl_desc.lodMaxClamp = img_desc->max_lod; + mtl_desc.maxAnisotropy = max_anisotropy; + mtl_desc.normalizedCoordinates = YES; + id mtl_sampler = [mtl_device newSamplerStateWithDescriptor:mtl_desc]; + new_item->mtl_sampler_state = _sg_mtl_add_resource(mtl_sampler); + return new_item->mtl_sampler_state; +} + +_SOKOL_PRIVATE void _sg_mtl_clear_state_cache(void) { + memset(&_sg.mtl.state_cache, 0, sizeof(_sg.mtl.state_cache)); +} + +/* https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf */ +_SOKOL_PRIVATE void _sg_mtl_init_caps(void) { + #if defined(_SG_TARGET_MACOS) + _sg.backend = SG_BACKEND_METAL_MACOS; + #elif defined(_SG_TARGET_IOS) + #if defined(_SG_TARGET_IOS_SIMULATOR) + _sg.backend = SG_BACKEND_METAL_SIMULATOR; + #else + _sg.backend = SG_BACKEND_METAL_IOS; + #endif + #endif + _sg.features.instancing = true; + _sg.features.origin_top_left = true; + _sg.features.multiple_render_targets = true; + _sg.features.msaa_render_targets = true; + _sg.features.imagetype_3d = true; + _sg.features.imagetype_array = true; + #if defined(_SG_TARGET_MACOS) + _sg.features.image_clamp_to_border = true; + #else + _sg.features.image_clamp_to_border = false; + #endif + + #if defined(_SG_TARGET_MACOS) + _sg.limits.max_image_size_2d = 16 * 1024; + _sg.limits.max_image_size_cube = 16 * 1024; + _sg.limits.max_image_size_3d = 2 * 1024; + _sg.limits.max_image_size_array = 16 * 1024; + _sg.limits.max_image_array_layers = 2 * 1024; + #else + /* newer iOS devices support 16k textures */ + _sg.limits.max_image_size_2d = 8 * 1024; + _sg.limits.max_image_size_cube = 8 * 1024; + _sg.limits.max_image_size_3d = 2 * 1024; + _sg.limits.max_image_size_array = 8 * 1024; + _sg.limits.max_image_array_layers = 2 * 1024; + #endif + _sg.limits.max_vertex_attrs = SG_MAX_VERTEX_ATTRIBUTES; + + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R8]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R8SN]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R8UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R8SI]); + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R16]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R16SN]); + #else + _sg_pixelformat_sfbr(&_sg.formats[SG_PIXELFORMAT_R16]); + _sg_pixelformat_sfbr(&_sg.formats[SG_PIXELFORMAT_R16SN]); + #endif + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R16UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_R16SI]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R16F]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG8]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG8SN]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG8UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG8SI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_R32UI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_R32SI]); + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_R32F]); + #else + _sg_pixelformat_sbr(&_sg.formats[SG_PIXELFORMAT_R32F]); + #endif + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG16]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG16SN]); + #else + _sg_pixelformat_sfbr(&_sg.formats[SG_PIXELFORMAT_RG16]); + _sg_pixelformat_sfbr(&_sg.formats[SG_PIXELFORMAT_RG16SN]); + #endif + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG16UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG16SI]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG16F]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA8]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA8SN]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA8UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA8SI]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_BGRA8]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGB10A2]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG11B10F]); + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG32UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RG32SI]); + #else + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_RG32UI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_RG32SI]); + #endif + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RG32F]); + #else + _sg_pixelformat_sbr(&_sg.formats[SG_PIXELFORMAT_RG32F]); + #endif + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16SN]); + #else + _sg_pixelformat_sfbr(&_sg.formats[SG_PIXELFORMAT_RGBA16]); + _sg_pixelformat_sfbr(&_sg.formats[SG_PIXELFORMAT_RGBA16SN]); + #endif + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA16UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA16SI]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA16F]); + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA32UI]); + _sg_pixelformat_srm(&_sg.formats[SG_PIXELFORMAT_RGBA32SI]); + _sg_pixelformat_all(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + #else + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_RGBA32UI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_RGBA32SI]); + _sg_pixelformat_sr(&_sg.formats[SG_PIXELFORMAT_RGBA32F]); + #endif + _sg_pixelformat_srmd(&_sg.formats[SG_PIXELFORMAT_DEPTH]); + _sg_pixelformat_srmd(&_sg.formats[SG_PIXELFORMAT_DEPTH_STENCIL]); + #if defined(_SG_TARGET_MACOS) + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC1_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC2_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC3_RGBA]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_R]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC4_RSN]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC5_RG]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC5_RGSN]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBF]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC6H_RGBUF]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_BC7_RGBA]); + #else + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGB_2BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGB_4BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGBA_2BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_PVRTC_RGBA_4BPP]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGB8A1]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RGBA8]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11]); + _sg_pixelformat_sf(&_sg.formats[SG_PIXELFORMAT_ETC2_RG11SN]); + #endif +} + +/*-- main Metal backend state and functions ----------------------------------*/ +_SOKOL_PRIVATE void _sg_setup_backend(const sg_desc* desc) { + /* assume already zero-initialized */ + SOKOL_ASSERT(desc); + SOKOL_ASSERT(desc->mtl_device); + SOKOL_ASSERT(desc->mtl_renderpass_descriptor_cb); + SOKOL_ASSERT(desc->mtl_drawable_cb); + SOKOL_ASSERT(desc->mtl_global_uniform_buffer_size > 0); + _sg_mtl_init_pool(desc); + _sg_mtl_init_sampler_cache(desc); + _sg_mtl_clear_state_cache(); + _sg.mtl.valid = true; + _sg.mtl.renderpass_descriptor_cb = desc->mtl_renderpass_descriptor_cb; + _sg.mtl.drawable_cb = desc->mtl_drawable_cb; + _sg.mtl.frame_index = 1; + _sg.mtl.ub_size = desc->mtl_global_uniform_buffer_size; + _sg_mtl_sem = dispatch_semaphore_create(SG_NUM_INFLIGHT_FRAMES); + _sg_mtl_device = (__bridge id) desc->mtl_device; + _sg_mtl_cmd_queue = [_sg_mtl_device newCommandQueue]; + MTLResourceOptions res_opts = MTLResourceCPUCacheModeWriteCombined; + #if defined(_SG_TARGET_MACOS) + res_opts |= MTLResourceStorageModeManaged; + #endif + for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { + _sg_mtl_uniform_buffers[i] = [_sg_mtl_device + newBufferWithLength:_sg.mtl.ub_size + options:res_opts + ]; + } + _sg_mtl_init_caps(); +} + +_SOKOL_PRIVATE void _sg_discard_backend(void) { + SOKOL_ASSERT(_sg.mtl.valid); + /* wait for the last frame to finish */ + for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { + dispatch_semaphore_wait(_sg_mtl_sem, DISPATCH_TIME_FOREVER); + } + _sg_mtl_destroy_sampler_cache(_sg.mtl.frame_index); + _sg_mtl_garbage_collect(_sg.mtl.frame_index + SG_NUM_INFLIGHT_FRAMES + 2); + _sg_mtl_destroy_pool(); + _sg.mtl.valid = false; + _sg_mtl_cmd_encoder = nil; + _sg_mtl_cmd_buffer = nil; + _sg_mtl_cmd_queue = nil; + for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { + _sg_mtl_uniform_buffers[i] = nil; + } + _sg_mtl_device = nil; +} + +_SOKOL_PRIVATE void _sg_reset_state_cache(void) { + _sg_mtl_clear_state_cache(); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + _SOKOL_UNUSED(ctx); + /* empty */ +} + +_SOKOL_PRIVATE void _sg_activate_context(_sg_context_t* ctx) { + _sg_reset_state_cache(); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_buffer(_sg_buffer_t* buf, const sg_buffer_desc* desc) { + SOKOL_ASSERT(buf && desc); + buf->size = desc->size; + buf->append_pos = 0; + buf->append_overflow = false; + buf->type = desc->type; + buf->usage = desc->usage; + buf->update_frame_index = 0; + buf->append_frame_index = 0; + buf->num_slots = (buf->usage == SG_USAGE_IMMUTABLE) ? 1 : SG_NUM_INFLIGHT_FRAMES; + buf->active_slot = 0; + const bool injected = (0 != desc->mtl_buffers[0]); + MTLResourceOptions mtl_options = _sg_mtl_buffer_resource_options(buf->usage); + for (int slot = 0; slot < buf->num_slots; slot++) { + id mtl_buf; + if (injected) { + SOKOL_ASSERT(desc->mtl_buffers[slot]); + mtl_buf = (__bridge id) desc->mtl_buffers[slot]; + } + else { + if (buf->usage == SG_USAGE_IMMUTABLE) { + SOKOL_ASSERT(desc->content); + mtl_buf = [_sg_mtl_device newBufferWithBytes:desc->content length:buf->size options:mtl_options]; + } + else { + mtl_buf = [_sg_mtl_device newBufferWithLength:buf->size options:mtl_options]; + } + } + buf->mtl_buf[slot] = _sg_mtl_add_resource(mtl_buf); + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_buffer(_sg_buffer_t* buf) { + SOKOL_ASSERT(buf); + for (int slot = 0; slot < buf->num_slots; slot++) { + /* it's valid to call release resource with '0' */ + _sg_mtl_release_resource(_sg.mtl.frame_index, buf->mtl_buf[slot]); + } +} + +_SOKOL_PRIVATE void _sg_mtl_copy_image_content(const _sg_image_t* img, __unsafe_unretained id mtl_tex, const sg_image_content* content) { + const int num_faces = (img->type == SG_IMAGETYPE_CUBE) ? 6:1; + const int num_slices = (img->type == SG_IMAGETYPE_ARRAY) ? img->depth : 1; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int mip_index = 0; mip_index < img->num_mipmaps; mip_index++) { + SOKOL_ASSERT(content->subimage[face_index][mip_index].ptr); + SOKOL_ASSERT(content->subimage[face_index][mip_index].size > 0); + const uint8_t* data_ptr = (const uint8_t*)content->subimage[face_index][mip_index].ptr; + const int mip_width = _sg_max(img->width >> mip_index, 1); + const int mip_height = _sg_max(img->height >> mip_index, 1); + /* special case PVRTC formats: bytePerRow must be 0 */ + int bytes_per_row = 0; + int bytes_per_slice = _sg_surface_pitch(img->pixel_format, mip_width, mip_height); + if (!_sg_mtl_is_pvrtc(img->pixel_format)) { + bytes_per_row = _sg_row_pitch(img->pixel_format, mip_width); + } + MTLRegion region; + if (img->type == SG_IMAGETYPE_3D) { + const int mip_depth = _sg_max(img->depth >> mip_index, 1); + region = MTLRegionMake3D(0, 0, 0, mip_width, mip_height, mip_depth); + /* FIXME: apparently the minimal bytes_per_image size for 3D texture + is 4 KByte... somehow need to handle this */ + } + else { + region = MTLRegionMake2D(0, 0, mip_width, mip_height); + } + for (int slice_index = 0; slice_index < num_slices; slice_index++) { + const int mtl_slice_index = (img->type == SG_IMAGETYPE_CUBE) ? face_index : slice_index; + const int slice_offset = slice_index * bytes_per_slice; + SOKOL_ASSERT((slice_offset + bytes_per_slice) <= (int)content->subimage[face_index][mip_index].size); + [mtl_tex replaceRegion:region + mipmapLevel:mip_index + slice:mtl_slice_index + withBytes:data_ptr + slice_offset + bytesPerRow:bytes_per_row + bytesPerImage:bytes_per_slice]; + } + } + } +} + +/* + FIXME: METAL RESOURCE STORAGE MODE FOR macOS AND iOS + + For immutable textures on macOS, the recommended procedure is to create + a MTLStorageModeManaged texture with the immutable content first, + and then use the GPU to blit the content into a MTLStorageModePrivate + texture before the first use. + + On iOS use the same one-time-blit procedure, but from a + MTLStorageModeShared to a MTLStorageModePrivate texture. + + It probably makes sense to handle this in a separate 'resource manager' + with a recycable pool of blit-source-textures? +*/ + +/* initialize MTLTextureDescritor with common attributes */ +_SOKOL_PRIVATE bool _sg_mtl_init_texdesc_common(MTLTextureDescriptor* mtl_desc, _sg_image_t* img) { + mtl_desc.textureType = _sg_mtl_texture_type(img->type); + mtl_desc.pixelFormat = _sg_mtl_pixel_format(img->pixel_format); + if (MTLPixelFormatInvalid == mtl_desc.pixelFormat) { + SOKOL_LOG("Unsupported texture pixel format!\n"); + return false; + } + mtl_desc.width = img->width; + mtl_desc.height = img->height; + if (SG_IMAGETYPE_3D == img->type) { + mtl_desc.depth = img->depth; + } + else { + mtl_desc.depth = 1; + } + mtl_desc.mipmapLevelCount = img->num_mipmaps; + if (SG_IMAGETYPE_ARRAY == img->type) { + mtl_desc.arrayLength = img->depth; + } + else { + mtl_desc.arrayLength = 1; + } + mtl_desc.usage = MTLTextureUsageShaderRead; + if (img->usage != SG_USAGE_IMMUTABLE) { + mtl_desc.cpuCacheMode = MTLCPUCacheModeWriteCombined; + } + #if defined(_SG_TARGET_MACOS) + /* macOS: use managed textures */ + mtl_desc.resourceOptions = MTLResourceStorageModeManaged; + mtl_desc.storageMode = MTLStorageModeManaged; + #else + /* iOS: use CPU/GPU shared memory */ + mtl_desc.resourceOptions = MTLResourceStorageModeShared; + mtl_desc.storageMode = MTLStorageModeShared; + #endif + return true; +} + +/* initialize MTLTextureDescritor with rendertarget attributes */ +_SOKOL_PRIVATE void _sg_mtl_init_texdesc_rt(MTLTextureDescriptor* mtl_desc, _sg_image_t* img) { + SOKOL_ASSERT(img->render_target); + /* reset the cpuCacheMode to 'default' */ + mtl_desc.cpuCacheMode = MTLCPUCacheModeDefaultCache; + /* render targets are only visible to the GPU */ + mtl_desc.resourceOptions = MTLResourceStorageModePrivate; + mtl_desc.storageMode = MTLStorageModePrivate; + /* non-MSAA render targets are shader-readable */ + mtl_desc.usage = MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget; +} + +/* initialize MTLTextureDescritor with MSAA attributes */ +_SOKOL_PRIVATE void _sg_mtl_init_texdesc_rt_msaa(MTLTextureDescriptor* mtl_desc, _sg_image_t* img) { + SOKOL_ASSERT(img->sample_count > 1); + /* reset the cpuCacheMode to 'default' */ + mtl_desc.cpuCacheMode = MTLCPUCacheModeDefaultCache; + /* render targets are only visible to the GPU */ + mtl_desc.resourceOptions = MTLResourceStorageModePrivate; + mtl_desc.storageMode = MTLStorageModePrivate; + /* MSAA render targets are not shader-readable (instead they are resolved) */ + mtl_desc.usage = MTLTextureUsageRenderTarget; + mtl_desc.textureType = MTLTextureType2DMultisample; + mtl_desc.depth = 1; + mtl_desc.arrayLength = 1; + mtl_desc.mipmapLevelCount = 1; + mtl_desc.sampleCount = img->sample_count; +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_image(_sg_image_t* img, const sg_image_desc* desc) { + SOKOL_ASSERT(img && desc); + img->type = desc->type; + img->render_target = desc->render_target; + img->width = desc->width; + img->height = desc->height; + img->depth = desc->depth; + img->num_mipmaps = desc->num_mipmaps; + img->usage = desc->usage; + img->pixel_format = desc->pixel_format; + img->sample_count = desc->sample_count; + img->min_filter = desc->min_filter; + img->mag_filter = desc->mag_filter; + img->wrap_u = desc->wrap_u; + img->wrap_v = desc->wrap_v; + img->wrap_w = desc->wrap_w; + img->max_anisotropy = desc->max_anisotropy; + img->upd_frame_index = 0; + img->num_slots = (img->usage == SG_USAGE_IMMUTABLE) ? 1 :SG_NUM_INFLIGHT_FRAMES; + img->active_slot = 0; + const bool injected = (0 != desc->mtl_textures[0]); + const bool msaa = (img->sample_count > 1); + + /* first initialize all Metal resource pool slots to 'empty' */ + for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { + img->mtl_tex[i] = _sg_mtl_add_resource(nil); + } + img->mtl_sampler_state = _sg_mtl_add_resource(nil); + img->mtl_depth_tex = _sg_mtl_add_resource(nil); + img->mtl_msaa_tex = _sg_mtl_add_resource(nil); + + /* initialize a Metal texture descriptor with common attributes */ + MTLTextureDescriptor* mtl_desc = [[MTLTextureDescriptor alloc] init]; + if (!_sg_mtl_init_texdesc_common(mtl_desc, img)) { + return SG_RESOURCESTATE_FAILED; + } + + /* special case depth-stencil-buffer? */ + if (_sg_is_valid_rendertarget_depth_format(img->pixel_format)) { + /* depth-stencil buffer texture must always be a render target */ + SOKOL_ASSERT(img->render_target); + SOKOL_ASSERT(img->type == SG_IMAGETYPE_2D); + SOKOL_ASSERT(img->num_mipmaps == 1); + SOKOL_ASSERT(!injected); + if (msaa) { + _sg_mtl_init_texdesc_rt_msaa(mtl_desc, img); + } + else { + _sg_mtl_init_texdesc_rt(mtl_desc, img); + } + id tex = [_sg_mtl_device newTextureWithDescriptor:mtl_desc]; + SOKOL_ASSERT(nil != tex); + img->mtl_depth_tex = _sg_mtl_add_resource(tex); + } + else { + /* create the color texture + In case this is a render target without MSAA, add the relevant + render-target descriptor attributes. + In case this is a render target *with* MSAA, the color texture + will serve as MSAA-resolve target (not as render target), and rendering + will go into a separate render target texture of type + MTLTextureType2DMultisample. + */ + if (img->render_target && !msaa) { + _sg_mtl_init_texdesc_rt(mtl_desc, img); + } + for (int slot = 0; slot < img->num_slots; slot++) { + id tex; + if (injected) { + SOKOL_ASSERT(desc->mtl_textures[slot]); + tex = (__bridge id) desc->mtl_textures[slot]; + } + else { + tex = [_sg_mtl_device newTextureWithDescriptor:mtl_desc]; + if ((img->usage == SG_USAGE_IMMUTABLE) && !img->render_target) { + _sg_mtl_copy_image_content(img, tex, &desc->content); + } + } + img->mtl_tex[slot] = _sg_mtl_add_resource(tex); + } + + /* if MSAA color render target, create an additional MSAA render-surface texture */ + if (img->render_target && msaa) { + _sg_mtl_init_texdesc_rt_msaa(mtl_desc, img); + id tex = [_sg_mtl_device newTextureWithDescriptor:mtl_desc]; + img->mtl_msaa_tex = _sg_mtl_add_resource(tex); + } + + /* create (possibly shared) sampler state */ + img->mtl_sampler_state = _sg_mtl_create_sampler(_sg_mtl_device, desc); + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_image(_sg_image_t* img) { + SOKOL_ASSERT(img); + /* it's valid to call release resource with a 'null resource' */ + for (int slot = 0; slot < img->num_slots; slot++) { + _sg_mtl_release_resource(_sg.mtl.frame_index, img->mtl_tex[slot]); + } + _sg_mtl_release_resource(_sg.mtl.frame_index, img->mtl_depth_tex); + _sg_mtl_release_resource(_sg.mtl.frame_index, img->mtl_msaa_tex); + /* NOTE: sampler state objects are shared and not released until shutdown */ +} + +_SOKOL_PRIVATE id _sg_mtl_compile_library(const char* src) { + NSError* err = NULL; + id lib = [_sg_mtl_device + newLibraryWithSource:[NSString stringWithUTF8String:src] + options:nil + error:&err + ]; + if (err) { + SOKOL_LOG([err.localizedDescription UTF8String]); + } + return lib; +} + +_SOKOL_PRIVATE id _sg_mtl_library_from_bytecode(const uint8_t* ptr, int num_bytes) { + NSError* err = NULL; + dispatch_data_t lib_data = dispatch_data_create(ptr, num_bytes, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + id lib = [_sg_mtl_device newLibraryWithData:lib_data error:&err]; + if (err) { + SOKOL_LOG([err.localizedDescription UTF8String]); + } + return lib; +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_shader(_sg_shader_t* shd, const sg_shader_desc* desc) { + SOKOL_ASSERT(shd && desc); + + /* uniform block sizes and image types */ + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const sg_shader_stage_desc* stage_desc = (stage_index == SG_SHADERSTAGE_VS) ? &desc->vs : &desc->fs; + _sg_shader_stage_t* stage = &shd->stage[stage_index]; + SOKOL_ASSERT(stage->num_uniform_blocks == 0); + for (int ub_index = 0; ub_index < SG_MAX_SHADERSTAGE_UBS; ub_index++) { + const sg_shader_uniform_block_desc* ub_desc = &stage_desc->uniform_blocks[ub_index]; + if (0 == ub_desc->size) { + break; + } + _sg_uniform_block_t* ub = &stage->uniform_blocks[ub_index]; + ub->size = ub_desc->size; + stage->num_uniform_blocks++; + } + SOKOL_ASSERT(stage->num_images == 0); + for (int img_index = 0; img_index < SG_MAX_SHADERSTAGE_IMAGES; img_index++) { + const sg_shader_image_desc* img_desc = &stage_desc->images[img_index]; + if (img_desc->type == _SG_IMAGETYPE_DEFAULT) { + break; + } + stage->images[img_index].type = img_desc->type; + stage->num_images++; + } + } + + /* create metal libray objects and lookup entry functions */ + id vs_lib; + id fs_lib; + id vs_func; + id fs_func; + const char* vs_entry = desc->vs.entry; + const char* fs_entry = desc->fs.entry; + if (desc->vs.byte_code && desc->fs.byte_code) { + /* separate byte code provided */ + vs_lib = _sg_mtl_library_from_bytecode(desc->vs.byte_code, desc->vs.byte_code_size); + fs_lib = _sg_mtl_library_from_bytecode(desc->fs.byte_code, desc->fs.byte_code_size); + if (nil == vs_lib || nil == fs_lib) { + return SG_RESOURCESTATE_FAILED; + } + vs_func = [vs_lib newFunctionWithName:[NSString stringWithUTF8String:vs_entry]]; + fs_func = [fs_lib newFunctionWithName:[NSString stringWithUTF8String:fs_entry]]; + } + else if (desc->vs.source && desc->fs.source) { + /* separate sources provided */ + vs_lib = _sg_mtl_compile_library(desc->vs.source); + fs_lib = _sg_mtl_compile_library(desc->fs.source); + if (nil == vs_lib || nil == fs_lib) { + return SG_RESOURCESTATE_FAILED; + } + vs_func = [vs_lib newFunctionWithName:[NSString stringWithUTF8String:vs_entry]]; + fs_func = [fs_lib newFunctionWithName:[NSString stringWithUTF8String:fs_entry]]; + } + else { + return SG_RESOURCESTATE_FAILED; + } + if (nil == vs_func) { + SOKOL_LOG("vertex shader entry function not found\n"); + return SG_RESOURCESTATE_FAILED; + } + if (nil == fs_func) { + SOKOL_LOG("fragment shader entry function not found\n"); + return SG_RESOURCESTATE_FAILED; + } + /* it is legal to call _sg_mtl_add_resource with a nil value, this will return a special 0xFFFFFFFF index */ + shd->stage[SG_SHADERSTAGE_VS].mtl_lib = _sg_mtl_add_resource(vs_lib); + shd->stage[SG_SHADERSTAGE_FS].mtl_lib = _sg_mtl_add_resource(fs_lib); + shd->stage[SG_SHADERSTAGE_VS].mtl_func = _sg_mtl_add_resource(vs_func); + shd->stage[SG_SHADERSTAGE_FS].mtl_func = _sg_mtl_add_resource(fs_func); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_shader(_sg_shader_t* shd) { + SOKOL_ASSERT(shd); + /* it is valid to call _sg_mtl_release_resource with a 'null resource' */ + _sg_mtl_release_resource(_sg.mtl.frame_index, shd->stage[SG_SHADERSTAGE_VS].mtl_func); + _sg_mtl_release_resource(_sg.mtl.frame_index, shd->stage[SG_SHADERSTAGE_VS].mtl_lib); + _sg_mtl_release_resource(_sg.mtl.frame_index, shd->stage[SG_SHADERSTAGE_FS].mtl_func); + _sg_mtl_release_resource(_sg.mtl.frame_index, shd->stage[SG_SHADERSTAGE_FS].mtl_lib); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pipeline(_sg_pipeline_t* pip, _sg_shader_t* shd, const sg_pipeline_desc* desc) { + SOKOL_ASSERT(pip && shd && desc); + SOKOL_ASSERT(desc->shader.id == shd->slot.id); + + pip->shader = shd; + pip->shader_id = desc->shader; + pip->color_attachment_count = desc->blend.color_attachment_count; + pip->color_format = desc->blend.color_format; + pip->depth_format = desc->blend.depth_format; + pip->sample_count = desc->rasterizer.sample_count; + pip->depth_bias = desc->rasterizer.depth_bias; + pip->depth_bias_slope_scale = desc->rasterizer.depth_bias_slope_scale; + pip->depth_bias_clamp = desc->rasterizer.depth_bias_clamp; + sg_primitive_type prim_type = desc->primitive_type; + pip->mtl_prim_type = _sg_mtl_primitive_type(prim_type); + pip->index_type = desc->index_type; + pip->mtl_index_size = _sg_mtl_index_size(pip->index_type); + if (SG_INDEXTYPE_NONE != pip->index_type) { + pip->mtl_index_type = _sg_mtl_index_type(pip->index_type); + } + pip->mtl_cull_mode = _sg_mtl_cull_mode(desc->rasterizer.cull_mode); + pip->mtl_winding = _sg_mtl_winding(desc->rasterizer.face_winding); + pip->mtl_stencil_ref = desc->depth_stencil.stencil_ref; + for (int i = 0; i < 4; i++) { + pip->blend_color[i] = desc->blend.blend_color[i]; + } + + /* create vertex-descriptor */ + MTLVertexDescriptor* vtx_desc = [MTLVertexDescriptor vertexDescriptor]; + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + const sg_vertex_attr_desc* a_desc = &desc->layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + break; + } + SOKOL_ASSERT((a_desc->buffer_index >= 0) && (a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS)); + vtx_desc.attributes[attr_index].format = _sg_mtl_vertex_format(a_desc->format); + vtx_desc.attributes[attr_index].offset = a_desc->offset; + vtx_desc.attributes[attr_index].bufferIndex = a_desc->buffer_index + SG_MAX_SHADERSTAGE_UBS; + pip->vertex_layout_valid[a_desc->buffer_index] = true; + } + for (int layout_index = 0; layout_index < SG_MAX_SHADERSTAGE_BUFFERS; layout_index++) { + if (pip->vertex_layout_valid[layout_index]) { + const sg_buffer_layout_desc* l_desc = &desc->layout.buffers[layout_index]; + const int mtl_vb_slot = layout_index + SG_MAX_SHADERSTAGE_UBS; + SOKOL_ASSERT(l_desc->stride > 0); + vtx_desc.layouts[mtl_vb_slot].stride = l_desc->stride; + vtx_desc.layouts[mtl_vb_slot].stepFunction = _sg_mtl_step_function(l_desc->step_func); + vtx_desc.layouts[mtl_vb_slot].stepRate = l_desc->step_rate; + } + } + + /* render-pipeline descriptor */ + MTLRenderPipelineDescriptor* rp_desc = [[MTLRenderPipelineDescriptor alloc] init]; + rp_desc.vertexDescriptor = vtx_desc; + SOKOL_ASSERT(shd->stage[SG_SHADERSTAGE_VS].mtl_func != _SG_MTL_INVALID_SLOT_INDEX); + rp_desc.vertexFunction = _sg_mtl_idpool[shd->stage[SG_SHADERSTAGE_VS].mtl_func]; + SOKOL_ASSERT(shd->stage[SG_SHADERSTAGE_FS].mtl_func != _SG_MTL_INVALID_SLOT_INDEX); + rp_desc.fragmentFunction = _sg_mtl_idpool[shd->stage[SG_SHADERSTAGE_FS].mtl_func]; + rp_desc.sampleCount = desc->rasterizer.sample_count; + rp_desc.alphaToCoverageEnabled = desc->rasterizer.alpha_to_coverage_enabled; + rp_desc.alphaToOneEnabled = NO; + rp_desc.rasterizationEnabled = YES; + rp_desc.depthAttachmentPixelFormat = _sg_mtl_pixel_format(desc->blend.depth_format); + if (desc->blend.depth_format == SG_PIXELFORMAT_DEPTH_STENCIL) { + rp_desc.stencilAttachmentPixelFormat = _sg_mtl_pixel_format(desc->blend.depth_format); + } + /* FIXME: this only works on macOS 10.13! + for (int i = 0; i < (SG_MAX_SHADERSTAGE_UBS+SG_MAX_SHADERSTAGE_BUFFERS); i++) { + rp_desc.vertexBuffers[i].mutability = MTLMutabilityImmutable; + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_UBS; i++) { + rp_desc.fragmentBuffers[i].mutability = MTLMutabilityImmutable; + } + */ + const int att_count = desc->blend.color_attachment_count; + for (int i = 0; i < att_count; i++) { + rp_desc.colorAttachments[i].pixelFormat = _sg_mtl_pixel_format(desc->blend.color_format); + rp_desc.colorAttachments[i].writeMask = _sg_mtl_color_write_mask((sg_color_mask)desc->blend.color_write_mask); + rp_desc.colorAttachments[i].blendingEnabled = desc->blend.enabled; + rp_desc.colorAttachments[i].alphaBlendOperation = _sg_mtl_blend_op(desc->blend.op_alpha); + rp_desc.colorAttachments[i].rgbBlendOperation = _sg_mtl_blend_op(desc->blend.op_rgb); + rp_desc.colorAttachments[i].destinationAlphaBlendFactor = _sg_mtl_blend_factor(desc->blend.dst_factor_alpha); + rp_desc.colorAttachments[i].destinationRGBBlendFactor = _sg_mtl_blend_factor(desc->blend.dst_factor_rgb); + rp_desc.colorAttachments[i].sourceAlphaBlendFactor = _sg_mtl_blend_factor(desc->blend.src_factor_alpha); + rp_desc.colorAttachments[i].sourceRGBBlendFactor = _sg_mtl_blend_factor(desc->blend.src_factor_rgb); + } + NSError* err = NULL; + id mtl_rps = [_sg_mtl_device newRenderPipelineStateWithDescriptor:rp_desc error:&err]; + if (nil == mtl_rps) { + SOKOL_ASSERT(err); + SOKOL_LOG([err.localizedDescription UTF8String]); + return SG_RESOURCESTATE_FAILED; + } + + /* depth-stencil-state */ + MTLDepthStencilDescriptor* ds_desc = [[MTLDepthStencilDescriptor alloc] init]; + ds_desc.depthCompareFunction = _sg_mtl_compare_func(desc->depth_stencil.depth_compare_func); + ds_desc.depthWriteEnabled = desc->depth_stencil.depth_write_enabled; + if (desc->depth_stencil.stencil_enabled) { + const sg_stencil_state* sb = &desc->depth_stencil.stencil_back; + ds_desc.backFaceStencil = [[MTLStencilDescriptor alloc] init]; + ds_desc.backFaceStencil.stencilFailureOperation = _sg_mtl_stencil_op(sb->fail_op); + ds_desc.backFaceStencil.depthFailureOperation = _sg_mtl_stencil_op(sb->depth_fail_op); + ds_desc.backFaceStencil.depthStencilPassOperation = _sg_mtl_stencil_op(sb->pass_op); + ds_desc.backFaceStencil.stencilCompareFunction = _sg_mtl_compare_func(sb->compare_func); + ds_desc.backFaceStencil.readMask = desc->depth_stencil.stencil_read_mask; + ds_desc.backFaceStencil.writeMask = desc->depth_stencil.stencil_write_mask; + const sg_stencil_state* sf = &desc->depth_stencil.stencil_front; + ds_desc.frontFaceStencil = [[MTLStencilDescriptor alloc] init]; + ds_desc.frontFaceStencil.stencilFailureOperation = _sg_mtl_stencil_op(sf->fail_op); + ds_desc.frontFaceStencil.depthFailureOperation = _sg_mtl_stencil_op(sf->depth_fail_op); + ds_desc.frontFaceStencil.depthStencilPassOperation = _sg_mtl_stencil_op(sf->pass_op); + ds_desc.frontFaceStencil.stencilCompareFunction = _sg_mtl_compare_func(sf->compare_func); + ds_desc.frontFaceStencil.readMask = desc->depth_stencil.stencil_read_mask; + ds_desc.frontFaceStencil.writeMask = desc->depth_stencil.stencil_write_mask; + } + id mtl_dss = [_sg_mtl_device newDepthStencilStateWithDescriptor:ds_desc]; + + pip->mtl_rps = _sg_mtl_add_resource(mtl_rps); + pip->mtl_dss = _sg_mtl_add_resource(mtl_dss); + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + /* it's valid to call release resource with a 'null resource' */ + _sg_mtl_release_resource(_sg.mtl.frame_index, pip->mtl_rps); + _sg_mtl_release_resource(_sg.mtl.frame_index, pip->mtl_dss); +} + +_SOKOL_PRIVATE sg_resource_state _sg_create_pass(_sg_pass_t* pass, _sg_image_t** att_images, const sg_pass_desc* desc) { + SOKOL_ASSERT(pass && desc); + SOKOL_ASSERT(att_images && att_images[0]); + + /* copy image pointers and desc attributes */ + const sg_attachment_desc* att_desc; + _sg_attachment_t* att; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + SOKOL_ASSERT(0 == pass->color_atts[i].image); + att_desc = &desc->color_attachments[i]; + if (att_desc->image.id != SG_INVALID_ID) { + pass->num_color_atts++; + SOKOL_ASSERT(att_images[i] && (att_images[i]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_color_format(att_images[i]->pixel_format)); + att = &pass->color_atts[i]; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[i]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + } + } + SOKOL_ASSERT(0 == pass->ds_att.image); + att_desc = &desc->depth_stencil_attachment; + const int ds_img_index = SG_MAX_COLOR_ATTACHMENTS; + if (att_desc->image.id != SG_INVALID_ID) { + SOKOL_ASSERT(att_images[ds_img_index] && (att_images[ds_img_index]->slot.id == att_desc->image.id)); + SOKOL_ASSERT(_sg_is_valid_rendertarget_depth_format(att_images[ds_img_index]->pixel_format)); + att = &pass->ds_att; + SOKOL_ASSERT((att->image == 0) && (att->image_id.id == SG_INVALID_ID)); + att->image = att_images[ds_img_index]; + att->image_id = att_desc->image; + att->mip_level = att_desc->mip_level; + att->slice = att_desc->slice; + } + return SG_RESOURCESTATE_VALID; +} + +_SOKOL_PRIVATE void _sg_destroy_pass(_sg_pass_t* pass) { + SOKOL_ASSERT(pass); + _SOKOL_UNUSED(pass); +} + +_SOKOL_PRIVATE void _sg_begin_pass(_sg_pass_t* pass, const sg_pass_action* action, int w, int h) { + SOKOL_ASSERT(action); + SOKOL_ASSERT(!_sg.mtl.in_pass); + SOKOL_ASSERT(_sg_mtl_cmd_queue); + SOKOL_ASSERT(!_sg_mtl_cmd_encoder); + SOKOL_ASSERT(_sg.mtl.renderpass_descriptor_cb); + _sg.mtl.in_pass = true; + _sg.mtl.cur_width = w; + _sg.mtl.cur_height = h; + _sg_mtl_clear_state_cache(); + + /* if this is the first pass in the frame, create a command buffer */ + if (nil == _sg_mtl_cmd_buffer) { + /* block until the oldest frame in flight has finished */ + dispatch_semaphore_wait(_sg_mtl_sem, DISPATCH_TIME_FOREVER); + _sg_mtl_cmd_buffer = [_sg_mtl_cmd_queue commandBufferWithUnretainedReferences]; + } + + /* if this is first pass in frame, get uniform buffer base pointer */ + if (0 == _sg.mtl.cur_ub_base_ptr) { + _sg.mtl.cur_ub_base_ptr = (uint8_t*)[_sg_mtl_uniform_buffers[_sg.mtl.cur_frame_rotate_index] contents]; + } + + /* initialize a render pass descriptor */ + MTLRenderPassDescriptor* pass_desc = nil; + if (pass) { + /* offscreen render pass */ + pass_desc = [MTLRenderPassDescriptor renderPassDescriptor]; + } + else { + /* default render pass, call user-provided callback to provide render pass descriptor */ + pass_desc = (__bridge MTLRenderPassDescriptor*) _sg.mtl.renderpass_descriptor_cb(); + + } + if (pass_desc) { + _sg.mtl.pass_valid = true; + } + else { + /* default pass descriptor will not be valid if window is minimized, + don't do any rendering in this case */ + _sg.mtl.pass_valid = false; + return; + } + if (pass) { + /* setup pass descriptor for offscreen rendering */ + SOKOL_ASSERT(pass->slot.state == SG_RESOURCESTATE_VALID); + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + const _sg_attachment_t* att = &pass->color_atts[i]; + if (0 == att->image) { + break; + } + SOKOL_ASSERT(att->image->slot.state == SG_RESOURCESTATE_VALID); + SOKOL_ASSERT(att->image->slot.id == att->image_id.id); + const bool is_msaa = (att->image->sample_count > 1); + pass_desc.colorAttachments[i].loadAction = _sg_mtl_load_action(action->colors[i].action); + pass_desc.colorAttachments[i].storeAction = is_msaa ? MTLStoreActionMultisampleResolve : MTLStoreActionStore; + const float* c = &(action->colors[i].val[0]); + pass_desc.colorAttachments[i].clearColor = MTLClearColorMake(c[0], c[1], c[2], c[3]); + if (is_msaa) { + SOKOL_ASSERT(att->image->mtl_msaa_tex != _SG_MTL_INVALID_SLOT_INDEX); + SOKOL_ASSERT(att->image->mtl_tex[att->image->active_slot] != _SG_MTL_INVALID_SLOT_INDEX); + pass_desc.colorAttachments[i].texture = _sg_mtl_idpool[att->image->mtl_msaa_tex]; + pass_desc.colorAttachments[i].resolveTexture = _sg_mtl_idpool[att->image->mtl_tex[att->image->active_slot]]; + pass_desc.colorAttachments[i].resolveLevel = att->mip_level; + switch (att->image->type) { + case SG_IMAGETYPE_CUBE: + case SG_IMAGETYPE_ARRAY: + pass_desc.colorAttachments[i].resolveSlice = att->slice; + break; + case SG_IMAGETYPE_3D: + pass_desc.colorAttachments[i].resolveDepthPlane = att->slice; + break; + default: break; + } + } + else { + SOKOL_ASSERT(att->image->mtl_tex[att->image->active_slot] != _SG_MTL_INVALID_SLOT_INDEX); + pass_desc.colorAttachments[i].texture = _sg_mtl_idpool[att->image->mtl_tex[att->image->active_slot]]; + pass_desc.colorAttachments[i].level = att->mip_level; + switch (att->image->type) { + case SG_IMAGETYPE_CUBE: + case SG_IMAGETYPE_ARRAY: + pass_desc.colorAttachments[i].slice = att->slice; + break; + case SG_IMAGETYPE_3D: + pass_desc.colorAttachments[i].depthPlane = att->slice; + break; + default: break; + } + } + } + if (0 != pass->ds_att.image) { + const _sg_attachment_t* att = &pass->ds_att; + SOKOL_ASSERT(att->image->slot.state == SG_RESOURCESTATE_VALID); + SOKOL_ASSERT(att->image->slot.id == att->image_id.id); + SOKOL_ASSERT(att->image->mtl_depth_tex != _SG_MTL_INVALID_SLOT_INDEX); + pass_desc.depthAttachment.texture = _sg_mtl_idpool[att->image->mtl_depth_tex]; + pass_desc.depthAttachment.loadAction = _sg_mtl_load_action(action->depth.action); + pass_desc.depthAttachment.clearDepth = action->depth.val; + if (_sg_is_depth_stencil_format(att->image->pixel_format)) { + pass_desc.stencilAttachment.texture = _sg_mtl_idpool[att->image->mtl_depth_tex]; + pass_desc.stencilAttachment.loadAction = _sg_mtl_load_action(action->stencil.action); + pass_desc.stencilAttachment.clearStencil = action->stencil.val; + } + } + } + else { + /* setup pass descriptor for default rendering */ + pass_desc.colorAttachments[0].loadAction = _sg_mtl_load_action(action->colors[0].action); + const float* c = &(action->colors[0].val[0]); + pass_desc.colorAttachments[0].clearColor = MTLClearColorMake(c[0], c[1], c[2], c[3]); + pass_desc.depthAttachment.loadAction = _sg_mtl_load_action(action->depth.action); + pass_desc.depthAttachment.clearDepth = action->depth.val; + pass_desc.stencilAttachment.loadAction = _sg_mtl_load_action(action->stencil.action); + pass_desc.stencilAttachment.clearStencil = action->stencil.val; + } + + /* create a render command encoder, this might return nil if window is minimized */ + _sg_mtl_cmd_encoder = [_sg_mtl_cmd_buffer renderCommandEncoderWithDescriptor:pass_desc]; + if (_sg_mtl_cmd_encoder == nil) { + _sg.mtl.pass_valid = false; + return; + } + + /* bind the global uniform buffer, this only happens once per pass */ + for (int slot = 0; slot < SG_MAX_SHADERSTAGE_UBS; slot++) { + [_sg_mtl_cmd_encoder + setVertexBuffer:_sg_mtl_uniform_buffers[_sg.mtl.cur_frame_rotate_index] + offset:0 + atIndex:slot]; + [_sg_mtl_cmd_encoder + setFragmentBuffer:_sg_mtl_uniform_buffers[_sg.mtl.cur_frame_rotate_index] + offset:0 + atIndex:slot]; + } +} + +_SOKOL_PRIVATE void _sg_end_pass(void) { + SOKOL_ASSERT(_sg.mtl.in_pass); + _sg.mtl.in_pass = false; + _sg.mtl.pass_valid = false; + if (nil != _sg_mtl_cmd_encoder) { + [_sg_mtl_cmd_encoder endEncoding]; + _sg_mtl_cmd_encoder = nil; + } +} + +_SOKOL_PRIVATE void _sg_commit(void) { + SOKOL_ASSERT(!_sg.mtl.in_pass); + SOKOL_ASSERT(!_sg.mtl.pass_valid); + SOKOL_ASSERT(_sg.mtl.drawable_cb); + SOKOL_ASSERT(nil == _sg_mtl_cmd_encoder); + SOKOL_ASSERT(nil != _sg_mtl_cmd_buffer); + + #if defined(_SG_TARGET_MACOS) + [_sg_mtl_uniform_buffers[_sg.mtl.cur_frame_rotate_index] didModifyRange:NSMakeRange(0, _sg.mtl.cur_ub_offset)]; + #endif + + /* present, commit and signal semaphore when done */ + id cur_drawable = (__bridge id) _sg.mtl.drawable_cb(); + [_sg_mtl_cmd_buffer presentDrawable:cur_drawable]; + [_sg_mtl_cmd_buffer addCompletedHandler:^(id cmd_buffer) { + dispatch_semaphore_signal(_sg_mtl_sem); + }]; + [_sg_mtl_cmd_buffer commit]; + + /* garbage-collect resources pending for release */ + _sg_mtl_garbage_collect(_sg.mtl.frame_index); + + /* rotate uniform buffer slot */ + if (++_sg.mtl.cur_frame_rotate_index >= SG_NUM_INFLIGHT_FRAMES) { + _sg.mtl.cur_frame_rotate_index = 0; + } + _sg.mtl.frame_index++; + _sg.mtl.cur_ub_offset = 0; + _sg.mtl.cur_ub_base_ptr = 0; + _sg_mtl_cmd_buffer = nil; +} + +_SOKOL_PRIVATE void _sg_apply_viewport(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_sg.mtl.in_pass); + if (!_sg.mtl.pass_valid) { + return; + } + SOKOL_ASSERT(_sg_mtl_cmd_encoder); + MTLViewport vp; + vp.originX = (double) x; + vp.originY = (double) (origin_top_left ? y : (_sg.mtl.cur_height - (y + h))); + vp.width = (double) w; + vp.height = (double) h; + vp.znear = 0.0; + vp.zfar = 1.0; + [_sg_mtl_cmd_encoder setViewport:vp]; +} + +_SOKOL_PRIVATE void _sg_apply_scissor_rect(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_sg.mtl.in_pass); + if (!_sg.mtl.pass_valid) { + return; + } + SOKOL_ASSERT(_sg_mtl_cmd_encoder); + /* clip against framebuffer rect */ + x = _sg_min(_sg_max(0, x), _sg.mtl.cur_width-1); + y = _sg_min(_sg_max(0, y), _sg.mtl.cur_height-1); + if ((x + w) > _sg.mtl.cur_width) { + w = _sg.mtl.cur_width - x; + } + if ((y + h) > _sg.mtl.cur_height) { + h = _sg.mtl.cur_height - y; + } + w = _sg_max(w, 1); + h = _sg_max(h, 1); + + MTLScissorRect r; + r.x = x; + r.y = origin_top_left ? y : (_sg.mtl.cur_height - (y + h)); + r.width = w; + r.height = h; + [_sg_mtl_cmd_encoder setScissorRect:r]; +} + +_SOKOL_PRIVATE void _sg_apply_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + SOKOL_ASSERT(pip->shader); + SOKOL_ASSERT(_sg.mtl.in_pass); + if (!_sg.mtl.pass_valid) { + return; + } + SOKOL_ASSERT(_sg_mtl_cmd_encoder); + + if ((_sg.mtl.state_cache.cur_pipeline != pip) || (_sg.mtl.state_cache.cur_pipeline_id.id != pip->slot.id)) { + _sg.mtl.state_cache.cur_pipeline = pip; + _sg.mtl.state_cache.cur_pipeline_id.id = pip->slot.id; + const float* c = pip->blend_color; + [_sg_mtl_cmd_encoder setBlendColorRed:c[0] green:c[1] blue:c[2] alpha:c[3]]; + [_sg_mtl_cmd_encoder setCullMode:pip->mtl_cull_mode]; + [_sg_mtl_cmd_encoder setFrontFacingWinding:pip->mtl_winding]; + [_sg_mtl_cmd_encoder setStencilReferenceValue:pip->mtl_stencil_ref]; + [_sg_mtl_cmd_encoder setDepthBias:pip->depth_bias slopeScale:pip->depth_bias_slope_scale clamp:pip->depth_bias_clamp]; + SOKOL_ASSERT(pip->mtl_rps != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setRenderPipelineState:_sg_mtl_idpool[pip->mtl_rps]]; + SOKOL_ASSERT(pip->mtl_dss != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setDepthStencilState:_sg_mtl_idpool[pip->mtl_dss]]; + } +} + +_SOKOL_PRIVATE void _sg_apply_bindings( + _sg_pipeline_t* pip, + _sg_buffer_t** vbs, const int* vb_offsets, int num_vbs, + _sg_buffer_t* ib, int ib_offset, + _sg_image_t** vs_imgs, int num_vs_imgs, + _sg_image_t** fs_imgs, int num_fs_imgs) +{ + SOKOL_ASSERT(_sg.mtl.in_pass); + if (!_sg.mtl.pass_valid) { + return; + } + SOKOL_ASSERT(_sg_mtl_cmd_encoder); + + /* store index buffer binding, this will be needed later in sg_draw() */ + _sg.mtl.state_cache.cur_indexbuffer = ib; + _sg.mtl.state_cache.cur_indexbuffer_offset = ib_offset; + if (ib) { + SOKOL_ASSERT(pip->index_type != SG_INDEXTYPE_NONE); + _sg.mtl.state_cache.cur_indexbuffer_id.id = ib->slot.id; + } + else { + SOKOL_ASSERT(pip->index_type == SG_INDEXTYPE_NONE); + _sg.mtl.state_cache.cur_indexbuffer_id.id = SG_INVALID_ID; + } + + /* apply vertex buffers */ + int slot; + for (slot = 0; slot < num_vbs; slot++) { + const _sg_buffer_t* vb = vbs[slot]; + if ((_sg.mtl.state_cache.cur_vertexbuffers[slot] != vb) || + (_sg.mtl.state_cache.cur_vertexbuffer_offsets[slot] != vb_offsets[slot]) || + (_sg.mtl.state_cache.cur_vertexbuffer_ids[slot].id != vb->slot.id)) + { + _sg.mtl.state_cache.cur_vertexbuffers[slot] = vb; + _sg.mtl.state_cache.cur_vertexbuffer_offsets[slot] = vb_offsets[slot]; + _sg.mtl.state_cache.cur_vertexbuffer_ids[slot].id = vb->slot.id; + const NSUInteger mtl_slot = SG_MAX_SHADERSTAGE_UBS + slot; + SOKOL_ASSERT(vb->mtl_buf[vb->active_slot] != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setVertexBuffer:_sg_mtl_idpool[vb->mtl_buf[vb->active_slot]] + offset:vb_offsets[slot] + atIndex:mtl_slot]; + } + } + + /* apply vertex shader images */ + for (slot = 0; slot < num_vs_imgs; slot++) { + const _sg_image_t* img = vs_imgs[slot]; + if ((_sg.mtl.state_cache.cur_vs_images[slot] != img) || (_sg.mtl.state_cache.cur_vs_image_ids[slot].id != img->slot.id)) { + _sg.mtl.state_cache.cur_vs_images[slot] = img; + _sg.mtl.state_cache.cur_vs_image_ids[slot].id = img->slot.id; + SOKOL_ASSERT(img->mtl_tex[img->active_slot] != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setVertexTexture:_sg_mtl_idpool[img->mtl_tex[img->active_slot]] atIndex:slot]; + SOKOL_ASSERT(img->mtl_sampler_state != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setVertexSamplerState:_sg_mtl_idpool[img->mtl_sampler_state] atIndex:slot]; + } + } + + /* apply fragment shader images */ + for (slot = 0; slot < num_fs_imgs; slot++) { + const _sg_image_t* img = fs_imgs[slot]; + if ((_sg.mtl.state_cache.cur_fs_images[slot] != img) || (_sg.mtl.state_cache.cur_fs_image_ids[slot].id != img->slot.id)) { + _sg.mtl.state_cache.cur_fs_images[slot] = img; + _sg.mtl.state_cache.cur_fs_image_ids[slot].id = img->slot.id; + SOKOL_ASSERT(img->mtl_tex[img->active_slot] != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setFragmentTexture:_sg_mtl_idpool[img->mtl_tex[img->active_slot]] atIndex:slot]; + SOKOL_ASSERT(img->mtl_sampler_state != _SG_MTL_INVALID_SLOT_INDEX); + [_sg_mtl_cmd_encoder setFragmentSamplerState:_sg_mtl_idpool[img->mtl_sampler_state] atIndex:slot]; + } + } +} + +#define _sg_mtl_roundup(val, round_to) (((val)+((round_to)-1))&~((round_to)-1)) + +_SOKOL_PRIVATE void _sg_apply_uniforms(sg_shader_stage stage_index, int ub_index, const void* data, int num_bytes) { + SOKOL_ASSERT(_sg.mtl.in_pass); + if (!_sg.mtl.pass_valid) { + return; + } + SOKOL_ASSERT(_sg_mtl_cmd_encoder); + SOKOL_ASSERT(data && (num_bytes > 0)); + SOKOL_ASSERT((stage_index >= 0) && ((int)stage_index < SG_NUM_SHADER_STAGES)); + SOKOL_ASSERT((ub_index >= 0) && (ub_index < SG_MAX_SHADERSTAGE_UBS)); + SOKOL_ASSERT((_sg.mtl.cur_ub_offset + num_bytes) <= _sg.mtl.ub_size); + SOKOL_ASSERT((_sg.mtl.cur_ub_offset & (_SG_MTL_UB_ALIGN-1)) == 0); + SOKOL_ASSERT(_sg.mtl.state_cache.cur_pipeline && _sg.mtl.state_cache.cur_pipeline->shader); + SOKOL_ASSERT(_sg.mtl.state_cache.cur_pipeline->slot.id == _sg.mtl.state_cache.cur_pipeline_id.id); + SOKOL_ASSERT(_sg.mtl.state_cache.cur_pipeline->shader->slot.id == _sg.mtl.state_cache.cur_pipeline->shader_id.id); + SOKOL_ASSERT(ub_index < _sg.mtl.state_cache.cur_pipeline->shader->stage[stage_index].num_uniform_blocks); + SOKOL_ASSERT(num_bytes <= _sg.mtl.state_cache.cur_pipeline->shader->stage[stage_index].uniform_blocks[ub_index].size); + + /* copy to global uniform buffer, record offset into cmd encoder, and advance offset */ + uint8_t* dst = &_sg.mtl.cur_ub_base_ptr[_sg.mtl.cur_ub_offset]; + memcpy(dst, data, num_bytes); + if (stage_index == SG_SHADERSTAGE_VS) { + [_sg_mtl_cmd_encoder setVertexBufferOffset:_sg.mtl.cur_ub_offset atIndex:ub_index]; + } + else { + [_sg_mtl_cmd_encoder setFragmentBufferOffset:_sg.mtl.cur_ub_offset atIndex:ub_index]; + } + _sg.mtl.cur_ub_offset = _sg_mtl_roundup(_sg.mtl.cur_ub_offset + num_bytes, _SG_MTL_UB_ALIGN); +} + +_SOKOL_PRIVATE void _sg_draw(int base_element, int num_elements, int num_instances) { + SOKOL_ASSERT(_sg.mtl.in_pass); + if (!_sg.mtl.pass_valid) { + return; + } + SOKOL_ASSERT(_sg_mtl_cmd_encoder); + SOKOL_ASSERT(_sg.mtl.state_cache.cur_pipeline && (_sg.mtl.state_cache.cur_pipeline->slot.id == _sg.mtl.state_cache.cur_pipeline_id.id)); + if (SG_INDEXTYPE_NONE != _sg.mtl.state_cache.cur_pipeline->index_type) { + /* indexed rendering */ + SOKOL_ASSERT(_sg.mtl.state_cache.cur_indexbuffer && (_sg.mtl.state_cache.cur_indexbuffer->slot.id == _sg.mtl.state_cache.cur_indexbuffer_id.id)); + const _sg_buffer_t* ib = _sg.mtl.state_cache.cur_indexbuffer; + SOKOL_ASSERT(ib->mtl_buf[ib->active_slot] != _SG_MTL_INVALID_SLOT_INDEX); + const NSUInteger index_buffer_offset = _sg.mtl.state_cache.cur_indexbuffer_offset + + base_element * _sg.mtl.state_cache.cur_pipeline->mtl_index_size; + [_sg_mtl_cmd_encoder drawIndexedPrimitives:_sg.mtl.state_cache.cur_pipeline->mtl_prim_type + indexCount:num_elements + indexType:_sg.mtl.state_cache.cur_pipeline->mtl_index_type + indexBuffer:_sg_mtl_idpool[ib->mtl_buf[ib->active_slot]] + indexBufferOffset:index_buffer_offset + instanceCount:num_instances]; + } + else { + /* non-indexed rendering */ + [_sg_mtl_cmd_encoder drawPrimitives:_sg.mtl.state_cache.cur_pipeline->mtl_prim_type + vertexStart:base_element + vertexCount:num_elements + instanceCount:num_instances]; + } +} + +_SOKOL_PRIVATE void _sg_update_buffer(_sg_buffer_t* buf, const void* data, int data_size) { + SOKOL_ASSERT(buf && data && (data_size > 0)); + if (++buf->active_slot >= buf->num_slots) { + buf->active_slot = 0; + } + __unsafe_unretained id mtl_buf = _sg_mtl_idpool[buf->mtl_buf[buf->active_slot]]; + void* dst_ptr = [mtl_buf contents]; + memcpy(dst_ptr, data, data_size); + #if defined(_SG_TARGET_MACOS) + [mtl_buf didModifyRange:NSMakeRange(0, data_size)]; + #endif +} + +_SOKOL_PRIVATE void _sg_append_buffer(_sg_buffer_t* buf, const void* data, int data_size, bool new_frame) { + SOKOL_ASSERT(buf && data && (data_size > 0)); + if (new_frame) { + if (++buf->active_slot >= buf->num_slots) { + buf->active_slot = 0; + } + } + __unsafe_unretained id mtl_buf = _sg_mtl_idpool[buf->mtl_buf[buf->active_slot]]; + uint8_t* dst_ptr = (uint8_t*) [mtl_buf contents]; + dst_ptr += buf->append_pos; + memcpy(dst_ptr, data, data_size); + #if defined(_SG_TARGET_MACOS) + [mtl_buf didModifyRange:NSMakeRange(buf->append_pos, data_size)]; + #endif +} + +_SOKOL_PRIVATE void _sg_update_image(_sg_image_t* img, const sg_image_content* data) { + SOKOL_ASSERT(img && data); + if (++img->active_slot >= img->num_slots) { + img->active_slot = 0; + } + __unsafe_unretained id mtl_tex = _sg_mtl_idpool[img->mtl_tex[img->active_slot]]; + _sg_mtl_copy_image_content(img, mtl_tex, data); +} + +#endif + +/*== RESOURCE POOLS ==========================================================*/ + +_SOKOL_PRIVATE void _sg_init_pool(_sg_pool_t* pool, int num) { + SOKOL_ASSERT(pool && (num >= 1)); + /* slot 0 is reserved for the 'invalid id', so bump the pool size by 1 */ + pool->size = num + 1; + pool->queue_top = 0; + /* generation counters indexable by pool slot index, slot 0 is reserved */ + size_t gen_ctrs_size = sizeof(uint32_t) * pool->size; + pool->gen_ctrs = (uint32_t*) SOKOL_MALLOC(gen_ctrs_size); + SOKOL_ASSERT(pool->gen_ctrs); + memset(pool->gen_ctrs, 0, gen_ctrs_size); + /* it's not a bug to only reserve 'num' here */ + pool->free_queue = (int*) SOKOL_MALLOC(sizeof(int)*num); + SOKOL_ASSERT(pool->free_queue); + /* never allocate the zero-th pool item since the invalid id is 0 */ + for (int i = pool->size-1; i >= 1; i--) { + pool->free_queue[pool->queue_top++] = i; + } +} + +_SOKOL_PRIVATE void _sg_discard_pool(_sg_pool_t* pool) { + SOKOL_ASSERT(pool); + SOKOL_ASSERT(pool->free_queue); + SOKOL_FREE(pool->free_queue); + pool->free_queue = 0; + SOKOL_ASSERT(pool->gen_ctrs); + SOKOL_FREE(pool->gen_ctrs); + pool->gen_ctrs = 0; + pool->size = 0; + pool->queue_top = 0; +} + +_SOKOL_PRIVATE int _sg_pool_alloc_index(_sg_pool_t* pool) { + SOKOL_ASSERT(pool); + SOKOL_ASSERT(pool->free_queue); + if (pool->queue_top > 0) { + int slot_index = pool->free_queue[--pool->queue_top]; + SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size)); + return slot_index; + } + else { + /* pool exhausted */ + return _SG_INVALID_SLOT_INDEX; + } +} + +_SOKOL_PRIVATE void _sg_pool_free_index(_sg_pool_t* pool, int slot_index) { + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < pool->size)); + SOKOL_ASSERT(pool); + SOKOL_ASSERT(pool->free_queue); + SOKOL_ASSERT(pool->queue_top < pool->size); + #ifdef SOKOL_DEBUG + /* debug check against double-free */ + for (int i = 0; i < pool->queue_top; i++) { + SOKOL_ASSERT(pool->free_queue[i] != slot_index); + } + #endif + pool->free_queue[pool->queue_top++] = slot_index; + SOKOL_ASSERT(pool->queue_top <= (pool->size-1)); +} + +_SOKOL_PRIVATE void _sg_reset_buffer(_sg_buffer_t* buf) { + SOKOL_ASSERT(buf); + memset(buf, 0, sizeof(_sg_buffer_t)); +} + +_SOKOL_PRIVATE void _sg_reset_image(_sg_image_t* img) { + SOKOL_ASSERT(img); + memset(img, 0, sizeof(_sg_image_t)); +} + +_SOKOL_PRIVATE void _sg_reset_shader(_sg_shader_t* shd) { + SOKOL_ASSERT(shd); + memset(shd, 0, sizeof(_sg_shader_t)); +} + +_SOKOL_PRIVATE void _sg_reset_pipeline(_sg_pipeline_t* pip) { + SOKOL_ASSERT(pip); + memset(pip, 0, sizeof(_sg_pipeline_t)); +} + +_SOKOL_PRIVATE void _sg_reset_pass(_sg_pass_t* pass) { + SOKOL_ASSERT(pass); + memset(pass, 0, sizeof(_sg_pass_t)); +} + +_SOKOL_PRIVATE void _sg_reset_context(_sg_context_t* ctx) { + SOKOL_ASSERT(ctx); + memset(ctx, 0, sizeof(_sg_context_t)); +} + +_SOKOL_PRIVATE void _sg_setup_pools(_sg_pools_t* p, const sg_desc* desc) { + SOKOL_ASSERT(p); + SOKOL_ASSERT(desc); + /* note: the pools here will have an additional item, since slot 0 is reserved */ + SOKOL_ASSERT((desc->buffer_pool_size > 0) && (desc->buffer_pool_size < _SG_MAX_POOL_SIZE)); + _sg_init_pool(&p->buffer_pool, desc->buffer_pool_size); + size_t buffer_pool_byte_size = sizeof(_sg_buffer_t) * p->buffer_pool.size; + p->buffers = (_sg_buffer_t*) SOKOL_MALLOC(buffer_pool_byte_size); + SOKOL_ASSERT(p->buffers); + memset(p->buffers, 0, buffer_pool_byte_size); + + SOKOL_ASSERT((desc->image_pool_size > 0) && (desc->image_pool_size < _SG_MAX_POOL_SIZE)); + _sg_init_pool(&p->image_pool, desc->image_pool_size); + size_t image_pool_byte_size = sizeof(_sg_image_t) * p->image_pool.size; + p->images = (_sg_image_t*) SOKOL_MALLOC(image_pool_byte_size); + SOKOL_ASSERT(p->images); + memset(p->images, 0, image_pool_byte_size); + + SOKOL_ASSERT((desc->shader_pool_size > 0) && (desc->shader_pool_size < _SG_MAX_POOL_SIZE)); + _sg_init_pool(&p->shader_pool, desc->shader_pool_size); + size_t shader_pool_byte_size = sizeof(_sg_shader_t) * p->shader_pool.size; + p->shaders = (_sg_shader_t*) SOKOL_MALLOC(shader_pool_byte_size); + SOKOL_ASSERT(p->shaders); + memset(p->shaders, 0, shader_pool_byte_size); + + SOKOL_ASSERT((desc->pipeline_pool_size > 0) && (desc->pipeline_pool_size < _SG_MAX_POOL_SIZE)); + _sg_init_pool(&p->pipeline_pool, desc->pipeline_pool_size); + size_t pipeline_pool_byte_size = sizeof(_sg_pipeline_t) * p->pipeline_pool.size; + p->pipelines = (_sg_pipeline_t*) SOKOL_MALLOC(pipeline_pool_byte_size); + SOKOL_ASSERT(p->pipelines); + memset(p->pipelines, 0, pipeline_pool_byte_size); + + SOKOL_ASSERT((desc->pass_pool_size > 0) && (desc->pass_pool_size < _SG_MAX_POOL_SIZE)); + _sg_init_pool(&p->pass_pool, desc->pass_pool_size); + size_t pass_pool_byte_size = sizeof(_sg_pass_t) * p->pass_pool.size; + p->passes = (_sg_pass_t*) SOKOL_MALLOC(pass_pool_byte_size); + SOKOL_ASSERT(p->passes); + memset(p->passes, 0, pass_pool_byte_size); + + SOKOL_ASSERT((desc->context_pool_size > 0) && (desc->context_pool_size < _SG_MAX_POOL_SIZE)); + _sg_init_pool(&p->context_pool, desc->context_pool_size); + size_t context_pool_byte_size = sizeof(_sg_context_t) * p->context_pool.size; + p->contexts = (_sg_context_t*) SOKOL_MALLOC(context_pool_byte_size); + SOKOL_ASSERT(p->contexts); + memset(p->contexts, 0, context_pool_byte_size); +} + +_SOKOL_PRIVATE void _sg_discard_pools(_sg_pools_t* p) { + SOKOL_ASSERT(p); + SOKOL_FREE(p->contexts); p->contexts = 0; + SOKOL_FREE(p->passes); p->passes = 0; + SOKOL_FREE(p->pipelines); p->pipelines = 0; + SOKOL_FREE(p->shaders); p->shaders = 0; + SOKOL_FREE(p->images); p->images = 0; + SOKOL_FREE(p->buffers); p->buffers = 0; + _sg_discard_pool(&p->context_pool); + _sg_discard_pool(&p->pass_pool); + _sg_discard_pool(&p->pipeline_pool); + _sg_discard_pool(&p->shader_pool); + _sg_discard_pool(&p->image_pool); + _sg_discard_pool(&p->buffer_pool); +} + +/* allocate the slot at slot_index: + - bump the slot's generation counter + - create a resource id from the generation counter and slot index + - set the slot's id to this id + - set the slot's state to ALLOC + - return the resource id +*/ +_SOKOL_PRIVATE uint32_t _sg_slot_alloc(_sg_pool_t* pool, _sg_slot_t* slot, int slot_index) { + /* FIXME: add handling for an overflowing generation counter, + for now, just overflow (another option is to disable + the slot) + */ + SOKOL_ASSERT(pool && pool->gen_ctrs); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < pool->size)); + SOKOL_ASSERT((slot->state == SG_RESOURCESTATE_INITIAL) && (slot->id == SG_INVALID_ID)); + uint32_t ctr = ++pool->gen_ctrs[slot_index]; + slot->id = (ctr<<_SG_SLOT_SHIFT)|(slot_index & _SG_SLOT_MASK); + slot->state = SG_RESOURCESTATE_ALLOC; + return slot->id; +} + +/* extract slot index from id */ +_SOKOL_PRIVATE int _sg_slot_index(uint32_t id) { + int slot_index = (int) (id & _SG_SLOT_MASK); + SOKOL_ASSERT(_SG_INVALID_SLOT_INDEX != slot_index); + return slot_index; +} + +/* returns pointer to resource by id without matching id check */ +_SOKOL_PRIVATE _sg_buffer_t* _sg_buffer_at(const _sg_pools_t* p, uint32_t buf_id) { + SOKOL_ASSERT(p && (SG_INVALID_ID != buf_id)); + int slot_index = _sg_slot_index(buf_id); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < p->buffer_pool.size)); + return &p->buffers[slot_index]; +} + +_SOKOL_PRIVATE _sg_image_t* _sg_image_at(const _sg_pools_t* p, uint32_t img_id) { + SOKOL_ASSERT(p && (SG_INVALID_ID != img_id)); + int slot_index = _sg_slot_index(img_id); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < p->image_pool.size)); + return &p->images[slot_index]; +} + +_SOKOL_PRIVATE _sg_shader_t* _sg_shader_at(const _sg_pools_t* p, uint32_t shd_id) { + SOKOL_ASSERT(p && (SG_INVALID_ID != shd_id)); + int slot_index = _sg_slot_index(shd_id); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < p->shader_pool.size)); + return &p->shaders[slot_index]; +} + +_SOKOL_PRIVATE _sg_pipeline_t* _sg_pipeline_at(const _sg_pools_t* p, uint32_t pip_id) { + SOKOL_ASSERT(p && (SG_INVALID_ID != pip_id)); + int slot_index = _sg_slot_index(pip_id); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < p->pipeline_pool.size)); + return &p->pipelines[slot_index]; +} + +_SOKOL_PRIVATE _sg_pass_t* _sg_pass_at(const _sg_pools_t* p, uint32_t pass_id) { + SOKOL_ASSERT(p && (SG_INVALID_ID != pass_id)); + int slot_index = _sg_slot_index(pass_id); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < p->pass_pool.size)); + return &p->passes[slot_index]; +} + +_SOKOL_PRIVATE _sg_context_t* _sg_context_at(const _sg_pools_t* p, uint32_t context_id) { + SOKOL_ASSERT(p && (SG_INVALID_ID != context_id)); + int slot_index = _sg_slot_index(context_id); + SOKOL_ASSERT((slot_index > _SG_INVALID_SLOT_INDEX) && (slot_index < p->context_pool.size)); + return &p->contexts[slot_index]; +} + +/* returns pointer to resource with matching id check, may return 0 */ +_SOKOL_PRIVATE _sg_buffer_t* _sg_lookup_buffer(const _sg_pools_t* p, uint32_t buf_id) { + if (SG_INVALID_ID != buf_id) { + _sg_buffer_t* buf = _sg_buffer_at(p, buf_id); + if (buf->slot.id == buf_id) { + return buf; + } + } + return 0; +} + +_SOKOL_PRIVATE _sg_image_t* _sg_lookup_image(const _sg_pools_t* p, uint32_t img_id) { + if (SG_INVALID_ID != img_id) { + _sg_image_t* img = _sg_image_at(p, img_id); + if (img->slot.id == img_id) { + return img; + } + } + return 0; +} + +_SOKOL_PRIVATE _sg_shader_t* _sg_lookup_shader(const _sg_pools_t* p, uint32_t shd_id) { + SOKOL_ASSERT(p); + if (SG_INVALID_ID != shd_id) { + _sg_shader_t* shd = _sg_shader_at(p, shd_id); + if (shd->slot.id == shd_id) { + return shd; + } + } + return 0; +} + +_SOKOL_PRIVATE _sg_pipeline_t* _sg_lookup_pipeline(const _sg_pools_t* p, uint32_t pip_id) { + SOKOL_ASSERT(p); + if (SG_INVALID_ID != pip_id) { + _sg_pipeline_t* pip = _sg_pipeline_at(p, pip_id); + if (pip->slot.id == pip_id) { + return pip; + } + } + return 0; +} + +_SOKOL_PRIVATE _sg_pass_t* _sg_lookup_pass(const _sg_pools_t* p, uint32_t pass_id) { + SOKOL_ASSERT(p); + if (SG_INVALID_ID != pass_id) { + _sg_pass_t* pass = _sg_pass_at(p, pass_id); + if (pass->slot.id == pass_id) { + return pass; + } + } + return 0; +} + +_SOKOL_PRIVATE _sg_context_t* _sg_lookup_context(const _sg_pools_t* p, uint32_t ctx_id) { + SOKOL_ASSERT(p); + if (SG_INVALID_ID != ctx_id) { + _sg_context_t* ctx = _sg_context_at(p, ctx_id); + if (ctx->slot.id == ctx_id) { + return ctx; + } + } + return 0; +} + +_SOKOL_PRIVATE void _sg_destroy_all_resources(_sg_pools_t* p, uint32_t ctx_id) { + /* this is a bit dumb since it loops over all pool slots to + find the occupied slots, on the other hand it is only ever + executed at shutdown + NOTE: ONLY EXECUTE THIS AT SHUTDOWN + ...because the free queues will not be reset + and the resource slots not be cleared! + */ + for (int i = 1; i < p->buffer_pool.size; i++) { + if (p->buffers[i].slot.ctx_id == ctx_id) { + sg_resource_state state = p->buffers[i].slot.state; + if ((state == SG_RESOURCESTATE_VALID) || (state == SG_RESOURCESTATE_FAILED)) { + _sg_destroy_buffer(&p->buffers[i]); + } + } + } + for (int i = 1; i < p->image_pool.size; i++) { + if (p->images[i].slot.ctx_id == ctx_id) { + sg_resource_state state = p->images[i].slot.state; + if ((state == SG_RESOURCESTATE_VALID) || (state == SG_RESOURCESTATE_FAILED)) { + _sg_destroy_image(&p->images[i]); + } + } + } + for (int i = 1; i < p->shader_pool.size; i++) { + if (p->shaders[i].slot.ctx_id == ctx_id) { + sg_resource_state state = p->shaders[i].slot.state; + if ((state == SG_RESOURCESTATE_VALID) || (state == SG_RESOURCESTATE_FAILED)) { + _sg_destroy_shader(&p->shaders[i]); + } + } + } + for (int i = 1; i < p->pipeline_pool.size; i++) { + if (p->pipelines[i].slot.ctx_id == ctx_id) { + sg_resource_state state = p->pipelines[i].slot.state; + if ((state == SG_RESOURCESTATE_VALID) || (state == SG_RESOURCESTATE_FAILED)) { + _sg_destroy_pipeline(&p->pipelines[i]); + } + } + } + for (int i = 1; i < p->pass_pool.size; i++) { + if (p->passes[i].slot.ctx_id == ctx_id) { + sg_resource_state state = p->passes[i].slot.state; + if ((state == SG_RESOURCESTATE_VALID) || (state == SG_RESOURCESTATE_FAILED)) { + _sg_destroy_pass(&p->passes[i]); + } + } + } +} + +/*== VALIDATION LAYER ========================================================*/ +#if defined(SOKOL_DEBUG) +/* return a human readable string for an _sg_validate_error */ +_SOKOL_PRIVATE const char* _sg_validate_string(_sg_validate_error_t err) { + switch (err) { + /* buffer creation validation errors */ + case _SG_VALIDATE_BUFFERDESC_CANARY: return "sg_buffer_desc not initialized"; + case _SG_VALIDATE_BUFFERDESC_SIZE: return "sg_buffer_desc.size cannot be 0"; + case _SG_VALIDATE_BUFFERDESC_CONTENT: return "immutable buffers must be initialized with content (sg_buffer_desc.content)"; + case _SG_VALIDATE_BUFFERDESC_NO_CONTENT: return "dynamic/stream usage buffers cannot be initialized with content"; + + /* image creation validation errros */ + case _SG_VALIDATE_IMAGEDESC_CANARY: return "sg_image_desc not initialized"; + case _SG_VALIDATE_IMAGEDESC_WIDTH: return "sg_image_desc.width must be > 0"; + case _SG_VALIDATE_IMAGEDESC_HEIGHT: return "sg_image_desc.height must be > 0"; + case _SG_VALIDATE_IMAGEDESC_RT_PIXELFORMAT: return "invalid pixel format for render-target image"; + case _SG_VALIDATE_IMAGEDESC_NONRT_PIXELFORMAT: return "invalid pixel format for non-render-target image"; + case _SG_VALIDATE_IMAGEDESC_MSAA_BUT_NO_RT: return "non-render-target images cannot be multisampled"; + case _SG_VALIDATE_IMAGEDESC_NO_MSAA_RT_SUPPORT: return "MSAA not supported for this pixel format"; + case _SG_VALIDATE_IMAGEDESC_RT_IMMUTABLE: return "render target images must be SG_USAGE_IMMUTABLE"; + case _SG_VALIDATE_IMAGEDESC_RT_NO_CONTENT: return "render target images cannot be initialized with content"; + case _SG_VALIDATE_IMAGEDESC_CONTENT: return "missing or invalid content for immutable image"; + case _SG_VALIDATE_IMAGEDESC_NO_CONTENT: return "dynamic/stream usage images cannot be initialized with content"; + + /* shader creation */ + case _SG_VALIDATE_SHADERDESC_CANARY: return "sg_shader_desc not initialized"; + case _SG_VALIDATE_SHADERDESC_SOURCE: return "shader source code required"; + case _SG_VALIDATE_SHADERDESC_BYTECODE: return "shader byte code required"; + case _SG_VALIDATE_SHADERDESC_SOURCE_OR_BYTECODE: return "shader source or byte code required"; + case _SG_VALIDATE_SHADERDESC_NO_BYTECODE_SIZE: return "shader byte code length (in bytes) required"; + case _SG_VALIDATE_SHADERDESC_NO_CONT_UBS: return "shader uniform blocks must occupy continuous slots"; + case _SG_VALIDATE_SHADERDESC_NO_CONT_UB_MEMBERS: return "uniform block members must occupy continuous slots"; + case _SG_VALIDATE_SHADERDESC_NO_UB_MEMBERS: return "GL backend requires uniform block member declarations"; + case _SG_VALIDATE_SHADERDESC_UB_MEMBER_NAME: return "uniform block member name missing"; + case _SG_VALIDATE_SHADERDESC_UB_SIZE_MISMATCH: return "size of uniform block members doesn't match uniform block size"; + case _SG_VALIDATE_SHADERDESC_NO_CONT_IMGS: return "shader images must occupy continuous slots"; + case _SG_VALIDATE_SHADERDESC_IMG_NAME: return "GL backend requires uniform block member names"; + case _SG_VALIDATE_SHADERDESC_ATTR_NAMES: return "GLES2 backend requires vertex attribute names"; + case _SG_VALIDATE_SHADERDESC_ATTR_SEMANTICS: return "D3D11 backend requires vertex attribute semantics"; + case _SG_VALIDATE_SHADERDESC_ATTR_STRING_TOO_LONG: return "vertex attribute name/semantic string too long (max len 16)"; + + /* pipeline creation */ + case _SG_VALIDATE_PIPELINEDESC_CANARY: return "sg_pipeline_desc not initialized"; + case _SG_VALIDATE_PIPELINEDESC_SHADER: return "sg_pipeline_desc.shader missing or invalid"; + case _SG_VALIDATE_PIPELINEDESC_NO_ATTRS: return "sg_pipeline_desc.layout.attrs is empty or not continuous"; + case _SG_VALIDATE_PIPELINEDESC_LAYOUT_STRIDE4: return "sg_pipeline_desc.layout.buffers[].stride must be multiple of 4"; + case _SG_VALIDATE_PIPELINEDESC_ATTR_NAME: return "GLES2/WebGL missing vertex attribute name in shader"; + case _SG_VALIDATE_PIPELINEDESC_ATTR_SEMANTICS: return "D3D11 missing vertex attribute semantics in shader"; + + /* pass creation */ + case _SG_VALIDATE_PASSDESC_CANARY: return "sg_pass_desc not initialized"; + case _SG_VALIDATE_PASSDESC_NO_COLOR_ATTS: return "sg_pass_desc.color_attachments[0] must be valid"; + case _SG_VALIDATE_PASSDESC_NO_CONT_COLOR_ATTS: return "color attachments must occupy continuous slots"; + case _SG_VALIDATE_PASSDESC_IMAGE: return "pass attachment image is not valid"; + case _SG_VALIDATE_PASSDESC_MIPLEVEL: return "pass attachment mip level is bigger than image has mipmaps"; + case _SG_VALIDATE_PASSDESC_FACE: return "pass attachment image is cubemap, but face index is too big"; + case _SG_VALIDATE_PASSDESC_LAYER: return "pass attachment image is array texture, but layer index is too big"; + case _SG_VALIDATE_PASSDESC_SLICE: return "pass attachment image is 3d texture, but slice value is too big"; + case _SG_VALIDATE_PASSDESC_IMAGE_NO_RT: return "pass attachment image must be render targets"; + case _SG_VALIDATE_PASSDESC_COLOR_PIXELFORMATS: return "all pass color attachment images must have the same pixel format"; + case _SG_VALIDATE_PASSDESC_COLOR_INV_PIXELFORMAT: return "pass color-attachment images must have a renderable pixel format"; + case _SG_VALIDATE_PASSDESC_DEPTH_INV_PIXELFORMAT: return "pass depth-attachment image must have depth pixel format"; + case _SG_VALIDATE_PASSDESC_IMAGE_SIZES: return "all pass attachments must have the same size"; + case _SG_VALIDATE_PASSDESC_IMAGE_SAMPLE_COUNTS: return "all pass attachments must have the same sample count"; + + /* sg_begin_pass */ + case _SG_VALIDATE_BEGINPASS_PASS: return "sg_begin_pass: pass must be valid"; + case _SG_VALIDATE_BEGINPASS_IMAGE: return "sg_begin_pass: one or more attachment images are not valid"; + + /* sg_apply_pipeline */ + case _SG_VALIDATE_APIP_PIPELINE_VALID_ID: return "sg_apply_pipeline: invalid pipeline id provided"; + case _SG_VALIDATE_APIP_PIPELINE_EXISTS: return "sg_apply_pipeline: pipeline object no longer alive"; + case _SG_VALIDATE_APIP_PIPELINE_VALID: return "sg_apply_pipeline: pipeline object not in valid state"; + case _SG_VALIDATE_APIP_SHADER_EXISTS: return "sg_apply_pipeline: shader object no longer alive"; + case _SG_VALIDATE_APIP_SHADER_VALID: return "sg_apply_pipeline: shader object not in valid state"; + case _SG_VALIDATE_APIP_ATT_COUNT: return "sg_apply_pipeline: color_attachment_count in pipeline doesn't match number of pass color attachments"; + case _SG_VALIDATE_APIP_COLOR_FORMAT: return "sg_apply_pipeline: color_format in pipeline doesn't match pass color attachment pixel format"; + case _SG_VALIDATE_APIP_DEPTH_FORMAT: return "sg_apply_pipeline: depth_format in pipeline doesn't match pass depth attachment pixel format"; + case _SG_VALIDATE_APIP_SAMPLE_COUNT: return "sg_apply_pipeline: MSAA sample count in pipeline doesn't match render pass attachment sample count"; + + /* sg_apply_bindings */ + case _SG_VALIDATE_ABND_PIPELINE: return "sg_apply_bindings: must be called after sg_apply_pipeline"; + case _SG_VALIDATE_ABND_PIPELINE_EXISTS: return "sg_apply_bindings: currently applied pipeline object no longer alive"; + case _SG_VALIDATE_ABND_PIPELINE_VALID: return "sg_apply_bindings: currently applied pipeline object not in valid state"; + case _SG_VALIDATE_ABND_VBS: return "sg_apply_bindings: number of vertex buffers doesn't match number of pipeline vertex layouts"; + case _SG_VALIDATE_ABND_VB_EXISTS: return "sg_apply_bindings: vertex buffer no longer alive"; + case _SG_VALIDATE_ABND_VB_TYPE: return "sg_apply_bindings: buffer in vertex buffer slot is not a SG_BUFFERTYPE_VERTEXBUFFER"; + case _SG_VALIDATE_ABND_VB_OVERFLOW: return "sg_apply_bindings: buffer in vertex buffer slot is overflown"; + case _SG_VALIDATE_ABND_NO_IB: return "sg_apply_bindings: pipeline object defines indexed rendering, but no index buffer provided"; + case _SG_VALIDATE_ABND_IB: return "sg_apply_bindings: pipeline object defines non-indexed rendering, but index buffer provided"; + case _SG_VALIDATE_ABND_IB_EXISTS: return "sg_apply_bindings: index buffer no longer alive"; + case _SG_VALIDATE_ABND_IB_TYPE: return "sg_apply_bindings: buffer in index buffer slot is not a SG_BUFFERTYPE_INDEXBUFFER"; + case _SG_VALIDATE_ABND_IB_OVERFLOW: return "sg_apply_bindings: buffer in index buffer slot is overflown"; + case _SG_VALIDATE_ABND_VS_IMGS: return "sg_apply_bindings: vertex shader image count doesn't match sg_shader_desc"; + case _SG_VALIDATE_ABND_VS_IMG_EXISTS: return "sg_apply_bindings: vertex shader image no longer alive"; + case _SG_VALIDATE_ABND_VS_IMG_TYPES: return "sg_apply_bindings: one or more vertex shader image types don't match sg_shader_desc"; + case _SG_VALIDATE_ABND_FS_IMGS: return "sg_apply_bindings: fragment shader image count doesn't match sg_shader_desc"; + case _SG_VALIDATE_ABND_FS_IMG_EXISTS: return "sg_apply_bindings: fragment shader image no longer alive"; + case _SG_VALIDATE_ABND_FS_IMG_TYPES: return "sg_apply_bindings: one or more fragment shader image types don't match sg_shader_desc"; + + /* sg_apply_uniforms */ + case _SG_VALIDATE_AUB_NO_PIPELINE: return "sg_apply_uniforms: must be called after sg_apply_pipeline()"; + case _SG_VALIDATE_AUB_NO_UB_AT_SLOT: return "sg_apply_uniforms: no uniform block declaration at this shader stage UB slot"; + case _SG_VALIDATE_AUB_SIZE: return "sg_apply_uniforms: data size exceeds declared uniform block size"; + + /* sg_update_buffer */ + case _SG_VALIDATE_UPDATEBUF_USAGE: return "sg_update_buffer: cannot update immutable buffer"; + case _SG_VALIDATE_UPDATEBUF_SIZE: return "sg_update_buffer: update size is bigger than buffer size"; + case _SG_VALIDATE_UPDATEBUF_ONCE: return "sg_update_buffer: only one update allowed per buffer and frame"; + case _SG_VALIDATE_UPDATEBUF_APPEND: return "sg_update_buffer: cannot call sg_update_buffer and sg_append_buffer in same frame"; + + /* sg_append_buffer */ + case _SG_VALIDATE_APPENDBUF_USAGE: return "sg_append_buffer: cannot append to immutable buffer"; + case _SG_VALIDATE_APPENDBUF_SIZE: return "sg_append_buffer: overall appended size is bigger than buffer size"; + case _SG_VALIDATE_APPENDBUF_UPDATE: return "sg_append_buffer: cannot call sg_append_buffer and sg_update_buffer in same frame"; + + /* sg_update_image */ + case _SG_VALIDATE_UPDIMG_USAGE: return "sg_update_image: cannot update immutable image"; + case _SG_VALIDATE_UPDIMG_NOTENOUGHDATA: return "sg_update_image: not enough subimage data provided"; + case _SG_VALIDATE_UPDIMG_SIZE: return "sg_update_image: provided subimage data size too big"; + case _SG_VALIDATE_UPDIMG_COMPRESSED: return "sg_update_image: cannot update images with compressed format"; + case _SG_VALIDATE_UPDIMG_ONCE: return "sg_update_image: only one update allowed per image and frame"; + + default: return "unknown validation error"; + } +} +#endif /* defined(SOKOL_DEBUG) */ + +/*-- validation checks -------------------------------------------------------*/ +#if defined(SOKOL_DEBUG) +_SOKOL_PRIVATE void _sg_validate_begin(void) { + _sg.validate_error = _SG_VALIDATE_SUCCESS; +} + +_SOKOL_PRIVATE void _sg_validate(bool cond, _sg_validate_error_t err) { + if (!cond) { + _sg.validate_error = err; + SOKOL_LOG(_sg_validate_string(err)); + } +} + +_SOKOL_PRIVATE bool _sg_validate_end(void) { + if (_sg.validate_error != _SG_VALIDATE_SUCCESS) { + #if !defined(SOKOL_VALIDATE_NON_FATAL) + SOKOL_LOG("^^^^ VALIDATION FAILED, TERMINATING ^^^^"); + SOKOL_ASSERT(false); + #endif + return false; + } + else { + return true; + } +} +#endif + +_SOKOL_PRIVATE bool _sg_validate_buffer_desc(const sg_buffer_desc* desc) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(desc); + return true; + #else + SOKOL_ASSERT(desc); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(desc->_start_canary == 0, _SG_VALIDATE_BUFFERDESC_CANARY); + SOKOL_VALIDATE(desc->_end_canary == 0, _SG_VALIDATE_BUFFERDESC_CANARY); + SOKOL_VALIDATE(desc->size > 0, _SG_VALIDATE_BUFFERDESC_SIZE); + bool ext = (0 != desc->gl_buffers[0]) || (0 != desc->mtl_buffers[0]) || (0 != desc->d3d11_buffer); + if (!ext && (desc->usage == SG_USAGE_IMMUTABLE)) { + SOKOL_VALIDATE(0 != desc->content, _SG_VALIDATE_BUFFERDESC_CONTENT); + } + else { + SOKOL_VALIDATE(0 == desc->content, _SG_VALIDATE_BUFFERDESC_NO_CONTENT); + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_image_desc(const sg_image_desc* desc) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(desc); + return true; + #else + SOKOL_ASSERT(desc); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(desc->_start_canary == 0, _SG_VALIDATE_IMAGEDESC_CANARY); + SOKOL_VALIDATE(desc->_end_canary == 0, _SG_VALIDATE_IMAGEDESC_CANARY); + SOKOL_VALIDATE(desc->width > 0, _SG_VALIDATE_IMAGEDESC_WIDTH); + SOKOL_VALIDATE(desc->height > 0, _SG_VALIDATE_IMAGEDESC_HEIGHT); + const sg_pixel_format fmt = desc->pixel_format; + const sg_usage usage = desc->usage; + const bool ext = (0 != desc->gl_textures[0]) || (0 != desc->mtl_textures[0]) || (0 != desc->d3d11_texture); + if (desc->render_target) { + SOKOL_ASSERT(((int)fmt >= 0) && ((int)fmt < _SG_PIXELFORMAT_NUM)); + SOKOL_VALIDATE(_sg.formats[fmt].render, _SG_VALIDATE_IMAGEDESC_RT_PIXELFORMAT); + /* on GLES2, sample count for render targets is completely ignored */ + #if defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + if (!_sg.gl.gles2) { + #endif + if (desc->sample_count > 1) { + SOKOL_VALIDATE(_sg.features.msaa_render_targets && _sg.formats[fmt].msaa, _SG_VALIDATE_IMAGEDESC_NO_MSAA_RT_SUPPORT); + } + #if defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + } + #endif + SOKOL_VALIDATE(usage == SG_USAGE_IMMUTABLE, _SG_VALIDATE_IMAGEDESC_RT_IMMUTABLE); + SOKOL_VALIDATE(desc->content.subimage[0][0].ptr==0, _SG_VALIDATE_IMAGEDESC_RT_NO_CONTENT); + } + else { + SOKOL_VALIDATE(desc->sample_count <= 1, _SG_VALIDATE_IMAGEDESC_MSAA_BUT_NO_RT); + const bool valid_nonrt_fmt = !_sg_is_valid_rendertarget_depth_format(fmt); + SOKOL_VALIDATE(valid_nonrt_fmt, _SG_VALIDATE_IMAGEDESC_NONRT_PIXELFORMAT); + /* FIXME: should use the same "expected size" computation as in _sg_validate_update_image() here */ + if (!ext && (usage == SG_USAGE_IMMUTABLE)) { + const int num_faces = desc->type == SG_IMAGETYPE_CUBE ? 6:1; + const int num_mips = desc->num_mipmaps; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int mip_index = 0; mip_index < num_mips; mip_index++) { + const bool has_data = desc->content.subimage[face_index][mip_index].ptr != 0; + const bool has_size = desc->content.subimage[face_index][mip_index].size > 0; + SOKOL_VALIDATE(has_data && has_size, _SG_VALIDATE_IMAGEDESC_CONTENT); + } + } + } + else { + for (int face_index = 0; face_index < SG_CUBEFACE_NUM; face_index++) { + for (int mip_index = 0; mip_index < SG_MAX_MIPMAPS; mip_index++) { + const bool no_data = 0 == desc->content.subimage[face_index][mip_index].ptr; + const bool no_size = 0 == desc->content.subimage[face_index][mip_index].size; + SOKOL_VALIDATE(no_data && no_size, _SG_VALIDATE_IMAGEDESC_NO_CONTENT); + } + } + } + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_shader_desc(const sg_shader_desc* desc) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(desc); + return true; + #else + SOKOL_ASSERT(desc); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(desc->_start_canary == 0, _SG_VALIDATE_SHADERDESC_CANARY); + SOKOL_VALIDATE(desc->_end_canary == 0, _SG_VALIDATE_SHADERDESC_CANARY); + #if defined(SOKOL_GLES2) + SOKOL_VALIDATE(0 != desc->attrs[0].name, _SG_VALIDATE_SHADERDESC_ATTR_NAMES); + #elif defined(SOKOL_D3D11) + SOKOL_VALIDATE(0 != desc->attrs[0].sem_name, _SG_VALIDATE_SHADERDESC_ATTR_SEMANTICS); + #endif + #if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + /* on GL, must provide shader source code */ + SOKOL_VALIDATE(0 != desc->vs.source, _SG_VALIDATE_SHADERDESC_SOURCE); + SOKOL_VALIDATE(0 != desc->fs.source, _SG_VALIDATE_SHADERDESC_SOURCE); + #elif defined(SOKOL_METAL) || defined(SOKOL_D3D11) + /* on Metal or D3D11, must provide shader source code or byte code */ + SOKOL_VALIDATE((0 != desc->vs.source)||(0 != desc->vs.byte_code), _SG_VALIDATE_SHADERDESC_SOURCE_OR_BYTECODE); + SOKOL_VALIDATE((0 != desc->fs.source)||(0 != desc->fs.byte_code), _SG_VALIDATE_SHADERDESC_SOURCE_OR_BYTECODE); + #else + /* Dummy Backend, don't require source or bytecode */ + #endif + for (int i = 0; i < SG_MAX_VERTEX_ATTRIBUTES; i++) { + if (desc->attrs[i].name) { + SOKOL_VALIDATE(strlen(desc->attrs[i].name) < _SG_STRING_SIZE, _SG_VALIDATE_SHADERDESC_ATTR_STRING_TOO_LONG); + } + if (desc->attrs[i].sem_name) { + SOKOL_VALIDATE(strlen(desc->attrs[i].sem_name) < _SG_STRING_SIZE, _SG_VALIDATE_SHADERDESC_ATTR_STRING_TOO_LONG); + } + } + /* if shader byte code, the size must also be provided */ + if (0 != desc->vs.byte_code) { + SOKOL_VALIDATE(desc->vs.byte_code_size > 0, _SG_VALIDATE_SHADERDESC_NO_BYTECODE_SIZE); + } + if (0 != desc->fs.byte_code) { + SOKOL_VALIDATE(desc->fs.byte_code_size > 0, _SG_VALIDATE_SHADERDESC_NO_BYTECODE_SIZE); + } + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + const sg_shader_stage_desc* stage_desc = (stage_index == 0)? &desc->vs : &desc->fs; + bool uniform_blocks_continuous = true; + for (int ub_index = 0; ub_index < SG_MAX_SHADERSTAGE_UBS; ub_index++) { + const sg_shader_uniform_block_desc* ub_desc = &stage_desc->uniform_blocks[ub_index]; + if (ub_desc->size > 0) { + SOKOL_VALIDATE(uniform_blocks_continuous, _SG_VALIDATE_SHADERDESC_NO_CONT_UBS); + bool uniforms_continuous = true; + int uniform_offset = 0; + int num_uniforms = 0; + for (int u_index = 0; u_index < SG_MAX_UB_MEMBERS; u_index++) { + const sg_shader_uniform_desc* u_desc = &ub_desc->uniforms[u_index]; + if (u_desc->type != SG_UNIFORMTYPE_INVALID) { + SOKOL_VALIDATE(uniforms_continuous, _SG_VALIDATE_SHADERDESC_NO_CONT_UB_MEMBERS); + #if defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + SOKOL_VALIDATE(u_desc->name, _SG_VALIDATE_SHADERDESC_UB_MEMBER_NAME); + #endif + const int array_count = u_desc->array_count; + uniform_offset += _sg_uniform_size(u_desc->type, array_count); + num_uniforms++; + } + else { + uniforms_continuous = false; + } + } + #if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3) + SOKOL_VALIDATE(uniform_offset == ub_desc->size, _SG_VALIDATE_SHADERDESC_UB_SIZE_MISMATCH); + SOKOL_VALIDATE(num_uniforms > 0, _SG_VALIDATE_SHADERDESC_NO_UB_MEMBERS); + #endif + } + else { + uniform_blocks_continuous = false; + } + } + bool images_continuous = true; + for (int img_index = 0; img_index < SG_MAX_SHADERSTAGE_IMAGES; img_index++) { + const sg_shader_image_desc* img_desc = &stage_desc->images[img_index]; + if (img_desc->type != _SG_IMAGETYPE_DEFAULT) { + SOKOL_VALIDATE(images_continuous, _SG_VALIDATE_SHADERDESC_NO_CONT_IMGS); + #if defined(SOKOL_GLES2) + SOKOL_VALIDATE(img_desc->name, _SG_VALIDATE_SHADERDESC_IMG_NAME); + #endif + } + else { + images_continuous = false; + } + } + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_pipeline_desc(const sg_pipeline_desc* desc) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(desc); + return true; + #else + SOKOL_ASSERT(desc); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(desc->_start_canary == 0, _SG_VALIDATE_PIPELINEDESC_CANARY); + SOKOL_VALIDATE(desc->_end_canary == 0, _SG_VALIDATE_PIPELINEDESC_CANARY); + SOKOL_VALIDATE(desc->shader.id != SG_INVALID_ID, _SG_VALIDATE_PIPELINEDESC_SHADER); + const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, desc->shader.id); + SOKOL_VALIDATE(shd && shd->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_PIPELINEDESC_SHADER); + for (int buf_index = 0; buf_index < SG_MAX_SHADERSTAGE_BUFFERS; buf_index++) { + const sg_buffer_layout_desc* l_desc = &desc->layout.buffers[buf_index]; + if (l_desc->stride == 0) { + continue; + } + SOKOL_VALIDATE((l_desc->stride & 3) == 0, _SG_VALIDATE_PIPELINEDESC_LAYOUT_STRIDE4); + } + SOKOL_VALIDATE(desc->layout.attrs[0].format != SG_VERTEXFORMAT_INVALID, _SG_VALIDATE_PIPELINEDESC_NO_ATTRS); + bool attrs_cont = true; + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + const sg_vertex_attr_desc* a_desc = &desc->layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + attrs_cont = false; + continue; + } + SOKOL_VALIDATE(attrs_cont, _SG_VALIDATE_PIPELINEDESC_NO_ATTRS); + SOKOL_ASSERT(a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS); + #if defined(SOKOL_GLES2) + /* on GLES2, vertex attribute names must be provided */ + SOKOL_VALIDATE(!_sg_strempty(&shd->attrs[attr_index].name), _SG_VALIDATE_PIPELINEDESC_ATTR_NAME); + #elif defined(SOKOL_D3D11) + /* on D3D11, semantic names (and semantic indices) must be provided */ + SOKOL_VALIDATE(!_sg_strempty(&shd->attrs[attr_index].sem_name), _SG_VALIDATE_PIPELINEDESC_ATTR_SEMANTICS); + #endif + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_pass_desc(const sg_pass_desc* desc) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(desc); + return true; + #else + SOKOL_ASSERT(desc); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(desc->_start_canary == 0, _SG_VALIDATE_PASSDESC_CANARY); + SOKOL_VALIDATE(desc->_end_canary == 0, _SG_VALIDATE_PASSDESC_CANARY); + bool atts_cont = true; + sg_pixel_format color_fmt = SG_PIXELFORMAT_NONE; + int width = -1, height = -1, sample_count = -1; + for (int att_index = 0; att_index < SG_MAX_COLOR_ATTACHMENTS; att_index++) { + const sg_attachment_desc* att = &desc->color_attachments[att_index]; + if (att->image.id == SG_INVALID_ID) { + SOKOL_VALIDATE(att_index > 0, _SG_VALIDATE_PASSDESC_NO_COLOR_ATTS); + atts_cont = false; + continue; + } + SOKOL_VALIDATE(atts_cont, _SG_VALIDATE_PASSDESC_NO_CONT_COLOR_ATTS); + const _sg_image_t* img = _sg_lookup_image(&_sg.pools, att->image.id); + SOKOL_VALIDATE(img && img->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_PASSDESC_IMAGE); + SOKOL_VALIDATE(att->mip_level < img->num_mipmaps, _SG_VALIDATE_PASSDESC_MIPLEVEL); + if (img->type == SG_IMAGETYPE_CUBE) { + SOKOL_VALIDATE(att->face < 6, _SG_VALIDATE_PASSDESC_FACE); + } + else if (img->type == SG_IMAGETYPE_ARRAY) { + SOKOL_VALIDATE(att->layer < img->depth, _SG_VALIDATE_PASSDESC_LAYER); + } + else if (img->type == SG_IMAGETYPE_3D) { + SOKOL_VALIDATE(att->slice < img->depth, _SG_VALIDATE_PASSDESC_SLICE); + } + SOKOL_VALIDATE(img->render_target, _SG_VALIDATE_PASSDESC_IMAGE_NO_RT); + if (att_index == 0) { + color_fmt = img->pixel_format; + width = img->width >> att->mip_level; + height = img->height >> att->mip_level; + sample_count = img->sample_count; + } + else { + SOKOL_VALIDATE(img->pixel_format == color_fmt, _SG_VALIDATE_PASSDESC_COLOR_PIXELFORMATS); + SOKOL_VALIDATE(width == img->width >> att->mip_level, _SG_VALIDATE_PASSDESC_IMAGE_SIZES); + SOKOL_VALIDATE(height == img->height >> att->mip_level, _SG_VALIDATE_PASSDESC_IMAGE_SIZES); + SOKOL_VALIDATE(sample_count == img->sample_count, _SG_VALIDATE_PASSDESC_IMAGE_SAMPLE_COUNTS); + } + SOKOL_VALIDATE(_sg_is_valid_rendertarget_color_format(img->pixel_format), _SG_VALIDATE_PASSDESC_COLOR_INV_PIXELFORMAT); + } + if (desc->depth_stencil_attachment.image.id != SG_INVALID_ID) { + const sg_attachment_desc* att = &desc->depth_stencil_attachment; + const _sg_image_t* img = _sg_lookup_image(&_sg.pools, att->image.id); + SOKOL_VALIDATE(img && img->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_PASSDESC_IMAGE); + SOKOL_VALIDATE(att->mip_level < img->num_mipmaps, _SG_VALIDATE_PASSDESC_MIPLEVEL); + if (img->type == SG_IMAGETYPE_CUBE) { + SOKOL_VALIDATE(att->face < 6, _SG_VALIDATE_PASSDESC_FACE); + } + else if (img->type == SG_IMAGETYPE_ARRAY) { + SOKOL_VALIDATE(att->layer < img->depth, _SG_VALIDATE_PASSDESC_LAYER); + } + else if (img->type == SG_IMAGETYPE_3D) { + SOKOL_VALIDATE(att->slice < img->depth, _SG_VALIDATE_PASSDESC_SLICE); + } + SOKOL_VALIDATE(img->render_target, _SG_VALIDATE_PASSDESC_IMAGE_NO_RT); + SOKOL_VALIDATE(width == img->width >> att->mip_level, _SG_VALIDATE_PASSDESC_IMAGE_SIZES); + SOKOL_VALIDATE(height == img->height >> att->mip_level, _SG_VALIDATE_PASSDESC_IMAGE_SIZES); + SOKOL_VALIDATE(sample_count == img->sample_count, _SG_VALIDATE_PASSDESC_IMAGE_SAMPLE_COUNTS); + SOKOL_VALIDATE(_sg_is_valid_rendertarget_depth_format(img->pixel_format), _SG_VALIDATE_PASSDESC_DEPTH_INV_PIXELFORMAT); + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_begin_pass(_sg_pass_t* pass) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(pass); + return true; + #else + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(pass->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_BEGINPASS_PASS); + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + const _sg_attachment_t* att = &pass->color_atts[i]; + if (att->image) { + SOKOL_VALIDATE(att->image->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_BEGINPASS_IMAGE); + SOKOL_VALIDATE(att->image->slot.id == att->image_id.id, _SG_VALIDATE_BEGINPASS_IMAGE); + } + } + if (pass->ds_att.image) { + const _sg_attachment_t* att = &pass->ds_att; + SOKOL_VALIDATE(att->image->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_BEGINPASS_IMAGE); + SOKOL_VALIDATE(att->image->slot.id == att->image_id.id, _SG_VALIDATE_BEGINPASS_IMAGE); + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_apply_pipeline(sg_pipeline pip_id) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(pip_id); + return true; + #else + SOKOL_VALIDATE_BEGIN(); + /* the pipeline object must be alive and valid */ + SOKOL_VALIDATE(pip_id.id != SG_INVALID_ID, _SG_VALIDATE_APIP_PIPELINE_VALID_ID); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + SOKOL_VALIDATE(pip != 0, _SG_VALIDATE_APIP_PIPELINE_EXISTS); + if (!pip) { + return SOKOL_VALIDATE_END(); + } + SOKOL_VALIDATE(pip->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_APIP_PIPELINE_VALID); + /* the pipeline's shader must be alive and valid */ + SOKOL_ASSERT(pip->shader); + SOKOL_VALIDATE(pip->shader->slot.id == pip->shader_id.id, _SG_VALIDATE_APIP_SHADER_EXISTS); + SOKOL_VALIDATE(pip->shader->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_APIP_SHADER_VALID); + /* check that pipeline attributes match current pass attributes */ + const _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, _sg.cur_pass.id); + if (pass) { + /* an offscreen pass */ + SOKOL_VALIDATE(pip->color_attachment_count == pass->num_color_atts, _SG_VALIDATE_APIP_ATT_COUNT); + SOKOL_VALIDATE(pip->color_format == pass->color_atts[0].image->pixel_format, _SG_VALIDATE_APIP_COLOR_FORMAT); + SOKOL_VALIDATE(pip->sample_count == pass->color_atts[0].image->sample_count, _SG_VALIDATE_APIP_SAMPLE_COUNT); + if (pass->ds_att.image) { + SOKOL_VALIDATE(pip->depth_format == pass->ds_att.image->pixel_format, _SG_VALIDATE_APIP_DEPTH_FORMAT); + } + else { + SOKOL_VALIDATE(pip->depth_format == SG_PIXELFORMAT_NONE, _SG_VALIDATE_APIP_DEPTH_FORMAT); + } + } + else { + /* default pass */ + SOKOL_VALIDATE(pip->color_attachment_count == 1, _SG_VALIDATE_APIP_ATT_COUNT); + SOKOL_VALIDATE(pip->color_format == _sg_default_rendertarget_colorformat(), _SG_VALIDATE_APIP_COLOR_FORMAT); + SOKOL_VALIDATE(pip->depth_format == _sg_default_rendertarget_depthformat(), _SG_VALIDATE_APIP_DEPTH_FORMAT); + /* FIXME: hmm, we don't know if the default framebuffer is multisampled here */ + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(bindings); + return true; + #else + SOKOL_VALIDATE_BEGIN(); + + /* a pipeline object must have been applied */ + SOKOL_VALIDATE(_sg.cur_pipeline.id != SG_INVALID_ID, _SG_VALIDATE_ABND_PIPELINE); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, _sg.cur_pipeline.id); + SOKOL_VALIDATE(pip != 0, _SG_VALIDATE_ABND_PIPELINE_EXISTS); + if (!pip) { + return SOKOL_VALIDATE_END(); + } + SOKOL_VALIDATE(pip->slot.state == SG_RESOURCESTATE_VALID, _SG_VALIDATE_ABND_PIPELINE_VALID); + SOKOL_ASSERT(pip->shader); + + /* has expected vertex buffers, and vertex buffers still exist */ + for (int i = 0; i < SG_MAX_SHADERSTAGE_BUFFERS; i++) { + if (bindings->vertex_buffers[i].id != SG_INVALID_ID) { + SOKOL_VALIDATE(pip->vertex_layout_valid[i], _SG_VALIDATE_ABND_VBS); + /* buffers in vertex-buffer-slots must be of type SG_BUFFERTYPE_VERTEXBUFFER */ + const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, bindings->vertex_buffers[i].id); + SOKOL_VALIDATE(buf != 0, _SG_VALIDATE_ABND_VB_EXISTS); + if (buf && buf->slot.state == SG_RESOURCESTATE_VALID) { + SOKOL_VALIDATE(SG_BUFFERTYPE_VERTEXBUFFER == buf->type, _SG_VALIDATE_ABND_VB_TYPE); + SOKOL_VALIDATE(!buf->append_overflow, _SG_VALIDATE_ABND_VB_OVERFLOW); + } + } + else { + /* vertex buffer provided in a slot which has no vertex layout in pipeline */ + SOKOL_VALIDATE(!pip->vertex_layout_valid[i], _SG_VALIDATE_ABND_VBS); + } + } + + /* index buffer expected or not, and index buffer still exists */ + if (pip->index_type == SG_INDEXTYPE_NONE) { + /* pipeline defines non-indexed rendering, but index buffer provided */ + SOKOL_VALIDATE(bindings->index_buffer.id == SG_INVALID_ID, _SG_VALIDATE_ABND_IB); + } + else { + /* pipeline defines indexed rendering, but no index buffer provided */ + SOKOL_VALIDATE(bindings->index_buffer.id != SG_INVALID_ID, _SG_VALIDATE_ABND_NO_IB); + } + if (bindings->index_buffer.id != SG_INVALID_ID) { + /* buffer in index-buffer-slot must be of type SG_BUFFERTYPE_INDEXBUFFER */ + const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, bindings->index_buffer.id); + SOKOL_VALIDATE(buf != 0, _SG_VALIDATE_ABND_IB_EXISTS); + if (buf && buf->slot.state == SG_RESOURCESTATE_VALID) { + SOKOL_VALIDATE(SG_BUFFERTYPE_INDEXBUFFER == buf->type, _SG_VALIDATE_ABND_IB_TYPE); + SOKOL_VALIDATE(!buf->append_overflow, _SG_VALIDATE_ABND_IB_OVERFLOW); + } + } + + /* has expected vertex shader images */ + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + _sg_shader_stage_t* stage = &pip->shader->stage[SG_SHADERSTAGE_VS]; + if (bindings->vs_images[i].id != SG_INVALID_ID) { + SOKOL_VALIDATE(i < stage->num_images, _SG_VALIDATE_ABND_VS_IMGS); + const _sg_image_t* img = _sg_lookup_image(&_sg.pools, bindings->vs_images[i].id); + SOKOL_VALIDATE(img != 0, _SG_VALIDATE_ABND_VS_IMG_EXISTS); + if (img && img->slot.state == SG_RESOURCESTATE_VALID) { + SOKOL_VALIDATE(img->type == stage->images[i].type, _SG_VALIDATE_ABND_VS_IMG_TYPES); + } + } + else { + SOKOL_VALIDATE(i >= stage->num_images, _SG_VALIDATE_ABND_VS_IMGS); + } + } + + /* has expected fragment shader images */ + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + _sg_shader_stage_t* stage = &pip->shader->stage[SG_SHADERSTAGE_FS]; + if (bindings->fs_images[i].id != SG_INVALID_ID) { + SOKOL_VALIDATE(i < stage->num_images, _SG_VALIDATE_ABND_FS_IMGS); + const _sg_image_t* img = _sg_lookup_image(&_sg.pools, bindings->fs_images[i].id); + SOKOL_VALIDATE(img != 0, _SG_VALIDATE_ABND_FS_IMG_EXISTS); + if (img && img->slot.state == SG_RESOURCESTATE_VALID) { + SOKOL_VALIDATE(img->type == stage->images[i].type, _SG_VALIDATE_ABND_FS_IMG_TYPES); + } + } + else { + SOKOL_VALIDATE(i >= stage->num_images, _SG_VALIDATE_ABND_FS_IMGS); + } + } + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_apply_uniforms(sg_shader_stage stage_index, int ub_index, const void* data, int num_bytes) { + _SOKOL_UNUSED(data); + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(stage_index); + _SOKOL_UNUSED(ub_index); + _SOKOL_UNUSED(num_bytes); + return true; + #else + SOKOL_ASSERT((stage_index == SG_SHADERSTAGE_VS) || (stage_index == SG_SHADERSTAGE_FS)); + SOKOL_ASSERT((ub_index >= 0) && (ub_index < SG_MAX_SHADERSTAGE_UBS)); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(_sg.cur_pipeline.id != SG_INVALID_ID, _SG_VALIDATE_AUB_NO_PIPELINE); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, _sg.cur_pipeline.id); + SOKOL_ASSERT(pip && (pip->slot.id == _sg.cur_pipeline.id)); + SOKOL_ASSERT(pip->shader && (pip->shader->slot.id == pip->shader_id.id)); + + /* check that there is a uniform block at 'stage' and 'ub_index' */ + const _sg_shader_stage_t* stage = &pip->shader->stage[stage_index]; + SOKOL_VALIDATE(ub_index < stage->num_uniform_blocks, _SG_VALIDATE_AUB_NO_UB_AT_SLOT); + + /* check that the provided data size doesn't exceed the uniform block size */ + SOKOL_VALIDATE(num_bytes <= stage->uniform_blocks[ub_index].size, _SG_VALIDATE_AUB_SIZE); + + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_update_buffer(const _sg_buffer_t* buf, const void* data, int size) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(buf); + _SOKOL_UNUSED(data); + _SOKOL_UNUSED(size); + return true; + #else + SOKOL_ASSERT(buf && data); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(buf->usage != SG_USAGE_IMMUTABLE, _SG_VALIDATE_UPDATEBUF_USAGE); + SOKOL_VALIDATE(buf->size >= size, _SG_VALIDATE_UPDATEBUF_SIZE); + SOKOL_VALIDATE(buf->update_frame_index != _sg.frame_index, _SG_VALIDATE_UPDATEBUF_ONCE); + SOKOL_VALIDATE(buf->append_frame_index != _sg.frame_index, _SG_VALIDATE_UPDATEBUF_APPEND); + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_append_buffer(const _sg_buffer_t* buf, const void* data, int size) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(buf); + _SOKOL_UNUSED(data); + _SOKOL_UNUSED(size); + return true; + #else + SOKOL_ASSERT(buf && data); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(buf->usage != SG_USAGE_IMMUTABLE, _SG_VALIDATE_APPENDBUF_USAGE); + SOKOL_VALIDATE(buf->size >= (buf->append_pos+size), _SG_VALIDATE_APPENDBUF_SIZE); + SOKOL_VALIDATE(buf->update_frame_index != _sg.frame_index, _SG_VALIDATE_APPENDBUF_UPDATE); + return SOKOL_VALIDATE_END(); + #endif +} + +_SOKOL_PRIVATE bool _sg_validate_update_image(const _sg_image_t* img, const sg_image_content* data) { + #if !defined(SOKOL_DEBUG) + _SOKOL_UNUSED(img); + _SOKOL_UNUSED(data); + return true; + #else + SOKOL_ASSERT(img && data); + SOKOL_VALIDATE_BEGIN(); + SOKOL_VALIDATE(img->usage != SG_USAGE_IMMUTABLE, _SG_VALIDATE_UPDIMG_USAGE); + SOKOL_VALIDATE(img->upd_frame_index != _sg.frame_index, _SG_VALIDATE_UPDIMG_ONCE); + SOKOL_VALIDATE(!_sg_is_compressed_pixel_format(img->pixel_format), _SG_VALIDATE_UPDIMG_COMPRESSED); + const int num_faces = (img->type == SG_IMAGETYPE_CUBE) ? 6 : 1; + const int num_mips = img->num_mipmaps; + for (int face_index = 0; face_index < num_faces; face_index++) { + for (int mip_index = 0; mip_index < num_mips; mip_index++) { + SOKOL_VALIDATE(0 != data->subimage[face_index][mip_index].ptr, _SG_VALIDATE_UPDIMG_NOTENOUGHDATA); + const int mip_width = _sg_max(img->width >> mip_index, 1); + const int mip_height = _sg_max(img->height >> mip_index, 1); + const int bytes_per_slice = _sg_surface_pitch(img->pixel_format, mip_width, mip_height); + const int expected_size = bytes_per_slice * img->depth; + SOKOL_VALIDATE(data->subimage[face_index][mip_index].size <= expected_size, _SG_VALIDATE_UPDIMG_SIZE); + } + } + return SOKOL_VALIDATE_END(); + #endif +} + +/*== fill in desc default values =============================================*/ +_SOKOL_PRIVATE sg_buffer_desc _sg_buffer_desc_defaults(const sg_buffer_desc* desc) { + sg_buffer_desc def = *desc; + def.type = _sg_def(def.type, SG_BUFFERTYPE_VERTEXBUFFER); + def.usage = _sg_def(def.usage, SG_USAGE_IMMUTABLE); + return def; +} + +_SOKOL_PRIVATE sg_image_desc _sg_image_desc_defaults(const sg_image_desc* desc) { + sg_image_desc def = *desc; + def.type = _sg_def(def.type, SG_IMAGETYPE_2D); + def.depth = _sg_def(def.depth, 1); + def.num_mipmaps = _sg_def(def.num_mipmaps, 1); + def.usage = _sg_def(def.usage, SG_USAGE_IMMUTABLE); + if (desc->render_target) { + def.pixel_format = _sg_def(def.pixel_format, _sg_default_rendertarget_colorformat()); + } + else { + def.pixel_format = _sg_def(def.pixel_format, SG_PIXELFORMAT_RGBA8); + } + def.sample_count = _sg_def(def.sample_count, 1); + def.min_filter = _sg_def(def.min_filter, SG_FILTER_NEAREST); + def.mag_filter = _sg_def(def.mag_filter, SG_FILTER_NEAREST); + def.wrap_u = _sg_def(def.wrap_u, SG_WRAP_REPEAT); + def.wrap_v = _sg_def(def.wrap_v, SG_WRAP_REPEAT); + def.wrap_w = _sg_def(def.wrap_w, SG_WRAP_REPEAT); + def.border_color = _sg_def(def.border_color, SG_BORDERCOLOR_OPAQUE_BLACK); + def.max_anisotropy = _sg_def(def.max_anisotropy, 1); + def.max_lod = _sg_def_flt(def.max_lod, FLT_MAX); + return def; +} + +_SOKOL_PRIVATE sg_shader_desc _sg_shader_desc_defaults(const sg_shader_desc* desc) { + sg_shader_desc def = *desc; + #if defined(SOKOL_METAL) + def.vs.entry = _sg_def(def.vs.entry, "_main"); + def.fs.entry = _sg_def(def.fs.entry, "_main"); + #else + def.vs.entry = _sg_def(def.vs.entry, "main"); + def.fs.entry = _sg_def(def.fs.entry, "main"); + #endif + for (int stage_index = 0; stage_index < SG_NUM_SHADER_STAGES; stage_index++) { + sg_shader_stage_desc* stage_desc = (stage_index == SG_SHADERSTAGE_VS)? &def.vs : &def.fs; + for (int ub_index = 0; ub_index < SG_MAX_SHADERSTAGE_UBS; ub_index++) { + sg_shader_uniform_block_desc* ub_desc = &stage_desc->uniform_blocks[ub_index]; + if (0 == ub_desc->size) { + break; + } + for (int u_index = 0; u_index < SG_MAX_UB_MEMBERS; u_index++) { + sg_shader_uniform_desc* u_desc = &ub_desc->uniforms[u_index]; + if (u_desc->type == SG_UNIFORMTYPE_INVALID) { + break; + } + u_desc->array_count = _sg_def(u_desc->array_count, 1); + } + } + } + return def; +} + +_SOKOL_PRIVATE sg_pipeline_desc _sg_pipeline_desc_defaults(const sg_pipeline_desc* desc) { + sg_pipeline_desc def = *desc; + + def.primitive_type = _sg_def(def.primitive_type, SG_PRIMITIVETYPE_TRIANGLES); + def.index_type = _sg_def(def.index_type, SG_INDEXTYPE_NONE); + + def.depth_stencil.stencil_front.fail_op = _sg_def(def.depth_stencil.stencil_front.fail_op, SG_STENCILOP_KEEP); + def.depth_stencil.stencil_front.depth_fail_op = _sg_def(def.depth_stencil.stencil_front.depth_fail_op, SG_STENCILOP_KEEP); + def.depth_stencil.stencil_front.pass_op = _sg_def(def.depth_stencil.stencil_front.pass_op, SG_STENCILOP_KEEP); + def.depth_stencil.stencil_front.compare_func = _sg_def(def.depth_stencil.stencil_front.compare_func, SG_COMPAREFUNC_ALWAYS); + def.depth_stencil.stencil_back.fail_op = _sg_def(def.depth_stencil.stencil_back.fail_op, SG_STENCILOP_KEEP); + def.depth_stencil.stencil_back.depth_fail_op = _sg_def(def.depth_stencil.stencil_back.depth_fail_op, SG_STENCILOP_KEEP); + def.depth_stencil.stencil_back.pass_op = _sg_def(def.depth_stencil.stencil_back.pass_op, SG_STENCILOP_KEEP); + def.depth_stencil.stencil_back.compare_func = _sg_def(def.depth_stencil.stencil_back.compare_func, SG_COMPAREFUNC_ALWAYS); + def.depth_stencil.depth_compare_func = _sg_def(def.depth_stencil.depth_compare_func, SG_COMPAREFUNC_ALWAYS); + + def.blend.src_factor_rgb = _sg_def(def.blend.src_factor_rgb, SG_BLENDFACTOR_ONE); + def.blend.dst_factor_rgb = _sg_def(def.blend.dst_factor_rgb, SG_BLENDFACTOR_ZERO); + def.blend.op_rgb = _sg_def(def.blend.op_rgb, SG_BLENDOP_ADD); + def.blend.src_factor_alpha = _sg_def(def.blend.src_factor_alpha, SG_BLENDFACTOR_ONE); + def.blend.dst_factor_alpha = _sg_def(def.blend.dst_factor_alpha, SG_BLENDFACTOR_ZERO); + def.blend.op_alpha = _sg_def(def.blend.op_alpha, SG_BLENDOP_ADD); + if (def.blend.color_write_mask == SG_COLORMASK_NONE) { + def.blend.color_write_mask = 0; + } + else { + def.blend.color_write_mask = (uint8_t) _sg_def((sg_color_mask)def.blend.color_write_mask, SG_COLORMASK_RGBA); + } + def.blend.color_attachment_count = _sg_def(def.blend.color_attachment_count, 1); + def.blend.color_format = _sg_def(def.blend.color_format, _sg_default_rendertarget_colorformat()); + def.blend.depth_format = _sg_def(def.blend.depth_format, _sg_default_rendertarget_depthformat()); + + def.rasterizer.cull_mode = _sg_def(def.rasterizer.cull_mode, SG_CULLMODE_NONE); + def.rasterizer.face_winding = _sg_def(def.rasterizer.face_winding, SG_FACEWINDING_CW); + def.rasterizer.sample_count = _sg_def(def.rasterizer.sample_count, 1); + + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + sg_vertex_attr_desc* a_desc = &def.layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + break; + } + SOKOL_ASSERT((a_desc->buffer_index >= 0) && (a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS)); + sg_buffer_layout_desc* b_desc = &def.layout.buffers[a_desc->buffer_index]; + b_desc->step_func = _sg_def(b_desc->step_func, SG_VERTEXSTEP_PER_VERTEX); + b_desc->step_rate = _sg_def(b_desc->step_rate, 1); + } + + /* resolve vertex layout strides and offsets */ + int auto_offset[SG_MAX_SHADERSTAGE_BUFFERS]; + memset(auto_offset, 0, sizeof(auto_offset)); + bool use_auto_offset = true; + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + /* to use computed offsets, *all* attr offsets must be 0 */ + if (def.layout.attrs[attr_index].offset != 0) { + use_auto_offset = false; + } + } + for (int attr_index = 0; attr_index < SG_MAX_VERTEX_ATTRIBUTES; attr_index++) { + sg_vertex_attr_desc* a_desc = &def.layout.attrs[attr_index]; + if (a_desc->format == SG_VERTEXFORMAT_INVALID) { + break; + } + SOKOL_ASSERT((a_desc->buffer_index >= 0) && (a_desc->buffer_index < SG_MAX_SHADERSTAGE_BUFFERS)); + if (use_auto_offset) { + a_desc->offset = auto_offset[a_desc->buffer_index]; + } + auto_offset[a_desc->buffer_index] += _sg_vertexformat_bytesize(a_desc->format); + } + /* compute vertex strides if needed */ + for (int buf_index = 0; buf_index < SG_MAX_SHADERSTAGE_BUFFERS; buf_index++) { + sg_buffer_layout_desc* l_desc = &def.layout.buffers[buf_index]; + if (l_desc->stride == 0) { + l_desc->stride = auto_offset[buf_index]; + } + } + + return def; +} + +_SOKOL_PRIVATE sg_pass_desc _sg_pass_desc_defaults(const sg_pass_desc* desc) { + /* FIXME: no values to replace in sg_pass_desc? */ + sg_pass_desc def = *desc; + return def; +} + +/*== allocate/initialize resource private functions ==========================*/ +_SOKOL_PRIVATE sg_buffer _sg_alloc_buffer(void) { + sg_buffer res; + int slot_index = _sg_pool_alloc_index(&_sg.pools.buffer_pool); + if (_SG_INVALID_SLOT_INDEX != slot_index) { + res.id = _sg_slot_alloc(&_sg.pools.buffer_pool, &_sg.pools.buffers[slot_index].slot, slot_index); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + return res; +} + +_SOKOL_PRIVATE sg_image _sg_alloc_image(void) { + sg_image res; + int slot_index = _sg_pool_alloc_index(&_sg.pools.image_pool); + if (_SG_INVALID_SLOT_INDEX != slot_index) { + res.id = _sg_slot_alloc(&_sg.pools.image_pool, &_sg.pools.images[slot_index].slot, slot_index); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + return res; +} + +_SOKOL_PRIVATE sg_shader _sg_alloc_shader(void) { + sg_shader res; + int slot_index = _sg_pool_alloc_index(&_sg.pools.shader_pool); + if (_SG_INVALID_SLOT_INDEX != slot_index) { + res.id = _sg_slot_alloc(&_sg.pools.shader_pool, &_sg.pools.shaders[slot_index].slot, slot_index); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + return res; +} + +_SOKOL_PRIVATE sg_pipeline _sg_alloc_pipeline(void) { + sg_pipeline res; + int slot_index = _sg_pool_alloc_index(&_sg.pools.pipeline_pool); + if (_SG_INVALID_SLOT_INDEX != slot_index) { + res.id =_sg_slot_alloc(&_sg.pools.pipeline_pool, &_sg.pools.pipelines[slot_index].slot, slot_index); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + return res; +} + +_SOKOL_PRIVATE sg_pass _sg_alloc_pass(void) { + sg_pass res; + int slot_index = _sg_pool_alloc_index(&_sg.pools.pass_pool); + if (_SG_INVALID_SLOT_INDEX != slot_index) { + res.id = _sg_slot_alloc(&_sg.pools.pass_pool, &_sg.pools.passes[slot_index].slot, slot_index); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + return res; +} + +_SOKOL_PRIVATE void _sg_init_buffer(sg_buffer buf_id, const sg_buffer_desc* desc) { + SOKOL_ASSERT(buf_id.id != SG_INVALID_ID && desc); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + SOKOL_ASSERT(buf && buf->slot.state == SG_RESOURCESTATE_ALLOC); + buf->slot.ctx_id = _sg.active_context.id; + if (_sg_validate_buffer_desc(desc)) { + buf->slot.state = _sg_create_buffer(buf, desc); + } + else { + buf->slot.state = SG_RESOURCESTATE_FAILED; + } + SOKOL_ASSERT((buf->slot.state == SG_RESOURCESTATE_VALID)||(buf->slot.state == SG_RESOURCESTATE_FAILED)); +} + +_SOKOL_PRIVATE void _sg_init_image(sg_image img_id, const sg_image_desc* desc) { + SOKOL_ASSERT(img_id.id != SG_INVALID_ID && desc); + _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + SOKOL_ASSERT(img && img->slot.state == SG_RESOURCESTATE_ALLOC); + img->slot.ctx_id = _sg.active_context.id; + if (_sg_validate_image_desc(desc)) { + img->slot.state = _sg_create_image(img, desc); + } + else { + img->slot.state = SG_RESOURCESTATE_FAILED; + } + SOKOL_ASSERT((img->slot.state == SG_RESOURCESTATE_VALID)||(img->slot.state == SG_RESOURCESTATE_FAILED)); +} + +_SOKOL_PRIVATE void _sg_init_shader(sg_shader shd_id, const sg_shader_desc* desc) { + SOKOL_ASSERT(shd_id.id != SG_INVALID_ID && desc); + _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + SOKOL_ASSERT(shd && shd->slot.state == SG_RESOURCESTATE_ALLOC); + shd->slot.ctx_id = _sg.active_context.id; + if (_sg_validate_shader_desc(desc)) { + shd->slot.state = _sg_create_shader(shd, desc); + } + else { + shd->slot.state = SG_RESOURCESTATE_FAILED; + } + SOKOL_ASSERT((shd->slot.state == SG_RESOURCESTATE_VALID)||(shd->slot.state == SG_RESOURCESTATE_FAILED)); +} + +_SOKOL_PRIVATE void _sg_init_pipeline(sg_pipeline pip_id, const sg_pipeline_desc* desc) { + SOKOL_ASSERT(pip_id.id != SG_INVALID_ID && desc); + _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + SOKOL_ASSERT(pip && pip->slot.state == SG_RESOURCESTATE_ALLOC); + pip->slot.ctx_id = _sg.active_context.id; + if (_sg_validate_pipeline_desc(desc)) { + _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, desc->shader.id); + SOKOL_ASSERT(shd && shd->slot.state == SG_RESOURCESTATE_VALID); + pip->slot.state = _sg_create_pipeline(pip, shd, desc); + } + else { + pip->slot.state = SG_RESOURCESTATE_FAILED; + } + SOKOL_ASSERT((pip->slot.state == SG_RESOURCESTATE_VALID)||(pip->slot.state == SG_RESOURCESTATE_FAILED)); +} + +_SOKOL_PRIVATE void _sg_init_pass(sg_pass pass_id, const sg_pass_desc* desc) { + SOKOL_ASSERT(pass_id.id != SG_INVALID_ID && desc); + _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id); + SOKOL_ASSERT(pass && pass->slot.state == SG_RESOURCESTATE_ALLOC); + pass->slot.ctx_id = _sg.active_context.id; + if (_sg_validate_pass_desc(desc)) { + /* lookup pass attachment image pointers */ + _sg_image_t* att_imgs[SG_MAX_COLOR_ATTACHMENTS + 1]; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (desc->color_attachments[i].image.id) { + att_imgs[i] = _sg_lookup_image(&_sg.pools, desc->color_attachments[i].image.id); + SOKOL_ASSERT(att_imgs[i] && att_imgs[i]->slot.state == SG_RESOURCESTATE_VALID); + } + else { + att_imgs[i] = 0; + } + } + const int ds_att_index = SG_MAX_COLOR_ATTACHMENTS; + if (desc->depth_stencil_attachment.image.id) { + att_imgs[ds_att_index] = _sg_lookup_image(&_sg.pools, desc->depth_stencil_attachment.image.id); + SOKOL_ASSERT(att_imgs[ds_att_index] && att_imgs[ds_att_index]->slot.state == SG_RESOURCESTATE_VALID); + } + else { + att_imgs[ds_att_index] = 0; + } + pass->slot.state = _sg_create_pass(pass, att_imgs, desc); + } + else { + pass->slot.state = SG_RESOURCESTATE_FAILED; + } + SOKOL_ASSERT((pass->slot.state == SG_RESOURCESTATE_VALID)||(pass->slot.state == SG_RESOURCESTATE_FAILED)); +} + +/*== PUBLIC API FUNCTIONS ====================================================*/ +SOKOL_API_IMPL void sg_setup(const sg_desc* desc) { + SOKOL_ASSERT(desc); + SOKOL_ASSERT((desc->_start_canary == 0) && (desc->_end_canary == 0)); + memset(&_sg, 0, sizeof(_sg)); + _sg.desc = *desc; + + /* replace zero-init items with their default values */ + _sg.desc.buffer_pool_size = _sg_def(_sg.desc.buffer_pool_size, _SG_DEFAULT_BUFFER_POOL_SIZE); + _sg.desc.image_pool_size = _sg_def(_sg.desc.image_pool_size, _SG_DEFAULT_IMAGE_POOL_SIZE); + _sg.desc.shader_pool_size = _sg_def(_sg.desc.shader_pool_size, _SG_DEFAULT_SHADER_POOL_SIZE); + _sg.desc.pipeline_pool_size = _sg_def(_sg.desc.pipeline_pool_size, _SG_DEFAULT_PIPELINE_POOL_SIZE); + _sg.desc.pass_pool_size = _sg_def(_sg.desc.pass_pool_size, _SG_DEFAULT_PASS_POOL_SIZE); + _sg.desc.context_pool_size = _sg_def(_sg.desc.context_pool_size, _SG_DEFAULT_CONTEXT_POOL_SIZE); + _sg.desc.mtl_global_uniform_buffer_size = _sg_def(_sg.desc.mtl_global_uniform_buffer_size, _SG_MTL_DEFAULT_UB_SIZE); + _sg.desc.mtl_sampler_cache_size = _sg_def(_sg.desc.mtl_sampler_cache_size, _SG_MTL_DEFAULT_SAMPLER_CACHE_CAPACITY); + + _sg_setup_pools(&_sg.pools, &_sg.desc); + _sg.frame_index = 1; + _sg_setup_backend(&_sg.desc); + _sg.valid = true; + sg_setup_context(); +} + +SOKOL_API_IMPL void sg_shutdown(void) { + /* can only delete resources for the currently set context here, if multiple + contexts are used, the app code must take care of properly releasing them + (since only the app code can switch between 3D-API contexts) + */ + if (_sg.active_context.id != SG_INVALID_ID) { + _sg_context_t* ctx = _sg_lookup_context(&_sg.pools, _sg.active_context.id); + if (ctx) { + _sg_destroy_all_resources(&_sg.pools, _sg.active_context.id); + _sg_destroy_context(ctx); + } + } + _sg_discard_backend(); + _sg_discard_pools(&_sg.pools); + _sg.valid = false; +} + +SOKOL_API_IMPL bool sg_isvalid(void) { + return _sg.valid; +} + +SOKOL_API_IMPL sg_desc sg_query_desc(void) { + SOKOL_ASSERT(_sg.valid); + return _sg.desc; +} + +SOKOL_API_IMPL sg_backend sg_query_backend(void) { + SOKOL_ASSERT(_sg.valid); + return _sg.backend; +} + +SOKOL_API_IMPL sg_features sg_query_features(void) { + SOKOL_ASSERT(_sg.valid); + return _sg.features; +} + +SOKOL_API_IMPL sg_limits sg_query_limits(void) { + SOKOL_ASSERT(_sg.valid); + return _sg.limits; +} + +SOKOL_API_IMPL sg_pixelformat_info sg_query_pixelformat(sg_pixel_format fmt) { + SOKOL_ASSERT(_sg.valid); + int fmt_index = (int) fmt; + SOKOL_ASSERT((fmt_index > SG_PIXELFORMAT_NONE) && (fmt_index < _SG_PIXELFORMAT_NUM)); + return _sg.formats[fmt_index]; +} + +SOKOL_API_IMPL sg_context sg_setup_context(void) { + SOKOL_ASSERT(_sg.valid); + sg_context res; + int slot_index = _sg_pool_alloc_index(&_sg.pools.context_pool); + if (_SG_INVALID_SLOT_INDEX != slot_index) { + res.id = _sg_slot_alloc(&_sg.pools.context_pool, &_sg.pools.contexts[slot_index].slot, slot_index); + _sg_context_t* ctx = _sg_context_at(&_sg.pools, res.id); + ctx->slot.state = _sg_create_context(ctx); + SOKOL_ASSERT(ctx->slot.state == SG_RESOURCESTATE_VALID); + _sg_activate_context(ctx); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + _sg.active_context = res; + return res; +} + +SOKOL_API_IMPL void sg_discard_context(sg_context ctx_id) { + SOKOL_ASSERT(_sg.valid); + _sg_destroy_all_resources(&_sg.pools, ctx_id.id); + _sg_context_t* ctx = _sg_lookup_context(&_sg.pools, ctx_id.id); + if (ctx) { + _sg_destroy_context(ctx); + _sg_reset_context(ctx); + _sg_pool_free_index(&_sg.pools.context_pool, _sg_slot_index(ctx_id.id)); + } + _sg.active_context.id = SG_INVALID_ID; + _sg_activate_context(0); +} + +SOKOL_API_IMPL void sg_activate_context(sg_context ctx_id) { + SOKOL_ASSERT(_sg.valid); + _sg.active_context = ctx_id; + _sg_context_t* ctx = _sg_lookup_context(&_sg.pools, ctx_id.id); + /* NOTE: ctx can be 0 here if the context is no longer valid */ + _sg_activate_context(ctx); +} + +SOKOL_API_IMPL sg_trace_hooks sg_install_trace_hooks(const sg_trace_hooks* trace_hooks) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(trace_hooks); + #if defined(SOKOL_TRACE_HOOKS) + sg_trace_hooks old_hooks = _sg.hooks; + _sg.hooks = *trace_hooks; + #else + static sg_trace_hooks old_hooks; + SOKOL_LOG("sg_install_trace_hooks() called, but SG_TRACE_HOOKS is not defined!"); + #endif + return old_hooks; +} + +SOKOL_API_IMPL sg_buffer sg_alloc_buffer(void) { + SOKOL_ASSERT(_sg.valid); + sg_buffer res = _sg_alloc_buffer(); + _SG_TRACE_ARGS(alloc_buffer, res); + return res; +} + +SOKOL_API_IMPL sg_image sg_alloc_image(void) { + SOKOL_ASSERT(_sg.valid); + sg_image res = _sg_alloc_image(); + _SG_TRACE_ARGS(alloc_image, res); + return res; +} + +SOKOL_API_IMPL sg_shader sg_alloc_shader(void) { + SOKOL_ASSERT(_sg.valid); + sg_shader res = _sg_alloc_shader(); + _SG_TRACE_ARGS(alloc_shader, res); + return res; +} + +SOKOL_API_IMPL sg_pipeline sg_alloc_pipeline(void) { + SOKOL_ASSERT(_sg.valid); + sg_pipeline res = _sg_alloc_pipeline(); + _SG_TRACE_ARGS(alloc_pipeline, res); + return res; +} + +SOKOL_API_IMPL sg_pass sg_alloc_pass(void) { + SOKOL_ASSERT(_sg.valid); + sg_pass res = _sg_alloc_pass(); + _SG_TRACE_ARGS(alloc_pass, res); + return res; +} + +SOKOL_API_IMPL void sg_init_buffer(sg_buffer buf_id, const sg_buffer_desc* desc) { + SOKOL_ASSERT(_sg.valid); + sg_buffer_desc desc_def = _sg_buffer_desc_defaults(desc); + _sg_init_buffer(buf_id, &desc_def); + _SG_TRACE_ARGS(init_buffer, buf_id, &desc_def); +} + +SOKOL_API_IMPL void sg_init_image(sg_image img_id, const sg_image_desc* desc) { + SOKOL_ASSERT(_sg.valid); + sg_image_desc desc_def = _sg_image_desc_defaults(desc); + _sg_init_image(img_id, &desc_def); + _SG_TRACE_ARGS(init_image, img_id, &desc_def); +} + +SOKOL_API_IMPL void sg_init_shader(sg_shader shd_id, const sg_shader_desc* desc) { + SOKOL_ASSERT(_sg.valid); + sg_shader_desc desc_def = _sg_shader_desc_defaults(desc); + _sg_init_shader(shd_id, &desc_def); + _SG_TRACE_ARGS(init_shader, shd_id, &desc_def); +} + +SOKOL_API_IMPL void sg_init_pipeline(sg_pipeline pip_id, const sg_pipeline_desc* desc) { + SOKOL_ASSERT(_sg.valid); + sg_pipeline_desc desc_def = _sg_pipeline_desc_defaults(desc); + _sg_init_pipeline(pip_id, &desc_def); + _SG_TRACE_ARGS(init_pipeline, pip_id, &desc_def); +} + +SOKOL_API_IMPL void sg_init_pass(sg_pass pass_id, const sg_pass_desc* desc) { + SOKOL_ASSERT(_sg.valid); + sg_pass_desc desc_def = _sg_pass_desc_defaults(desc); + _sg_init_pass(pass_id, &desc_def); + _SG_TRACE_ARGS(init_pass, pass_id, &desc_def); +} + +/*-- set allocated resource to failed state ----------------------------------*/ +SOKOL_API_IMPL void sg_fail_buffer(sg_buffer buf_id) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(buf_id.id != SG_INVALID_ID); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + SOKOL_ASSERT(buf && buf->slot.state == SG_RESOURCESTATE_ALLOC); + buf->slot.ctx_id = _sg.active_context.id; + buf->slot.state = SG_RESOURCESTATE_FAILED; + _SG_TRACE_ARGS(fail_buffer, buf_id); +} + +SOKOL_API_IMPL void sg_fail_image(sg_image img_id) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(img_id.id != SG_INVALID_ID); + _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + SOKOL_ASSERT(img && img->slot.state == SG_RESOURCESTATE_ALLOC); + img->slot.ctx_id = _sg.active_context.id; + img->slot.state = SG_RESOURCESTATE_FAILED; + _SG_TRACE_ARGS(fail_image, img_id); +} + +SOKOL_API_IMPL void sg_fail_shader(sg_shader shd_id) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(shd_id.id != SG_INVALID_ID); + _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + SOKOL_ASSERT(shd && shd->slot.state == SG_RESOURCESTATE_ALLOC); + shd->slot.ctx_id = _sg.active_context.id; + shd->slot.state = SG_RESOURCESTATE_FAILED; + _SG_TRACE_ARGS(fail_shader, shd_id); +} + +SOKOL_API_IMPL void sg_fail_pipeline(sg_pipeline pip_id) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(pip_id.id != SG_INVALID_ID); + _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + SOKOL_ASSERT(pip && pip->slot.state == SG_RESOURCESTATE_ALLOC); + pip->slot.ctx_id = _sg.active_context.id; + pip->slot.state = SG_RESOURCESTATE_FAILED; + _SG_TRACE_ARGS(fail_pipeline, pip_id); +} + +SOKOL_API_IMPL void sg_fail_pass(sg_pass pass_id) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(pass_id.id != SG_INVALID_ID); + _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id); + SOKOL_ASSERT(pass && pass->slot.state == SG_RESOURCESTATE_ALLOC); + pass->slot.ctx_id = _sg.active_context.id; + pass->slot.state = SG_RESOURCESTATE_FAILED; + _SG_TRACE_ARGS(fail_pass, pass_id); +} + +/*-- get resource state */ +SOKOL_API_IMPL sg_resource_state sg_query_buffer_state(sg_buffer buf_id) { + SOKOL_ASSERT(_sg.valid); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + sg_resource_state res = buf ? buf->slot.state : SG_RESOURCESTATE_INVALID; + return res; +} + +SOKOL_API_IMPL sg_resource_state sg_query_image_state(sg_image img_id) { + SOKOL_ASSERT(_sg.valid); + _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + sg_resource_state res = img ? img->slot.state : SG_RESOURCESTATE_INVALID; + return res; +} + +SOKOL_API_IMPL sg_resource_state sg_query_shader_state(sg_shader shd_id) { + SOKOL_ASSERT(_sg.valid); + _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + sg_resource_state res = shd ? shd->slot.state : SG_RESOURCESTATE_INVALID; + return res; +} + +SOKOL_API_IMPL sg_resource_state sg_query_pipeline_state(sg_pipeline pip_id) { + SOKOL_ASSERT(_sg.valid); + _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + sg_resource_state res = pip ? pip->slot.state : SG_RESOURCESTATE_INVALID; + return res; +} + +SOKOL_API_IMPL sg_resource_state sg_query_pass_state(sg_pass pass_id) { + SOKOL_ASSERT(_sg.valid); + _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id); + sg_resource_state res = pass ? pass->slot.state : SG_RESOURCESTATE_INVALID; + return res; +} + +/*-- allocate and initialize resource ----------------------------------------*/ +SOKOL_API_IMPL sg_buffer sg_make_buffer(const sg_buffer_desc* desc) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(desc); + sg_buffer_desc desc_def = _sg_buffer_desc_defaults(desc); + sg_buffer buf_id = _sg_alloc_buffer(); + if (buf_id.id != SG_INVALID_ID) { + _sg_init_buffer(buf_id, &desc_def); + } + else { + SOKOL_LOG("buffer pool exhausted!"); + _SG_TRACE_NOARGS(err_buffer_pool_exhausted); + } + _SG_TRACE_ARGS(make_buffer, &desc_def, buf_id); + return buf_id; +} + +SOKOL_API_IMPL sg_image sg_make_image(const sg_image_desc* desc) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(desc); + sg_image_desc desc_def = _sg_image_desc_defaults(desc); + sg_image img_id = _sg_alloc_image(); + if (img_id.id != SG_INVALID_ID) { + _sg_init_image(img_id, &desc_def); + } + else { + SOKOL_LOG("image pool exhausted!"); + _SG_TRACE_NOARGS(err_image_pool_exhausted); + } + _SG_TRACE_ARGS(make_image, &desc_def, img_id); + return img_id; +} + +SOKOL_API_IMPL sg_shader sg_make_shader(const sg_shader_desc* desc) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(desc); + sg_shader_desc desc_def = _sg_shader_desc_defaults(desc); + sg_shader shd_id = _sg_alloc_shader(); + if (shd_id.id != SG_INVALID_ID) { + _sg_init_shader(shd_id, &desc_def); + } + else { + SOKOL_LOG("shader pool exhausted!"); + _SG_TRACE_NOARGS(err_shader_pool_exhausted); + } + _SG_TRACE_ARGS(make_shader, &desc_def, shd_id); + return shd_id; +} + +SOKOL_API_IMPL sg_pipeline sg_make_pipeline(const sg_pipeline_desc* desc) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(desc); + sg_pipeline_desc desc_def = _sg_pipeline_desc_defaults(desc); + sg_pipeline pip_id = _sg_alloc_pipeline(); + if (pip_id.id != SG_INVALID_ID) { + _sg_init_pipeline(pip_id, &desc_def); + } + else { + SOKOL_LOG("pipeline pool exhausted!"); + _SG_TRACE_NOARGS(err_pipeline_pool_exhausted); + } + _SG_TRACE_ARGS(make_pipeline, &desc_def, pip_id); + return pip_id; +} + +SOKOL_API_IMPL sg_pass sg_make_pass(const sg_pass_desc* desc) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(desc); + sg_pass_desc desc_def = _sg_pass_desc_defaults(desc); + sg_pass pass_id = _sg_alloc_pass(); + if (pass_id.id != SG_INVALID_ID) { + _sg_init_pass(pass_id, &desc_def); + } + else { + SOKOL_LOG("pass pool exhausted!"); + _SG_TRACE_NOARGS(err_pass_pool_exhausted); + } + _SG_TRACE_ARGS(make_pass, &desc_def, pass_id); + return pass_id; +} + +/*-- destroy resource --------------------------------------------------------*/ +SOKOL_API_IMPL void sg_destroy_buffer(sg_buffer buf_id) { + SOKOL_ASSERT(_sg.valid); + _SG_TRACE_ARGS(destroy_buffer, buf_id); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + if (buf) { + if (buf->slot.ctx_id == _sg.active_context.id) { + _sg_destroy_buffer(buf); + _sg_reset_buffer(buf); + _sg_pool_free_index(&_sg.pools.buffer_pool, _sg_slot_index(buf_id.id)); + } + else { + SOKOL_LOG("sg_destroy_buffer: active context mismatch (must be same as for creation)"); + _SG_TRACE_NOARGS(err_context_mismatch); + } + } +} + +SOKOL_API_IMPL void sg_destroy_image(sg_image img_id) { + SOKOL_ASSERT(_sg.valid); + _SG_TRACE_ARGS(destroy_image, img_id); + _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + if (img) { + if (img->slot.ctx_id == _sg.active_context.id) { + _sg_destroy_image(img); + _sg_reset_image(img); + _sg_pool_free_index(&_sg.pools.image_pool, _sg_slot_index(img_id.id)); + } + else { + SOKOL_LOG("sg_destroy_image: active context mismatch (must be same as for creation)"); + _SG_TRACE_NOARGS(err_context_mismatch); + } + } +} + +SOKOL_API_IMPL void sg_destroy_shader(sg_shader shd_id) { + SOKOL_ASSERT(_sg.valid); + _SG_TRACE_ARGS(destroy_shader, shd_id); + _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + if (shd) { + if (shd->slot.ctx_id == _sg.active_context.id) { + _sg_destroy_shader(shd); + _sg_reset_shader(shd); + _sg_pool_free_index(&_sg.pools.shader_pool, _sg_slot_index(shd_id.id)); + } + else { + SOKOL_LOG("sg_destroy_shader: active context mismatch (must be same as for creation)"); + _SG_TRACE_NOARGS(err_context_mismatch); + } + } +} + +SOKOL_API_IMPL void sg_destroy_pipeline(sg_pipeline pip_id) { + SOKOL_ASSERT(_sg.valid); + _SG_TRACE_ARGS(destroy_pipeline, pip_id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + if (pip) { + if (pip->slot.ctx_id == _sg.active_context.id) { + _sg_destroy_pipeline(pip); + _sg_reset_pipeline(pip); + _sg_pool_free_index(&_sg.pools.pipeline_pool, _sg_slot_index(pip_id.id)); + } + else { + SOKOL_LOG("sg_destroy_pipeline: active context mismatch (must be same as for creation)"); + _SG_TRACE_NOARGS(err_context_mismatch); + } + } +} + +SOKOL_API_IMPL void sg_destroy_pass(sg_pass pass_id) { + SOKOL_ASSERT(_sg.valid); + _SG_TRACE_ARGS(destroy_pass, pass_id); + _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id); + if (pass) { + if (pass->slot.ctx_id == _sg.active_context.id) { + _sg_destroy_pass(pass); + _sg_reset_pass(pass); + _sg_pool_free_index(&_sg.pools.pass_pool, _sg_slot_index(pass_id.id)); + } + else { + SOKOL_LOG("sg_destroy_pass: active context mismatch (must be same as for creation)"); + _SG_TRACE_NOARGS(err_context_mismatch); + } + } +} + +SOKOL_API_IMPL void sg_begin_default_pass(const sg_pass_action* pass_action, int width, int height) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(pass_action); + SOKOL_ASSERT((pass_action->_start_canary == 0) && (pass_action->_end_canary == 0)); + sg_pass_action pa; + _sg_resolve_default_pass_action(pass_action, &pa); + _sg.cur_pass.id = SG_INVALID_ID; + _sg.pass_valid = true; + _sg_begin_pass(0, &pa, width, height); + _SG_TRACE_ARGS(begin_default_pass, pass_action, width, height); +} + +SOKOL_API_IMPL void sg_begin_pass(sg_pass pass_id, const sg_pass_action* pass_action) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(pass_action); + SOKOL_ASSERT((pass_action->_start_canary == 0) && (pass_action->_end_canary == 0)); + _sg.cur_pass = pass_id; + _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id); + if (pass && _sg_validate_begin_pass(pass)) { + _sg.pass_valid = true; + sg_pass_action pa; + _sg_resolve_default_pass_action(pass_action, &pa); + const int w = pass->color_atts[0].image->width; + const int h = pass->color_atts[0].image->height; + _sg_begin_pass(pass, &pa, w, h); + _SG_TRACE_ARGS(begin_pass, pass_id, pass_action); + } + else { + _sg.pass_valid = false; + _SG_TRACE_NOARGS(err_pass_invalid); + } +} + +SOKOL_API_IMPL void sg_apply_viewport(int x, int y, int width, int height, bool origin_top_left) { + SOKOL_ASSERT(_sg.valid); + if (!_sg.pass_valid) { + _SG_TRACE_NOARGS(err_pass_invalid); + return; + } + _sg_apply_viewport(x, y, width, height, origin_top_left); + _SG_TRACE_ARGS(apply_viewport, x, y, width, height, origin_top_left); +} + +SOKOL_API_IMPL void sg_apply_scissor_rect(int x, int y, int width, int height, bool origin_top_left) { + SOKOL_ASSERT(_sg.valid); + if (!_sg.pass_valid) { + _SG_TRACE_NOARGS(err_pass_invalid); + return; + } + _sg_apply_scissor_rect(x, y, width, height, origin_top_left); + _SG_TRACE_ARGS(apply_scissor_rect, x, y, width, height, origin_top_left); +} + +SOKOL_API_IMPL void sg_apply_pipeline(sg_pipeline pip_id) { + SOKOL_ASSERT(_sg.valid); + _sg.bindings_valid = false; + if (!_sg_validate_apply_pipeline(pip_id)) { + _sg.next_draw_valid = false; + _SG_TRACE_NOARGS(err_draw_invalid); + return; + } + if (!_sg.pass_valid) { + _SG_TRACE_NOARGS(err_pass_invalid); + return; + } + _sg.cur_pipeline = pip_id; + _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + SOKOL_ASSERT(pip); + _sg.next_draw_valid = (SG_RESOURCESTATE_VALID == pip->slot.state); + SOKOL_ASSERT(pip->shader && (pip->shader->slot.id == pip->shader_id.id)); + _sg_apply_pipeline(pip); + _SG_TRACE_ARGS(apply_pipeline, pip_id); +} + +SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(bindings); + SOKOL_ASSERT((bindings->_start_canary == 0) && (bindings->_end_canary==0)); + if (!_sg_validate_apply_bindings(bindings)) { + _sg.next_draw_valid = false; + _SG_TRACE_NOARGS(err_draw_invalid); + return; + } + _sg.bindings_valid = true; + + _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, _sg.cur_pipeline.id); + SOKOL_ASSERT(pip); + + _sg_buffer_t* vbs[SG_MAX_SHADERSTAGE_BUFFERS] = { 0 }; + int num_vbs = 0; + for (int i = 0; i < SG_MAX_SHADERSTAGE_BUFFERS; i++, num_vbs++) { + if (bindings->vertex_buffers[i].id) { + vbs[i] = _sg_lookup_buffer(&_sg.pools, bindings->vertex_buffers[i].id); + SOKOL_ASSERT(vbs[i]); + _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == vbs[i]->slot.state); + _sg.next_draw_valid &= !vbs[i]->append_overflow; + } + else { + break; + } + } + + _sg_buffer_t* ib = 0; + if (bindings->index_buffer.id) { + ib = _sg_lookup_buffer(&_sg.pools, bindings->index_buffer.id); + SOKOL_ASSERT(ib); + _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == ib->slot.state); + _sg.next_draw_valid &= !ib->append_overflow; + } + + _sg_image_t* vs_imgs[SG_MAX_SHADERSTAGE_IMAGES] = { 0 }; + int num_vs_imgs = 0; + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++, num_vs_imgs++) { + if (bindings->vs_images[i].id) { + vs_imgs[i] = _sg_lookup_image(&_sg.pools, bindings->vs_images[i].id); + SOKOL_ASSERT(vs_imgs[i]); + _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == vs_imgs[i]->slot.state); + } + else { + break; + } + } + + _sg_image_t* fs_imgs[SG_MAX_SHADERSTAGE_IMAGES] = { 0 }; + int num_fs_imgs = 0; + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++, num_fs_imgs++) { + if (bindings->fs_images[i].id) { + fs_imgs[i] = _sg_lookup_image(&_sg.pools, bindings->fs_images[i].id); + SOKOL_ASSERT(fs_imgs[i]); + _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == fs_imgs[i]->slot.state); + } + else { + break; + } + } + if (_sg.next_draw_valid) { + const int* vb_offsets = bindings->vertex_buffer_offsets; + int ib_offset = bindings->index_buffer_offset; + _sg_apply_bindings(pip, vbs, vb_offsets, num_vbs, ib, ib_offset, vs_imgs, num_vs_imgs, fs_imgs, num_fs_imgs); + _SG_TRACE_ARGS(apply_bindings, bindings); + } + else { + _SG_TRACE_NOARGS(err_draw_invalid); + } +} + +SOKOL_API_IMPL void sg_apply_uniforms(sg_shader_stage stage, int ub_index, const void* data, int num_bytes) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT((stage == SG_SHADERSTAGE_VS) || (stage == SG_SHADERSTAGE_FS)); + SOKOL_ASSERT((ub_index >= 0) && (ub_index < SG_MAX_SHADERSTAGE_UBS)); + SOKOL_ASSERT(data && (num_bytes > 0)); + if (!_sg_validate_apply_uniforms(stage, ub_index, data, num_bytes)) { + _sg.next_draw_valid = false; + _SG_TRACE_NOARGS(err_draw_invalid); + return; + } + if (!_sg.pass_valid) { + _SG_TRACE_NOARGS(err_pass_invalid); + return; + } + if (!_sg.next_draw_valid) { + _SG_TRACE_NOARGS(err_draw_invalid); + } + _sg_apply_uniforms(stage, ub_index, data, num_bytes); + _SG_TRACE_ARGS(apply_uniforms, stage, ub_index, data, num_bytes); +} + +SOKOL_API_IMPL void sg_draw(int base_element, int num_elements, int num_instances) { + SOKOL_ASSERT(_sg.valid); + #if defined(SOKOL_DEBUG) + if (!_sg.bindings_valid) { + SOKOL_LOG("attempting to draw without resource bindings"); + } + #endif + if (!_sg.pass_valid) { + _SG_TRACE_NOARGS(err_pass_invalid); + return; + } + if (!_sg.next_draw_valid) { + _SG_TRACE_NOARGS(err_draw_invalid); + return; + } + if (!_sg.bindings_valid) { + _SG_TRACE_NOARGS(err_bindings_invalid); + return; + } + _sg_draw(base_element, num_elements, num_instances); + _SG_TRACE_ARGS(draw, base_element, num_elements, num_instances); +} + +SOKOL_API_IMPL void sg_end_pass(void) { + SOKOL_ASSERT(_sg.valid); + if (!_sg.pass_valid) { + _SG_TRACE_NOARGS(err_pass_invalid); + return; + } + _sg_end_pass(); + _sg.cur_pass.id = SG_INVALID_ID; + _sg.cur_pipeline.id = SG_INVALID_ID; + _sg.pass_valid = false; + _SG_TRACE_NOARGS(end_pass); +} + +SOKOL_API_IMPL void sg_commit(void) { + SOKOL_ASSERT(_sg.valid); + _sg_commit(); + _SG_TRACE_NOARGS(commit); + _sg.frame_index++; +} + +SOKOL_API_IMPL void sg_reset_state_cache(void) { + SOKOL_ASSERT(_sg.valid); + _sg_reset_state_cache(); + _SG_TRACE_NOARGS(reset_state_cache); +} + +SOKOL_API_IMPL void sg_update_buffer(sg_buffer buf_id, const void* data, int num_bytes) { + SOKOL_ASSERT(_sg.valid); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + if ((num_bytes > 0) && buf && (buf->slot.state == SG_RESOURCESTATE_VALID)) { + if (_sg_validate_update_buffer(buf, data, num_bytes)) { + SOKOL_ASSERT(num_bytes <= buf->size); + /* only one update allowed per buffer and frame */ + SOKOL_ASSERT(buf->update_frame_index != _sg.frame_index); + /* update and append on same buffer in same frame not allowed */ + SOKOL_ASSERT(buf->append_frame_index != _sg.frame_index); + _sg_update_buffer(buf, data, num_bytes); + buf->update_frame_index = _sg.frame_index; + } + } + _SG_TRACE_ARGS(update_buffer, buf_id, data, num_bytes); +} + +SOKOL_API_IMPL int sg_append_buffer(sg_buffer buf_id, const void* data, int num_bytes) { + SOKOL_ASSERT(_sg.valid); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + int result; + if (buf) { + /* rewind append cursor in a new frame */ + if (buf->append_frame_index != _sg.frame_index) { + buf->append_pos = 0; + buf->append_overflow = false; + } + if ((buf->append_pos + num_bytes) > buf->size) { + buf->append_overflow = true; + } + const int start_pos = buf->append_pos; + if (buf->slot.state == SG_RESOURCESTATE_VALID) { + if (_sg_validate_append_buffer(buf, data, num_bytes)) { + if (!buf->append_overflow && (num_bytes > 0)) { + /* update and append on same buffer in same frame not allowed */ + SOKOL_ASSERT(buf->update_frame_index != _sg.frame_index); + _sg_append_buffer(buf, data, num_bytes, buf->append_frame_index != _sg.frame_index); + buf->append_pos += num_bytes; + buf->append_frame_index = _sg.frame_index; + } + } + } + result = start_pos; + } + else { + /* FIXME: should we return -1 here? */ + result = 0; + } + _SG_TRACE_ARGS(append_buffer, buf_id, data, num_bytes, result); + return result; +} + +SOKOL_API_IMPL bool sg_query_buffer_overflow(sg_buffer buf_id) { + SOKOL_ASSERT(_sg.valid); + _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + bool result = buf ? buf->append_overflow : false; + return result; +} + +SOKOL_API_IMPL void sg_update_image(sg_image img_id, const sg_image_content* data) { + SOKOL_ASSERT(_sg.valid); + _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + if (img && img->slot.state == SG_RESOURCESTATE_VALID) { + if (_sg_validate_update_image(img, data)) { + SOKOL_ASSERT(img->upd_frame_index != _sg.frame_index); + _sg_update_image(img, data); + img->upd_frame_index = _sg.frame_index; + } + } + _SG_TRACE_ARGS(update_image, img_id, data); +} + +SOKOL_API_IMPL void sg_push_debug_group(const char* name) { + SOKOL_ASSERT(_sg.valid); + SOKOL_ASSERT(name); + _SG_TRACE_ARGS(push_debug_group, name); +} + +SOKOL_API_IMPL void sg_pop_debug_group(void) { + SOKOL_ASSERT(_sg.valid); + _SG_TRACE_NOARGS(pop_debug_group); +} + +SOKOL_API_IMPL sg_buffer_info sg_query_buffer_info(sg_buffer buf_id) { + SOKOL_ASSERT(_sg.valid); + sg_buffer_info info; + memset(&info, 0, sizeof(info)); + const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + if (buf) { + info.slot.state = buf->slot.state; + info.slot.res_id = buf->slot.id; + info.slot.ctx_id = buf->slot.ctx_id; + info.update_frame_index = buf->update_frame_index; + info.append_frame_index = buf->append_frame_index; + info.append_pos = buf->append_pos; + info.append_overflow = buf->append_overflow; + #if defined(SOKOL_D3D11) + info.num_slots = 1; + info.active_slot = 0; + #else + info.num_slots = buf->num_slots; + info.active_slot = buf->active_slot; + #endif + } + return info; +} + +SOKOL_API_IMPL sg_image_info sg_query_image_info(sg_image img_id) { + SOKOL_ASSERT(_sg.valid); + sg_image_info info; + memset(&info, 0, sizeof(info)); + const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + if (img) { + info.slot.state = img->slot.state; + info.slot.res_id = img->slot.id; + info.slot.ctx_id = img->slot.ctx_id; + #if defined(SOKOL_D3D11) + info.num_slots = 1; + info.active_slot = 0; + #else + info.num_slots = img->num_slots; + info.active_slot = img->active_slot; + #endif + } + return info; +} + +SOKOL_API_IMPL sg_shader_info sg_query_shader_info(sg_shader shd_id) { + SOKOL_ASSERT(_sg.valid); + sg_shader_info info; + memset(&info, 0, sizeof(info)); + const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + if (shd) { + info.slot.state = shd->slot.state; + info.slot.res_id = shd->slot.id; + info.slot.ctx_id = shd->slot.ctx_id; + } + return info; +} + +SOKOL_API_IMPL sg_pipeline_info sg_query_pipeline_info(sg_pipeline pip_id) { + SOKOL_ASSERT(_sg.valid); + sg_pipeline_info info; + memset(&info, 0, sizeof(info)); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + if (pip) { + info.slot.state = pip->slot.state; + info.slot.res_id = pip->slot.id; + info.slot.ctx_id = pip->slot.ctx_id; + } + return info; +} + +SOKOL_API_IMPL sg_pass_info sg_query_pass_info(sg_pass pass_id) { + SOKOL_ASSERT(_sg.valid); + sg_pass_info info; + memset(&info, 0, sizeof(info)); + const _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id); + if (pass) { + info.slot.state = pass->slot.state; + info.slot.res_id = pass->slot.id; + info.slot.ctx_id = pass->slot.ctx_id; + } + return info; +} + +SOKOL_API_IMPL sg_buffer_desc sg_query_buffer_defaults(const sg_buffer_desc* desc) { + SOKOL_ASSERT(_sg.valid && desc); + return _sg_buffer_desc_defaults(desc); +} + +SOKOL_API_IMPL sg_image_desc sg_query_image_defaults(const sg_image_desc* desc) { + SOKOL_ASSERT(_sg.valid && desc); + return _sg_image_desc_defaults(desc); +} + +SOKOL_API_IMPL sg_shader_desc sg_query_shader_defaults(const sg_shader_desc* desc) { + SOKOL_ASSERT(_sg.valid && desc); + return _sg_shader_desc_defaults(desc); +} + +SOKOL_API_IMPL sg_pipeline_desc sg_query_pipeline_defaults(const sg_pipeline_desc* desc) { + SOKOL_ASSERT(_sg.valid && desc); + return _sg_pipeline_desc_defaults(desc); +} + +SOKOL_API_IMPL sg_pass_desc sg_query_pass_defaults(const sg_pass_desc* desc) { + SOKOL_ASSERT(_sg.valid && desc); + return _sg_pass_desc_defaults(desc); +} + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#endif /* SOKOL_IMPL */ diff --git a/sokol-app-sys/external/sokol/sokol_time.h b/sokol-app-sys/external/sokol/sokol_time.h new file mode 100644 index 00000000..d3e4c2a3 --- /dev/null +++ b/sokol-app-sys/external/sokol/sokol_time.h @@ -0,0 +1,277 @@ +#ifndef SOKOL_TIME_INCLUDED +/* + sokol_time.h -- simple cross-platform time measurement + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + Optionally provide the following defines with your own implementations: + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + + If sokol_time.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + void stm_setup(); + Call once before any other functions to initialize sokol_time + (this calls for instance QueryPerformanceFrequency on Windows) + + uint64_t stm_now(); + Get current point in time in unspecified 'ticks'. The value that + is returned has no relation to the 'wall-clock' time and is + not in a specific time unit, it is only useful to compute + time differences. + + uint64_t stm_diff(uint64_t new, uint64_t old); + Computes the time difference between new and old. This will always + return a positive, non-zero value. + + uint64_t stm_since(uint64_t start); + Takes the current time, and returns the elapsed time since start + (this is a shortcut for "stm_diff(stm_now(), start)") + + uint64_t stm_laptime(uint64_t* last_time); + This is useful for measuring frame time and other recurring + events. It takes the current time, returns the time difference + to the value in last_time, and stores the current time in + last_time for the next call. If the value in last_time is 0, + the return value will be zero (this usually happens on the + very first call). + + Use the following functions to convert a duration in ticks into + useful time units: + + double stm_sec(uint64_t ticks); + double stm_ms(uint64_t ticks); + double stm_us(uint64_t ticks); + double stm_ns(uint64_t ticks); + Converts a tick value into seconds, milliseconds, microseconds + or nanoseconds. Note that not all platforms will have nanosecond + or even microsecond precision. + + Uses the following time measurement functions under the hood: + + Windows: QueryPerformanceFrequency() / QueryPerformanceCounter() + MacOS/iOS: mach_absolute_time() + emscripten: performance.now() + Linux+others: clock_gettime(CLOCK_MONOTONIC) + + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_TIME_INCLUDED (1) +#include + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +SOKOL_API_DECL void stm_setup(void); +SOKOL_API_DECL uint64_t stm_now(void); +SOKOL_API_DECL uint64_t stm_diff(uint64_t new_ticks, uint64_t old_ticks); +SOKOL_API_DECL uint64_t stm_since(uint64_t start_ticks); +SOKOL_API_DECL uint64_t stm_laptime(uint64_t* last_time); +SOKOL_API_DECL double stm_sec(uint64_t ticks); +SOKOL_API_DECL double stm_ms(uint64_t ticks); +SOKOL_API_DECL double stm_us(uint64_t ticks); +SOKOL_API_DECL double stm_ns(uint64_t ticks); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif // SOKOL_TIME_INCLUDED + +/*-- IMPLEMENTATION ----------------------------------------------------------*/ +#ifdef SOKOL_IMPL +#define SOKOL_TIME_IMPL_INCLUDED (1) +#include /* memset */ + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif + +#if defined(_WIN32) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#include +typedef struct { + uint32_t initialized; + LARGE_INTEGER freq; + LARGE_INTEGER start; +} _stm_state_t; +#elif defined(__APPLE__) && defined(__MACH__) +#include +typedef struct { + uint32_t initialized; + mach_timebase_info_data_t timebase; + uint64_t start; +} _stm_state_t; +#elif defined(__EMSCRIPTEN__) +#include +typedef struct { + uint32_t initialized; + double start; +} _stm_state_t; +#else /* anything else, this will need more care for non-Linux platforms */ +#ifdef ESP8266 +// On the ESP8266, clock_gettime ignores the first argument and CLOCK_MONOTONIC isn't defined +#define CLOCK_MONOTONIC 0 +#endif +#include +typedef struct { + uint32_t initialized; + uint64_t start; +} _stm_state_t; +#endif +static _stm_state_t _stm; + +/* prevent 64-bit overflow when computing relative timestamp + see https://gist.github.com/jspohr/3dc4f00033d79ec5bdaf67bc46c813e3 +*/ +#if defined(_WIN32) || (defined(__APPLE__) && defined(__MACH__)) +_SOKOL_PRIVATE int64_t int64_muldiv(int64_t value, int64_t numer, int64_t denom) { + int64_t q = value / denom; + int64_t r = value % denom; + return q * numer + r * numer / denom; +} +#endif + +#if defined(__EMSCRIPTEN__) +EM_JS(double, stm_js_perfnow, (void), { + return performance.now(); +}); +#endif + +SOKOL_API_IMPL void stm_setup(void) { + memset(&_stm, 0, sizeof(_stm)); + _stm.initialized = 0xABCDABCD; + #if defined(_WIN32) + QueryPerformanceFrequency(&_stm.freq); + QueryPerformanceCounter(&_stm.start); + #elif defined(__APPLE__) && defined(__MACH__) + mach_timebase_info(&_stm.timebase); + _stm.start = mach_absolute_time(); + #elif defined(__EMSCRIPTEN__) + _stm.start = stm_js_perfnow(); + #else + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + _stm.start = (uint64_t)ts.tv_sec*1000000000 + (uint64_t)ts.tv_nsec; + #endif +} + +SOKOL_API_IMPL uint64_t stm_now(void) { + SOKOL_ASSERT(_stm.initialized == 0xABCDABCD); + uint64_t now; + #if defined(_WIN32) + LARGE_INTEGER qpc_t; + QueryPerformanceCounter(&qpc_t); + now = int64_muldiv(qpc_t.QuadPart - _stm.start.QuadPart, 1000000000, _stm.freq.QuadPart); + #elif defined(__APPLE__) && defined(__MACH__) + const uint64_t mach_now = mach_absolute_time() - _stm.start; + now = int64_muldiv(mach_now, _stm.timebase.numer, _stm.timebase.denom); + #elif defined(__EMSCRIPTEN__) + double js_now = stm_js_perfnow() - _stm.start; + SOKOL_ASSERT(js_now >= 0.0); + now = (uint64_t) (js_now * 1000000.0); + #else + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + now = ((uint64_t)ts.tv_sec*1000000000 + (uint64_t)ts.tv_nsec) - _stm.start; + #endif + return now; +} + +SOKOL_API_IMPL uint64_t stm_diff(uint64_t new_ticks, uint64_t old_ticks) { + if (new_ticks > old_ticks) { + return new_ticks - old_ticks; + } + else { + return 1; + } +} + +SOKOL_API_IMPL uint64_t stm_since(uint64_t start_ticks) { + return stm_diff(stm_now(), start_ticks); +} + +SOKOL_API_IMPL uint64_t stm_laptime(uint64_t* last_time) { + SOKOL_ASSERT(last_time); + uint64_t dt = 0; + uint64_t now = stm_now(); + if (0 != *last_time) { + dt = stm_diff(now, *last_time); + } + *last_time = now; + return dt; +} + +SOKOL_API_IMPL double stm_sec(uint64_t ticks) { + return (double)ticks / 1000000000.0; +} + +SOKOL_API_IMPL double stm_ms(uint64_t ticks) { + return (double)ticks / 1000000.0; +} + +SOKOL_API_IMPL double stm_us(uint64_t ticks) { + return (double)ticks / 1000.0; +} + +SOKOL_API_IMPL double stm_ns(uint64_t ticks) { + return (double)ticks; +} +#endif /* SOKOL_IMPL */ + diff --git a/sokol-app-sys/external/sokol/util/README.md b/sokol-app-sys/external/sokol/util/README.md new file mode 100644 index 00000000..cb3995e5 --- /dev/null +++ b/sokol-app-sys/external/sokol/util/README.md @@ -0,0 +1,17 @@ +# Sokol Utility Headers + +These are optional utility headers on top of the Sokol headers. Unlike the +'core headers' they are not standalone but depend on other Sokol headers +and sometimes also external libraries. + +### What's in here: + +- **sokol_imgui.h**: implements a renderer for [Dear ImGui](https://github.com/ocornut/imgui) on top of sokol_gfx.h and sokol_app.h (the latter being optional if you do your own input-forwarding to ImGui), the implementation +can be compiled as C++ or C. +- **sokol_gfx_imgui.h**: a debug-inspection UI for sokol_gfx.h, this hooks into the sokol-gfx API and lets you inspect resource objects and captured API calls +- **sokol_gl.h**: an OpenGL 1.x style immediate-mode rendering API +on top of sokol_gfx.h +- **sokol_fontstash.h**: a renderer for [fontstash.h](https://github.com/memononen/fontstash) on +on top of sokol_gl.h + +See the embedded header-documentation for build- and usage-details. diff --git a/sokol-app-sys/external/sokol/util/sokol_fontstash.h b/sokol-app-sys/external/sokol/util/sokol_fontstash.h new file mode 100644 index 00000000..fe348fed --- /dev/null +++ b/sokol-app-sys/external/sokol/util/sokol_fontstash.h @@ -0,0 +1,789 @@ +#ifndef SOKOL_FONTSTASH_INCLUDED +/* + sokol_fontstash.h -- renderer for https://github.com/memononen/fontstash + on top of sokol_gl.h + + Project URL: https://github.com/floooh/sokol + + Do this: + + #define SOKOL_FONTSTASH_IMPL + + before you include this file in *one* C or C++ file to create the + implementation. + + The following defines are used by the implementation to select the + platform-specific embedded shader code (these are the same defines as + used by sokol_gfx.h and sokol_app.h): + + SOKOL_GLCORE33 + SOKOL_GLES2 + SOKOL_GLES3 + SOKOL_D3D11 + SOKOL_METAL + + ...optionally provide the following macros to override defaults: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) + SOKOL_FREE(p) - your own free function (default: free(p)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + SOKOL_LOG(msg) - your own logging function (default: puts(msg)) + SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) + + Include the following headers before including sokol_fontstash.h: + + sokol_gfx.h + + Additionally include the following headers for including the sokol_fontstash.h + implementation: + + sokol_gl.h + + HOW TO + ====== + --- First initialize sokol-gfx and sokol-gl as usual: + + sg_setup(&(sg_desc){...}); + sgl_setup(&(sgl_desc){...}); + + --- Create at least one fontstash context with sfons_create() (this replaces + glfonsCreate() from fontstash.h's example GL renderer: + + FONScontext* ctx = sfons_create(atlas_width, atlas_height, FONS_ZERO_TOPLEFT); + + Each FONScontext manages one font atlas texture which can hold rasterized + glyphs for multiple fonts. + + --- From here on, use fontstash.h's functions "as usual" to add TTF + font data and draw text. Note that (just like with sokol-gl), text + rendering can happen anywhere in the frame, not only inside + a sokol-gfx rendering pass. + + --- You can use the helper function + + uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a) + + To convert a 0..255 RGBA color into a packed uint32_t color value + expected by fontstash.h. + + --- Once per frame before calling sgl_draw(), call: + + sfons_flush(FONScontext* ctx) + + ...this will update the dynamic sokol-gfx texture with the latest font + atlas content. + + --- To actually render the text (and any other sokol-gl draw commands), + call sgl_draw() inside a sokol-gfx frame. + + --- NOTE that you can mix fontstash.h calls with sokol-gl calls to mix + text rendering with sokol-gl rendering. You can also use + sokol-gl's matrix stack to position fontstash.h text in 3D. + + --- finally on application shutdown, call: + + sfons_shutdown() + + before sgl_shutdown() and sg_shutdown() + + + WHAT HAPPENS UNDER THE HOOD: + ============================ + + sfons_create(): + - creates a sokol-gfx shader compatible with sokol-gl + - creates an sgl_pipeline object with alpha-blending using + this shader + - creates a 1-byte-per-pixel font atlas texture via sokol-gfx + (pixel format SG_PIXELFORMAT_R8) + + fonsDrawText(): + - this will call the following sequence of sokol-gl functions: + + sgl_enable_texture(); + sgl_texture(...); + sgl_push_pipeline(); + sgl_load_pipeline(...); + sgl_begin_triangles(); + for each vertex: + sg_v2f_t2f_c1i(...); + sgl_end(); + sgl_pop_pipeline(); + sgl_disable_texture(); + + - note that sokol-gl will merge several sgl_*_begin/sgl_end pairs + into a single draw call if no relevant state has changed, typically + all calls to fonsDrawText() will be merged into a single draw call + as long as all calls use the same FONScontext + + sfons_flush(): + - this will call sg_update_image() on the font atlas texture + if fontstash.h has added any rasterized glyphs since the last + frame + + sfons_shutdown(): + - destroy the font atlas texture, sgl_pipeline and sg_shader objects + + LICENSE + ======= + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_FONTSTASH_INCLUDED (1) +#include +#include + +#if !defined(SOKOL_GFX_INCLUDED) +#error "Please include sokol_gfx.h before sokol_fontstash.h" +#endif + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif +#ifdef __cplusplus +extern "C" { +#endif + +SOKOL_API_DECL FONScontext* sfons_create(int width, int height, int flags); +SOKOL_API_DECL void sfons_destroy(FONScontext* ctx); +SOKOL_API_DECL void sfons_flush(FONScontext* ctx); +SOKOL_API_DECL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif /* SOKOL_FONTSTASH_INCLUDED */ + +/*-- IMPLEMENTATION ----------------------------------------------------------*/ +#ifdef SOKOL_FONTSTASH_IMPL +#define SOKOL_FONTSTASH_IMPL_INCLUDED (1) +#include /* memset, memcpy */ + +#if !defined(SOKOL_GL_INCLUDED) +#error "Please include sokol_gl.h before sokol_fontstash.h" +#endif +#if !defined(FONS_H) +#error "Please include fontstash.h before sokol_fontstash.h" +#endif + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef SOKOL_MALLOC + #include + #define SOKOL_MALLOC(s) malloc(s) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #else + #define SOKOL_LOG(s) + #endif +#endif +#ifndef SOKOL_UNREACHABLE + #define SOKOL_UNREACHABLE SOKOL_ASSERT(false) +#endif + +#if defined(SOKOL_GLCORE33) +static const char* _sfons_vs_src = + "#version 330\n" + "uniform mat4 mvp;\n" + "uniform mat4 tm;\n" + "in vec4 position;\n" + "in vec2 texcoord0;\n" + "in vec4 color0;\n" + "out vec4 uv;\n" + "out vec4 color;\n" + "void main() {\n" + " gl_Position = mvp * position;\n" + " uv = tm * vec4(texcoord0, 0.0, 1.0);\n" + " color = color0;\n" + "}\n"; +static const char* _sfons_fs_src = + "#version 330\n" + "uniform sampler2D tex;\n" + "in vec4 uv;\n" + "in vec4 color;\n" + "out vec4 frag_color;\n" + "void main() {\n" + " frag_color = vec4(1.0, 1.0, 1.0, texture(tex, uv.xy).r) * color;\n" + "}\n"; +#elif defined(SOKOL_GLES2) || defined(SOKOL_GLES3) +static const char* _sfons_vs_src = + "uniform mat4 mvp;\n" + "uniform mat4 tm;\n" + "attribute vec4 position;\n" + "attribute vec2 texcoord0;\n" + "attribute vec4 color0;\n" + "varying vec4 uv;\n" + "varying vec4 color;\n" + "void main() {\n" + " gl_Position = mvp * position;\n" + " uv = tm * vec4(texcoord0, 0.0, 1.0);\n" + " color = color0;\n" + "}\n"; +static const char* _sfons_fs_src = + "precision mediump float;\n" + "uniform sampler2D tex;\n" + "varying vec4 uv;\n" + "varying vec4 color;\n" + "void main() {\n" + " gl_FragColor = vec4(1.0, 1.0, 1.0, texture2D(tex, uv.xy).r) * color;\n" + "}\n"; +#elif defined(SOKOL_METAL) +static const char* _sfons_vs_src = + "#include \n" + "using namespace metal;\n" + "struct params_t {\n" + " float4x4 mvp;\n" + " float4x4 tm;\n" + "};\n" + "struct vs_in {\n" + " float4 pos [[attribute(0)]];\n" + " float2 uv [[attribute(1)]];\n" + " float4 color [[attribute(2)]];\n" + "};\n" + "struct vs_out {\n" + " float4 pos [[position]];\n" + " float4 uv;\n" + " float4 color;\n" + "};\n" + "vertex vs_out _main(vs_in in [[stage_in]], constant params_t& params [[buffer(0)]]) {\n" + " vs_out out;\n" + " out.pos = params.mvp * in.pos;\n" + " out.uv = params.tm * float4(in.uv, 0.0, 1.0);\n" + " out.color = in.color;\n" + " return out;\n" + "}\n"; +static const char* _sfons_fs_src = + "#include \n" + "using namespace metal;\n" + "struct fs_in {\n" + " float4 uv;\n" + " float4 color;\n" + "};\n" + "fragment float4 _main(fs_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) {\n" + " return float4(1.0, 1.0, 1.0, tex.sample(smp, in.uv.xy).r) * in.color;\n" + "}\n"; +#elif defined(SOKOL_D3D11) +/* + Shader blobs for D3D11, compiled with: + + fxc.exe /T vs_4_0 /Fh vs.h /Gec /O3 vs.hlsl + fxc.exe /T ps_4_0 /Fh fs.h /Gec /O3 fs.hlsl + + Vertex shader source: + + cbuffer params: register(b0) { + float4x4 mvp; + float4x4 tm; + }; + struct vs_in { + float4 pos: POSITION; + float2 uv: TEXCOORD0; + float4 color: COLOR0; + }; + struct vs_out { + float4 uv: TEXCOORD0; + float4 color: COLOR0; + float4 pos: SV_Position; + }; + vs_out main(vs_in inp) { + vs_out outp; + outp.pos = mul(mvp, inp.pos); + outp.uv = mul(tm, float4(inp.uv, 0.0, 1.0)); + outp.color = inp.color; + return outp; + }; + + Pixel shader source: + + Texture2D tex: register(t0); + sampler smp: register(s0); + float4 main(float4 uv: TEXCOORD0, float4 color: COLOR0): SV_Target0 { + return float4(1.0, 1.0, 1.0, tex.Sample(smp, uv.xy).r) * color; + } +*/ +static const uint8_t _sfons_vs_bin[] = { + 68, 88, 66, 67, 89, 173, + 124, 225, 74, 102, 159, 55, + 47, 64, 241, 32, 31, 107, + 240, 204, 1, 0, 0, 0, + 244, 3, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 8, 1, 0, 0, 120, 1, + 0, 0, 236, 1, 0, 0, + 120, 3, 0, 0, 82, 68, + 69, 70, 204, 0, 0, 0, + 1, 0, 0, 0, 68, 0, + 0, 0, 1, 0, 0, 0, + 28, 0, 0, 0, 0, 4, + 254, 255, 0, 17, 0, 0, + 163, 0, 0, 0, 60, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 112, 97, 114, 97, 109, 115, + 0, 171, 60, 0, 0, 0, + 2, 0, 0, 0, 92, 0, + 0, 0, 128, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 140, 0, 0, 0, + 0, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 144, 0, 0, 0, 0, 0, + 0, 0, 160, 0, 0, 0, + 64, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 144, 0, 0, 0, 0, 0, + 0, 0, 109, 118, 112, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 116, 109, + 0, 77, 105, 99, 114, 111, + 115, 111, 102, 116, 32, 40, + 82, 41, 32, 72, 76, 83, + 76, 32, 83, 104, 97, 100, + 101, 114, 32, 67, 111, 109, + 112, 105, 108, 101, 114, 32, + 49, 48, 46, 49, 0, 171, + 73, 83, 71, 78, 104, 0, + 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 15, 0, 0, 89, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 3, 0, 0, 98, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 15, 15, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 84, 69, 88, 67, 79, + 79, 82, 68, 0, 67, 79, + 76, 79, 82, 0, 79, 83, + 71, 78, 108, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 0, + 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 67, + 79, 76, 79, 82, 0, 83, + 86, 95, 80, 111, 115, 105, + 116, 105, 111, 110, 0, 171, + 83, 72, 68, 82, 132, 1, + 0, 0, 64, 0, 1, 0, + 97, 0, 0, 0, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 95, 0, 0, 3, + 242, 16, 16, 0, 0, 0, + 0, 0, 95, 0, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 95, 0, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 1, 0, + 0, 0, 103, 0, 0, 4, + 242, 32, 16, 0, 2, 0, + 0, 0, 1, 0, 0, 0, + 104, 0, 0, 2, 1, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 0, 0, + 0, 0, 86, 21, 16, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 6, 16, + 16, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 1, 0, 0, 0, 70, 30, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 86, 21, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 6, 16, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 166, 26, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 242, 32, 16, 0, + 2, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 246, 31, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 62, 0, 0, 1, + 83, 84, 65, 84, 116, 0, + 0, 0, 9, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, + 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; +static uint8_t _sfons_fs_bin[] = { + 68, 88, 66, 67, 180, 53, + 115, 174, 239, 17, 254, 112, + 63, 104, 217, 123, 150, 145, + 179, 27, 1, 0, 0, 0, + 120, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 200, 0, 0, 0, 24, 1, + 0, 0, 76, 1, 0, 0, + 252, 1, 0, 0, 82, 68, + 69, 70, 140, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 28, 0, 0, 0, 0, 4, + 255, 255, 0, 17, 0, 0, + 100, 0, 0, 0, 92, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 96, 0, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 1, 0, 0, 0, 13, 0, + 0, 0, 115, 109, 112, 0, + 116, 101, 120, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 49, 48, 46, + 49, 0, 73, 83, 71, 78, + 72, 0, 0, 0, 2, 0, + 0, 0, 8, 0, 0, 0, + 56, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 3, 0, 0, + 65, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 15, 0, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 67, 79, 76, + 79, 82, 0, 171, 79, 83, + 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, + 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 84, + 97, 114, 103, 101, 116, 0, + 171, 171, 83, 72, 68, 82, + 168, 0, 0, 0, 64, 0, + 0, 0, 42, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 0, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 69, 0, 0, 9, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 0, 0, + 0, 0, 150, 115, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 242, 32, 16, 0, 0, 0, + 0, 0, 6, 12, 16, 0, + 0, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 116, 0, 0, 0, + 4, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0 +}; +#elif defined(SOKOL_DUMMY_BACKEND) +static const char* _sfons_vs_src = ""; +static const char* _sfons_fs_src = ""; +#endif + +typedef struct _sfons_t { + sg_shader shd; + sgl_pipeline pip; + sg_image img; + int width, height; + bool img_dirty; +} _sfons_t; + +static int _sfons_render_create(void* user_ptr, int width, int height) { + SOKOL_ASSERT(user_ptr && (width > 8) && (height > 8)); + _sfons_t* sfons = (_sfons_t*) user_ptr; + + /* sokol-gl compatible shader which treats RED channel as alpha */ + if (sfons->shd.id == SG_INVALID_ID) { + sg_shader_desc shd_desc; + memset(&shd_desc, 0, sizeof(shd_desc)); + shd_desc.attrs[0].name = "position"; + shd_desc.attrs[1].name = "texcoord0"; + shd_desc.attrs[2].name = "color0"; + shd_desc.attrs[0].sem_name = "POSITION"; + shd_desc.attrs[1].sem_name = "TEXCOORD"; + shd_desc.attrs[2].sem_name = "COLOR"; + sg_shader_uniform_block_desc* ub = &shd_desc.vs.uniform_blocks[0]; + ub->size = 128; + ub->uniforms[0].name = "mvp"; + ub->uniforms[0].type = SG_UNIFORMTYPE_MAT4; + ub->uniforms[1].name = "tm"; + ub->uniforms[1].type = SG_UNIFORMTYPE_MAT4; + shd_desc.fs.images[0].name = "tex"; + shd_desc.fs.images[0].type = SG_IMAGETYPE_2D; + #if defined(SOKOL_D3D11) + shd_desc.vs.byte_code = _sfons_vs_bin; + shd_desc.vs.byte_code_size = sizeof(_sfons_vs_bin); + shd_desc.fs.byte_code = _sfons_fs_bin; + shd_desc.fs.byte_code_size = sizeof(_sfons_fs_bin); + #else + shd_desc.vs.source = _sfons_vs_src; + shd_desc.fs.source = _sfons_fs_src; + #endif + shd_desc.label = "sfons-shader"; + sfons->shd = sg_make_shader(&shd_desc); + } + + /* sokol-gl pipeline object */ + if (sfons->pip.id == SG_INVALID_ID) { + sg_pipeline_desc pip_desc; + memset(&pip_desc, 0, sizeof(pip_desc)); + pip_desc.shader = sfons->shd; + pip_desc.blend.enabled = true; + pip_desc.blend.src_factor_rgb = SG_BLENDFACTOR_SRC_ALPHA; + pip_desc.blend.dst_factor_rgb = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA; + sfons->pip = sgl_make_pipeline(&pip_desc); + } + + /* create or re-create font atlas texture */ + if (sfons->img.id != SG_INVALID_ID) { + sg_destroy_image(sfons->img); + sfons->img.id = SG_INVALID_ID; + } + sfons->width = width; + sfons->height = height; + + SOKOL_ASSERT(sfons->img.id == SG_INVALID_ID); + sg_image_desc img_desc; + memset(&img_desc, 0, sizeof(img_desc)); + img_desc.width = sfons->width; + img_desc.height = sfons->height; + img_desc.min_filter = SG_FILTER_LINEAR; + img_desc.mag_filter = SG_FILTER_LINEAR; + img_desc.usage = SG_USAGE_DYNAMIC; + img_desc.pixel_format = SG_PIXELFORMAT_R8; + sfons->img = sg_make_image(&img_desc); + return 1; +} + +static int _sfons_render_resize(void* user_ptr, int width, int height) { + return _sfons_render_create(user_ptr, width, height); +} + +static void _sfons_render_update(void* user_ptr, int* rect, const unsigned char* data) { + SOKOL_ASSERT(user_ptr && rect && data); + _sfons_t* sfons = (_sfons_t*) user_ptr; + sfons->img_dirty = true; +} + +static void _sfons_render_draw(void* user_ptr, const float* verts, const float* tcoords, const unsigned int* colors, int nverts) { + SOKOL_ASSERT(user_ptr && verts && tcoords && colors && (nverts > 0)); + _sfons_t* sfons = (_sfons_t*) user_ptr; + sgl_enable_texture(); + sgl_texture(sfons->img); + sgl_push_pipeline(); + sgl_load_pipeline(sfons->pip); + sgl_begin_triangles(); + for (int i = 0; i < nverts; i++) { + sgl_v2f_t2f_c1i(verts[2*i+0], verts[2*i+1], tcoords[2*i+0], tcoords[2*i+1], colors[i]); + } + sgl_end(); + sgl_pop_pipeline(); + sgl_disable_texture(); +} + +static void _sfons_render_delete(void* user_ptr) { + SOKOL_ASSERT(user_ptr); + _sfons_t* sfons = (_sfons_t*) user_ptr; + if (sfons->img.id != SG_INVALID_ID) { + sg_destroy_image(sfons->img); + sfons->img.id = SG_INVALID_ID; + } + if (sfons->pip.id != SG_INVALID_ID) { + sgl_destroy_pipeline(sfons->pip); + sfons->pip.id = SG_INVALID_ID; + } + if (sfons->shd.id != SG_INVALID_ID) { + sg_destroy_shader(sfons->shd); + sfons->shd.id = SG_INVALID_ID; + } + SOKOL_FREE(sfons); +} + +SOKOL_API_IMPL FONScontext* sfons_create(int width, int height, int flags) { + SOKOL_ASSERT((width > 0) && (height > 0)); + FONSparams params; + _sfons_t* sfons = (_sfons_t*) SOKOL_MALLOC(sizeof(_sfons_t)); + memset(sfons, 0, sizeof(_sfons_t)); + memset(¶ms, 0, sizeof(params)); + params.width = width; + params.height = height; + params.flags = (unsigned char) flags; + params.renderCreate = _sfons_render_create; + params.renderResize = _sfons_render_resize; + params.renderUpdate = _sfons_render_update; + params.renderDraw = _sfons_render_draw; + params.renderDelete = _sfons_render_delete; + params.userPtr = sfons; + return fonsCreateInternal(¶ms); +} + +SOKOL_API_IMPL void sfons_destroy(FONScontext* ctx) { + SOKOL_ASSERT(ctx); + fonsDeleteInternal(ctx); +} + +SOKOL_API_IMPL void sfons_flush(FONScontext* ctx) { + SOKOL_ASSERT(ctx && ctx->params.userPtr); + _sfons_t* sfons = (_sfons_t*) ctx->params.userPtr; + if (sfons->img_dirty) { + sfons->img_dirty = false; + sg_image_content content; + memset(&content, 0, sizeof(content)); + content.subimage[0][0].ptr = ctx->texData; + content.subimage[0][0].size = sfons->width * sfons->height; + sg_update_image(sfons->img, &content); + } +} + +SOKOL_API_IMPL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + return (r) | (g<<8) | (b<<16) | (a<<24); +} + +#endif /* SOKOL_FONTSTASH_IMPL */ diff --git a/sokol-app-sys/external/sokol/util/sokol_gfx_imgui.h b/sokol-app-sys/external/sokol/util/sokol_gfx_imgui.h new file mode 100644 index 00000000..b373a3dc --- /dev/null +++ b/sokol-app-sys/external/sokol/util/sokol_gfx_imgui.h @@ -0,0 +1,3648 @@ +#ifndef SOKOL_GFX_IMGUI_INCLUDED +/* + sokol_gfx_imgui.h -- debug-inspection UI for sokol_gfx.h using Dear ImGui + + Project URL: https://github.com/floooh/sokol + + Do this: + + #define SOKOL_GFX_IMGUI_IMPL + + before you include this file in *one* C or C++ file to create the + implementation. + + NOTE that the implementation can be compiled either as C++ or as C. + When compiled as C++, sokol_gfx_imgui.h will directly call into the + Dear ImGui C++ API. When compiled as C, sokol_gfx_imgui.h will call + cimgui.h functions instead. + + Include the following file(s) before including sokol_gfx_imgui.h: + + sokol_gfx.h + + Additionally, include the following headers before including the + implementation: + + If the implementation is compiled as C++: + imgui.h + + If the implementation is compiled as C: + cimgui.h + + The sokol_gfx.h implementation must be compiled with debug trace hooks + enabled by defining: + + SOKOL_TRACE_HOOKS + + ...before including the sokol_gfx.h implementation. + + Before including the sokol_gfx_imgui.h implementation, optionally + override the following macros: + + SOKOL_ASSERT(c) -- your own assert macro, default: assert(c) + SOKOL_UNREACHABLE -- your own macro to annotate unreachable code, + default: SOKOL_ASSERT(false) + SOKOL_MALLOC(s) -- your own memory allocation function, default: malloc(s) + SOKOL_FREE(p) -- your own memory free function, default: free(p) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + + If sokol_gfx_imgui.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + STEP BY STEP: + ============= + --- create an sg_imgui_t struct (which must be preserved between frames) + and initialize it with: + + sg_imgui_init(&sg_imgui); + + --- somewhere in the per-frame code call: + + sg_imgui_draw(&sg_imgui) + + this won't draw anything yet, since no windows are open. + + --- open and close windows directly by setting the following public + booleans in the sg_imgui_t struct: + + sg_imgui.buffers.open = true; + sg_imgui.images.open = true; + sg_imgui.shaders.open = true; + sg_imgui.pipelines.open = true; + sg_imgui.passes.open = true; + sg_imgui.capture.open = true; + + ...for instance, to control the window visibility through + menu items, the following code can be used: + + if (ImGui::BeginMainMenuBar()) { + if (ImGui::BeginMenu("sokol-gfx")) { + ImGui::MenuItem("Buffers", 0, &sg_imgui.buffers.open); + ImGui::MenuItem("Images", 0, &sg_imgui.images.open); + ImGui::MenuItem("Shaders", 0, &sg_imgui.shaders.open); + ImGui::MenuItem("Pipelines", 0, &sg_imgui.pipelines.open); + ImGui::MenuItem("Passes", 0, &sg_imgui.passes.open); + ImGui::MenuItem("Calls", 0, &sg_imgui.capture.open); + ImGui::EndMenu(); + } + ImGui::EndMainMenuBar(); + } + + --- before application shutdown, call: + + sg_imgui_discard(&sg_imgui); + + ...this is not strictly necessary because the application exits + anyway, but not doing this may trigger memory leak detection tools. + + --- finally, your application needs an ImGui renderer, you can either + provide your own, or drop in the sokol_imgui.h utility header + + ALTERNATIVE DRAWING FUNCTIONS: + ============================== + Instead of the convenient, but all-in-one sg_imgui_draw() function, + you can also use the following granular functions which might allow + better integration with your existing UI: + + The following functions only render the window *content* (so you + can integrate the UI into you own windows): + + void sg_imgui_draw_buffers_content(sg_imgui_t* ctx); + void sg_imgui_draw_images_content(sg_imgui_t* ctx); + void sg_imgui_draw_shaders_content(sg_imgui_t* ctx); + void sg_imgui_draw_pipelines_content(sg_imgui_t* ctx); + void sg_imgui_draw_passes_content(sg_imgui_t* ctx); + void sg_imgui_draw_capture_content(sg_imgui_t* ctx); + + And these are the 'full window' drawing functions: + + void sg_imgui_draw_buffers_window(sg_imgui_t* ctx); + void sg_imgui_draw_images_window(sg_imgui_t* ctx); + void sg_imgui_draw_shaders_window(sg_imgui_t* ctx); + void sg_imgui_draw_pipelines_window(sg_imgui_t* ctx); + void sg_imgui_draw_passes_window(sg_imgui_t* ctx); + void sg_imgui_draw_capture_window(sg_imgui_t* ctx); + + Finer-grained drawing functions may be moved to the public API + in the future as needed. + + LICENSE + ======= + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_GFX_IMGUI_INCLUDED (1) +#include +#include + +#if !defined(SOKOL_GFX_INCLUDED) +#error "Please include sokol_gfx.h before sokol_gfx_imgui.h" +#endif + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +#define SG_IMGUI_STRBUF_LEN (96) +/* max number of captured calls per frame */ +#define SG_IMGUI_MAX_FRAMECAPTURE_ITEMS (4096) + +typedef struct { + char buf[SG_IMGUI_STRBUF_LEN]; +} sg_imgui_str_t; + +typedef struct { + sg_buffer res_id; + sg_imgui_str_t label; + sg_buffer_desc desc; +} sg_imgui_buffer_t; + +typedef struct { + sg_image res_id; + float ui_scale; + sg_imgui_str_t label; + sg_image_desc desc; +} sg_imgui_image_t; + +typedef struct { + sg_shader res_id; + sg_imgui_str_t label; + sg_imgui_str_t vs_entry; + sg_imgui_str_t vs_image_name[SG_MAX_SHADERSTAGE_IMAGES]; + sg_imgui_str_t vs_uniform_name[SG_MAX_SHADERSTAGE_UBS][SG_MAX_UB_MEMBERS]; + sg_imgui_str_t fs_entry; + sg_imgui_str_t fs_image_name[SG_MAX_SHADERSTAGE_IMAGES]; + sg_imgui_str_t fs_uniform_name[SG_MAX_SHADERSTAGE_UBS][SG_MAX_UB_MEMBERS]; + sg_imgui_str_t attr_name[SG_MAX_VERTEX_ATTRIBUTES]; + sg_imgui_str_t attr_sem_name[SG_MAX_VERTEX_ATTRIBUTES]; + sg_shader_desc desc; +} sg_imgui_shader_t; + +typedef struct { + sg_pipeline res_id; + sg_imgui_str_t label; + sg_pipeline_desc desc; +} sg_imgui_pipeline_t; + +typedef struct { + sg_pass res_id; + sg_imgui_str_t label; + float color_image_scale[SG_MAX_COLOR_ATTACHMENTS]; + float ds_image_scale; + sg_pass_desc desc; +} sg_imgui_pass_t; + +typedef struct { + bool open; + int num_slots; + sg_buffer sel_buf; + sg_imgui_buffer_t* slots; +} sg_imgui_buffers_t; + +typedef struct { + bool open; + int num_slots; + sg_image sel_img; + sg_imgui_image_t* slots; +} sg_imgui_images_t; + +typedef struct { + bool open; + int num_slots; + sg_shader sel_shd; + sg_imgui_shader_t* slots; +} sg_imgui_shaders_t; + +typedef struct { + bool open; + int num_slots; + sg_pipeline sel_pip; + sg_imgui_pipeline_t* slots; +} sg_imgui_pipelines_t; + +typedef struct { + bool open; + int num_slots; + sg_pass sel_pass; + sg_imgui_pass_t* slots; +} sg_imgui_passes_t; + +typedef enum { + SG_IMGUI_CMD_INVALID, + SG_IMGUI_CMD_RESET_STATE_CACHE, + SG_IMGUI_CMD_MAKE_BUFFER, + SG_IMGUI_CMD_MAKE_IMAGE, + SG_IMGUI_CMD_MAKE_SHADER, + SG_IMGUI_CMD_MAKE_PIPELINE, + SG_IMGUI_CMD_MAKE_PASS, + SG_IMGUI_CMD_DESTROY_BUFFER, + SG_IMGUI_CMD_DESTROY_IMAGE, + SG_IMGUI_CMD_DESTROY_SHADER, + SG_IMGUI_CMD_DESTROY_PIPELINE, + SG_IMGUI_CMD_DESTROY_PASS, + SG_IMGUI_CMD_UPDATE_BUFFER, + SG_IMGUI_CMD_UPDATE_IMAGE, + SG_IMGUI_CMD_APPEND_BUFFER, + SG_IMGUI_CMD_BEGIN_DEFAULT_PASS, + SG_IMGUI_CMD_BEGIN_PASS, + SG_IMGUI_CMD_APPLY_VIEWPORT, + SG_IMGUI_CMD_APPLY_SCISSOR_RECT, + SG_IMGUI_CMD_APPLY_PIPELINE, + SG_IMGUI_CMD_APPLY_BINDINGS, + SG_IMGUI_CMD_APPLY_UNIFORMS, + SG_IMGUI_CMD_DRAW, + SG_IMGUI_CMD_END_PASS, + SG_IMGUI_CMD_COMMIT, + SG_IMGUI_CMD_ALLOC_BUFFER, + SG_IMGUI_CMD_ALLOC_IMAGE, + SG_IMGUI_CMD_ALLOC_SHADER, + SG_IMGUI_CMD_ALLOC_PIPELINE, + SG_IMGUI_CMD_ALLOC_PASS, + SG_IMGUI_CMD_INIT_BUFFER, + SG_IMGUI_CMD_INIT_IMAGE, + SG_IMGUI_CMD_INIT_SHADER, + SG_IMGUI_CMD_INIT_PIPELINE, + SG_IMGUI_CMD_INIT_PASS, + SG_IMGUI_CMD_FAIL_BUFFER, + SG_IMGUI_CMD_FAIL_IMAGE, + SG_IMGUI_CMD_FAIL_SHADER, + SG_IMGUI_CMD_FAIL_PIPELINE, + SG_IMGUI_CMD_FAIL_PASS, + SG_IMGUI_CMD_PUSH_DEBUG_GROUP, + SG_IMGUI_CMD_POP_DEBUG_GROUP, + SG_IMGUI_CMD_ERR_BUFFER_POOL_EXHAUSTED, + SG_IMGUI_CMD_ERR_IMAGE_POOL_EXHAUSTED, + SG_IMGUI_CMD_ERR_SHADER_POOL_EXHAUSTED, + SG_IMGUI_CMD_ERR_PIPELINE_POOL_EXHAUSTED, + SG_IMGUI_CMD_ERR_PASS_POOL_EXHAUSTED, + SG_IMGUI_CMD_ERR_CONTEXT_MISMATCH, + SG_IMGUI_CMD_ERR_PASS_INVALID, + SG_IMGUI_CMD_ERR_DRAW_INVALID, + SG_IMGUI_CMD_ERR_BINDINGS_INVALID, +} sg_imgui_cmd_t; + +typedef struct { + sg_buffer result; +} sg_imgui_args_make_buffer_t; + +typedef struct { + sg_image result; +} sg_imgui_args_make_image_t; + +typedef struct { + sg_shader result; +} sg_imgui_args_make_shader_t; + +typedef struct { + sg_pipeline result; +} sg_imgui_args_make_pipeline_t; + +typedef struct { + sg_pass result; +} sg_imgui_args_make_pass_t; + +typedef struct { + sg_buffer buffer; +} sg_imgui_args_destroy_buffer_t; + +typedef struct { + sg_image image; +} sg_imgui_args_destroy_image_t; + +typedef struct { + sg_shader shader; +} sg_imgui_args_destroy_shader_t; + +typedef struct { + sg_pipeline pipeline; +} sg_imgui_args_destroy_pipeline_t; + +typedef struct { + sg_pass pass; +} sg_imgui_args_destroy_pass_t; + +typedef struct { + sg_buffer buffer; + int data_size; +} sg_imgui_args_update_buffer_t; + +typedef struct { + sg_image image; +} sg_imgui_args_update_image_t; + +typedef struct { + sg_buffer buffer; + int data_size; + int result; +} sg_imgui_args_append_buffer_t; + +typedef struct { + sg_pass_action action; + int width; + int height; +} sg_imgui_args_begin_default_pass_t; + +typedef struct { + sg_pass pass; + sg_pass_action action; +} sg_imgui_args_begin_pass_t; + +typedef struct { + int x, y, width, height; + bool origin_top_left; +} sg_imgui_args_apply_viewport_t; + +typedef struct { + int x, y, width, height; + bool origin_top_left; +} sg_imgui_args_apply_scissor_rect_t; + +typedef struct { + sg_pipeline pipeline; +} sg_imgui_args_apply_pipeline_t; + +typedef struct { + sg_bindings bindings; +} sg_imgui_args_apply_bindings_t; + +typedef struct { + sg_shader_stage stage; + int ub_index; + const void* data; + int num_bytes; + sg_pipeline pipeline; /* the pipeline which was active at this call */ + uint32_t ubuf_pos; /* start of copied data in capture buffer */ +} sg_imgui_args_apply_uniforms_t; + +typedef struct { + int base_element; + int num_elements; + int num_instances; +} sg_imgui_args_draw_t; + +typedef struct { + sg_buffer result; +} sg_imgui_args_alloc_buffer_t; + +typedef struct { + sg_image result; +} sg_imgui_args_alloc_image_t; + +typedef struct { + sg_shader result; +} sg_imgui_args_alloc_shader_t; + +typedef struct { + sg_pipeline result; +} sg_imgui_args_alloc_pipeline_t; + +typedef struct { + sg_pass result; +} sg_imgui_args_alloc_pass_t; + +typedef struct { + sg_buffer buffer; +} sg_imgui_args_init_buffer_t; + +typedef struct { + sg_image image; +} sg_imgui_args_init_image_t; + +typedef struct { + sg_shader shader; +} sg_imgui_args_init_shader_t; + +typedef struct { + sg_pipeline pipeline; +} sg_imgui_args_init_pipeline_t; + +typedef struct { + sg_pass pass; +} sg_imgui_args_init_pass_t; + +typedef struct { + sg_buffer buffer; +} sg_imgui_args_fail_buffer_t; + +typedef struct { + sg_image image; +} sg_imgui_args_fail_image_t; + +typedef struct { + sg_shader shader; +} sg_imgui_args_fail_shader_t; + +typedef struct { + sg_pipeline pipeline; +} sg_imgui_args_fail_pipeline_t; + +typedef struct { + sg_pass pass; +} sg_imgui_args_fail_pass_t; + +typedef struct { + sg_imgui_str_t name; +} sg_imgui_args_push_debug_group_t; + +typedef union { + sg_imgui_args_make_buffer_t make_buffer; + sg_imgui_args_make_image_t make_image; + sg_imgui_args_make_shader_t make_shader; + sg_imgui_args_make_pipeline_t make_pipeline; + sg_imgui_args_make_pass_t make_pass; + sg_imgui_args_destroy_buffer_t destroy_buffer; + sg_imgui_args_destroy_image_t destroy_image; + sg_imgui_args_destroy_shader_t destroy_shader; + sg_imgui_args_destroy_pipeline_t destroy_pipeline; + sg_imgui_args_destroy_pass_t destroy_pass; + sg_imgui_args_update_buffer_t update_buffer; + sg_imgui_args_update_image_t update_image; + sg_imgui_args_append_buffer_t append_buffer; + sg_imgui_args_begin_default_pass_t begin_default_pass; + sg_imgui_args_begin_pass_t begin_pass; + sg_imgui_args_apply_viewport_t apply_viewport; + sg_imgui_args_apply_scissor_rect_t apply_scissor_rect; + sg_imgui_args_apply_pipeline_t apply_pipeline; + sg_imgui_args_apply_bindings_t apply_bindings; + sg_imgui_args_apply_uniforms_t apply_uniforms; + sg_imgui_args_draw_t draw; + sg_imgui_args_alloc_buffer_t alloc_buffer; + sg_imgui_args_alloc_image_t alloc_image; + sg_imgui_args_alloc_shader_t alloc_shader; + sg_imgui_args_alloc_pipeline_t alloc_pipeline; + sg_imgui_args_alloc_pass_t alloc_pass; + sg_imgui_args_init_buffer_t init_buffer; + sg_imgui_args_init_image_t init_image; + sg_imgui_args_init_shader_t init_shader; + sg_imgui_args_init_pipeline_t init_pipeline; + sg_imgui_args_init_pass_t init_pass; + sg_imgui_args_fail_buffer_t fail_buffer; + sg_imgui_args_fail_image_t fail_image; + sg_imgui_args_fail_shader_t fail_shader; + sg_imgui_args_fail_pipeline_t fail_pipeline; + sg_imgui_args_fail_pass_t fail_pass; + sg_imgui_args_push_debug_group_t push_debug_group; +} sg_imgui_args_t; + +typedef struct { + sg_imgui_cmd_t cmd; + uint32_t color; + sg_imgui_args_t args; +} sg_imgui_capture_item_t; + +typedef struct { + uint32_t ubuf_size; /* size of uniform capture buffer in bytes */ + uint32_t ubuf_pos; /* current uniform buffer pos */ + uint8_t* ubuf; /* buffer for capturing uniform updates */ + uint32_t num_items; + sg_imgui_capture_item_t items[SG_IMGUI_MAX_FRAMECAPTURE_ITEMS]; +} sg_imgui_capture_bucket_t; + +/* double-buffered call-capture buckets, one bucket is currently recorded, + the previous bucket is displayed +*/ +typedef struct { + bool open; + uint32_t bucket_index; /* which bucket to record to, 0 or 1 */ + uint32_t sel_item; /* currently selected capture item by index */ + sg_imgui_capture_bucket_t bucket[2]; +} sg_imgui_capture_t; + +typedef struct { + bool open; +} sg_imgui_caps_t; + +typedef struct { + uint32_t init_tag; + sg_imgui_buffers_t buffers; + sg_imgui_images_t images; + sg_imgui_shaders_t shaders; + sg_imgui_pipelines_t pipelines; + sg_imgui_passes_t passes; + sg_imgui_capture_t capture; + sg_imgui_caps_t caps; + sg_pipeline cur_pipeline; + sg_trace_hooks hooks; +} sg_imgui_t; + +SOKOL_API_DECL void sg_imgui_init(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_discard(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw(sg_imgui_t* ctx); + +SOKOL_API_DECL void sg_imgui_draw_buffers_content(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_images_content(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_shaders_content(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_pipelines_content(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_passes_content(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_capture_content(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_capabilities_content(sg_imgui_t* ctx); + +SOKOL_API_DECL void sg_imgui_draw_buffers_window(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_images_window(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_shaders_window(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_pipelines_window(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_passes_window(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_capture_window(sg_imgui_t* ctx); +SOKOL_API_DECL void sg_imgui_draw_capabilities_window(sg_imgui_t* ctx); + +#if defined(__cplusplus) +} /* extern "C" */ +#endif +#endif /* SOKOL_GFX_IMGUI_INCLUDED */ + +/*=== IMPLEMENTATION =========================================================*/ +#ifdef SOKOL_GFX_IMGUI_IMPL +#define SOKOL_GFX_IMGUI_IMPL_INCLUDED (1) +#if defined(__cplusplus) + #if !defined(IMGUI_VERSION) + #error "Please include imgui.h before the sokol_imgui.h implementation" + #endif +#else + #if !defined(CIMGUI_INCLUDED) + #error "Please include cimgui.h before the sokol_imgui.h implementation" + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef SOKOL_UNREACHABLE + #define SOKOL_UNREACHABLE SOKOL_ASSERT(false) +#endif +#ifndef SOKOL_MALLOC + #include + #define SOKOL_MALLOC(s) malloc(s) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif +#ifndef SOKOL_API_IMPL +#define SOKOL_API_IMPL +#endif + +#include +#include /* snprintf */ + +#define _SG_IMGUI_SLOT_MASK (0xFFFF) +#define _SG_IMGUI_LIST_WIDTH (192) +#define _SG_IMGUI_COLOR_OTHER 0xFFCCCCCC +#define _SG_IMGUI_COLOR_RSRC 0xFF00FFFF +#define _SG_IMGUI_COLOR_DRAW 0xFF00FF00 +#define _SG_IMGUI_COLOR_ERR 0xFF8888FF + +/*--- C => C++ layer ---------------------------------------------------------*/ +#if defined(__cplusplus) +#define IMVEC2(x,y) ImVec2(x,y) +#define IMVEC4(x,y,z,w) ImVec4(x,y,z,w) +_SOKOL_PRIVATE void igText(const char* fmt,...) { + va_list args; + va_start(args, fmt); + ImGui::TextV(fmt, args); + va_end(args); +} +_SOKOL_PRIVATE void igSeparator() { + return ImGui::Separator(); +} +_SOKOL_PRIVATE void igSameLine(float offset_from_start_x, float spacing) { + return ImGui::SameLine(offset_from_start_x,spacing); +} +_SOKOL_PRIVATE void igPushIDInt(int int_id) { + return ImGui::PushID(int_id); +} +_SOKOL_PRIVATE void igPopID() { + return ImGui::PopID(); +} +_SOKOL_PRIVATE bool igSelectable(const char* label,bool selected,ImGuiSelectableFlags flags,const ImVec2 size) { + return ImGui::Selectable(label,selected,flags,size); +} +_SOKOL_PRIVATE bool igSmallButton(const char* label) { + return ImGui::SmallButton(label); +} +_SOKOL_PRIVATE bool igBeginChild(const char* str_id,const ImVec2 size,bool border,ImGuiWindowFlags flags) { + return ImGui::BeginChild(str_id,size,border,flags); +} +_SOKOL_PRIVATE void igEndChild() { + return ImGui::EndChild(); +} +_SOKOL_PRIVATE void igPushStyleColorU32(ImGuiCol idx, ImU32 col) { + return ImGui::PushStyleColor(idx,col); +} +_SOKOL_PRIVATE void igPopStyleColor(int count) { + return ImGui::PopStyleColor(count); +} +_SOKOL_PRIVATE bool igTreeNodeStrStr(const char* str_id,const char* fmt,...) { + va_list args; + va_start(args, fmt); + bool ret = ImGui::TreeNodeV(str_id,fmt,args); + va_end(args); + return ret; +} +_SOKOL_PRIVATE bool igTreeNodeStr(const char* label) { + return ImGui::TreeNode(label); +} +_SOKOL_PRIVATE void igTreePop() { + return ImGui::TreePop(); +} +_SOKOL_PRIVATE bool igIsItemHovered(ImGuiHoveredFlags flags) { + return ImGui::IsItemHovered(flags); +} +_SOKOL_PRIVATE void igSetTooltip(const char* fmt,...) { + va_list args; + va_start(args, fmt); + ImGui::SetTooltipV(fmt,args); + va_end(args); +} +_SOKOL_PRIVATE bool igSliderFloat(const char* label,float* v,float v_min,float v_max,const char* format,float power) { + return ImGui::SliderFloat(label,v,v_min,v_max,format,power); +} +_SOKOL_PRIVATE void igImage(ImTextureID user_texture_id,const ImVec2 size,const ImVec2 uv0,const ImVec2 uv1,const ImVec4 tint_col,const ImVec4 border_col) { + return ImGui::Image(user_texture_id,size,uv0,uv1,tint_col,border_col); +} +_SOKOL_PRIVATE void igSetNextWindowSize(const ImVec2 size,ImGuiCond cond) { + return ImGui::SetNextWindowSize(size,cond); +} +_SOKOL_PRIVATE bool igBegin(const char* name,bool* p_open,ImGuiWindowFlags flags) { + return ImGui::Begin(name,p_open,flags); +} +_SOKOL_PRIVATE void igEnd() { + return ImGui::End(); +} +#else +#define IMVEC2(x,y) (ImVec2){x,y} +#define IMVEC4(x,y,z,w) (ImVec4){x,y,z,w} +#endif + +/*--- UTILS ------------------------------------------------------------------*/ +_SOKOL_PRIVATE int _sg_imgui_slot_index(uint32_t id) { + int slot_index = (int) (id & _SG_IMGUI_SLOT_MASK); + SOKOL_ASSERT(0 != slot_index); + return slot_index; +} + +_SOKOL_PRIVATE int _sg_imgui_uniform_size(sg_uniform_type type, int count) { + switch (type) { + case SG_UNIFORMTYPE_INVALID: return 0; + case SG_UNIFORMTYPE_FLOAT: return 4 * count; + case SG_UNIFORMTYPE_FLOAT2: return 8 * count; + case SG_UNIFORMTYPE_FLOAT3: return 12 * count; /* FIXME: std140??? */ + case SG_UNIFORMTYPE_FLOAT4: return 16 * count; + case SG_UNIFORMTYPE_MAT4: return 64 * count; + default: + SOKOL_UNREACHABLE; + return -1; + } +} + +_SOKOL_PRIVATE void* _sg_imgui_alloc(int size) { + SOKOL_ASSERT(size > 0); + return SOKOL_MALLOC(size); +} + +_SOKOL_PRIVATE void _sg_imgui_free(void* ptr) { + if (ptr) { + SOKOL_FREE(ptr); + } +} + +_SOKOL_PRIVATE void* _sg_imgui_realloc(void* old_ptr, int old_size, int new_size) { + SOKOL_ASSERT((new_size > 0) && (new_size > old_size)); + void* new_ptr = SOKOL_MALLOC(new_size); + SOKOL_ASSERT(new_ptr); + if (old_ptr) { + if (old_size > 0) { + memcpy(new_ptr, old_ptr, old_size); + } + _sg_imgui_free(old_ptr); + } + return new_ptr; +} + +_SOKOL_PRIVATE void _sg_imgui_strcpy(sg_imgui_str_t* dst, const char* src) { + SOKOL_ASSERT(dst); + if (src) { + #if defined(_MSC_VER) + strncpy_s(dst->buf, SG_IMGUI_STRBUF_LEN, src, (SG_IMGUI_STRBUF_LEN-1)); + #else + strncpy(dst->buf, src, SG_IMGUI_STRBUF_LEN); + #endif + dst->buf[SG_IMGUI_STRBUF_LEN-1] = 0; + } + else { + memset(dst->buf, 0, SG_IMGUI_STRBUF_LEN); + } +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_make_str(const char* str) { + sg_imgui_str_t res; + _sg_imgui_strcpy(&res, str); + return res; +} + +_SOKOL_PRIVATE const char* _sg_imgui_str_dup(const char* src) { + SOKOL_ASSERT(src); + int len = (int) strlen(src) + 1; + char* dst = (char*) _sg_imgui_alloc(len); + memcpy(dst, src, len); + return (const char*) dst; +} + +_SOKOL_PRIVATE const uint8_t* _sg_imgui_bin_dup(const uint8_t* src, int num_bytes) { + SOKOL_ASSERT(src && (num_bytes > 0)); + uint8_t* dst = (uint8_t*) _sg_imgui_alloc(num_bytes); + memcpy(dst, src, num_bytes); + return (const uint8_t*) dst; +} + +_SOKOL_PRIVATE void _sg_imgui_snprintf(sg_imgui_str_t* dst, const char* fmt, ...) { + SOKOL_ASSERT(dst); + va_list args; + va_start(args, fmt); + vsnprintf(dst->buf, sizeof(dst->buf), fmt, args); + dst->buf[sizeof(dst->buf)-1] = 0; + va_end(args); +} + +/*--- STRING CONVERSION ------------------------------------------------------*/ +_SOKOL_PRIVATE const char* _sg_imgui_resourcestate_string(sg_resource_state s) { + switch (s) { + case SG_RESOURCESTATE_INITIAL: return "SG_RESOURCESTATE_INITIAL"; + case SG_RESOURCESTATE_ALLOC: return "SG_RESOURCESTATE_ALLOC"; + case SG_RESOURCESTATE_VALID: return "SG_RESOURCESTATE_VALID"; + case SG_RESOURCESTATE_FAILED: return "SG_RESOURCESTATE_FAILED"; + default: return "SG_RESOURCESTATE_INVALID"; + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_resource_slot(const sg_slot_info* slot) { + igText("ResId: %08X", slot->res_id); + igText("CtxId: %08X", slot->ctx_id); + igText("State: %s", _sg_imgui_resourcestate_string(slot->state)); +} + +_SOKOL_PRIVATE const char* _sg_imgui_backend_string(sg_backend b) { + switch (b) { + case SG_BACKEND_GLCORE33: return "SG_BACKEND_GLCORE33"; + case SG_BACKEND_GLES2: return "SG_BACKEND_GLES2"; + case SG_BACKEND_GLES3: return "SG_BACKEND_GLES3"; + case SG_BACKEND_D3D11: return "SG_BACKEND_D3D11"; + case SG_BACKEND_METAL_IOS: return "SG_BACKEND_METAL_IOS"; + case SG_BACKEND_METAL_MACOS: return "SG_BACKEND_METAL_MACOS"; + case SG_BACKEND_METAL_SIMULATOR: return "SG_BACKEND_METAL_SIMULATOR"; + case SG_BACKEND_DUMMY: return "SG_BACKEND_DUMMY"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_buffertype_string(sg_buffer_type t) { + switch (t) { + case SG_BUFFERTYPE_VERTEXBUFFER: return "SG_BUFFERTYPE_VERTEXBUFFER"; + case SG_BUFFERTYPE_INDEXBUFFER: return "SG_BUFFERTYPE_INDEXBUFFER"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_usage_string(sg_usage u) { + switch (u) { + case SG_USAGE_IMMUTABLE: return "SG_USAGE_IMMUTABLE"; + case SG_USAGE_DYNAMIC: return "SG_USAGE_DYNAMIC"; + case SG_USAGE_STREAM: return "SG_USAGE_STREAM"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_imagetype_string(sg_image_type t) { + switch (t) { + case SG_IMAGETYPE_2D: return "SG_IMAGETYPE_2D"; + case SG_IMAGETYPE_CUBE: return "SG_IMAGETYPE_CUBE"; + case SG_IMAGETYPE_3D: return "SG_IMAGETYPE_3D"; + case SG_IMAGETYPE_ARRAY: return "SG_IMAGETYPE_ARRAY"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_pixelformat_string(sg_pixel_format fmt) { + switch (fmt) { + case SG_PIXELFORMAT_NONE: return "SG_PIXELFORMAT_NONE"; + case SG_PIXELFORMAT_R8: return "SG_PIXELFORMAT_R8"; + case SG_PIXELFORMAT_R8SN: return "SG_PIXELFORMAT_R8SN"; + case SG_PIXELFORMAT_R8UI: return "SG_PIXELFORMAT_R8UI"; + case SG_PIXELFORMAT_R8SI: return "SG_PIXELFORMAT_R8SI"; + case SG_PIXELFORMAT_R16: return "SG_PIXELFORMAT_R16"; + case SG_PIXELFORMAT_R16SN: return "SG_PIXELFORMAT_R16SN"; + case SG_PIXELFORMAT_R16UI: return "SG_PIXELFORMAT_R16UI"; + case SG_PIXELFORMAT_R16SI: return "SG_PIXELFORMAT_R16SI"; + case SG_PIXELFORMAT_R16F: return "SG_PIXELFORMAT_R16F"; + case SG_PIXELFORMAT_RG8: return "SG_PIXELFORMAT_RG8"; + case SG_PIXELFORMAT_RG8SN: return "SG_PIXELFORMAT_RG8SN"; + case SG_PIXELFORMAT_RG8UI: return "SG_PIXELFORMAT_RG8UI"; + case SG_PIXELFORMAT_RG8SI: return "SG_PIXELFORMAT_RG8SI"; + case SG_PIXELFORMAT_R32UI: return "SG_PIXELFORMAT_R32UI"; + case SG_PIXELFORMAT_R32SI: return "SG_PIXELFORMAT_R32SI"; + case SG_PIXELFORMAT_R32F: return "SG_PIXELFORMAT_R32F"; + case SG_PIXELFORMAT_RG16: return "SG_PIXELFORMAT_RG16"; + case SG_PIXELFORMAT_RG16SN: return "SG_PIXELFORMAT_RG16SN"; + case SG_PIXELFORMAT_RG16UI: return "SG_PIXELFORMAT_RG16UI"; + case SG_PIXELFORMAT_RG16SI: return "SG_PIXELFORMAT_RG16SI"; + case SG_PIXELFORMAT_RG16F: return "SG_PIXELFORMAT_RG16F"; + case SG_PIXELFORMAT_RGBA8: return "SG_PIXELFORMAT_RGBA8"; + case SG_PIXELFORMAT_RGBA8SN: return "SG_PIXELFORMAT_RGBA8SN"; + case SG_PIXELFORMAT_RGBA8UI: return "SG_PIXELFORMAT_RGBA8UI"; + case SG_PIXELFORMAT_RGBA8SI: return "SG_PIXELFORMAT_RGBA8SI"; + case SG_PIXELFORMAT_BGRA8: return "SG_PIXELFORMAT_BGRA8"; + case SG_PIXELFORMAT_RGB10A2: return "SG_PIXELFORMAT_RGB10A2"; + case SG_PIXELFORMAT_RG11B10F: return "SG_PIXELFORMAT_RG11B10F"; + case SG_PIXELFORMAT_RG32UI: return "SG_PIXELFORMAT_RG32UI"; + case SG_PIXELFORMAT_RG32SI: return "SG_PIXELFORMAT_RG32SI"; + case SG_PIXELFORMAT_RG32F: return "SG_PIXELFORMAT_RG32F"; + case SG_PIXELFORMAT_RGBA16: return "SG_PIXELFORMAT_RGBA16"; + case SG_PIXELFORMAT_RGBA16SN: return "SG_PIXELFORMAT_RGBA16SN"; + case SG_PIXELFORMAT_RGBA16UI: return "SG_PIXELFORMAT_RGBA16UI"; + case SG_PIXELFORMAT_RGBA16SI: return "SG_PIXELFORMAT_RGBA16SI"; + case SG_PIXELFORMAT_RGBA16F: return "SG_PIXELFORMAT_RGBA16F"; + case SG_PIXELFORMAT_RGBA32UI: return "SG_PIXELFORMAT_RGBA32UI"; + case SG_PIXELFORMAT_RGBA32SI: return "SG_PIXELFORMAT_RGBA32SI"; + case SG_PIXELFORMAT_RGBA32F: return "SG_PIXELFORMAT_RGBA32F"; + case SG_PIXELFORMAT_DEPTH: return "SG_PIXELFORMAT_DEPTH"; + case SG_PIXELFORMAT_DEPTH_STENCIL: return "SG_PIXELFORMAT_DEPTH_STENCIL"; + case SG_PIXELFORMAT_BC1_RGBA: return "SG_PIXELFORMAT_BC1_RGBA"; + case SG_PIXELFORMAT_BC2_RGBA: return "SG_PIXELFORMAT_BC2_RGBA"; + case SG_PIXELFORMAT_BC3_RGBA: return "SG_PIXELFORMAT_BC3_RGBA"; + case SG_PIXELFORMAT_BC4_R: return "SG_PIXELFORMAT_BC4_R"; + case SG_PIXELFORMAT_BC4_RSN: return "SG_PIXELFORMAT_BC4_RSN"; + case SG_PIXELFORMAT_BC5_RG: return "SG_PIXELFORMAT_BC5_RG"; + case SG_PIXELFORMAT_BC5_RGSN: return "SG_PIXELFORMAT_BC5_RGSN"; + case SG_PIXELFORMAT_BC6H_RGBF: return "SG_PIXELFORMAT_BC6H_RGBF"; + case SG_PIXELFORMAT_BC6H_RGBUF: return "SG_PIXELFORMAT_BC6H_RGBUF"; + case SG_PIXELFORMAT_BC7_RGBA: return "SG_PIXELFORMAT_BC7_RGBA"; + case SG_PIXELFORMAT_PVRTC_RGB_2BPP: return "SG_PIXELFORMAT_PVRTC_RGB_2BPP"; + case SG_PIXELFORMAT_PVRTC_RGB_4BPP: return "SG_PIXELFORMAT_PVRTC_RGB_4BPP"; + case SG_PIXELFORMAT_PVRTC_RGBA_2BPP: return "SG_PIXELFORMAT_PVRTC_RGBA_2BPP"; + case SG_PIXELFORMAT_PVRTC_RGBA_4BPP: return "SG_PIXELFORMAT_PVRTC_RGBA_4BPP"; + case SG_PIXELFORMAT_ETC2_RGB8: return "SG_PIXELFORMAT_ETC2_RGB8"; + case SG_PIXELFORMAT_ETC2_RGB8A1: return "SG_PIXELFORMAT_ETC2_RGB8A1"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_filter_string(sg_filter f) { + switch (f) { + case SG_FILTER_NEAREST: return "SG_FILTER_NEAREST"; + case SG_FILTER_LINEAR: return "SG_FILTER_LINEAR"; + case SG_FILTER_NEAREST_MIPMAP_NEAREST: return "SG_FILTER_NEAREST_MIPMAP_NEAREST"; + case SG_FILTER_NEAREST_MIPMAP_LINEAR: return "SG_FILTER_NEAREST_MIPMAP_LINEAR"; + case SG_FILTER_LINEAR_MIPMAP_NEAREST: return "SG_FILTER_LINEAR_MIPMAP_NEAREST"; + case SG_FILTER_LINEAR_MIPMAP_LINEAR: return "SG_FILTER_LINEAR_MIPMAP_LINEAR"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_wrap_string(sg_wrap w) { + switch (w) { + case SG_WRAP_REPEAT: return "SG_WRAP_REPEAT"; + case SG_WRAP_CLAMP_TO_EDGE: return "SG_WRAP_CLAMP_TO_EDGE"; + case SG_WRAP_CLAMP_TO_BORDER: return "SG_WRAP_CLAMP_TO_BORDER"; + case SG_WRAP_MIRRORED_REPEAT: return "SG_WRAP_MIRRORED_REPEAT"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_bordercolor_string(sg_border_color bc) { + switch (bc) { + case SG_BORDERCOLOR_TRANSPARENT_BLACK: return "SG_BORDERCOLOR_TRANSPARENT_BLACK"; + case SG_BORDERCOLOR_OPAQUE_BLACK: return "SG_BORDERCOLOR_OPAQUE_BLACK"; + case SG_BORDERCOLOR_OPAQUE_WHITE: return "SG_BORDERCOLOR_OPAQUE_WHITE"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_uniformtype_string(sg_uniform_type t) { + switch (t) { + case SG_UNIFORMTYPE_FLOAT: return "SG_UNIFORMTYPE_FLOAT"; + case SG_UNIFORMTYPE_FLOAT2: return "SG_UNIFORMTYPE_FLOAT2"; + case SG_UNIFORMTYPE_FLOAT3: return "SG_UNIFORMTYPE_FLOAT3"; + case SG_UNIFORMTYPE_FLOAT4: return "SG_UNIFORMTYPE_FLOAT4"; + case SG_UNIFORMTYPE_MAT4: return "SG_UNIFORMTYPE_MAT4"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_vertexstep_string(sg_vertex_step s) { + switch (s) { + case SG_VERTEXSTEP_PER_VERTEX: return "SG_VERTEXSTEP_PER_VERTEX"; + case SG_VERTEXSTEP_PER_INSTANCE: return "SG_VERTEXSTEP_PER_INSTANCE"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_vertexformat_string(sg_vertex_format f) { + switch (f) { + case SG_VERTEXFORMAT_FLOAT: return "SG_VERTEXFORMAT_FLOAT"; + case SG_VERTEXFORMAT_FLOAT2: return "SG_VERTEXFORMAT_FLOAT2"; + case SG_VERTEXFORMAT_FLOAT3: return "SG_VERTEXFORMAT_FLOAT3"; + case SG_VERTEXFORMAT_FLOAT4: return "SG_VERTEXFORMAT_FLOAT4"; + case SG_VERTEXFORMAT_BYTE4: return "SG_VERTEXFORMAT_BYTE4"; + case SG_VERTEXFORMAT_BYTE4N: return "SG_VERTEXFORMAT_BYTE4N"; + case SG_VERTEXFORMAT_UBYTE4: return "SG_VERTEXFORMAT_UBYTE4"; + case SG_VERTEXFORMAT_UBYTE4N: return "SG_VERTEXFORMAT_UBYTE4N"; + case SG_VERTEXFORMAT_SHORT2: return "SG_VERTEXFORMAT_SHORT2"; + case SG_VERTEXFORMAT_SHORT2N: return "SG_VERTEXFORMAT_SHORT2N"; + case SG_VERTEXFORMAT_SHORT4: return "SG_VERTEXFORMAT_SHORT4"; + case SG_VERTEXFORMAT_SHORT4N: return "SG_VERTEXFORMAT_SHORT4N"; + case SG_VERTEXFORMAT_UINT10_N2: return "SG_VERTEXFORMAT_UINT10_N2"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_primitivetype_string(sg_primitive_type t) { + switch (t) { + case SG_PRIMITIVETYPE_POINTS: return "SG_PRIMITIVETYPE_POINTS"; + case SG_PRIMITIVETYPE_LINES: return "SG_PRIMITIVETYPE_LINES"; + case SG_PRIMITIVETYPE_LINE_STRIP: return "SG_PRIMITIVETYPE_LINE_STRIP"; + case SG_PRIMITIVETYPE_TRIANGLES: return "SG_PRIMITIVETYPE_TRIANGLES"; + case SG_PRIMITIVETYPE_TRIANGLE_STRIP: return "SG_PRIMITIVETYPE_TRIANGLE_STRIP"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_indextype_string(sg_index_type t) { + switch (t) { + case SG_INDEXTYPE_NONE: return "SG_INDEXTYPE_NONE"; + case SG_INDEXTYPE_UINT16: return "SG_INDEXTYPE_UINT16"; + case SG_INDEXTYPE_UINT32: return "SG_INDEXTYPE_UINT32"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_stencilop_string(sg_stencil_op op) { + switch (op) { + case SG_STENCILOP_KEEP: return "SG_STENCILOP_KEEP"; + case SG_STENCILOP_ZERO: return "SG_STENCILOP_ZERO"; + case SG_STENCILOP_REPLACE: return "SG_STENCILOP_REPLACE"; + case SG_STENCILOP_INCR_CLAMP: return "SG_STENCILOP_INCR_CLAMP"; + case SG_STENCILOP_DECR_CLAMP: return "SG_STENCILOP_DECR_CLAMP"; + case SG_STENCILOP_INVERT: return "SG_STENCILOP_INVERT"; + case SG_STENCILOP_INCR_WRAP: return "SG_STENCILOP_INCR_WRAP"; + case SG_STENCILOP_DECR_WRAP: return "SG_STENCILOP_DECR_WRAP"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_comparefunc_string(sg_compare_func f) { + switch (f) { + case SG_COMPAREFUNC_NEVER: return "SG_COMPAREFUNC_NEVER"; + case SG_COMPAREFUNC_LESS: return "SG_COMPAREFUNC_LESS"; + case SG_COMPAREFUNC_EQUAL: return "SG_COMPAREFUNC_EQUAL"; + case SG_COMPAREFUNC_LESS_EQUAL: return "SG_COMPAREFUNC_LESS_EQUAL"; + case SG_COMPAREFUNC_GREATER: return "SG_COMPAREFUNC_GREATER"; + case SG_COMPAREFUNC_NOT_EQUAL: return "SG_COMPAREFUNC_NOT_EQUAL"; + case SG_COMPAREFUNC_GREATER_EQUAL: return "SG_COMPAREFUNC_GREATER_EQUAL"; + case SG_COMPAREFUNC_ALWAYS: return "SG_COMPAREFUNC_ALWAYS"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_blendfactor_string(sg_blend_factor f) { + switch (f) { + case SG_BLENDFACTOR_ZERO: return "SG_BLENDFACTOR_ZERO"; + case SG_BLENDFACTOR_ONE: return "SG_BLENDFACTOR_ONE"; + case SG_BLENDFACTOR_SRC_COLOR: return "SG_BLENDFACTOR_SRC_COLOR"; + case SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR: return "SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR"; + case SG_BLENDFACTOR_SRC_ALPHA: return "SG_BLENDFACTOR_SRC_ALPHA"; + case SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA: return "SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA"; + case SG_BLENDFACTOR_DST_COLOR: return "SG_BLENDFACTOR_DST_COLOR"; + case SG_BLENDFACTOR_ONE_MINUS_DST_COLOR: return "SG_BLENDFACTOR_ONE_MINUS_DST_COLOR"; + case SG_BLENDFACTOR_DST_ALPHA: return "SG_BLENDFACTOR_DST_ALPHA"; + case SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA: return "SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA"; + case SG_BLENDFACTOR_SRC_ALPHA_SATURATED: return "SG_BLENDFACTOR_SRC_ALPHA_SATURATED"; + case SG_BLENDFACTOR_BLEND_COLOR: return "SG_BLENDFACTOR_BLEND_COLOR"; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_COLOR: return "SG_BLENDFACTOR_ONE_MINUS_BLEND_COLOR"; + case SG_BLENDFACTOR_BLEND_ALPHA: return "SG_BLENDFACTOR_BLEND_ALPHA"; + case SG_BLENDFACTOR_ONE_MINUS_BLEND_ALPHA: return "SG_BLENDFACTOR_ONE_MINUS_BLEND_ALPHA"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_blendop_string(sg_blend_op op) { + switch (op) { + case SG_BLENDOP_ADD: return "SG_BLENDOP_ADD"; + case SG_BLENDOP_SUBTRACT: return "SG_BLENDOP_SUBTRACT"; + case SG_BLENDOP_REVERSE_SUBTRACT: return "SG_BLENDOP_REVERSE_SUBTRACT"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_colormask_string(uint8_t m) { + static const char* str[] = { + "NONE", + "R", + "G", + "RG", + "B", + "RB", + "GB", + "RGB", + "A", + "RA", + "GA", + "RGA", + "BA", + "RBA", + "GBA", + "RGBA", + }; + return str[m & 0xF]; +} + +_SOKOL_PRIVATE const char* _sg_imgui_cullmode_string(sg_cull_mode cm) { + switch (cm) { + case SG_CULLMODE_NONE: return "SG_CULLMODE_NONE"; + case SG_CULLMODE_FRONT: return "SG_CULLMODE_FRONT"; + case SG_CULLMODE_BACK: return "SG_CULLMODE_BACK"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_facewinding_string(sg_face_winding fw) { + switch (fw) { + case SG_FACEWINDING_CCW: return "SG_FACEWINDING_CCW"; + case SG_FACEWINDING_CW: return "SG_FACEWINDING_CW"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_shaderstage_string(sg_shader_stage stage) { + switch (stage) { + case SG_SHADERSTAGE_VS: return "SG_SHADERSTAGE_VS"; + case SG_SHADERSTAGE_FS: return "SG_SHADERSTAGE_FS"; + default: return "???"; + } +} + +_SOKOL_PRIVATE const char* _sg_imgui_bool_string(bool b) { + return b ? "true" : "false"; +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_res_id_string(uint32_t res_id, const char* label) { + SOKOL_ASSERT(label); + sg_imgui_str_t res; + if (label[0]) { + _sg_imgui_snprintf(&res, "'%s'", label); + } + else { + _sg_imgui_snprintf(&res, "0x%08X", res_id); + } + return res; +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_buffer_id_string(sg_imgui_t* ctx, sg_buffer buf_id) { + if (buf_id.id != SG_INVALID_ID) { + const sg_imgui_buffer_t* buf_ui = &ctx->buffers.slots[_sg_imgui_slot_index(buf_id.id)]; + return _sg_imgui_res_id_string(buf_id.id, buf_ui->label.buf); + } + else { + return _sg_imgui_make_str(""); + } +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_image_id_string(sg_imgui_t* ctx, sg_image img_id) { + if (img_id.id != SG_INVALID_ID) { + const sg_imgui_image_t* img_ui = &ctx->images.slots[_sg_imgui_slot_index(img_id.id)]; + return _sg_imgui_res_id_string(img_id.id, img_ui->label.buf); + } + else { + return _sg_imgui_make_str(""); + } +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_shader_id_string(sg_imgui_t* ctx, sg_shader shd_id) { + if (shd_id.id != SG_INVALID_ID) { + const sg_imgui_shader_t* shd_ui = &ctx->shaders.slots[_sg_imgui_slot_index(shd_id.id)]; + return _sg_imgui_res_id_string(shd_id.id, shd_ui->label.buf); + } + else { + return _sg_imgui_make_str(""); + } +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_pipeline_id_string(sg_imgui_t* ctx, sg_pipeline pip_id) { + if (pip_id.id != SG_INVALID_ID) { + const sg_imgui_pipeline_t* pip_ui = &ctx->pipelines.slots[_sg_imgui_slot_index(pip_id.id)]; + return _sg_imgui_res_id_string(pip_id.id, pip_ui->label.buf); + } + else { + return _sg_imgui_make_str(""); + } +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_pass_id_string(sg_imgui_t* ctx, sg_pass pass_id) { + if (pass_id.id != SG_INVALID_ID) { + const sg_imgui_pass_t* pass_ui = &ctx->passes.slots[_sg_imgui_slot_index(pass_id.id)]; + return _sg_imgui_res_id_string(pass_id.id, pass_ui->label.buf); + } + else { + return _sg_imgui_make_str(""); + } +} + +/*--- RESOURCE HELPERS -------------------------------------------------------*/ +_SOKOL_PRIVATE void _sg_imgui_buffer_created(sg_imgui_t* ctx, sg_buffer res_id, int slot_index, const sg_buffer_desc* desc) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->buffers.num_slots)); + sg_imgui_buffer_t* buf = &ctx->buffers.slots[slot_index]; + buf->res_id = res_id; + buf->desc = *desc; + buf->label = _sg_imgui_make_str(desc->label); +} + +_SOKOL_PRIVATE void _sg_imgui_buffer_destroyed(sg_imgui_t* ctx, int slot_index) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->buffers.num_slots)); + sg_imgui_buffer_t* buf = &ctx->buffers.slots[slot_index]; + buf->res_id.id = SG_INVALID_ID; +} + +_SOKOL_PRIVATE void _sg_imgui_image_created(sg_imgui_t* ctx, sg_image res_id, int slot_index, const sg_image_desc* desc) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->images.num_slots)); + sg_imgui_image_t* img = &ctx->images.slots[slot_index]; + img->res_id = res_id; + img->desc = *desc; + img->ui_scale = 1.0f; + img->label = _sg_imgui_make_str(desc->label); +} + +_SOKOL_PRIVATE void _sg_imgui_image_destroyed(sg_imgui_t* ctx, int slot_index) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->images.num_slots)); + sg_imgui_image_t* img = &ctx->images.slots[slot_index]; + img->res_id.id = SG_INVALID_ID; +} + +_SOKOL_PRIVATE void _sg_imgui_shader_created(sg_imgui_t* ctx, sg_shader res_id, int slot_index, const sg_shader_desc* desc) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->shaders.num_slots)); + sg_imgui_shader_t* shd = &ctx->shaders.slots[slot_index]; + shd->res_id = res_id; + shd->desc = *desc; + shd->label = _sg_imgui_make_str(desc->label); + if (shd->desc.vs.entry) { + shd->vs_entry = _sg_imgui_make_str(shd->desc.vs.entry); + shd->desc.vs.entry = shd->vs_entry.buf; + } + if (shd->desc.fs.entry) { + shd->fs_entry = _sg_imgui_make_str(shd->desc.fs.entry); + shd->desc.fs.entry = shd->fs_entry.buf; + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_UBS; i++) { + for (int j = 0; j < SG_MAX_UB_MEMBERS; j++) { + sg_shader_uniform_desc* ud = &shd->desc.vs.uniform_blocks[i].uniforms[j]; + if (ud->name) { + shd->vs_uniform_name[i][j] = _sg_imgui_make_str(ud->name); + ud->name = shd->vs_uniform_name[i][j].buf; + } + } + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_UBS; i++) { + for (int j = 0; j < SG_MAX_UB_MEMBERS; j++) { + sg_shader_uniform_desc* ud = &shd->desc.fs.uniform_blocks[i].uniforms[j]; + if (ud->name) { + shd->fs_uniform_name[i][j] = _sg_imgui_make_str(ud->name); + ud->name = shd->fs_uniform_name[i][j].buf; + } + } + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + if (shd->desc.vs.images[i].name) { + shd->vs_image_name[i] = _sg_imgui_make_str(shd->desc.vs.images[i].name); + shd->desc.vs.images[i].name = shd->vs_image_name[i].buf; + } + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + if (shd->desc.fs.images[i].name) { + shd->fs_image_name[i] = _sg_imgui_make_str(shd->desc.fs.images[i].name); + shd->desc.fs.images[i].name = shd->fs_image_name[i].buf; + } + } + if (shd->desc.vs.source) { + shd->desc.vs.source = _sg_imgui_str_dup(shd->desc.vs.source); + } + if (shd->desc.vs.byte_code) { + shd->desc.vs.byte_code = _sg_imgui_bin_dup(shd->desc.vs.byte_code, shd->desc.vs.byte_code_size); + } + if (shd->desc.fs.source) { + shd->desc.fs.source = _sg_imgui_str_dup(shd->desc.fs.source); + } + if (shd->desc.fs.byte_code) { + shd->desc.fs.byte_code = _sg_imgui_bin_dup(shd->desc.fs.byte_code, shd->desc.fs.byte_code_size); + } + for (int i = 0; i < SG_MAX_VERTEX_ATTRIBUTES; i++) { + sg_shader_attr_desc* ad = &shd->desc.attrs[i]; + if (ad->name) { + shd->attr_name[i] = _sg_imgui_make_str(ad->name); + ad->name = shd->attr_name[i].buf; + } + if (ad->sem_name) { + shd->attr_sem_name[i] = _sg_imgui_make_str(ad->sem_name); + ad->sem_name = shd->attr_sem_name[i].buf; + } + } +} + +_SOKOL_PRIVATE void _sg_imgui_shader_destroyed(sg_imgui_t* ctx, int slot_index) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->shaders.num_slots)); + sg_imgui_shader_t* shd = &ctx->shaders.slots[slot_index]; + shd->res_id.id = SG_INVALID_ID; + if (shd->desc.vs.source) { + _sg_imgui_free((void*)shd->desc.vs.source); + shd->desc.vs.source = 0; + } + if (shd->desc.vs.byte_code) { + _sg_imgui_free((void*)shd->desc.vs.byte_code); + shd->desc.vs.byte_code = 0; + } + if (shd->desc.fs.source) { + _sg_imgui_free((void*)shd->desc.fs.source); + shd->desc.fs.source = 0; + } + if (shd->desc.fs.byte_code) { + _sg_imgui_free((void*)shd->desc.fs.byte_code); + shd->desc.fs.byte_code = 0; + } +} + +_SOKOL_PRIVATE void _sg_imgui_pipeline_created(sg_imgui_t* ctx, sg_pipeline res_id, int slot_index, const sg_pipeline_desc* desc) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->pipelines.num_slots)); + sg_imgui_pipeline_t* pip = &ctx->pipelines.slots[slot_index]; + pip->res_id = res_id; + pip->label = _sg_imgui_make_str(desc->label); + pip->desc = *desc; + +} + +_SOKOL_PRIVATE void _sg_imgui_pipeline_destroyed(sg_imgui_t* ctx, int slot_index) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->pipelines.num_slots)); + sg_imgui_pipeline_t* pip = &ctx->pipelines.slots[slot_index]; + pip->res_id.id = SG_INVALID_ID; +} + +_SOKOL_PRIVATE void _sg_imgui_pass_created(sg_imgui_t* ctx, sg_pass res_id, int slot_index, const sg_pass_desc* desc) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->passes.num_slots)); + sg_imgui_pass_t* pass = &ctx->passes.slots[slot_index]; + pass->res_id = res_id; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + pass->color_image_scale[i] = 0.25f; + } + pass->ds_image_scale = 0.25f; + pass->label = _sg_imgui_make_str(desc->label); + pass->desc = *desc; +} + +_SOKOL_PRIVATE void _sg_imgui_pass_destroyed(sg_imgui_t* ctx, int slot_index) { + SOKOL_ASSERT((slot_index > 0) && (slot_index < ctx->passes.num_slots)); + sg_imgui_pass_t* pass = &ctx->passes.slots[slot_index]; + pass->res_id.id = SG_INVALID_ID; +} + +/*--- COMMAND CAPTURING ------------------------------------------------------*/ +_SOKOL_PRIVATE void _sg_imgui_capture_init(sg_imgui_t* ctx) { + const int ubuf_initial_size = 256 * 1024; + for (int i = 0; i < 2; i++) { + sg_imgui_capture_bucket_t* bucket = &ctx->capture.bucket[i]; + bucket->ubuf_size = ubuf_initial_size; + bucket->ubuf = (uint8_t*) _sg_imgui_alloc(bucket->ubuf_size); + SOKOL_ASSERT(bucket->ubuf); + } +} + +_SOKOL_PRIVATE void _sg_imgui_capture_discard(sg_imgui_t* ctx) { + for (int i = 0; i < 2; i++) { + sg_imgui_capture_bucket_t* bucket = &ctx->capture.bucket[i]; + SOKOL_ASSERT(bucket->ubuf); + _sg_imgui_free(bucket->ubuf); + bucket->ubuf = 0; + } +} + +_SOKOL_PRIVATE sg_imgui_capture_bucket_t* _sg_imgui_capture_get_write_bucket(sg_imgui_t* ctx) { + return &ctx->capture.bucket[ctx->capture.bucket_index & 1]; +} + +_SOKOL_PRIVATE sg_imgui_capture_bucket_t* _sg_imgui_capture_get_read_bucket(sg_imgui_t* ctx) { + return &ctx->capture.bucket[(ctx->capture.bucket_index + 1) & 1]; +} + +_SOKOL_PRIVATE void _sg_imgui_capture_next_frame(sg_imgui_t* ctx) { + ctx->capture.bucket_index = (ctx->capture.bucket_index + 1) & 1; + sg_imgui_capture_bucket_t* bucket = &ctx->capture.bucket[ctx->capture.bucket_index]; + bucket->num_items = 0; + bucket->ubuf_pos = 0; +} + +_SOKOL_PRIVATE void _sg_imgui_capture_grow_ubuf(sg_imgui_t* ctx, uint32_t required_size) { + sg_imgui_capture_bucket_t* bucket = _sg_imgui_capture_get_write_bucket(ctx); + SOKOL_ASSERT(required_size > bucket->ubuf_size); + int old_size = bucket->ubuf_size; + int new_size = required_size + (required_size>>1); /* allocate a bit ahead */ + bucket->ubuf_size = new_size; + bucket->ubuf = (uint8_t*) _sg_imgui_realloc(bucket->ubuf, old_size, new_size); +} + +_SOKOL_PRIVATE sg_imgui_capture_item_t* _sg_imgui_capture_next_write_item(sg_imgui_t* ctx) { + sg_imgui_capture_bucket_t* bucket = _sg_imgui_capture_get_write_bucket(ctx); + if (bucket->num_items < SG_IMGUI_MAX_FRAMECAPTURE_ITEMS) { + sg_imgui_capture_item_t* item = &bucket->items[bucket->num_items++]; + return item; + } + else { + return 0; + } +} + +_SOKOL_PRIVATE uint32_t _sg_imgui_capture_num_read_items(sg_imgui_t* ctx) { + sg_imgui_capture_bucket_t* bucket = _sg_imgui_capture_get_read_bucket(ctx); + return bucket->num_items; +} + +_SOKOL_PRIVATE sg_imgui_capture_item_t* _sg_imgui_capture_read_item_at(sg_imgui_t* ctx, uint32_t index) { + sg_imgui_capture_bucket_t* bucket = _sg_imgui_capture_get_read_bucket(ctx); + SOKOL_ASSERT(index < bucket->num_items); + return &bucket->items[index]; +} + +_SOKOL_PRIVATE uint32_t _sg_imgui_capture_uniforms(sg_imgui_t* ctx, const void* data, int num_bytes) { + sg_imgui_capture_bucket_t* bucket = _sg_imgui_capture_get_write_bucket(ctx); + const uint32_t required_size = bucket->ubuf_pos + num_bytes; + if (required_size > bucket->ubuf_size) { + _sg_imgui_capture_grow_ubuf(ctx, required_size); + } + SOKOL_ASSERT(required_size <= bucket->ubuf_size); + memcpy(bucket->ubuf + bucket->ubuf_pos, data, num_bytes); + const uint32_t pos = bucket->ubuf_pos; + bucket->ubuf_pos += num_bytes; + SOKOL_ASSERT(bucket->ubuf_pos <= bucket->ubuf_size); + return pos; +} + +_SOKOL_PRIVATE sg_imgui_str_t _sg_imgui_capture_item_string(sg_imgui_t* ctx, int index, const sg_imgui_capture_item_t* item) { + sg_imgui_str_t str = _sg_imgui_make_str(0); + sg_imgui_str_t res_id = _sg_imgui_make_str(0); + switch (item->cmd) { + case SG_IMGUI_CMD_RESET_STATE_CACHE: + _sg_imgui_snprintf(&str, "%d: sg_reset_state_cache()", index); + break; + + case SG_IMGUI_CMD_MAKE_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.make_buffer.result); + _sg_imgui_snprintf(&str, "%d: sg_make_buffer(desc=..) => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_MAKE_IMAGE: + res_id = _sg_imgui_image_id_string(ctx, item->args.make_image.result); + _sg_imgui_snprintf(&str, "%d: sg_make_image(desc=..) => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_MAKE_SHADER: + res_id = _sg_imgui_shader_id_string(ctx, item->args.make_shader.result); + _sg_imgui_snprintf(&str, "%d: sg_make_shader(desc=..) => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_MAKE_PIPELINE: + res_id = _sg_imgui_pipeline_id_string(ctx, item->args.make_pipeline.result); + _sg_imgui_snprintf(&str, "%d: sg_make_pipeline(desc=..) => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_MAKE_PASS: + res_id = _sg_imgui_pass_id_string(ctx, item->args.make_pass.result); + _sg_imgui_snprintf(&str, "%d: sg_make_pass(desc=..) => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_DESTROY_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.destroy_buffer.buffer); + _sg_imgui_snprintf(&str, "%d: sg_destroy_buffer(buf=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_DESTROY_IMAGE: + res_id = _sg_imgui_image_id_string(ctx, item->args.destroy_image.image); + _sg_imgui_snprintf(&str, "%d: sg_destroy_image(img=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_DESTROY_SHADER: + res_id = _sg_imgui_shader_id_string(ctx, item->args.destroy_shader.shader); + _sg_imgui_snprintf(&str, "%d: sg_destroy_shader(shd=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_DESTROY_PIPELINE: + res_id = _sg_imgui_pipeline_id_string(ctx, item->args.destroy_pipeline.pipeline); + _sg_imgui_snprintf(&str, "%d: sg_destroy_pipeline(pip=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_DESTROY_PASS: + res_id = _sg_imgui_pass_id_string(ctx, item->args.destroy_pass.pass); + _sg_imgui_snprintf(&str, "%d: sg_destroy_pass(pass=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_UPDATE_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.update_buffer.buffer); + _sg_imgui_snprintf(&str, "%d: sg_update_buffer(buf=%s, data_ptr=.., data_size=%d)", + index, res_id.buf, + item->args.update_buffer.data_size); + break; + + case SG_IMGUI_CMD_UPDATE_IMAGE: + res_id = _sg_imgui_image_id_string(ctx, item->args.update_image.image); + _sg_imgui_snprintf(&str, "%d: sg_update_image(img=%s, data=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_APPEND_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.append_buffer.buffer); + _sg_imgui_snprintf(&str, "%d: sg_append_buffer(buf=%s, data_ptr=.., data_size=%d) => %d", + index, res_id.buf, + item->args.append_buffer.data_size, + item->args.append_buffer.result); + break; + + case SG_IMGUI_CMD_BEGIN_DEFAULT_PASS: + _sg_imgui_snprintf(&str, "%d: sg_begin_default_pass(pass_action=.., width=%d, height=%d)", + index, + item->args.begin_default_pass.width, + item->args.begin_default_pass.height); + break; + + case SG_IMGUI_CMD_BEGIN_PASS: + res_id = _sg_imgui_pass_id_string(ctx, item->args.begin_pass.pass); + _sg_imgui_snprintf(&str, "%d: sg_begin_pass(pass=%s, pass_action=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_APPLY_VIEWPORT: + _sg_imgui_snprintf(&str, "%d: sg_apply_viewport(x=%d, y=%d, width=%d, height=%d, origin_top_left=%s)", + index, + item->args.apply_viewport.x, + item->args.apply_viewport.y, + item->args.apply_viewport.width, + item->args.apply_viewport.height, + _sg_imgui_bool_string(item->args.apply_viewport.origin_top_left)); + break; + + case SG_IMGUI_CMD_APPLY_SCISSOR_RECT: + _sg_imgui_snprintf(&str, "%d: sg_apply_scissor_rect(x=%d, y=%d, width=%d, height=%d, origin_top_left=%s)", + index, + item->args.apply_scissor_rect.x, + item->args.apply_scissor_rect.y, + item->args.apply_scissor_rect.width, + item->args.apply_scissor_rect.height, + _sg_imgui_bool_string(item->args.apply_scissor_rect.origin_top_left)); + break; + + case SG_IMGUI_CMD_APPLY_PIPELINE: + res_id = _sg_imgui_pipeline_id_string(ctx, item->args.apply_pipeline.pipeline); + _sg_imgui_snprintf(&str, "%d: sg_apply_pipeline(pip=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_APPLY_BINDINGS: + _sg_imgui_snprintf(&str, "%d: sg_apply_bindings(bindings=..)", index); + break; + + case SG_IMGUI_CMD_APPLY_UNIFORMS: + _sg_imgui_snprintf(&str, "%d: sg_apply_uniforms(stage=%s, ub_index=%d, data=.., num_bytes=%d)", + index, + _sg_imgui_shaderstage_string(item->args.apply_uniforms.stage), + item->args.apply_uniforms.ub_index, + item->args.apply_uniforms.num_bytes); + break; + + case SG_IMGUI_CMD_DRAW: + _sg_imgui_snprintf(&str, "%d: sg_draw(base_element=%d, num_elements=%d, num_instances=%d)", + index, + item->args.draw.base_element, + item->args.draw.num_elements, + item->args.draw.num_instances); + break; + + case SG_IMGUI_CMD_END_PASS: + _sg_imgui_snprintf(&str, "%d: sg_end_pass()", index); + break; + + case SG_IMGUI_CMD_COMMIT: + _sg_imgui_snprintf(&str, "%d: sg_commit()", index); + break; + + case SG_IMGUI_CMD_ALLOC_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.alloc_buffer.result); + _sg_imgui_snprintf(&str, "%d: sg_alloc_buffer() => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_ALLOC_IMAGE: + res_id = _sg_imgui_image_id_string(ctx, item->args.alloc_image.result); + _sg_imgui_snprintf(&str, "%d: sg_alloc_image() => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_ALLOC_SHADER: + res_id = _sg_imgui_shader_id_string(ctx, item->args.alloc_shader.result); + _sg_imgui_snprintf(&str, "%d: sg_alloc_shader() => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_ALLOC_PIPELINE: + res_id = _sg_imgui_pipeline_id_string(ctx, item->args.alloc_pipeline.result); + _sg_imgui_snprintf(&str, "%d: sg_alloc_pipeline() => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_ALLOC_PASS: + res_id = _sg_imgui_pass_id_string(ctx, item->args.alloc_pass.result); + _sg_imgui_snprintf(&str, "%d: sg_alloc_pass() => %s", index, res_id.buf); + break; + + case SG_IMGUI_CMD_INIT_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.init_buffer.buffer); + _sg_imgui_snprintf(&str, "%d: sg_init_buffer(buf=%s, desc=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_INIT_IMAGE: + res_id = _sg_imgui_image_id_string(ctx, item->args.init_image.image); + _sg_imgui_snprintf(&str, "%d: sg_init_image(img=%s, desc=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_INIT_SHADER: + res_id = _sg_imgui_shader_id_string(ctx, item->args.init_shader.shader); + _sg_imgui_snprintf(&str, "%d: sg_init_shader(shd=%s, desc=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_INIT_PIPELINE: + res_id = _sg_imgui_pipeline_id_string(ctx, item->args.init_pipeline.pipeline); + _sg_imgui_snprintf(&str, "%d: sg_init_pipeline(pip=%s, desc=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_INIT_PASS: + res_id = _sg_imgui_pass_id_string(ctx, item->args.init_pass.pass); + _sg_imgui_snprintf(&str, "%d: sg_init_pass(pass=%s, desc=..)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_FAIL_BUFFER: + res_id = _sg_imgui_buffer_id_string(ctx, item->args.fail_buffer.buffer); + _sg_imgui_snprintf(&str, "%d: sg_fail_buffer(buf=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_FAIL_IMAGE: + res_id = _sg_imgui_image_id_string(ctx, item->args.fail_image.image); + _sg_imgui_snprintf(&str, "%d: sg_fail_image(img=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_FAIL_SHADER: + res_id = _sg_imgui_shader_id_string(ctx, item->args.fail_shader.shader); + _sg_imgui_snprintf(&str, "%d: sg_fail_shader(shd=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_FAIL_PIPELINE: + res_id = _sg_imgui_pipeline_id_string(ctx, item->args.fail_pipeline.pipeline); + _sg_imgui_snprintf(&str, "%d: sg_fail_pipeline(shd=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_FAIL_PASS: + res_id = _sg_imgui_pass_id_string(ctx, item->args.fail_pass.pass); + _sg_imgui_snprintf(&str, "%d: sg_fail_pass(pass=%s)", index, res_id.buf); + break; + + case SG_IMGUI_CMD_PUSH_DEBUG_GROUP: + _sg_imgui_snprintf(&str, "%d: sg_push_debug_group(name=%s)", index, + item->args.push_debug_group.name.buf); + break; + + case SG_IMGUI_CMD_POP_DEBUG_GROUP: + _sg_imgui_snprintf(&str, "%d: sg_pop_debug_group()", index); + break; + + case SG_IMGUI_CMD_ERR_BUFFER_POOL_EXHAUSTED: + _sg_imgui_snprintf(&str, "%d: sg_err_buffer_pool_exhausted()", index); + break; + + case SG_IMGUI_CMD_ERR_IMAGE_POOL_EXHAUSTED: + _sg_imgui_snprintf(&str, "%d: sg_err_image_pool_exhausted()", index); + break; + + case SG_IMGUI_CMD_ERR_SHADER_POOL_EXHAUSTED: + _sg_imgui_snprintf(&str, "%d: sg_err_shader_pool_exhausted()", index); + break; + + case SG_IMGUI_CMD_ERR_PIPELINE_POOL_EXHAUSTED: + _sg_imgui_snprintf(&str, "%d: sg_err_pipeline_pool_exhausted()", index); + break; + + case SG_IMGUI_CMD_ERR_PASS_POOL_EXHAUSTED: + _sg_imgui_snprintf(&str, "%d: sg_err_pass_pool_exhausted()", index); + break; + + case SG_IMGUI_CMD_ERR_CONTEXT_MISMATCH: + _sg_imgui_snprintf(&str, "%d: sg_err_context_mismatch()", index); + break; + + case SG_IMGUI_CMD_ERR_PASS_INVALID: + _sg_imgui_snprintf(&str, "%d: sg_err_pass_invalid()", index); + break; + + case SG_IMGUI_CMD_ERR_DRAW_INVALID: + _sg_imgui_snprintf(&str, "%d: sg_err_draw_invalid()", index); + break; + + case SG_IMGUI_CMD_ERR_BINDINGS_INVALID: + _sg_imgui_snprintf(&str, "%d: sg_err_bindings_invalid()", index); + break; + + default: + _sg_imgui_snprintf(&str, "%d: ???", index); + break; + } + return str; +} + +/*--- CAPTURE CALLBACKS ------------------------------------------------------*/ +_SOKOL_PRIVATE void _sg_imgui_reset_state_cache(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_RESET_STATE_CACHE; + item->color = _SG_IMGUI_COLOR_OTHER; + } + if (ctx->hooks.reset_state_cache) { + ctx->hooks.reset_state_cache(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_make_buffer(const sg_buffer_desc* desc, sg_buffer buf_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_MAKE_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.make_buffer.result = buf_id; + } + if (ctx->hooks.make_buffer) { + ctx->hooks.make_buffer(desc, buf_id, ctx->hooks.user_data); + } + if (buf_id.id != SG_INVALID_ID) { + _sg_imgui_buffer_created(ctx, buf_id, _sg_imgui_slot_index(buf_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_make_image(const sg_image_desc* desc, sg_image img_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_MAKE_IMAGE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.make_image.result = img_id; + } + if (ctx->hooks.make_image) { + ctx->hooks.make_image(desc, img_id, ctx->hooks.user_data); + } + if (img_id.id != SG_INVALID_ID) { + _sg_imgui_image_created(ctx, img_id, _sg_imgui_slot_index(img_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_make_shader(const sg_shader_desc* desc, sg_shader shd_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_MAKE_SHADER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.make_shader.result = shd_id; + } + if (ctx->hooks.make_shader) { + ctx->hooks.make_shader(desc, shd_id, ctx->hooks.user_data); + } + if (shd_id.id != SG_INVALID_ID) { + _sg_imgui_shader_created(ctx, shd_id, _sg_imgui_slot_index(shd_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_make_pipeline(const sg_pipeline_desc* desc, sg_pipeline pip_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_MAKE_PIPELINE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.make_pipeline.result = pip_id; + } + if (ctx->hooks.make_pipeline) { + ctx->hooks.make_pipeline(desc, pip_id, ctx->hooks.user_data); + } + if (pip_id.id != SG_INVALID_ID) { + _sg_imgui_pipeline_created(ctx, pip_id, _sg_imgui_slot_index(pip_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_make_pass(const sg_pass_desc* desc, sg_pass pass_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_MAKE_PASS; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.make_pass.result = pass_id; + } + if (ctx->hooks.make_pass) { + ctx->hooks.make_pass(desc, pass_id, ctx->hooks.user_data); + } + if (pass_id.id != SG_INVALID_ID) { + _sg_imgui_pass_created(ctx, pass_id, _sg_imgui_slot_index(pass_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_destroy_buffer(sg_buffer buf, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_DESTROY_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.destroy_buffer.buffer = buf; + } + if (ctx->hooks.destroy_buffer) { + ctx->hooks.destroy_buffer(buf, ctx->hooks.user_data); + } + if (buf.id != SG_INVALID_ID) { + _sg_imgui_buffer_destroyed(ctx, _sg_imgui_slot_index(buf.id)); + } +} + +_SOKOL_PRIVATE void _sg_imgui_destroy_image(sg_image img, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_DESTROY_IMAGE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.destroy_image.image = img; + } + if (ctx->hooks.destroy_image) { + ctx->hooks.destroy_image(img, ctx->hooks.user_data); + } + if (img.id != SG_INVALID_ID) { + _sg_imgui_image_destroyed(ctx, _sg_imgui_slot_index(img.id)); + } +} + +_SOKOL_PRIVATE void _sg_imgui_destroy_shader(sg_shader shd, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_DESTROY_SHADER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.destroy_shader.shader = shd; + } + if (ctx->hooks.destroy_shader) { + ctx->hooks.destroy_shader(shd, ctx->hooks.user_data); + } + if (shd.id != SG_INVALID_ID) { + _sg_imgui_shader_destroyed(ctx, _sg_imgui_slot_index(shd.id)); + } +} + +_SOKOL_PRIVATE void _sg_imgui_destroy_pipeline(sg_pipeline pip, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_DESTROY_PIPELINE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.destroy_pipeline.pipeline = pip; + } + if (ctx->hooks.destroy_pipeline) { + ctx->hooks.destroy_pipeline(pip, ctx->hooks.user_data); + } + if (pip.id != SG_INVALID_ID) { + _sg_imgui_pipeline_destroyed(ctx, _sg_imgui_slot_index(pip.id)); + } +} + +_SOKOL_PRIVATE void _sg_imgui_destroy_pass(sg_pass pass, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_DESTROY_PASS; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.destroy_pass.pass = pass; + } + if (ctx->hooks.destroy_pass) { + ctx->hooks.destroy_pass(pass, ctx->hooks.user_data); + } + if (pass.id != SG_INVALID_ID) { + _sg_imgui_pass_destroyed(ctx, _sg_imgui_slot_index(pass.id)); + } +} + +_SOKOL_PRIVATE void _sg_imgui_update_buffer(sg_buffer buf, const void* data_ptr, int data_size, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_UPDATE_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.update_buffer.buffer = buf; + item->args.update_buffer.data_size = data_size; + } + if (ctx->hooks.update_buffer) { + ctx->hooks.update_buffer(buf, data_ptr, data_size, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_update_image(sg_image img, const sg_image_content* data, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_UPDATE_IMAGE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.update_image.image = img; + } + if (ctx->hooks.update_image) { + ctx->hooks.update_image(img, data, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_append_buffer(sg_buffer buf, const void* data_ptr, int data_size, int result, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_APPEND_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.append_buffer.buffer = buf; + item->args.append_buffer.data_size = data_size; + item->args.append_buffer.result = result; + } + if (ctx->hooks.append_buffer) { + ctx->hooks.append_buffer(buf, data_ptr, data_size, result, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_begin_default_pass(const sg_pass_action* pass_action, int width, int height, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + SOKOL_ASSERT(pass_action); + item->cmd = SG_IMGUI_CMD_BEGIN_DEFAULT_PASS; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.begin_default_pass.action = *pass_action; + item->args.begin_default_pass.width = width; + item->args.begin_default_pass.height = height; + } + if (ctx->hooks.begin_default_pass) { + ctx->hooks.begin_default_pass(pass_action, width, height, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_begin_pass(sg_pass pass, const sg_pass_action* pass_action, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + SOKOL_ASSERT(pass_action); + item->cmd = SG_IMGUI_CMD_BEGIN_PASS; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.begin_pass.pass = pass; + item->args.begin_pass.action = *pass_action; + } + if (ctx->hooks.begin_pass) { + ctx->hooks.begin_pass(pass, pass_action, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_apply_viewport(int x, int y, int width, int height, bool origin_top_left, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_APPLY_VIEWPORT; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.apply_viewport.x = x; + item->args.apply_viewport.y = y; + item->args.apply_viewport.width = width; + item->args.apply_viewport.height = height; + item->args.apply_viewport.origin_top_left = origin_top_left; + } + if (ctx->hooks.apply_viewport) { + ctx->hooks.apply_viewport(x, y, width, height, origin_top_left, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_apply_scissor_rect(int x, int y, int width, int height, bool origin_top_left, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_APPLY_SCISSOR_RECT; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.apply_scissor_rect.x = x; + item->args.apply_scissor_rect.y = y; + item->args.apply_scissor_rect.width = width; + item->args.apply_scissor_rect.height = height; + item->args.apply_scissor_rect.origin_top_left = origin_top_left; + } + if (ctx->hooks.apply_scissor_rect) { + ctx->hooks.apply_scissor_rect(x, y, width, height, origin_top_left, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_apply_pipeline(sg_pipeline pip, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + ctx->cur_pipeline = pip; /* stored for _sg_imgui_apply_uniforms */ + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_APPLY_PIPELINE; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.apply_pipeline.pipeline = pip; + } + if (ctx->hooks.apply_pipeline) { + ctx->hooks.apply_pipeline(pip, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_apply_bindings(const sg_bindings* bindings, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + SOKOL_ASSERT(bindings); + item->cmd = SG_IMGUI_CMD_APPLY_BINDINGS; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.apply_bindings.bindings = *bindings; + } + if (ctx->hooks.apply_bindings) { + ctx->hooks.apply_bindings(bindings, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_apply_uniforms(sg_shader_stage stage, int ub_index, const void* data, int num_bytes, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_APPLY_UNIFORMS; + item->color = _SG_IMGUI_COLOR_DRAW; + sg_imgui_args_apply_uniforms_t* args = &item->args.apply_uniforms; + args->stage = stage; + args->ub_index = ub_index; + args->data = data; + args->num_bytes = num_bytes; + args->pipeline = ctx->cur_pipeline; + args->ubuf_pos = _sg_imgui_capture_uniforms(ctx, data, num_bytes); + } + if (ctx->hooks.apply_uniforms) { + ctx->hooks.apply_uniforms(stage, ub_index, data, num_bytes, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw(int base_element, int num_elements, int num_instances, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_DRAW; + item->color = _SG_IMGUI_COLOR_DRAW; + item->args.draw.base_element = base_element; + item->args.draw.num_elements = num_elements; + item->args.draw.num_instances = num_instances; + } + if (ctx->hooks.draw) { + ctx->hooks.draw(base_element, num_elements, num_instances, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_end_pass(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + ctx->cur_pipeline.id = SG_INVALID_ID; + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_END_PASS; + item->color = _SG_IMGUI_COLOR_DRAW; + } + if (ctx->hooks.end_pass) { + ctx->hooks.end_pass(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_commit(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_COMMIT; + item->color = _SG_IMGUI_COLOR_DRAW; + } + _sg_imgui_capture_next_frame(ctx); + if (ctx->hooks.commit) { + ctx->hooks.commit(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_alloc_buffer(sg_buffer result, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ALLOC_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.alloc_buffer.result = result; + } + if (ctx->hooks.alloc_buffer) { + ctx->hooks.alloc_buffer(result, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_alloc_image(sg_image result, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ALLOC_IMAGE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.alloc_image.result = result; + } + if (ctx->hooks.alloc_image) { + ctx->hooks.alloc_image(result, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_alloc_shader(sg_shader result, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ALLOC_SHADER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.alloc_shader.result = result; + } + if (ctx->hooks.alloc_shader) { + ctx->hooks.alloc_shader(result, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_alloc_pipeline(sg_pipeline result, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ALLOC_PIPELINE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.alloc_pipeline.result = result; + } + if (ctx->hooks.alloc_pipeline) { + ctx->hooks.alloc_pipeline(result, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_alloc_pass(sg_pass result, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ALLOC_PASS; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.alloc_pass.result = result; + } + if (ctx->hooks.alloc_pass) { + ctx->hooks.alloc_pass(result, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_init_buffer(sg_buffer buf_id, const sg_buffer_desc* desc, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_INIT_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.init_buffer.buffer = buf_id; + } + if (ctx->hooks.init_buffer) { + ctx->hooks.init_buffer(buf_id, desc, ctx->hooks.user_data); + } + if (buf_id.id != SG_INVALID_ID) { + _sg_imgui_buffer_created(ctx, buf_id, _sg_imgui_slot_index(buf_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_init_image(sg_image img_id, const sg_image_desc* desc, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_INIT_IMAGE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.init_image.image = img_id; + } + if (ctx->hooks.init_image) { + ctx->hooks.init_image(img_id, desc, ctx->hooks.user_data); + } + if (img_id.id != SG_INVALID_ID) { + _sg_imgui_image_created(ctx, img_id, _sg_imgui_slot_index(img_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_init_shader(sg_shader shd_id, const sg_shader_desc* desc, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_INIT_SHADER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.init_shader.shader = shd_id; + } + if (ctx->hooks.init_shader) { + ctx->hooks.init_shader(shd_id, desc, ctx->hooks.user_data); + } + if (shd_id.id != SG_INVALID_ID) { + _sg_imgui_shader_created(ctx, shd_id, _sg_imgui_slot_index(shd_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_init_pipeline(sg_pipeline pip_id, const sg_pipeline_desc* desc, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_INIT_PIPELINE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.init_pipeline.pipeline = pip_id; + } + if (ctx->hooks.init_pipeline) { + ctx->hooks.init_pipeline(pip_id, desc, ctx->hooks.user_data); + } + if (pip_id.id != SG_INVALID_ID) { + _sg_imgui_pipeline_created(ctx, pip_id, _sg_imgui_slot_index(pip_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_init_pass(sg_pass pass_id, const sg_pass_desc* desc, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_INIT_PASS; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.init_pass.pass = pass_id; + } + if (ctx->hooks.init_pass) { + ctx->hooks.init_pass(pass_id, desc, ctx->hooks.user_data); + } + if (pass_id.id != SG_INVALID_ID) { + _sg_imgui_pass_created(ctx, pass_id, _sg_imgui_slot_index(pass_id.id), desc); + } +} + +_SOKOL_PRIVATE void _sg_imgui_fail_buffer(sg_buffer buf_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_FAIL_BUFFER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.fail_buffer.buffer = buf_id; + } + if (ctx->hooks.fail_buffer) { + ctx->hooks.fail_buffer(buf_id, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_fail_image(sg_image img_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_FAIL_IMAGE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.fail_image.image = img_id; + } + if (ctx->hooks.fail_image) { + ctx->hooks.fail_image(img_id, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_fail_shader(sg_shader shd_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_FAIL_SHADER; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.fail_shader.shader = shd_id; + } + if (ctx->hooks.fail_shader) { + ctx->hooks.fail_shader(shd_id, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_fail_pipeline(sg_pipeline pip_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_FAIL_PIPELINE; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.fail_pipeline.pipeline = pip_id; + } + if (ctx->hooks.fail_pipeline) { + ctx->hooks.fail_pipeline(pip_id, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_fail_pass(sg_pass pass_id, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_FAIL_PASS; + item->color = _SG_IMGUI_COLOR_RSRC; + item->args.fail_pass.pass = pass_id; + } + if (ctx->hooks.fail_pass) { + ctx->hooks.fail_pass(pass_id, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_push_debug_group(const char* name, void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_PUSH_DEBUG_GROUP; + item->color = _SG_IMGUI_COLOR_OTHER; + item->args.push_debug_group.name = _sg_imgui_make_str(name); + } + if (ctx->hooks.push_debug_group) { + ctx->hooks.push_debug_group(name, ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_pop_debug_group(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_POP_DEBUG_GROUP; + item->color = _SG_IMGUI_COLOR_OTHER; + } + if (ctx->hooks.pop_debug_group) { + ctx->hooks.pop_debug_group(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_buffer_pool_exhausted(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_BUFFER_POOL_EXHAUSTED; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_buffer_pool_exhausted) { + ctx->hooks.err_buffer_pool_exhausted(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_image_pool_exhausted(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_IMAGE_POOL_EXHAUSTED; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_image_pool_exhausted) { + ctx->hooks.err_image_pool_exhausted(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_shader_pool_exhausted(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_SHADER_POOL_EXHAUSTED; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_shader_pool_exhausted) { + ctx->hooks.err_shader_pool_exhausted(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_pipeline_pool_exhausted(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_PIPELINE_POOL_EXHAUSTED; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_pipeline_pool_exhausted) { + ctx->hooks.err_pipeline_pool_exhausted(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_pass_pool_exhausted(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_PASS_POOL_EXHAUSTED; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_pass_pool_exhausted) { + ctx->hooks.err_pass_pool_exhausted(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_context_mismatch(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_CONTEXT_MISMATCH; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_context_mismatch) { + ctx->hooks.err_context_mismatch(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_pass_invalid(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_PASS_INVALID; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_pass_invalid) { + ctx->hooks.err_pass_invalid(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_draw_invalid(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_DRAW_INVALID; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_draw_invalid) { + ctx->hooks.err_draw_invalid(ctx->hooks.user_data); + } +} + +_SOKOL_PRIVATE void _sg_imgui_err_bindings_invalid(void* user_data) { + sg_imgui_t* ctx = (sg_imgui_t*) user_data; + SOKOL_ASSERT(ctx); + sg_imgui_capture_item_t* item = _sg_imgui_capture_next_write_item(ctx); + if (item) { + item->cmd = SG_IMGUI_CMD_ERR_BINDINGS_INVALID; + item->color = _SG_IMGUI_COLOR_ERR; + } + if (ctx->hooks.err_bindings_invalid) { + ctx->hooks.err_bindings_invalid(ctx->hooks.user_data); + } +} + +/*--- IMGUI HELPERS ----------------------------------------------------------*/ +_SOKOL_PRIVATE bool _sg_imgui_draw_resid_list_item(uint32_t res_id, const char* label, bool selected) { + igPushIDInt((int)res_id); + bool res; + if (label[0]) { + res = igSelectable(label, selected, 0, IMVEC2(0,0)); + } + else { + sg_imgui_str_t str; + _sg_imgui_snprintf(&str, "0x%08X", res_id); + res = igSelectable(str.buf, selected, 0, IMVEC2(0,0)); + } + igPopID(); + return res; +} + +_SOKOL_PRIVATE bool _sg_imgui_draw_resid_link(uint32_t res_id, const char* label) { + SOKOL_ASSERT(label); + sg_imgui_str_t str_buf; + const char* str; + if (label[0]) { + str = label; + } + else { + _sg_imgui_snprintf(&str_buf, "0x%08X", res_id); + str = str_buf.buf; + } + igPushIDInt((int)res_id); + bool res = igSmallButton(str); + igPopID(); + return res; +} + +_SOKOL_PRIVATE bool _sg_imgui_draw_buffer_link(sg_imgui_t* ctx, sg_buffer buf) { + bool retval = false; + if (buf.id != SG_INVALID_ID) { + const sg_imgui_buffer_t* buf_ui = &ctx->buffers.slots[_sg_imgui_slot_index(buf.id)]; + retval = _sg_imgui_draw_resid_link(buf.id, buf_ui->label.buf); + } + return retval; +} + +_SOKOL_PRIVATE bool _sg_imgui_draw_image_link(sg_imgui_t* ctx, sg_image img) { + bool retval = false; + if (img.id != SG_INVALID_ID) { + const sg_imgui_image_t* img_ui = &ctx->images.slots[_sg_imgui_slot_index(img.id)]; + retval = _sg_imgui_draw_resid_link(img.id, img_ui->label.buf); + } + return retval; +} + +_SOKOL_PRIVATE bool _sg_imgui_draw_shader_link(sg_imgui_t* ctx, sg_shader shd) { + bool retval = false; + if (shd.id != SG_INVALID_ID) { + const sg_imgui_shader_t* shd_ui = &ctx->shaders.slots[_sg_imgui_slot_index(shd.id)]; + retval = _sg_imgui_draw_resid_link(shd.id, shd_ui->label.buf); + } + return retval; +} + +_SOKOL_PRIVATE void _sg_imgui_show_buffer(sg_imgui_t* ctx, sg_buffer buf) { + ctx->buffers.open = true; + ctx->buffers.sel_buf = buf; +} + +_SOKOL_PRIVATE void _sg_imgui_show_image(sg_imgui_t* ctx, sg_image img) { + ctx->images.open = true; + ctx->images.sel_img = img; +} + +_SOKOL_PRIVATE void _sg_imgui_show_shader(sg_imgui_t* ctx, sg_shader shd) { + ctx->shaders.open = true; + ctx->shaders.sel_shd = shd; +} + +_SOKOL_PRIVATE void _sg_imgui_draw_buffer_list(sg_imgui_t* ctx) { + igBeginChild("buffer_list", IMVEC2(_SG_IMGUI_LIST_WIDTH,0), true, 0); + for (int i = 0; i < ctx->buffers.num_slots; i++) { + sg_buffer buf = ctx->buffers.slots[i].res_id; + sg_resource_state state = sg_query_buffer_state(buf); + if ((state != SG_RESOURCESTATE_INVALID) && (state != SG_RESOURCESTATE_INITIAL)) { + bool selected = ctx->buffers.sel_buf.id == buf.id; + if (_sg_imgui_draw_resid_list_item(buf.id, ctx->buffers.slots[i].label.buf, selected)) { + ctx->buffers.sel_buf.id = buf.id; + } + } + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_image_list(sg_imgui_t* ctx) { + igBeginChild("image_list", IMVEC2(_SG_IMGUI_LIST_WIDTH,0), true, 0); + for (int i = 0; i < ctx->images.num_slots; i++) { + sg_image img = ctx->images.slots[i].res_id; + sg_resource_state state = sg_query_image_state(img); + if ((state != SG_RESOURCESTATE_INVALID) && (state != SG_RESOURCESTATE_INITIAL)) { + bool selected = ctx->images.sel_img.id == img.id; + if (_sg_imgui_draw_resid_list_item(img.id, ctx->images.slots[i].label.buf, selected)) { + ctx->images.sel_img.id = img.id; + } + } + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_shader_list(sg_imgui_t* ctx) { + igBeginChild("shader_list", IMVEC2(_SG_IMGUI_LIST_WIDTH,0), true, 0); + for (int i = 0; i < ctx->shaders.num_slots; i++) { + sg_shader shd = ctx->shaders.slots[i].res_id; + sg_resource_state state = sg_query_shader_state(shd); + if ((state != SG_RESOURCESTATE_INVALID) && (state != SG_RESOURCESTATE_INITIAL)) { + bool selected = ctx->shaders.sel_shd.id == shd.id; + if (_sg_imgui_draw_resid_list_item(shd.id, ctx->shaders.slots[i].label.buf, selected)) { + ctx->shaders.sel_shd.id = shd.id; + } + } + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_pipeline_list(sg_imgui_t* ctx) { + igBeginChild("pipeline_list", IMVEC2(_SG_IMGUI_LIST_WIDTH,0), true, 0); + for (int i = 1; i < ctx->pipelines.num_slots; i++) { + sg_pipeline pip = ctx->pipelines.slots[i].res_id; + sg_resource_state state = sg_query_pipeline_state(pip); + if ((state != SG_RESOURCESTATE_INVALID) && (state != SG_RESOURCESTATE_INITIAL)) { + bool selected = ctx->pipelines.sel_pip.id == pip.id; + if (_sg_imgui_draw_resid_list_item(pip.id, ctx->pipelines.slots[i].label.buf, selected)) { + ctx->pipelines.sel_pip.id = pip.id; + } + } + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_pass_list(sg_imgui_t* ctx) { + igBeginChild("pass_list", IMVEC2(_SG_IMGUI_LIST_WIDTH,0), true, 0); + for (int i = 1; i < ctx->passes.num_slots; i++) { + sg_pass pass = ctx->passes.slots[i].res_id; + sg_resource_state state = sg_query_pass_state(pass); + if ((state != SG_RESOURCESTATE_INVALID) && (state != SG_RESOURCESTATE_INITIAL)) { + bool selected = ctx->passes.sel_pass.id == pass.id; + if (_sg_imgui_draw_resid_list_item(pass.id, ctx->passes.slots[i].label.buf, selected)) { + ctx->passes.sel_pass.id = pass.id; + } + } + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_capture_list(sg_imgui_t* ctx) { + igBeginChild("capture_list", IMVEC2(_SG_IMGUI_LIST_WIDTH,0), true, 0); + const uint32_t num_items = _sg_imgui_capture_num_read_items(ctx); + uint64_t group_stack = 1; /* bit set: group unfolded, cleared: folded */ + for (uint32_t i = 0; i < num_items; i++) { + const sg_imgui_capture_item_t* item = _sg_imgui_capture_read_item_at(ctx, i); + sg_imgui_str_t item_string = _sg_imgui_capture_item_string(ctx, i, item); + igPushStyleColorU32(ImGuiCol_Text, item->color); + if (item->cmd == SG_IMGUI_CMD_PUSH_DEBUG_GROUP) { + if (group_stack & 1) { + group_stack <<= 1; + const char* group_name = item->args.push_debug_group.name.buf; + if (igTreeNodeStrStr(group_name, "Group: %s", group_name)) { + group_stack |= 1; + } + } + else { + group_stack <<= 1; + } + } + else if (item->cmd == SG_IMGUI_CMD_POP_DEBUG_GROUP) { + if (group_stack & 1) { + igTreePop(); + } + group_stack >>= 1; + } + else if (group_stack & 1) { + igPushIDInt(i); + if (igSelectable(item_string.buf, ctx->capture.sel_item == i, 0, IMVEC2(0,0))) { + ctx->capture.sel_item = i; + } + if (igIsItemHovered(0)) { + igSetTooltip("%s", item_string.buf); + } + igPopID(); + } + igPopStyleColor(1); + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_buffer_panel(sg_imgui_t* ctx, sg_buffer buf) { + if (buf.id != SG_INVALID_ID) { + igBeginChild("buffer", IMVEC2(0,0), false, 0); + sg_buffer_info info = sg_query_buffer_info(buf); + if (info.slot.state == SG_RESOURCESTATE_VALID) { + const sg_imgui_buffer_t* buf_ui = &ctx->buffers.slots[_sg_imgui_slot_index(buf.id)]; + igText("Label: %s", buf_ui->label.buf[0] ? buf_ui->label.buf : "---"); + _sg_imgui_draw_resource_slot(&info.slot); + igSeparator(); + igText("Type: %s", _sg_imgui_buffertype_string(buf_ui->desc.type)); + igText("Usage: %s", _sg_imgui_usage_string(buf_ui->desc.usage)); + igText("Size: %d", buf_ui->desc.size); + if (buf_ui->desc.usage != SG_USAGE_IMMUTABLE) { + igSeparator(); + igText("Num Slots: %d", info.num_slots); + igText("Active Slot: %d", info.active_slot); + igText("Update Frame Index: %d", info.update_frame_index); + igText("Append Frame Index: %d", info.append_frame_index); + igText("Append Pos: %d", info.append_pos); + igText("Append Overflow: %s", info.append_overflow ? "YES":"NO"); + } + } + else { + igText("Buffer 0x%08X not valid.", buf.id); + } + igEndChild(); + } +} + +_SOKOL_PRIVATE bool _sg_imgui_image_renderable(sg_imgui_t* ctx, sg_image_type type, sg_pixel_format fmt) { + return sg_query_pixelformat(fmt).sample && !sg_query_pixelformat(fmt).depth; +} + +_SOKOL_PRIVATE void _sg_imgui_draw_embedded_image(sg_imgui_t* ctx, sg_image img, float* scale) { + if (sg_query_image_state(img) == SG_RESOURCESTATE_VALID) { + sg_imgui_image_t* img_ui = &ctx->images.slots[_sg_imgui_slot_index(img.id)]; + if (_sg_imgui_image_renderable(ctx, img_ui->desc.type, img_ui->desc.pixel_format)) { + igPushIDInt((int)img.id); + igSliderFloat("Scale", scale, 0.125f, 8.0f, "%.3f", 2.0f); + float w = (float)img_ui->desc.width * (*scale); + float h = (float)img_ui->desc.height * (*scale); + igImage((ImTextureID)(intptr_t)img.id, IMVEC2(w, h), IMVEC2(0,0), IMVEC2(1,1), IMVEC4(1,1,1,1), IMVEC4(0,0,0,0)); + igPopID(); + } + else { + igText("Image not renderable."); + } + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_image_panel(sg_imgui_t* ctx, sg_image img) { + if (img.id != SG_INVALID_ID) { + igBeginChild("image", IMVEC2(0,0), false, 0); + sg_image_info info = sg_query_image_info(img); + if (info.slot.state == SG_RESOURCESTATE_VALID) { + sg_imgui_image_t* img_ui = &ctx->images.slots[_sg_imgui_slot_index(img.id)]; + const sg_image_desc* desc = &img_ui->desc; + igText("Label: %s", img_ui->label.buf[0] ? img_ui->label.buf : "---"); + _sg_imgui_draw_resource_slot(&info.slot); + igSeparator(); + _sg_imgui_draw_embedded_image(ctx, img, &img_ui->ui_scale); + igSeparator(); + igText("Type: %s", _sg_imgui_imagetype_string(desc->type)); + igText("Usage: %s", _sg_imgui_usage_string(desc->usage)); + igText("Render Target: %s", desc->render_target ? "YES":"NO"); + igText("Width: %d", desc->width); + igText("Height: %d", desc->height); + igText("Depth: %d", desc->depth); + igText("Num Mipmaps: %d", desc->num_mipmaps); + igText("Pixel Format: %s", _sg_imgui_pixelformat_string(desc->pixel_format)); + igText("Sample Count: %d", desc->sample_count); + igText("Min Filter: %s", _sg_imgui_filter_string(desc->min_filter)); + igText("Mag Filter: %s", _sg_imgui_filter_string(desc->mag_filter)); + igText("Wrap U: %s", _sg_imgui_wrap_string(desc->wrap_u)); + igText("Wrap V: %s", _sg_imgui_wrap_string(desc->wrap_v)); + igText("Wrap W: %s", _sg_imgui_wrap_string(desc->wrap_w)); + igText("Border Color: %s", _sg_imgui_bordercolor_string(desc->border_color)); + igText("Max Anisotropy: %d", desc->max_anisotropy); + igText("Min LOD: %.3f", desc->min_lod); + igText("Max LOD: %.3f", desc->max_lod); + if (desc->usage != SG_USAGE_IMMUTABLE) { + igSeparator(); + igText("Num Slots: %d", info.num_slots); + igText("Active Slot: %d", info.active_slot); + igText("Update Frame Index: %d", info.upd_frame_index); + } + } + else { + igText("Image 0x%08X not valid.", img.id); + } + igEndChild(); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_shader_stage(sg_imgui_t* ctx, const sg_shader_stage_desc* stage) { + int num_valid_ubs = 0; + for (int i = 0; i < SG_MAX_SHADERSTAGE_UBS; i++) { + const sg_shader_uniform_block_desc* ub = &stage->uniform_blocks[i]; + for (int j = 0; j < SG_MAX_UB_MEMBERS; j++) { + const sg_shader_uniform_desc* u = &ub->uniforms[j]; + if (SG_UNIFORMTYPE_INVALID != u->type) { + num_valid_ubs++; + break; + } + } + } + int num_valid_images = 0; + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + if (_SG_IMAGETYPE_DEFAULT != stage->images[i].type) { + num_valid_images++; + } + else { + break; + } + } + if (num_valid_ubs > 0) { + if (igTreeNodeStr("Uniform Blocks")) { + for (int i = 0; i < num_valid_ubs; i++) { + igText("#%d:", i); + const sg_shader_uniform_block_desc* ub = &stage->uniform_blocks[i]; + for (int j = 0; j < SG_MAX_UB_MEMBERS; j++) { + const sg_shader_uniform_desc* u = &ub->uniforms[j]; + if (SG_UNIFORMTYPE_INVALID != u->type) { + if (u->array_count == 0) { + igText(" %s %s", _sg_imgui_uniformtype_string(u->type), u->name ? u->name : ""); + } + else { + igText(" %s[%d] %s", _sg_imgui_uniformtype_string(u->type), u->array_count, u->name ? u->name : ""); + } + } + } + } + igTreePop(); + } + } + if (num_valid_images > 0) { + if (igTreeNodeStr("Images")) { + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + const sg_shader_image_desc* sid = &stage->images[i]; + if (sid->type != _SG_IMAGETYPE_DEFAULT) { + igText("%s %s", _sg_imgui_imagetype_string(sid->type), sid->name ? sid->name : ""); + } + else { + break; + } + } + igTreePop(); + } + } + if (stage->entry) { + igText("Entry: %s", stage->entry); + } + if (stage->source) { + if (igTreeNodeStr("Source")) { + igText("%s", stage->source); + igTreePop(); + } + } + else if (stage->byte_code) { + if (igTreeNodeStr("Byte Code")) { + igText("Byte-code display currently not supported."); + igTreePop(); + } + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_shader_panel(sg_imgui_t* ctx, sg_shader shd) { + if (shd.id != SG_INVALID_ID) { + igBeginChild("shader", IMVEC2(0,0), false, ImGuiWindowFlags_HorizontalScrollbar); + sg_shader_info info = sg_query_shader_info(shd); + if (info.slot.state == SG_RESOURCESTATE_VALID) { + const sg_imgui_shader_t* shd_ui = &ctx->shaders.slots[_sg_imgui_slot_index(shd.id)]; + igText("Label: %s", shd_ui->label.buf[0] ? shd_ui->label.buf : "---"); + _sg_imgui_draw_resource_slot(&info.slot); + igSeparator(); + if (igTreeNodeStr("Attrs")) { + for (int i = 0; i < SG_MAX_VERTEX_ATTRIBUTES; i++) { + const sg_shader_attr_desc* a_desc = &shd_ui->desc.attrs[i]; + if (a_desc->name || a_desc->sem_index) { + igText("#%d:", i); + igText(" Name: %s", a_desc->name ? a_desc->name : "---"); + igText(" Sem Name: %s", a_desc->sem_name ? a_desc->sem_name : "---"); + igText(" Sem Index: %d", a_desc->sem_index); + } + } + igTreePop(); + } + if (igTreeNodeStr("Vertex Shader Stage")) { + _sg_imgui_draw_shader_stage(ctx, &shd_ui->desc.vs); + igTreePop(); + } + if (igTreeNodeStr("Fragment Shader Stage")) { + _sg_imgui_draw_shader_stage(ctx, &shd_ui->desc.fs); + igTreePop(); + } + } + else { + igText("Shader 0x%08X not valid!", shd.id); + } + igEndChild(); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_vertex_layout(const sg_layout_desc* layout) { + if (igTreeNodeStr("Buffers")) { + for (int i = 0; i < SG_MAX_SHADERSTAGE_BUFFERS; i++) { + const sg_buffer_layout_desc* l_desc = &layout->buffers[i]; + if (l_desc->stride > 0) { + igText("#%d:", i); + igText(" Stride: %d", l_desc->stride); + igText(" Step Func: %s", _sg_imgui_vertexstep_string(l_desc->step_func)); + igText(" Step Rate: %d", l_desc->step_rate); + } + } + igTreePop(); + } + if (igTreeNodeStr("Attrs")) { + for (int i = 0; i < SG_MAX_VERTEX_ATTRIBUTES; i++) { + const sg_vertex_attr_desc* a_desc = &layout->attrs[i]; + if (a_desc->format != SG_VERTEXFORMAT_INVALID) { + igText("#%d:", i); + igText(" Format: %s", _sg_imgui_vertexformat_string(a_desc->format)); + igText(" Offset: %d", a_desc->offset); + igText(" Buffer Index: %d", a_desc->buffer_index); + } + } + igTreePop(); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_stencil_state(const sg_stencil_state* ss) { + igText("Fail Op: %s", _sg_imgui_stencilop_string(ss->fail_op)); + igText("Depth Fail Op: %s", _sg_imgui_stencilop_string(ss->depth_fail_op)); + igText("Pass Op: %s", _sg_imgui_stencilop_string(ss->pass_op)); + igText("Compare Func: %s", _sg_imgui_comparefunc_string(ss->compare_func)); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_depth_stencil_state(const sg_depth_stencil_state* dss) { + igText("Depth Compare Func: %s", _sg_imgui_comparefunc_string(dss->depth_compare_func)); + igText("Depth Write Enabled: %s", dss->depth_write_enabled ? "YES":"NO"); + igText("Stencil Enabled: %s", dss->stencil_enabled ? "YES":"NO"); + igText("Stencil Read Mask: 0x%02X", dss->stencil_read_mask); + igText("Stencil Write Mask: 0x%02X", dss->stencil_write_mask); + igText("Stencil Ref: 0x%02X", dss->stencil_ref); + if (igTreeNodeStr("Stencil Front")) { + _sg_imgui_draw_stencil_state(&dss->stencil_front); + igTreePop(); + } + if (igTreeNodeStr("Stencil Back")) { + _sg_imgui_draw_stencil_state(&dss->stencil_back); + igTreePop(); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_blend_state(const sg_blend_state* bs) { + igText("Blend Enabled: %s", bs->enabled ? "YES":"NO"); + igText("Src Factor RGB: %s", _sg_imgui_blendfactor_string(bs->src_factor_rgb)); + igText("Dst Factor RGB: %s", _sg_imgui_blendfactor_string(bs->dst_factor_rgb)); + igText("Op RGB: %s", _sg_imgui_blendop_string(bs->op_rgb)); + igText("Src Factor Alpha: %s", _sg_imgui_blendfactor_string(bs->src_factor_alpha)); + igText("Dst Factor Alpha: %s", _sg_imgui_blendfactor_string(bs->dst_factor_alpha)); + igText("Op Alpha: %s", _sg_imgui_blendop_string(bs->op_alpha)); + igText("Color Write Mask: %s", _sg_imgui_colormask_string(bs->color_write_mask)); + igText("Attachment Count: %d", bs->color_attachment_count); + igText("Color Format: %s", _sg_imgui_pixelformat_string(bs->color_format)); + igText("Depth Format: %s", _sg_imgui_pixelformat_string(bs->depth_format)); + igText("Blend Color: %.3f %.3f %.3f %.3f", bs->blend_color[0], bs->blend_color[1], bs->blend_color[2], bs->blend_color[3]); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_rasterizer_state(const sg_rasterizer_state* rs) { + igText("Alpha to Coverage: %s", rs->alpha_to_coverage_enabled ? "YES":"NO"); + igText("Cull Mode: %s", _sg_imgui_cullmode_string(rs->cull_mode)); + igText("Face Winding: %s", _sg_imgui_facewinding_string(rs->face_winding)); + igText("Sample Count: %d", rs->sample_count); + igText("Depth Bias: %f", rs->depth_bias); + igText("Depth Bias Slope: %f", rs->depth_bias_slope_scale); + igText("Depth Bias Clamp: %f", rs->depth_bias_clamp); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_pipeline_panel(sg_imgui_t* ctx, sg_pipeline pip) { + if (pip.id != SG_INVALID_ID) { + igBeginChild("pipeline", IMVEC2(0,0), false, 0); + sg_pipeline_info info = sg_query_pipeline_info(pip); + if (info.slot.state == SG_RESOURCESTATE_VALID) { + const sg_imgui_pipeline_t* pip_ui = &ctx->pipelines.slots[_sg_imgui_slot_index(pip.id)]; + igText("Label: %s", pip_ui->label.buf[0] ? pip_ui->label.buf : "---"); + _sg_imgui_draw_resource_slot(&info.slot); + igSeparator(); + igText("Shader: "); igSameLine(0,-1); + if (_sg_imgui_draw_shader_link(ctx, pip_ui->desc.shader)) { + _sg_imgui_show_shader(ctx, pip_ui->desc.shader); + } + igText("Prim Type: %s", _sg_imgui_primitivetype_string(pip_ui->desc.primitive_type)); + igText("Index Type: %s", _sg_imgui_indextype_string(pip_ui->desc.index_type)); + if (igTreeNodeStr("Vertex Layout")) { + _sg_imgui_draw_vertex_layout(&pip_ui->desc.layout); + igTreePop(); + } + if (igTreeNodeStr("Depth Stencil State")) { + _sg_imgui_draw_depth_stencil_state(&pip_ui->desc.depth_stencil); + igTreePop(); + } + if (igTreeNodeStr("Blend State")) { + _sg_imgui_draw_blend_state(&pip_ui->desc.blend); + igTreePop(); + } + if (igTreeNodeStr("Rasterizer State")) { + _sg_imgui_draw_rasterizer_state(&pip_ui->desc.rasterizer); + igTreePop(); + } + } + else { + igText("Pipeline 0x%08X not valid.", pip.id); + } + igEndChild(); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_attachment(sg_imgui_t* ctx, const sg_attachment_desc* att, float* img_scale) { + igText(" Image: "); igSameLine(0,-1); + if (_sg_imgui_draw_image_link(ctx, att->image)) { + _sg_imgui_show_image(ctx, att->image); + } + igText(" Mip Level: %d", att->mip_level); + igText(" Face/Layer/Slice: %d", att->layer); + _sg_imgui_draw_embedded_image(ctx, att->image, img_scale); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_pass_panel(sg_imgui_t* ctx, sg_pass pass) { + if (pass.id != SG_INVALID_ID) { + igBeginChild("pass", IMVEC2(0,0), false, 0); + sg_pass_info info = sg_query_pass_info(pass); + if (info.slot.state == SG_RESOURCESTATE_VALID) { + sg_imgui_pass_t* pass_ui = &ctx->passes.slots[_sg_imgui_slot_index(pass.id)]; + igText("Label: %s", pass_ui->label.buf[0] ? pass_ui->label.buf : "---"); + _sg_imgui_draw_resource_slot(&info.slot); + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (pass_ui->desc.color_attachments[i].image.id == SG_INVALID_ID) { + break; + } + igSeparator(); + igText("Color Attachment #%d:", i); + _sg_imgui_draw_attachment(ctx, &pass_ui->desc.color_attachments[i], &pass_ui->color_image_scale[i]); + } + if (pass_ui->desc.depth_stencil_attachment.image.id != SG_INVALID_ID) { + igSeparator(); + igText("Depth-Stencil Attachemnt:"); + _sg_imgui_draw_attachment(ctx, &pass_ui->desc.depth_stencil_attachment, &pass_ui->ds_image_scale); + } + } + else { + igText("Pass 0x%08X not valid.", pass.id); + } + igEndChild(); + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_bindings_panel(sg_imgui_t* ctx, const sg_bindings* bnd) { + for (int i = 0; i < SG_MAX_SHADERSTAGE_BUFFERS; i++) { + sg_buffer buf = bnd->vertex_buffers[i]; + if (buf.id != SG_INVALID_ID) { + igSeparator(); + igText("Vertex Buffer Slot #%d:", i); + igText(" Buffer: "); igSameLine(0,-1); + if (_sg_imgui_draw_buffer_link(ctx, buf)) { + _sg_imgui_show_buffer(ctx, buf); + } + igText(" Offset: %d", bnd->vertex_buffer_offsets[i]); + } + else { + break; + } + } + if (bnd->index_buffer.id != SG_INVALID_ID) { + sg_buffer buf = bnd->index_buffer; + if (buf.id != SG_INVALID_ID) { + igSeparator(); + igText("Index Buffer Slot:"); + igText(" Buffer: "); igSameLine(0,-1); + if (_sg_imgui_draw_buffer_link(ctx, buf)) { + _sg_imgui_show_buffer(ctx, buf); + } + igText(" Offset: %d", bnd->index_buffer_offset); + } + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + sg_image img = bnd->vs_images[i]; + if (img.id != SG_INVALID_ID) { + igSeparator(); + igText("Vertex Stage Image Slot #%d:", i); + igText(" Image: "); igSameLine(0,-1); + if (_sg_imgui_draw_image_link(ctx, img)) { + _sg_imgui_show_image(ctx, img); + } + } + else { + break; + } + } + for (int i = 0; i < SG_MAX_SHADERSTAGE_IMAGES; i++) { + sg_image img = bnd->fs_images[i]; + if (img.id != SG_INVALID_ID) { + igSeparator(); + igText("Fragment Stage Image Slot #%d:", i); + igText(" Image: "); igSameLine(0,-1); + if (_sg_imgui_draw_image_link(ctx, img)) { + _sg_imgui_show_image(ctx, img); + } + } + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_uniforms_panel(sg_imgui_t* ctx, const sg_imgui_args_apply_uniforms_t* args) { + SOKOL_ASSERT(args->ub_index < SG_MAX_SHADERSTAGE_BUFFERS); + + /* check if all the required information for drawing the structured uniform block content + is available, otherwise just render a generic hexdump + */ + if (sg_query_pipeline_state(args->pipeline) != SG_RESOURCESTATE_VALID) { + igText("Pipeline object not valid!"); + return; + } + sg_imgui_pipeline_t* pip_ui = &ctx->pipelines.slots[_sg_imgui_slot_index(args->pipeline.id)]; + if (sg_query_shader_state(pip_ui->desc.shader) != SG_RESOURCESTATE_VALID) { + igText("Shader object not valid!"); + return; + } + sg_imgui_shader_t* shd_ui = &ctx->shaders.slots[_sg_imgui_slot_index(pip_ui->desc.shader.id)]; + SOKOL_ASSERT(shd_ui->res_id.id == pip_ui->desc.shader.id); + const sg_shader_uniform_block_desc* ub_desc = (args->stage == SG_SHADERSTAGE_VS) ? + &shd_ui->desc.vs.uniform_blocks[args->ub_index] : + &shd_ui->desc.fs.uniform_blocks[args->ub_index]; + SOKOL_ASSERT(args->num_bytes <= ub_desc->size); + bool draw_dump = false; + if (ub_desc->uniforms[0].type == SG_UNIFORMTYPE_INVALID) { + draw_dump = true; + } + + sg_imgui_capture_bucket_t* bucket = _sg_imgui_capture_get_read_bucket(ctx); + SOKOL_ASSERT((args->ubuf_pos + args->num_bytes) <= bucket->ubuf_size); + const float* uptrf = (const float*) (bucket->ubuf + args->ubuf_pos); + if (!draw_dump) { + for (int i = 0; i < SG_MAX_UB_MEMBERS; i++) { + const sg_shader_uniform_desc* ud = &ub_desc->uniforms[i]; + if (ud->type == SG_UNIFORMTYPE_INVALID) { + break; + } + int num_items = (ud->array_count > 1) ? ud->array_count : 1; + if (num_items > 1) { + igText("%d: %s %s[%d] =", i, _sg_imgui_uniformtype_string(ud->type), ud->name?ud->name:"", ud->array_count); + } + else { + igText("%d: %s %s =", i, _sg_imgui_uniformtype_string(ud->type), ud->name?ud->name:""); + } + for (int i = 0; i < num_items; i++) { + switch (ud->type) { + case SG_UNIFORMTYPE_FLOAT: + igText(" %.3f", *uptrf); + break; + case SG_UNIFORMTYPE_FLOAT2: + igText(" %.3f, %.3f", uptrf[0], uptrf[1]); + break; + case SG_UNIFORMTYPE_FLOAT3: + igText(" %.3f, %.3f, %.3f", uptrf[0], uptrf[1], uptrf[2]); + break; + case SG_UNIFORMTYPE_FLOAT4: + igText(" %.3f, %.3f, %.3f, %.3f", uptrf[0], uptrf[1], uptrf[2], uptrf[3]); + break; + case SG_UNIFORMTYPE_MAT4: + igText(" %.3f, %.3f, %.3f, %.3f\n" + " %.3f, %.3f, %.3f, %.3f\n" + " %.3f, %.3f, %.3f, %.3f\n" + " %.3f, %.3f, %.3f, %.3f", + uptrf[0], uptrf[1], uptrf[2], uptrf[3], + uptrf[4], uptrf[5], uptrf[6], uptrf[7], + uptrf[8], uptrf[9], uptrf[10], uptrf[11], + uptrf[12], uptrf[13], uptrf[14], uptrf[15]); + break; + default: + igText("???"); + break; + } + uptrf += _sg_imgui_uniform_size(ud->type, 1) / sizeof(float); + } + } + } + else { + const uint32_t num_floats = ub_desc->size / sizeof(float); + for (uint32_t i = 0; i < num_floats; i++) { + igText("%.3f, ", uptrf[i]); + if (((i + 1) % 4) != 0) { + igSameLine(0,-1); + } + } + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_passaction_panel(sg_imgui_t* ctx, sg_pass pass, const sg_pass_action* action) { + /* determine number of valid color attachments in the pass */ + int num_color_atts = 0; + if (SG_INVALID_ID == pass.id) { + /* default pass: one color attachment */ + num_color_atts = 1; + } + else { + const sg_imgui_pass_t* pass_ui = &ctx->passes.slots[_sg_imgui_slot_index(pass.id)]; + for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { + if (pass_ui->desc.color_attachments[i].image.id != SG_INVALID_ID) { + num_color_atts++; + } + } + } + + igText("Pass Action: "); + for (int i = 0; i < num_color_atts; i++) { + const sg_color_attachment_action* c_att = &action->colors[i]; + igText(" Color Attachment %d:", i); + switch (c_att->action) { + case SG_ACTION_LOAD: igText(" SG_ACTION_LOAD"); break; + case SG_ACTION_DONTCARE: igText(" SG_ACTION_DONTCARE"); break; + default: + igText(" SG_ACTION_CLEAR: %.3f, %.3f, %.3f, %.3f", + c_att->val[0], + c_att->val[1], + c_att->val[2], + c_att->val[3]); + break; + } + } + const sg_depth_attachment_action* d_att = &action->depth; + igText(" Depth Attachment:"); + switch (d_att->action) { + case SG_ACTION_LOAD: igText(" SG_ACTION_LOAD"); break; + case SG_ACTION_DONTCARE: igText(" SG_ACTION_DONTCARE"); break; + default: igText(" SG_ACTION_CLEAR: %.3f", d_att->val); break; + } + const sg_stencil_attachment_action* s_att = &action->stencil; + igText(" Stencil Attachment"); + switch (s_att->action) { + case SG_ACTION_LOAD: igText(" SG_ACTION_LOAD"); break; + case SG_ACTION_DONTCARE: igText(" SG_ACTION_DONTCARE"); break; + default: igText(" SG_ACTION_CLEAR: 0x%02X", s_att->val); break; + } +} + +_SOKOL_PRIVATE void _sg_imgui_draw_capture_panel(sg_imgui_t* ctx) { + uint32_t sel_item_index = ctx->capture.sel_item; + if (sel_item_index >= _sg_imgui_capture_num_read_items(ctx)) { + return; + } + sg_imgui_capture_item_t* item = _sg_imgui_capture_read_item_at(ctx, sel_item_index); + igBeginChild("capture_item", IMVEC2(0, 0), false, 0); + igPushStyleColorU32(ImGuiCol_Text, item->color); + igText("%s", _sg_imgui_capture_item_string(ctx, sel_item_index, item).buf); + igPopStyleColor(1); + igSeparator(); + switch (item->cmd) { + case SG_IMGUI_CMD_RESET_STATE_CACHE: + break; + case SG_IMGUI_CMD_MAKE_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.make_buffer.result); + break; + case SG_IMGUI_CMD_MAKE_IMAGE: + _sg_imgui_draw_image_panel(ctx, item->args.make_image.result); + break; + case SG_IMGUI_CMD_MAKE_SHADER: + _sg_imgui_draw_shader_panel(ctx, item->args.make_shader.result); + break; + case SG_IMGUI_CMD_MAKE_PIPELINE: + _sg_imgui_draw_pipeline_panel(ctx, item->args.make_pipeline.result); + break; + case SG_IMGUI_CMD_MAKE_PASS: + _sg_imgui_draw_pass_panel(ctx, item->args.make_pass.result); + break; + case SG_IMGUI_CMD_DESTROY_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.destroy_buffer.buffer); + break; + case SG_IMGUI_CMD_DESTROY_IMAGE: + _sg_imgui_draw_image_panel(ctx, item->args.destroy_image.image); + break; + case SG_IMGUI_CMD_DESTROY_SHADER: + _sg_imgui_draw_shader_panel(ctx, item->args.destroy_shader.shader); + break; + case SG_IMGUI_CMD_DESTROY_PIPELINE: + _sg_imgui_draw_pipeline_panel(ctx, item->args.destroy_pipeline.pipeline); + break; + case SG_IMGUI_CMD_DESTROY_PASS: + _sg_imgui_draw_pass_panel(ctx, item->args.destroy_pass.pass); + break; + case SG_IMGUI_CMD_UPDATE_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.update_buffer.buffer); + break; + case SG_IMGUI_CMD_UPDATE_IMAGE: + _sg_imgui_draw_image_panel(ctx, item->args.update_image.image); + break; + case SG_IMGUI_CMD_APPEND_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.update_buffer.buffer); + break; + case SG_IMGUI_CMD_BEGIN_DEFAULT_PASS: + { + sg_pass inv_pass = { SG_INVALID_ID }; + _sg_imgui_draw_passaction_panel(ctx, inv_pass, &item->args.begin_default_pass.action); + } + break; + case SG_IMGUI_CMD_BEGIN_PASS: + _sg_imgui_draw_passaction_panel(ctx, item->args.begin_pass.pass, &item->args.begin_pass.action); + igSeparator(); + _sg_imgui_draw_pass_panel(ctx, item->args.begin_pass.pass); + break; + case SG_IMGUI_CMD_APPLY_VIEWPORT: + case SG_IMGUI_CMD_APPLY_SCISSOR_RECT: + break; + case SG_IMGUI_CMD_APPLY_PIPELINE: + _sg_imgui_draw_pipeline_panel(ctx, item->args.apply_pipeline.pipeline); + break; + case SG_IMGUI_CMD_APPLY_BINDINGS: + _sg_imgui_draw_bindings_panel(ctx, &item->args.apply_bindings.bindings); + break; + case SG_IMGUI_CMD_APPLY_UNIFORMS: + _sg_imgui_draw_uniforms_panel(ctx, &item->args.apply_uniforms); + break; + case SG_IMGUI_CMD_DRAW: + case SG_IMGUI_CMD_END_PASS: + case SG_IMGUI_CMD_COMMIT: + break; + case SG_IMGUI_CMD_ALLOC_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.alloc_buffer.result); + break; + case SG_IMGUI_CMD_ALLOC_IMAGE: + _sg_imgui_draw_image_panel(ctx, item->args.alloc_image.result); + break; + case SG_IMGUI_CMD_ALLOC_SHADER: + _sg_imgui_draw_shader_panel(ctx, item->args.alloc_shader.result); + break; + case SG_IMGUI_CMD_ALLOC_PIPELINE: + _sg_imgui_draw_pipeline_panel(ctx, item->args.alloc_pipeline.result); + break; + case SG_IMGUI_CMD_ALLOC_PASS: + _sg_imgui_draw_pass_panel(ctx, item->args.alloc_pass.result); + break; + case SG_IMGUI_CMD_INIT_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.init_buffer.buffer); + break; + case SG_IMGUI_CMD_INIT_IMAGE: + _sg_imgui_draw_image_panel(ctx, item->args.init_image.image); + break; + case SG_IMGUI_CMD_INIT_SHADER: + _sg_imgui_draw_shader_panel(ctx, item->args.init_shader.shader); + break; + case SG_IMGUI_CMD_INIT_PIPELINE: + _sg_imgui_draw_pipeline_panel(ctx, item->args.init_pipeline.pipeline); + break; + case SG_IMGUI_CMD_INIT_PASS: + _sg_imgui_draw_pass_panel(ctx, item->args.init_pass.pass); + break; + case SG_IMGUI_CMD_FAIL_BUFFER: + _sg_imgui_draw_buffer_panel(ctx, item->args.fail_buffer.buffer); + break; + case SG_IMGUI_CMD_FAIL_IMAGE: + _sg_imgui_draw_image_panel(ctx, item->args.fail_image.image); + break; + case SG_IMGUI_CMD_FAIL_SHADER: + _sg_imgui_draw_shader_panel(ctx, item->args.fail_shader.shader); + break; + case SG_IMGUI_CMD_FAIL_PIPELINE: + _sg_imgui_draw_pipeline_panel(ctx, item->args.fail_pipeline.pipeline); + break; + case SG_IMGUI_CMD_FAIL_PASS: + _sg_imgui_draw_pass_panel(ctx, item->args.fail_pass.pass); + break; + default: + break; + } + igEndChild(); +} + +_SOKOL_PRIVATE void _sg_imgui_draw_caps_panel(sg_imgui_t* ctx) { + igText("Backend: %s\n\n", _sg_imgui_backend_string(sg_query_backend())); + sg_features f = sg_query_features(); + igText("Features:"); + igText(" instancing: %s", _sg_imgui_bool_string(f.instancing)); + igText(" origin_top_left: %s", _sg_imgui_bool_string(f.origin_top_left)); + igText(" multiple_render_targets: %s", _sg_imgui_bool_string(f.multiple_render_targets)); + igText(" msaa_render_targets: %s", _sg_imgui_bool_string(f.msaa_render_targets)); + igText(" imagetype_3d: %s", _sg_imgui_bool_string(f.imagetype_3d)); + igText(" imagetype_array: %s", _sg_imgui_bool_string(f.imagetype_array)); + igText(" image_clamp_to_border: %s", _sg_imgui_bool_string(f.image_clamp_to_border)); + sg_limits l = sg_query_limits(); + igText("\nLimits:\n"); + igText(" max_image_size_2d: %d", l.max_image_size_2d); + igText(" max_image_size_cube: %d", l.max_image_size_cube); + igText(" max_image_size_3d: %d", l.max_image_size_3d); + igText(" max_image_size_array: %d", l.max_image_size_array); + igText(" max_image_array_layers: %d", l.max_image_array_layers); + igText(" max_vertex_attrs: %d", l.max_vertex_attrs); + igText("\nUsable Pixelformats:"); + for (int i = (int)(SG_PIXELFORMAT_NONE+1); i < (int)_SG_PIXELFORMAT_NUM; i++) { + sg_pixel_format fmt = (sg_pixel_format)i; + sg_pixelformat_info info = sg_query_pixelformat(fmt); + if (info.sample) { + igText(" %s: %s%s%s%s%s%s", + _sg_imgui_pixelformat_string(fmt), + info.sample ? "SAMPLE ":"", + info.filter ? "FILTER ":"", + info.blend ? "BLEND ":"", + info.render ? "RENDER ":"", + info.msaa ? "MSAA ":"", + info.depth ? "DEPTH ":""); + } + } +} + +/*--- PUBLIC FUNCTIONS -------------------------------------------------------*/ +SOKOL_API_IMPL void sg_imgui_init(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx); + memset(ctx, 0, sizeof(sg_imgui_t)); + ctx->init_tag = 0xABCDABCD; + _sg_imgui_capture_init(ctx); + + /* hook into sokol_gfx functions */ + sg_trace_hooks hooks; + memset(&hooks, 0, sizeof(hooks)); + hooks.user_data = (void*) ctx; + hooks.reset_state_cache = _sg_imgui_reset_state_cache; + hooks.make_buffer = _sg_imgui_make_buffer; + hooks.make_image = _sg_imgui_make_image; + hooks.make_shader = _sg_imgui_make_shader; + hooks.make_pipeline = _sg_imgui_make_pipeline; + hooks.make_pass = _sg_imgui_make_pass; + hooks.destroy_buffer = _sg_imgui_destroy_buffer; + hooks.destroy_image = _sg_imgui_destroy_image; + hooks.destroy_shader = _sg_imgui_destroy_shader; + hooks.destroy_pipeline = _sg_imgui_destroy_pipeline; + hooks.destroy_pass = _sg_imgui_destroy_pass; + hooks.update_buffer = _sg_imgui_update_buffer; + hooks.update_image = _sg_imgui_update_image; + hooks.append_buffer = _sg_imgui_append_buffer; + hooks.begin_default_pass = _sg_imgui_begin_default_pass; + hooks.begin_pass = _sg_imgui_begin_pass; + hooks.apply_viewport = _sg_imgui_apply_viewport; + hooks.apply_scissor_rect = _sg_imgui_apply_scissor_rect; + hooks.apply_pipeline = _sg_imgui_apply_pipeline; + hooks.apply_bindings = _sg_imgui_apply_bindings; + hooks.apply_uniforms = _sg_imgui_apply_uniforms; + hooks.draw = _sg_imgui_draw; + hooks.end_pass = _sg_imgui_end_pass; + hooks.commit = _sg_imgui_commit; + hooks.alloc_buffer = _sg_imgui_alloc_buffer; + hooks.alloc_image = _sg_imgui_alloc_image; + hooks.alloc_shader = _sg_imgui_alloc_shader; + hooks.alloc_pipeline = _sg_imgui_alloc_pipeline; + hooks.alloc_pass = _sg_imgui_alloc_pass; + hooks.init_buffer = _sg_imgui_init_buffer; + hooks.init_image = _sg_imgui_init_image; + hooks.init_shader = _sg_imgui_init_shader; + hooks.init_pipeline = _sg_imgui_init_pipeline; + hooks.init_pass = _sg_imgui_init_pass; + hooks.fail_buffer = _sg_imgui_fail_buffer; + hooks.fail_image = _sg_imgui_fail_image; + hooks.fail_shader = _sg_imgui_fail_shader; + hooks.fail_pipeline = _sg_imgui_fail_pipeline; + hooks.fail_pass = _sg_imgui_fail_pass; + hooks.push_debug_group = _sg_imgui_push_debug_group; + hooks.pop_debug_group = _sg_imgui_pop_debug_group; + hooks.err_buffer_pool_exhausted = _sg_imgui_err_buffer_pool_exhausted; + hooks.err_image_pool_exhausted = _sg_imgui_err_image_pool_exhausted; + hooks.err_shader_pool_exhausted = _sg_imgui_err_shader_pool_exhausted; + hooks.err_pipeline_pool_exhausted = _sg_imgui_err_pipeline_pool_exhausted; + hooks.err_pass_pool_exhausted = _sg_imgui_err_pass_pool_exhausted; + hooks.err_context_mismatch = _sg_imgui_err_context_mismatch; + hooks.err_pass_invalid = _sg_imgui_err_pass_invalid; + hooks.err_draw_invalid = _sg_imgui_err_draw_invalid; + hooks.err_bindings_invalid = _sg_imgui_err_bindings_invalid; + ctx->hooks = sg_install_trace_hooks(&hooks); + + /* allocate resource debug-info slots */ + sg_desc desc = sg_query_desc(); + ctx->buffers.num_slots = desc.buffer_pool_size; + ctx->images.num_slots = desc.image_pool_size; + ctx->shaders.num_slots = desc.shader_pool_size; + ctx->pipelines.num_slots = desc.pipeline_pool_size; + ctx->passes.num_slots = desc.pass_pool_size; + + const int buffer_pool_size = ctx->buffers.num_slots * sizeof(sg_imgui_buffer_t); + ctx->buffers.slots = (sg_imgui_buffer_t*) _sg_imgui_alloc(buffer_pool_size); + SOKOL_ASSERT(ctx->buffers.slots); + memset(ctx->buffers.slots, 0, buffer_pool_size); + + const int image_pool_size = ctx->images.num_slots * sizeof(sg_imgui_image_t); + ctx->images.slots = (sg_imgui_image_t*) _sg_imgui_alloc(image_pool_size); + SOKOL_ASSERT(ctx->images.slots); + memset(ctx->images.slots, 0, image_pool_size); + + const int shader_pool_size = ctx->shaders.num_slots * sizeof(sg_imgui_shader_t); + ctx->shaders.slots = (sg_imgui_shader_t*) _sg_imgui_alloc(shader_pool_size); + SOKOL_ASSERT(ctx->shaders.slots); + memset(ctx->shaders.slots, 0, shader_pool_size); + + const int pipeline_pool_size = ctx->pipelines.num_slots * sizeof(sg_imgui_pipeline_t); + ctx->pipelines.slots = (sg_imgui_pipeline_t*) _sg_imgui_alloc(pipeline_pool_size); + SOKOL_ASSERT(ctx->pipelines.slots); + memset(ctx->pipelines.slots, 0, pipeline_pool_size); + + const int pass_pool_size = ctx->passes.num_slots * sizeof(sg_imgui_pass_t); + ctx->passes.slots = (sg_imgui_pass_t*) _sg_imgui_alloc(pass_pool_size); + SOKOL_ASSERT(ctx->passes.slots); + memset(ctx->passes.slots, 0, pass_pool_size); +} + +SOKOL_API_IMPL void sg_imgui_discard(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + /* restore original trace hooks */ + sg_install_trace_hooks(&ctx->hooks); + ctx->init_tag = 0; + _sg_imgui_capture_discard(ctx); + if (ctx->buffers.slots) { + for (int i = 0; i < ctx->buffers.num_slots; i++) { + if (ctx->buffers.slots[i].res_id.id != SG_INVALID_ID) { + _sg_imgui_buffer_destroyed(ctx, i); + } + } + _sg_imgui_free((void*)ctx->buffers.slots); + ctx->buffers.slots = 0; + } + if (ctx->images.slots) { + for (int i = 0; i < ctx->images.num_slots; i++) { + if (ctx->images.slots[i].res_id.id != SG_INVALID_ID) { + _sg_imgui_image_destroyed(ctx, i); + } + } + _sg_imgui_free((void*)ctx->images.slots); + ctx->images.slots = 0; + } + if (ctx->shaders.slots) { + for (int i = 0; i < ctx->shaders.num_slots; i++) { + if (ctx->shaders.slots[i].res_id.id != SG_INVALID_ID) { + _sg_imgui_shader_destroyed(ctx, i); + } + } + _sg_imgui_free((void*)ctx->shaders.slots); + ctx->shaders.slots = 0; + } + if (ctx->pipelines.slots) { + for (int i = 0; i < ctx->pipelines.num_slots; i++) { + if (ctx->pipelines.slots[i].res_id.id != SG_INVALID_ID) { + _sg_imgui_pipeline_destroyed(ctx, i); + } + } + _sg_imgui_free((void*)ctx->pipelines.slots); + ctx->pipelines.slots = 0; + } + if (ctx->passes.slots) { + for (int i = 0; i < ctx->passes.num_slots; i++) { + if (ctx->passes.slots[i].res_id.id != SG_INVALID_ID) { + _sg_imgui_pass_destroyed(ctx, i); + } + } + _sg_imgui_free((void*)ctx->passes.slots); + ctx->passes.slots = 0; + } +} + +SOKOL_API_IMPL void sg_imgui_draw(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + sg_imgui_draw_buffers_window(ctx); + sg_imgui_draw_images_window(ctx); + sg_imgui_draw_shaders_window(ctx); + sg_imgui_draw_pipelines_window(ctx); + sg_imgui_draw_passes_window(ctx); + sg_imgui_draw_capture_window(ctx); + sg_imgui_draw_capabilities_window(ctx); +} + +SOKOL_API_IMPL void sg_imgui_draw_buffers_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->buffers.open) { + return; + } + igSetNextWindowSize(IMVEC2(440, 280), ImGuiCond_Once); + if (igBegin("Buffers", &ctx->buffers.open, 0)) { + sg_imgui_draw_buffers_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_images_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->images.open) { + return; + } + igSetNextWindowSize(IMVEC2(440, 400), ImGuiCond_Once); + if (igBegin("Images", &ctx->images.open, 0)) { + sg_imgui_draw_images_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_shaders_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->shaders.open) { + return; + } + igSetNextWindowSize(IMVEC2(440, 400), ImGuiCond_Once); + if (igBegin("Shaders", &ctx->shaders.open, 0)) { + sg_imgui_draw_shaders_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_pipelines_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->pipelines.open) { + return; + } + igSetNextWindowSize(IMVEC2(540, 400), ImGuiCond_Once); + if (igBegin("Pipelines", &ctx->pipelines.open, 0)) { + sg_imgui_draw_pipelines_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_passes_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->passes.open) { + return; + } + igSetNextWindowSize(IMVEC2(440, 400), ImGuiCond_Once); + if (igBegin("Passes", &ctx->passes.open, 0)) { + sg_imgui_draw_passes_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_capture_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->capture.open) { + return; + } + igSetNextWindowSize(IMVEC2(640, 400), ImGuiCond_Once); + if (igBegin("Frame Capture", &ctx->capture.open, 0)) { + sg_imgui_draw_capture_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_capabilities_window(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + if (!ctx->caps.open) { + return; + } + igSetNextWindowSize(IMVEC2(440, 400), ImGuiCond_Once); + if (igBegin("Capabilities", &ctx->caps.open, 0)) { + sg_imgui_draw_capabilities_content(ctx); + } + igEnd(); +} + +SOKOL_API_IMPL void sg_imgui_draw_buffers_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_buffer_list(ctx); + igSameLine(0,-1); + _sg_imgui_draw_buffer_panel(ctx, ctx->buffers.sel_buf); +} + +SOKOL_API_IMPL void sg_imgui_draw_images_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_image_list(ctx); + igSameLine(0,-1); + _sg_imgui_draw_image_panel(ctx, ctx->images.sel_img); +} + +SOKOL_API_IMPL void sg_imgui_draw_shaders_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_shader_list(ctx); + igSameLine(0,-1); + _sg_imgui_draw_shader_panel(ctx, ctx->shaders.sel_shd); +} + +SOKOL_API_IMPL void sg_imgui_draw_pipelines_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_pipeline_list(ctx); + igSameLine(0,-1); + _sg_imgui_draw_pipeline_panel(ctx, ctx->pipelines.sel_pip); +} + +SOKOL_API_IMPL void sg_imgui_draw_passes_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_pass_list(ctx); + igSameLine(0,-1); + _sg_imgui_draw_pass_panel(ctx, ctx->passes.sel_pass); +} + +SOKOL_API_IMPL void sg_imgui_draw_capture_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_capture_list(ctx); + igSameLine(0,-1); + _sg_imgui_draw_capture_panel(ctx); +} + +SOKOL_API_IMPL void sg_imgui_draw_capabilities_content(sg_imgui_t* ctx) { + SOKOL_ASSERT(ctx && (ctx->init_tag == 0xABCDABCD)); + _sg_imgui_draw_caps_panel(ctx); +} + +#endif /* SOKOL_GFX_IMGUI_IMPL */ diff --git a/sokol-app-sys/external/sokol/util/sokol_gl.h b/sokol-app-sys/external/sokol/util/sokol_gl.h new file mode 100644 index 00000000..0a46e64a --- /dev/null +++ b/sokol-app-sys/external/sokol/util/sokol_gl.h @@ -0,0 +1,2372 @@ +#ifndef SOKOL_GL_INCLUDED +/* + sokol_gl.h -- OpenGL 1.x style rendering on top of sokol_gfx.h + + Project URL: https://github.com/floooh/sokol + + Do this: + #define SOKOL_GL_IMPL + before you include this file in *one* C or C++ file to create the + implementation. + + The following defines are used by the implementation to select the + platform-specific embedded shader code (these are the same defines as + used by sokol_gfx.h and sokol_app.h): + + SOKOL_GLCORE33 + SOKOL_GLES2 + SOKOL_GLES3 + SOKOL_D3D11 + SOKOL_METAL + + ...optionally provide the following macros to override defaults: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_MALLOC(s) - your own malloc function (default: malloc(s)) + SOKOL_FREE(p) - your own free function (default: free(p)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + SOKOL_LOG(msg) - your own logging function (default: puts(msg)) + SOKOL_UNREACHABLE() - a guard macro for unreachable code (default: assert(false)) + + If sokol_gl.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + Include the following headers before including sokol_gl.h: + + sokol_gfx.h + + Matrix functions have been taken from MESA and Regal. + + FEATURE OVERVIEW: + ================= + sokol_gl.h implements a subset of the OpenGLES 1.x feature set useful for + when you just want to quickly render a bunch of colored triangles or + lines without having to mess with buffers and + shaders. + + The current feature set is mostly useful for debug visualizations + and simple UI-style 2D rendering: + + What's implemented: + - vertex components: + - position (x, y, z) + - 2D texture coords (u, v) + - color (r, g, b, a) + - primitive types: + - triangle list and strip + - line list and strip + - quad list (TODO: quad strips) + - point list (TODO: point size) + - one texture layer (no multi-texturing) + - viewport and scissor-rect with selectable origin (top-left or bottom-left) + - all GL 1.x matrix stack functions, and additionally equivalent + functions for gluPerspective and gluLookat + + Notable GLES 1.x features that are *NOT* implemented: + - vertex lighting (this is the most likely GL feature that might be added later) + - vertex arrays (although providing whole chunks of vertex data at once + might be a useful feature for a later version) + - texture coordinate generation + - point size and line width + - all pixel store functions + - no ALPHA_TEST + - no clear functions (clearing is handled by the sokol-gfx render pass) + - fog + + Notable differences to GL: + - No "enum soup" for render states etc, instead there's a + 'pipeline stack', this is similar to GL's matrix stack, + but for pipeline-state-objects. The pipeline object at + the top of the pipeline stack defines the active set of render states + - All angles are in radians, not degrees (note the sgl_rad() and + sgl_deg() conversion functions) + - No enable/disable state for scissor test, this is always enabled + + STEP BY STEP: + ============= + --- To initialize sokol-gl, call: + + sgl_setup(const sgl_desc_t* desc) + + NOTE that sgl_setup() must be called *after* initializing sokol-gfx + (via sg_setup). This is because sgl_setup() needs to create + sokol-gfx resource objects. + + sgl_setup() needs to know the attributes of the sokol-gfx render pass + where sokol-gl rendering will happen through the passed-in sgl_desc_t + struct: + + sg_pixel_format color_format - color pixel format of render pass + sg_pixel_format depth_format - depth pixel format of render pass + int sample_count - MSAA sample count of render pass + + These values have the same defaults as sokol_gfx.h and sokol_app.h, + to use the default values, leave them zero-initialized. + + You can adjust the maximum number of vertices and drawing commands + per frame through the members: + + int max_vertices - default is 65536 + int max_commands - default is 16384 + + You can adjust the size of the internal pipeline state object pool + with: + + int pipeline_pool_size - default is 64 + + Finally you can change the face winding for front-facing triangles + and quads: + + sg_face_winding face_winding - default is SG_FACEWINDING_CCW + + The default winding for front faces is counter-clock-wise. This is + the same as OpenGL's default, but different from sokol-gfx. + + --- Optionally create pipeline-state-objects if you need render state + that differs from sokol-gl's default state: + + sgl_pipeline pip = sgl_make_pipeline(const sg_pipeline_desc* desc) + + The similarity with sokol_gfx.h's sg_pipeline type and sg_make_pipeline() + function is intended. sgl_make_pipeline() also takes a standard + sokol-gfx sg_pipeline_desc object to describe the render state, but + without: + - shader + - vertex layout + - color- and depth-pixel-formats + - primitive type (lines, triangles, ...) + - MSAA sample count + Those will be filled in by sgl_make_pipeline(). Note that each + call to sgl_make_pipeline() needs to create several sokol-gfx + pipeline objects (one for each primitive type). + + --- if you need to destroy sgl_pipeline objects before sgl_shutdown(): + + sgl_destroy_pipeline(sgl_pipeline pip) + + --- After sgl_setup() you can call any of the sokol-gl functions anywhere + in a frame, *except* sgl_draw(). The 'vanilla' functions + will only change internal sokol-gl state, and not call any sokol-gfx + functions. + + --- Unlike OpenGL, sokol-gl has a function to reset internal state to + a known default. This is useful at the start of a sequence of + rendering operations: + + void sgl_defaults(void) + + This will set the following default state: + + - current texture coordinate to u=0.0f, v=0.0f + - current color to white (rgba all 1.0f) + - unbind the current texture and texturing will be disabled + - *all* matrices will be set to identity (also the projection matrix) + - the default render state will be set by loading the 'default pipeline' + into the top of the pipeline stack + + The current matrix- and pipeline-stack-depths will not be changed by + sgl_defaults(). + + --- change the currently active renderstate through the + pipeline-stack functions, this works similar to the + traditional GL matrix stack: + + ...load the default pipeline state on the top of the pipeline stack: + + sgl_default_pipeline() + + ...load a specific pipeline on the top of the pipeline stack: + + sgl_load_pipeline(sgl_pipeline pip) + + ...push and pop the pipeline stack: + sgl_push_pipeline() + sgl_pop_pipeline() + + --- control texturing with: + + sgl_enable_texture() + sgl_disable_texture() + sgl_texture(sg_image img) + + --- set the current viewport and scissor rect with: + + sgl_viewport(int x, int y, int w, int h, bool origin_top_left) + sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left) + + ...these calls add a new command to the internal command queue, so + that the viewport or scissor rect are set at the right time relative + to other sokol-gl calls. + + --- adjust the transform matrices, matrix manipulation works just like + the OpenGL matrix stack: + + ...set the current matrix mode: + + sgl_matrix_mode_modelview() + sgl_matrix_mode_projection() + sgl_matrix_mode_texture() + + ...load the identity matrix into the current matrix: + + sgl_load_identity() + + ...translate, rotate and scale the current matrix: + + sgl_translate(float x, float y, float z) + sgl_rotate(float angle_rad, float x, float y, float z) + sgl_scale(float x, float y, float z) + + NOTE that all angles in sokol-gl are in radians, not in degree. + Convert between radians and degree with the helper functions: + + float sgl_rad(float deg) - degrees to radians + float sgl_deg(float rad) - radians to degrees + + ...directly load the current matrix from a float[16] array: + + sgl_load_matrix(const float m[16]) + sgl_load_transpose_matrix(const float m[16]) + + ...directly multiply the current matrix from a float[16] array: + + sgl_mult_matrix(const float m[16]) + sgl_mult_transpose_matrix(const float m[16]) + + The memory layout of those float[16] arrays is the same as in OpenGL. + + ...more matrix functions: + + sgl_frustum(float left, float right, float bottom, float top, float near, float far) + sgl_ortho(float left, float right, float bottom, float top, float near, float far) + sgl_perspective(float fov_y, float aspect, float near, float far) + sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z) + + These functions work the same as glFrustum(), glOrtho(), gluPerspective() + and gluLookAt(). + + ...and finally to push / pop the current matrix stack: + + sgl_push_matrix(void) + sgl_pop_matrix(void) + + Again, these work the same as glPushMatrix() and glPopMatrix(). + + --- perform primitive rendering: + + ...set the current texture coordinate and color 'registers' with: + + sgl_t2f(float u, float v) - set current texture coordinate + sgl_c*(...) - set current color + + There are several functions for setting the color (as float values, + unsigned byte values, packed as unsigned 32-bit integer, with + and without alpha). + + NOTE that these are the only functions that can be called both inside + sgl_begin_*() / sgl_end() and outside. + + ...start a primitive vertex sequence with: + + sgl_begin_points() + sgl_begin_lines() + sgl_begin_line_strip() + sgl_begin_triangles() + sgl_begin_triangle_strip() + sgl_begin_quads() + + ...after sgl_begin_*() specifiy vertices: + + sgl_v*(...) + sgl_v*_t*(...) + sgl_v*_c*(...) + sgl_v*_t*_c*(...) + + These functions write a new vertex to sokol-gl's internal vertex buffer, + optionally with texture-coords and color. If the texture coordinate + and/or color is missing, it will be taken from the current texture-coord + and color 'register'. + + ...finally, after specifying vertices, call: + + sgl_end() + + This will record a new draw command in sokol-gl's internal command + list, or it will extend the previous draw command if no relevant + state has changed since the last sgl_begin/end pair. + + --- inside a sokol-gfx rendering pass, call: + + sgl_draw() + + This will render everything that has been recorded since the last + call to sgl_draw() through sokol-gfx, and will 'rewind' the internal + vertex-, uniform- and command-buffers. + + --- sokol-gl tracks a single internal error code which can be + queried with + + sgl_error_t sgl_error(void) + + ...which can return the following error codes: + + SGL_NO_ERROR - all OK, no error occurred since last sgl_draw() + SGL_ERROR_VERTICES_FULL - internal vertex buffer is full (checked in sgl_end()) + SGL_ERROR_UNIFORMS_FULL - the internal uniforms buffer is full (checked in sgl_end()) + SGL_ERROR_COMMANDS_FULL - the internal command buffer is full (checked in sgl_end()) + SGL_ERROR_STACK_OVERFLOW - matrix- or pipeline-stack overflow + SGL_ERROR_STACK_UNDERFLOW - matrix- or pipeline-stack underflow + + ...if sokol-gl is in an error-state, sgl_draw() will skip any rendering, + and reset the error code to SGL_NO_ERROR. + + UNDER THE HOOD: + =============== + sokol_gl.h works by recording vertex data and rendering commands into + memory buffers, and then drawing the recorded commands via sokol_gfx.h + + The only functions which call into sokol_gfx.h are: + - sgl_setup() + - sgl_shutdown() + - sgl_draw() + + sgl_setup() must be called after initializing sokol-gfx. + sgl_shutdown() must be called before shutting down sokol-gfx. + sgl_draw() must be called once per frame inside a sokol-gfx render pass. + + All other sokol-gl function can be called anywhere in a frame, since + they just record data into memory buffers owned by sokol-gl. + + What happens in: + + sgl_setup(): + - 3 memory buffers are allocated, one for vertex data, + one for uniform data, and one for commands + - sokol-gfx resources are created: a (dynamic) vertex buffer, + a shader object (using embedded shader source or byte code), + and an 8x8 all-white default texture + + One vertex is 24 bytes: + - float3 position + - float2 texture coords + - uint32_t color + + One uniform block is 128 bytes: + - mat4 model-view-projection matrix + - mat4 texture matrix + + One draw command is ca. 24 bytes for the actual + command code plus command arguments. + + Each sgl_end() consumes one command, and one uniform block + (only when the matrices have changed). + The required size for one sgl_begin/end pair is (at most): + + (152 + 24 * num_verts) bytes + + sgl_shutdown(): + - all sokol-gfx resources (buffer, shader, default-texture and + all pipeline objects) are destroyed + - the 3 memory buffers are freed + + sgl_draw(): + - copy all recorded vertex data into the dynamic sokol-gfx buffer + via a call to sg_update_buffer() + - for each recorded command: + - if it's a viewport command, call sg_apply_viewport() + - if it's a scissor-rect command, call sg_apply_scissor_rect() + - if it's a draw command: + - depending on what has changed since the last draw command, + call sg_apply_pipeline(), sg_apply_bindings() and + sg_apply_uniforms() + - finally call sg_draw() + + All other functions only modify the internally tracked state, add + data to the vertex, uniform and command buffers, or manipulate + the matrix stack. + + ON DRAW COMMAND MERGING + ======================= + Not every call to sgl_end() will automatically record a new draw command. + If possible, the previous draw command will simply be extended, + resulting in fewer actual draw calls later in sgl_draw(). + + A draw command will be merged with the previous command if "no relevant + state has changed" since the last sgl_end(), meaning: + + - no calls to sgl_apply_viewport() and sgl_apply_scissor_rect() + - the primitive type hasn't changed + - the primitive type isn't a 'strip type' (no line or triangle strip) + - the pipeline state object hasn't changed + - none of the matrices has changed + - none of the texture state has changed + + Merging a draw command simply means that the number of vertices + to render in the previous draw command will be incremented by the + number of vertices in the new draw command. + + LICENSE + ======= + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_GL_INCLUDED (1) +#include +#include + +#if !defined(SOKOL_GFX_INCLUDED) +#error "Please include sokol_gfx.h before sokol_gl.h" +#endif + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* sokol_gl pipeline handle (created with sgl_make_pipeline()) */ +typedef struct sgl_pipeline { uint32_t id; } sgl_pipeline; + +/* + sgl_error_t + + Errors are reset each frame after calling sgl_draw(), + get the last error code with sgl_error() +*/ +typedef enum sgl_error_t { + SGL_NO_ERROR = 0, + SGL_ERROR_VERTICES_FULL, + SGL_ERROR_UNIFORMS_FULL, + SGL_ERROR_COMMANDS_FULL, + SGL_ERROR_STACK_OVERFLOW, + SGL_ERROR_STACK_UNDERFLOW, +} sgl_error_t; + +typedef struct sgl_desc_t { + int max_vertices; /* size for vertex buffer */ + int max_commands; /* size of uniform- and command-buffers */ + int pipeline_pool_size; /* size of the internal pipeline pool, default is 64 */ + sg_pixel_format color_format; + sg_pixel_format depth_format; + int sample_count; + sg_face_winding face_winding; /* default front face winding is CCW */ +} sgl_desc_t; + +/* setup/shutdown/misc */ +SOKOL_API_DECL void sgl_setup(const sgl_desc_t* desc); +SOKOL_API_DECL void sgl_shutdown(void); +SOKOL_API_DECL sgl_error_t sgl_error(void); +SOKOL_API_DECL void sgl_defaults(void); +SOKOL_API_DECL float sgl_rad(float deg); +SOKOL_API_DECL float sgl_deg(float rad); + +/* create and destroy pipeline objects */ +SOKOL_API_DECL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc); +SOKOL_API_DECL void sgl_destroy_pipeline(sgl_pipeline pip); + +/* render state functions */ +SOKOL_API_DECL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left); +SOKOL_API_DECL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left); +SOKOL_API_DECL void sgl_enable_texture(void); +SOKOL_API_DECL void sgl_disable_texture(void); +SOKOL_API_DECL void sgl_texture(sg_image img); + +/* pipeline stack functions */ +SOKOL_API_DECL void sgl_default_pipeline(void); +SOKOL_API_DECL void sgl_load_pipeline(sgl_pipeline pip); +SOKOL_API_DECL void sgl_push_pipeline(void); +SOKOL_API_DECL void sgl_pop_pipeline(void); + +/* matrix stack functions */ +SOKOL_API_DECL void sgl_matrix_mode_modelview(void); +SOKOL_API_DECL void sgl_matrix_mode_projection(void); +SOKOL_API_DECL void sgl_matrix_mode_texture(void); +SOKOL_API_DECL void sgl_load_identity(void); +SOKOL_API_DECL void sgl_load_matrix(const float m[16]); +SOKOL_API_DECL void sgl_load_transpose_matrix(const float m[16]); +SOKOL_API_DECL void sgl_mult_matrix(const float m[16]); +SOKOL_API_DECL void sgl_mult_transpose_matrix(const float m[16]); +SOKOL_API_DECL void sgl_rotate(float angle_rad, float x, float y, float z); +SOKOL_API_DECL void sgl_scale(float x, float y, float z); +SOKOL_API_DECL void sgl_translate(float x, float y, float z); +SOKOL_API_DECL void sgl_frustum(float l, float r, float b, float t, float n, float f); +SOKOL_API_DECL void sgl_ortho(float l, float r, float b, float t, float n, float f); +SOKOL_API_DECL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far); +SOKOL_API_DECL void sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z); +SOKOL_API_DECL void sgl_push_matrix(void); +SOKOL_API_DECL void sgl_pop_matrix(void); + +/* these functions only set the internal 'current texcoord / color' (valid inside or outside begin/end) */ +SOKOL_API_DECL void sgl_t2f(float u, float v); +SOKOL_API_DECL void sgl_c3f(float r, float g, float b); +SOKOL_API_DECL void sgl_c4f(float r, float g, float b, float a); +SOKOL_API_DECL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b); +SOKOL_API_DECL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_API_DECL void sgl_c1i(uint32_t rgba); + +/* define primitives, each begin/end is one draw command */ +SOKOL_API_DECL void sgl_begin_points(void); +SOKOL_API_DECL void sgl_begin_lines(void); +SOKOL_API_DECL void sgl_begin_line_strip(void); +SOKOL_API_DECL void sgl_begin_triangles(void); +SOKOL_API_DECL void sgl_begin_triangle_strip(void); +SOKOL_API_DECL void sgl_begin_quads(void); +SOKOL_API_DECL void sgl_v2f(float x, float y); +SOKOL_API_DECL void sgl_v3f(float x, float y, float z); +SOKOL_API_DECL void sgl_v2f_t2f(float x, float y, float u, float v); +SOKOL_API_DECL void sgl_v3f_t2f(float x, float y, float z, float u, float v); +SOKOL_API_DECL void sgl_v2f_c3f(float x, float y, float r, float g, float b); +SOKOL_API_DECL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b); +SOKOL_API_DECL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a); +SOKOL_API_DECL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_API_DECL void sgl_v2f_c1i(float x, float y, uint32_t rgba); +SOKOL_API_DECL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b); +SOKOL_API_DECL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b); +SOKOL_API_DECL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a); +SOKOL_API_DECL void sgl_v3f_c4b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_API_DECL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba); +SOKOL_API_DECL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b); +SOKOL_API_DECL void sgl_v2f_t2f_c3b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b); +SOKOL_API_DECL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a); +SOKOL_API_DECL void sgl_v2f_t2f_c4b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_API_DECL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba); +SOKOL_API_DECL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b); +SOKOL_API_DECL void sgl_v3f_t2f_c3b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b); +SOKOL_API_DECL void sgl_v3f_t2f_c4f(float x, float y, float z, float u, float v, float r, float g, float b, float a); +SOKOL_API_DECL void sgl_v3f_t2f_c4b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a); +SOKOL_API_DECL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba); +SOKOL_API_DECL void sgl_end(void); + +/* render everything */ +SOKOL_API_DECL void sgl_draw(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif /* SOKOL_GL_INCLUDED */ + +/*-- IMPLEMENTATION ----------------------------------------------------------*/ +#ifdef SOKOL_GL_IMPL +#define SOKOL_GL_IMPL_INCLUDED (1) + +#include /* offsetof */ +#include /* memset */ +#include /* M_PI, sqrtf, sinf, cosf */ + +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + +#ifndef SOKOL_API_IMPL + #define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef SOKOL_MALLOC + #include + #define SOKOL_MALLOC(s) malloc(s) + #define SOKOL_FREE(p) free(p) +#endif +#ifndef SOKOL_LOG + #ifdef SOKOL_DEBUG + #include + #define SOKOL_LOG(s) { SOKOL_ASSERT(s); puts(s); } + #else + #define SOKOL_LOG(s) + #endif +#endif +#ifndef SOKOL_UNREACHABLE + #define SOKOL_UNREACHABLE SOKOL_ASSERT(false) +#endif + +#define _sgl_def(val, def) (((val) == 0) ? (def) : (val)) +#define _SGL_INIT_COOKIE (0xABCDABCD) + +#if defined(SOKOL_GLCORE33) +static const char* _sgl_vs_src = + "#version 330\n" + "uniform mat4 mvp;\n" + "uniform mat4 tm;\n" + "in vec4 position;\n" + "in vec2 texcoord0;\n" + "in vec4 color0;\n" + "out vec4 uv;\n" + "out vec4 color;\n" + "void main() {\n" + " gl_Position = mvp * position;\n" + " uv = tm * vec4(texcoord0, 0.0, 1.0);\n" + " color = color0;\n" + "}\n"; +static const char* _sgl_fs_src = + "#version 330\n" + "uniform sampler2D tex;\n" + "in vec4 uv;\n" + "in vec4 color;\n" + "out vec4 frag_color;\n" + "void main() {\n" + " frag_color = texture(tex, uv.xy) * color;\n" + "}\n"; +#elif defined(SOKOL_GLES2) || defined(SOKOL_GLES3) +static const char* _sgl_vs_src = + "uniform mat4 mvp;\n" + "uniform mat4 tm;\n" + "attribute vec4 position;\n" + "attribute vec2 texcoord0;\n" + "attribute vec4 color0;\n" + "varying vec4 uv;\n" + "varying vec4 color;\n" + "void main() {\n" + " gl_Position = mvp * position;\n" + " uv = tm * vec4(texcoord0, 0.0, 1.0);\n" + " color = color0;\n" + "}\n"; +static const char* _sgl_fs_src = + "precision mediump float;\n" + "uniform sampler2D tex;\n" + "varying vec4 uv;\n" + "varying vec4 color;\n" + "void main() {\n" + " gl_FragColor = texture2D(tex, uv.xy) * color;\n" + "}\n"; +#elif defined(SOKOL_METAL) +static const char* _sgl_vs_src = + "#include \n" + "using namespace metal;\n" + "struct params_t {\n" + " float4x4 mvp;\n" + " float4x4 tm;\n" + "};\n" + "struct vs_in {\n" + " float4 pos [[attribute(0)]];\n" + " float2 uv [[attribute(1)]];\n" + " float4 color [[attribute(2)]];\n" + "};\n" + "struct vs_out {\n" + " float4 pos [[position]];\n" + " float4 uv;\n" + " float4 color;\n" + "};\n" + "vertex vs_out _main(vs_in in [[stage_in]], constant params_t& params [[buffer(0)]]) {\n" + " vs_out out;\n" + " out.pos = params.mvp * in.pos;\n" + " out.uv = params.tm * float4(in.uv, 0.0, 1.0);\n" + " out.color = in.color;\n" + " return out;\n" + "}\n"; +static const char* _sgl_fs_src = + "#include \n" + "using namespace metal;\n" + "struct fs_in {\n" + " float4 uv;\n" + " float4 color;\n" + "};\n" + "fragment float4 _main(fs_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) {\n" + " return tex.sample(smp, in.uv.xy) * in.color;\n" + "}\n"; +#elif defined(SOKOL_D3D11) +/* + Shader blobs for D3D11, compiled with: + + fxc.exe /T vs_5_0 /Fh vs.h /Gec /O3 vs.hlsl + fxc.exe /T ps_5_0 /Fh fs.h /Gec /O3 fs.hlsl + + Vertex shader source: + + cbuffer params: register(b0) { + float4x4 mvp; + float4x4 tm; + }; + struct vs_in { + float4 pos: POSITION; + float2 uv: TEXCOORD0; + float4 color: COLOR0; + }; + struct vs_out { + float4 uv: TEXCOORD0; + float4 color: COLOR0; + float4 pos: SV_Position; + }; + vs_out main(vs_in inp) { + vs_out outp; + outp.pos = mul(mvp, inp.pos); + outp.uv = mul(tm, float4(inp.uv, 0.0, 1.0)); + outp.color = inp.color; + return outp; + }; + + Pixel shader source: + + Texture2D tex: register(t0); + sampler smp: register(s0); + float4 main(float4 uv: TEXCOORD0, float4 color: COLOR0): SV_Target0 { + return tex.Sample(smp, uv.xy) * color; + } +*/ +static const uint8_t _sgl_vs_bin[] = { + 68, 88, 66, 67, 239, 161, + 1, 229, 179, 68, 206, 40, + 34, 15, 57, 169, 103, 117, + 134, 191, 1, 0, 0, 0, + 120, 4, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 104, 1, 0, 0, 216, 1, + 0, 0, 76, 2, 0, 0, + 220, 3, 0, 0, 82, 68, + 69, 70, 44, 1, 0, 0, + 1, 0, 0, 0, 100, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 145, 0, 0, + 3, 1, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 112, 97, 114, 97, + 109, 115, 0, 171, 92, 0, + 0, 0, 2, 0, 0, 0, + 124, 0, 0, 0, 128, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 204, 0, + 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 220, 0, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 0, 1, 0, 0, + 64, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 220, 0, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 109, 118, 112, 0, 102, 108, + 111, 97, 116, 52, 120, 52, + 0, 171, 171, 171, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 116, 109, + 0, 77, 105, 99, 114, 111, + 115, 111, 102, 116, 32, 40, + 82, 41, 32, 72, 76, 83, + 76, 32, 83, 104, 97, 100, + 101, 114, 32, 67, 111, 109, + 112, 105, 108, 101, 114, 32, + 49, 48, 46, 49, 0, 171, + 73, 83, 71, 78, 104, 0, + 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 15, 0, 0, 89, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 3, 0, 0, 98, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 15, 15, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 84, 69, 88, 67, 79, + 79, 82, 68, 0, 67, 79, + 76, 79, 82, 0, 79, 83, + 71, 78, 108, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 89, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 0, + 0, 0, 95, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 67, + 79, 76, 79, 82, 0, 83, + 86, 95, 80, 111, 115, 105, + 116, 105, 111, 110, 0, 171, + 83, 72, 69, 88, 136, 1, + 0, 0, 80, 0, 1, 0, + 98, 0, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 95, 0, 0, 3, 242, 16, + 16, 0, 0, 0, 0, 0, + 95, 0, 0, 3, 50, 16, + 16, 0, 1, 0, 0, 0, + 95, 0, 0, 3, 242, 16, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 1, 0, 0, 0, + 103, 0, 0, 4, 242, 32, + 16, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 86, 21, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 6, 16, 16, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 242, 32, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 1, 0, + 0, 0, 70, 30, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 0, 0, 0, 0, 86, 21, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 6, 16, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 166, 26, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 10, + 242, 32, 16, 0, 2, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 246, 31, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 9, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; +static uint8_t _sgl_fs_bin[] = { + 68, 88, 66, 67, 145, 182, + 34, 101, 114, 183, 46, 3, + 176, 243, 147, 199, 109, 42, + 196, 114, 1, 0, 0, 0, + 176, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 232, 0, 0, 0, 56, 1, + 0, 0, 108, 1, 0, 0, + 20, 2, 0, 0, 82, 68, + 69, 70, 172, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 145, 0, 0, + 132, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 128, 0, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, + 13, 0, 0, 0, 115, 109, + 112, 0, 116, 101, 120, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 49, + 48, 46, 49, 0, 73, 83, + 71, 78, 72, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 3, + 0, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 15, + 0, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 67, + 79, 76, 79, 82, 0, 171, + 79, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 97, 114, 103, 101, + 116, 0, 171, 171, 83, 72, + 69, 88, 160, 0, 0, 0, + 80, 0, 0, 0, 40, 0, + 0, 0, 106, 8, 0, 1, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 0, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 69, 0, 0, 139, 194, 0, + 0, 128, 67, 85, 21, 0, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, + 0, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; +#elif defined(SOKOL_DUMMY_BACKEND) +static const char* _sgl_vs_src = ""; +static const char* _sgl_fs_src = ""; +#endif + +typedef enum { + SGL_PRIMITIVETYPE_POINTS = 0, + SGL_PRIMITIVETYPE_LINES, + SGL_PRIMITIVETYPE_LINE_STRIP, + SGL_PRIMITIVETYPE_TRIANGLES, + SGL_PRIMITIVETYPE_TRIANGLE_STRIP, + SGL_PRIMITIVETYPE_QUADS, + SGL_NUM_PRIMITIVE_TYPES, +} _sgl_primitive_type_t; + +typedef struct { + uint32_t id; + sg_resource_state state; +} _sgl_slot_t; + +typedef struct { + int size; + int queue_top; + uint32_t* gen_ctrs; + int* free_queue; +} _sgl_pool_t; + +typedef struct { + _sgl_slot_t slot; + sg_pipeline pip[SGL_NUM_PRIMITIVE_TYPES]; +} _sgl_pipeline_t; + +typedef struct { + _sgl_pool_t pool; + _sgl_pipeline_t* pips; +} _sgl_pipeline_pool_t; + +typedef enum { + SGL_MATRIXMODE_MODELVIEW, + SGL_MATRIXMODE_PROJECTION, + SGL_MATRIXMODE_TEXTURE, + SGL_NUM_MATRIXMODES +} _sgl_matrix_mode_t; + +typedef struct { + float pos[3]; + float uv[2]; + uint32_t rgba; +} _sgl_vertex_t; + +typedef struct { + float v[4][4]; +} _sgl_matrix_t; + +typedef struct { + _sgl_matrix_t mvp; /* model-view-projection matrix */ + _sgl_matrix_t tm; /* texture matrix */ +} _sgl_uniform_t; + +typedef enum { + SGL_COMMAND_DRAW, + SGL_COMMAND_VIEWPORT, + SGL_COMMAND_SCISSOR_RECT, +} _sgl_command_type_t; + +typedef struct { + sg_pipeline pip; + sg_image img; + int base_vertex; + int num_vertices; + int uniform_index; +} _sgl_draw_args_t; + +typedef struct { + int x, y, w, h; + bool origin_top_left; +} _sgl_viewport_args_t; + +typedef struct { + int x, y, w, h; + bool origin_top_left; +} _sgl_scissor_rect_args_t; + +typedef union { + _sgl_draw_args_t draw; + _sgl_viewport_args_t viewport; + _sgl_scissor_rect_args_t scissor_rect; +} _sgl_args_t; + +typedef struct { + _sgl_command_type_t cmd; + _sgl_args_t args; +} _sgl_command_t; + +#define _SGL_INVALID_SLOT_INDEX (0) +#define _SGL_MAX_STACK_DEPTH (64) +#define _SGL_DEFAULT_PIPELINE_POOL_SIZE (64) +#define _SGL_DEFAULT_MAX_VERTICES (1<<16) +#define _SGL_DEFAULT_MAX_COMMANDS (1<<14) +#define _SGL_SLOT_SHIFT (16) +#define _SGL_MAX_POOL_SIZE (1<<_SGL_SLOT_SHIFT) +#define _SGL_SLOT_MASK (_SGL_MAX_POOL_SIZE-1) + +typedef struct { + uint32_t init_cookie; + sgl_desc_t desc; + + int num_vertices; + int num_uniforms; + int num_commands; + int cur_vertex; + int cur_uniform; + int cur_command; + _sgl_vertex_t* vertices; + _sgl_uniform_t* uniforms; + _sgl_command_t* commands; + + /* state tracking */ + int base_vertex; + int vtx_count; /* number of times vtx function has been called, used for non-triangle primitives */ + sgl_error_t error; + bool in_begin; + float u, v; + uint32_t rgba; + _sgl_primitive_type_t cur_prim_type; + sg_image cur_img; + bool texturing_enabled; + bool matrix_dirty; /* reset in sgl_end(), set in any of the matrix stack functions */ + + /* sokol-gfx resources */ + sg_buffer vbuf; + sg_image def_img; /* a default white texture */ + sg_shader shd; + sg_bindings bind; + sgl_pipeline def_pip; + _sgl_pipeline_pool_t pip_pool; + + /* pipeline stack */ + int pip_tos; + sgl_pipeline pip_stack[_SGL_MAX_STACK_DEPTH]; + + /* matrix stacks */ + _sgl_matrix_mode_t cur_matrix_mode; + int matrix_tos[SGL_NUM_MATRIXMODES]; + _sgl_matrix_t matrix_stack[SGL_NUM_MATRIXMODES][_SGL_MAX_STACK_DEPTH]; +} _sgl_t; +static _sgl_t _sgl; + +/*== PRIVATE FUNCTIONS =======================================================*/ + +static void _sgl_init_pool(_sgl_pool_t* pool, int num) { + SOKOL_ASSERT(pool && (num >= 1)); + /* slot 0 is reserved for the 'invalid id', so bump the pool size by 1 */ + pool->size = num + 1; + pool->queue_top = 0; + /* generation counters indexable by pool slot index, slot 0 is reserved */ + size_t gen_ctrs_size = sizeof(uint32_t) * pool->size; + pool->gen_ctrs = (uint32_t*) SOKOL_MALLOC(gen_ctrs_size); + SOKOL_ASSERT(pool->gen_ctrs); + memset(pool->gen_ctrs, 0, gen_ctrs_size); + /* it's not a bug to only reserve 'num' here */ + pool->free_queue = (int*) SOKOL_MALLOC(sizeof(int)*num); + SOKOL_ASSERT(pool->free_queue); + /* never allocate the zero-th pool item since the invalid id is 0 */ + for (int i = pool->size-1; i >= 1; i--) { + pool->free_queue[pool->queue_top++] = i; + } +} + +static void _sgl_discard_pool(_sgl_pool_t* pool) { + SOKOL_ASSERT(pool); + SOKOL_ASSERT(pool->free_queue); + SOKOL_FREE(pool->free_queue); + pool->free_queue = 0; + SOKOL_ASSERT(pool->gen_ctrs); + SOKOL_FREE(pool->gen_ctrs); + pool->gen_ctrs = 0; + pool->size = 0; + pool->queue_top = 0; +} + +static int _sgl_pool_alloc_index(_sgl_pool_t* pool) { + SOKOL_ASSERT(pool); + SOKOL_ASSERT(pool->free_queue); + if (pool->queue_top > 0) { + int slot_index = pool->free_queue[--pool->queue_top]; + SOKOL_ASSERT((slot_index > 0) && (slot_index < pool->size)); + return slot_index; + } + else { + /* pool exhausted */ + return _SGL_INVALID_SLOT_INDEX; + } +} + +static void _sgl_pool_free_index(_sgl_pool_t* pool, int slot_index) { + SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < pool->size)); + SOKOL_ASSERT(pool); + SOKOL_ASSERT(pool->free_queue); + SOKOL_ASSERT(pool->queue_top < pool->size); + #ifdef SOKOL_DEBUG + /* debug check against double-free */ + for (int i = 0; i < pool->queue_top; i++) { + SOKOL_ASSERT(pool->free_queue[i] != slot_index); + } + #endif + pool->free_queue[pool->queue_top++] = slot_index; + SOKOL_ASSERT(pool->queue_top <= (pool->size-1)); +} + +static void _sgl_reset_pipeline(_sgl_pipeline_t* pip) { + SOKOL_ASSERT(pip); + memset(pip, 0, sizeof(_sgl_pipeline_t)); +} + +static void _sgl_setup_pipeline_pool(const sgl_desc_t* desc) { + SOKOL_ASSERT(desc); + /* note: the pools here will have an additional item, since slot 0 is reserved */ + SOKOL_ASSERT((desc->pipeline_pool_size > 0) && (desc->pipeline_pool_size < _SGL_MAX_POOL_SIZE)); + _sgl_init_pool(&_sgl.pip_pool.pool, desc->pipeline_pool_size); + size_t pool_byte_size = sizeof(_sgl_pipeline_t) * _sgl.pip_pool.pool.size; + _sgl.pip_pool.pips = (_sgl_pipeline_t*) SOKOL_MALLOC(pool_byte_size); + SOKOL_ASSERT(_sgl.pip_pool.pips); + memset(_sgl.pip_pool.pips, 0, pool_byte_size); +} + +static void _sgl_discard_pipeline_pool(void) { + SOKOL_FREE(_sgl.pip_pool.pips); _sgl.pip_pool.pips = 0; + _sgl_discard_pool(&_sgl.pip_pool.pool); +} + +/* allocate the slot at slot_index: + - bump the slot's generation counter + - create a resource id from the generation counter and slot index + - set the slot's id to this id + - set the slot's state to ALLOC + - return the resource id +*/ +static uint32_t _sgl_slot_alloc(_sgl_pool_t* pool, _sgl_slot_t* slot, int slot_index) { + /* FIXME: add handling for an overflowing generation counter, + for now, just overflow (another option is to disable + the slot) + */ + SOKOL_ASSERT(pool && pool->gen_ctrs); + SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < pool->size)); + SOKOL_ASSERT((slot->state == SG_RESOURCESTATE_INITIAL) && (slot->id == SG_INVALID_ID)); + uint32_t ctr = ++pool->gen_ctrs[slot_index]; + slot->id = (ctr<<_SGL_SLOT_SHIFT)|(slot_index & _SGL_SLOT_MASK); + slot->state = SG_RESOURCESTATE_ALLOC; + return slot->id; +} + +/* extract slot index from id */ +static int _sgl_slot_index(uint32_t id) { + int slot_index = (int) (id & _SGL_SLOT_MASK); + SOKOL_ASSERT(_SGL_INVALID_SLOT_INDEX != slot_index); + return slot_index; +} + +/* get pipeline pointer without id-check */ +static _sgl_pipeline_t* _sgl_pipeline_at(uint32_t pip_id) { + SOKOL_ASSERT(SG_INVALID_ID != pip_id); + int slot_index = _sgl_slot_index(pip_id); + SOKOL_ASSERT((slot_index > _SGL_INVALID_SLOT_INDEX) && (slot_index < _sgl.pip_pool.pool.size)); + return &_sgl.pip_pool.pips[slot_index]; +} + +/* get pipeline pointer with id-check, returns 0 if no match */ +static _sgl_pipeline_t* _sgl_lookup_pipeline(uint32_t pip_id) { + if (SG_INVALID_ID != pip_id) { + _sgl_pipeline_t* pip = _sgl_pipeline_at(pip_id); + if (pip->slot.id == pip_id) { + return pip; + } + } + return 0; +} + +static sgl_pipeline _sgl_alloc_pipeline(void) { + sgl_pipeline res; + int slot_index = _sgl_pool_alloc_index(&_sgl.pip_pool.pool); + if (_SGL_INVALID_SLOT_INDEX != slot_index) { + res.id =_sgl_slot_alloc(&_sgl.pip_pool.pool, &_sgl.pip_pool.pips[slot_index].slot, slot_index); + } + else { + /* pool is exhausted */ + res.id = SG_INVALID_ID; + } + return res; +} + +static void _sgl_init_pipeline(sgl_pipeline pip_id, const sg_pipeline_desc* in_desc) { + SOKOL_ASSERT((pip_id.id != SG_INVALID_ID) && in_desc); + + /* create a new desc with 'patched' shader and pixel format state */ + sg_pipeline_desc desc = *in_desc; + desc.layout.buffers[0].stride = sizeof(_sgl_vertex_t); + { + sg_vertex_attr_desc* pos = &desc.layout.attrs[0]; + pos->offset = offsetof(_sgl_vertex_t, pos); + pos->format = SG_VERTEXFORMAT_FLOAT3; + } + { + sg_vertex_attr_desc* uv = &desc.layout.attrs[1]; + uv->offset = offsetof(_sgl_vertex_t, uv); + uv->format = SG_VERTEXFORMAT_FLOAT2; + } + { + sg_vertex_attr_desc* rgba = &desc.layout.attrs[2]; + rgba->offset = offsetof(_sgl_vertex_t, rgba); + rgba->format = SG_VERTEXFORMAT_UBYTE4N; + } + if (in_desc->shader.id == SG_INVALID_ID) { + desc.shader = _sgl.shd; + } + desc.index_type = SG_INDEXTYPE_NONE; + desc.blend.color_format = _sgl.desc.color_format; + desc.blend.depth_format = _sgl.desc.depth_format; + desc.rasterizer.sample_count = _sgl.desc.sample_count; + if (desc.rasterizer.face_winding == _SG_FACEWINDING_DEFAULT) { + desc.rasterizer.face_winding = _sgl.desc.face_winding; + } + if (desc.blend.color_write_mask == _SG_COLORMASK_DEFAULT) { + desc.blend.color_write_mask = SG_COLORMASK_RGB; + } + + _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id); + SOKOL_ASSERT(pip && (pip->slot.state == SG_RESOURCESTATE_ALLOC)); + pip->slot.state = SG_RESOURCESTATE_VALID; + for (int i = 0; i < SGL_NUM_PRIMITIVE_TYPES; i++) { + switch (i) { + case SGL_PRIMITIVETYPE_POINTS: + desc.primitive_type = SG_PRIMITIVETYPE_POINTS; + break; + case SGL_PRIMITIVETYPE_LINES: + desc.primitive_type = SG_PRIMITIVETYPE_LINES; + break; + case SGL_PRIMITIVETYPE_LINE_STRIP: + desc.primitive_type = SG_PRIMITIVETYPE_LINE_STRIP; + break; + case SGL_PRIMITIVETYPE_TRIANGLES: + desc.primitive_type = SG_PRIMITIVETYPE_TRIANGLES; + break; + case SGL_PRIMITIVETYPE_TRIANGLE_STRIP: + case SGL_PRIMITIVETYPE_QUADS: + desc.primitive_type = SG_PRIMITIVETYPE_TRIANGLE_STRIP; + break; + } + if (SGL_PRIMITIVETYPE_QUADS == i) { + /* quads are emulated via triangles, use the same pipeline object */ + pip->pip[i] = pip->pip[SGL_PRIMITIVETYPE_TRIANGLES]; + } + else { + pip->pip[i] = sg_make_pipeline(&desc); + if (pip->pip[i].id == SG_INVALID_ID) { + SOKOL_LOG("sokol_gl.h: failed to create pipeline object"); + pip->slot.state = SG_RESOURCESTATE_FAILED; + } + } + } +} + +static sgl_pipeline _sgl_make_pipeline(const sg_pipeline_desc* desc) { + SOKOL_ASSERT(desc); + sgl_pipeline pip_id = _sgl_alloc_pipeline(); + if (pip_id.id != SG_INVALID_ID) { + _sgl_init_pipeline(pip_id, desc); + } + else { + SOKOL_LOG("sokol_gl.h: pipeline pool exhausted!"); + } + return pip_id; +} + +static void _sgl_destroy_pipeline(sgl_pipeline pip_id) { + _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id); + if (pip) { + for (int i = 0; i < SGL_NUM_PRIMITIVE_TYPES; i++) { + if (i != SGL_PRIMITIVETYPE_QUADS) { + sg_destroy_pipeline(pip->pip[i]); + } + } + _sgl_reset_pipeline(pip); + _sgl_pool_free_index(&_sgl.pip_pool.pool, _sgl_slot_index(pip_id.id)); + } +} + +static sg_pipeline _sgl_get_pipeline(sgl_pipeline pip_id, _sgl_primitive_type_t prim_type) { + _sgl_pipeline_t* pip = _sgl_lookup_pipeline(pip_id.id); + if (pip) { + return pip->pip[prim_type]; + } + else { + sg_pipeline dummy_pip; + dummy_pip.id = SG_INVALID_ID; + return dummy_pip; + } +} + +static inline void _sgl_begin(_sgl_primitive_type_t mode) { + _sgl.in_begin = true; + _sgl.base_vertex = _sgl.cur_vertex; + _sgl.vtx_count = 0; + _sgl.cur_prim_type = mode; +} + +static void _sgl_rewind(void) { + _sgl.base_vertex = 0; + _sgl.cur_vertex = 0; + _sgl.cur_uniform = 0; + _sgl.cur_command = 0; + _sgl.error = SGL_NO_ERROR; + _sgl.matrix_dirty = true; +} + +static inline _sgl_vertex_t* _sgl_next_vertex(void) { + if (_sgl.cur_vertex < _sgl.num_vertices) { + return &_sgl.vertices[_sgl.cur_vertex++]; + } + else { + _sgl.error = SGL_ERROR_VERTICES_FULL; + return 0; + } +} + +static inline _sgl_uniform_t* _sgl_next_uniform(void) { + if (_sgl.cur_uniform < _sgl.num_uniforms) { + return &_sgl.uniforms[_sgl.cur_uniform++]; + } + else { + _sgl.error = SGL_ERROR_UNIFORMS_FULL; + return 0; + } +} + +static inline _sgl_command_t* _sgl_prev_command(void) { + if (_sgl.cur_command > 0) { + return &_sgl.commands[_sgl.cur_command - 1]; + } + else { + return 0; + } +} + +static inline _sgl_command_t* _sgl_next_command(void) { + if (_sgl.cur_command < _sgl.num_commands) { + return &_sgl.commands[_sgl.cur_command++]; + } + else { + _sgl.error = SGL_ERROR_COMMANDS_FULL; + return 0; + } +} + +static inline uint32_t _sgl_pack_rgbab(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + return (uint32_t)(((uint32_t)a<<24)|((uint32_t)b<<16)|((uint32_t)g<<8)|r); +} + +static inline float _sgl_clamp(float v, float lo, float hi) { + if (v < lo) return lo; + else if (v > hi) return hi; + else return v; +} + +static inline uint32_t _sgl_pack_rgbaf(float r, float g, float b, float a) { + uint8_t r_u8 = (uint8_t) (_sgl_clamp(r, 0.0f, 1.0f) * 255.0f); + uint8_t g_u8 = (uint8_t) (_sgl_clamp(g, 0.0f, 1.0f) * 255.0f); + uint8_t b_u8 = (uint8_t) (_sgl_clamp(b, 0.0f, 1.0f) * 255.0f); + uint8_t a_u8 = (uint8_t) (_sgl_clamp(a, 0.0f, 1.0f) * 255.0f); + return _sgl_pack_rgbab(r_u8, g_u8, b_u8, a_u8); +} + +static inline void _sgl_vtx(float x, float y, float z, float u, float v, uint32_t rgba) { + SOKOL_ASSERT(_sgl.in_begin); + _sgl_vertex_t* vtx; + /* handle non-native primitive types */ + if ((_sgl.cur_prim_type == SGL_PRIMITIVETYPE_QUADS) && ((_sgl.vtx_count & 3) == 3)) { + /* for quads, before writing the last quad vertex, reuse + the first and third vertex to start the second triangle in the quad + */ + vtx = _sgl_next_vertex(); + if (vtx) { *vtx = *(vtx - 3); } + vtx = _sgl_next_vertex(); + if (vtx) { *vtx = *(vtx - 2); } + } + vtx = _sgl_next_vertex(); + if (vtx) { + vtx->pos[0] = x; vtx->pos[1] = y; vtx->pos[2] = z; + vtx->uv[0] = u; vtx->uv[1] = v; + vtx->rgba = rgba; + } + _sgl.vtx_count++; +} + +static void _sgl_identity(_sgl_matrix_t* m) { + for (int c = 0; c < 4; c++) { + for (int r = 0; r < 4; r++) { + m->v[c][r] = (r == c) ? 1.0f : 0.0f; + } + } +} + +static void _sgl_transpose(_sgl_matrix_t* dst, const _sgl_matrix_t* m) { + SOKOL_ASSERT(dst != m); + for (int c = 0; c < 4; c++) { + for (int r = 0; r < 4; r++) { + dst->v[r][c] = m->v[c][r]; + } + } +} + +/* _sgl_rotate, _sgl_frustum, _sgl_ortho from MESA m_matric.c */ +static void _sgl_matmul4(_sgl_matrix_t* p, const _sgl_matrix_t* a, const _sgl_matrix_t* b) { + for (int r = 0; r < 4; r++) { + float ai0=a->v[0][r], ai1=a->v[1][r], ai2=a->v[2][r], ai3=a->v[3][r]; + p->v[0][r] = ai0*b->v[0][0] + ai1*b->v[0][1] + ai2*b->v[0][2] + ai3*b->v[0][3]; + p->v[1][r] = ai0*b->v[1][0] + ai1*b->v[1][1] + ai2*b->v[1][2] + ai3*b->v[1][3]; + p->v[2][r] = ai0*b->v[2][0] + ai1*b->v[2][1] + ai2*b->v[2][2] + ai3*b->v[2][3]; + p->v[3][r] = ai0*b->v[3][0] + ai1*b->v[3][1] + ai2*b->v[3][2] + ai3*b->v[3][3]; + } +} + +static void _sgl_mul(_sgl_matrix_t* dst, const _sgl_matrix_t* m) { + _sgl_matmul4(dst, dst, m); +} + +static void _sgl_rotate(_sgl_matrix_t* dst, float a, float x, float y, float z) { + + float s = sinf(a); + float c = cosf(a); + + float mag = sqrtf(x*x + y*y + z*z); + if (mag < 1.0e-4F) { + return; + } + x /= mag; + y /= mag; + z /= mag; + float xx = x * x; + float yy = y * y; + float zz = z * z; + float xy = x * y; + float yz = y * z; + float zx = z * x; + float xs = x * s; + float ys = y * s; + float zs = z * s; + float one_c = 1.0f - c; + + _sgl_matrix_t m; + m.v[0][0] = (one_c * xx) + c; + m.v[1][0] = (one_c * xy) - zs; + m.v[2][0] = (one_c * zx) + ys; + m.v[3][0] = 0.0f; + m.v[0][1] = (one_c * xy) + zs; + m.v[1][1] = (one_c * yy) + c; + m.v[2][1] = (one_c * yz) - xs; + m.v[3][1] = 0.0f; + m.v[0][2] = (one_c * zx) - ys; + m.v[1][2] = (one_c * yz) + xs; + m.v[2][2] = (one_c * zz) + c; + m.v[3][2] = 0.0f; + m.v[0][3] = 0.0f; + m.v[1][3] = 0.0f; + m.v[2][3] = 0.0f; + m.v[3][3] = 1.0f; + _sgl_mul(dst, &m); +} + +static void _sgl_scale(_sgl_matrix_t* dst, float x, float y, float z) { + for (int r = 0; r < 4; r++) { + dst->v[0][r] *= x; + dst->v[1][r] *= y; + dst->v[2][r] *= z; + } +} + +static void _sgl_translate(_sgl_matrix_t* dst, float x, float y, float z) { + for (int r = 0; r < 4; r++) { + dst->v[3][r] = dst->v[0][r]*x + dst->v[1][r]*y + dst->v[2][r]*z + dst->v[3][r]; + } +} + +static void _sgl_frustum(_sgl_matrix_t* dst, float left, float right, float bottom, float top, float znear, float zfar) { + float x = (2.0f * znear) / (right - left); + float y = (2.0f * znear) / (top - bottom); + float a = (right + left) / (right - left); + float b = (top + bottom) / (top - bottom); + float c = -(zfar + znear) / (zfar - znear); + float d = -(2.0f * zfar * znear) / (zfar - znear); + _sgl_matrix_t m; + m.v[0][0] = x; m.v[0][1] = 0.0f; m.v[0][2] = 0.0f; m.v[0][3] = 0.0f; + m.v[1][0] = 0.0f; m.v[1][1] = y; m.v[1][2] = 0.0f; m.v[1][3] = 0.0f; + m.v[2][0] = a; m.v[2][1] = b; m.v[2][2] = c; m.v[2][3] = -1.0f; + m.v[3][0] = 0.0f; m.v[3][1] = 0.0f; m.v[3][2] = d; m.v[3][3] = 0.0f; + _sgl_mul(dst, &m); +} + +static void _sgl_ortho(_sgl_matrix_t* dst, float left, float right, float bottom, float top, float znear, float zfar) { + _sgl_matrix_t m; + m.v[0][0] = 2.0f / (right - left); + m.v[1][0] = 0.0f; + m.v[2][0] = 0.0f; + m.v[3][0] = -(right + left) / (right - left); + m.v[0][1] = 0.0f; + m.v[1][1] = 2.0f / (top - bottom); + m.v[2][1] = 0.0f; + m.v[3][1] = -(top + bottom) / (top - bottom); + m.v[0][2] = 0.0f; + m.v[1][2] = 0.0f; + m.v[2][2] = -2.0f / (zfar - znear); + m.v[3][2] = -(zfar + znear) / (zfar - znear); + m.v[0][3] = 0.0f; + m.v[1][3] = 0.0f; + m.v[2][3] = 0.0f; + m.v[3][3] = 1.0f; + + _sgl_mul(dst, &m); +} + +/* _sgl_perspective, _sgl_lookat from Regal project.c */ +static void _sgl_perspective(_sgl_matrix_t* dst, float fovy, float aspect, float znear, float zfar) { + float sine = sinf(fovy / 2.0f); + float delta_z = zfar - znear; + if ((delta_z == 0.0f) || (sine == 0.0f) || (aspect == 0.0f)) { + return; + } + float cotan = cosf(fovy / 2.0f) / sine; + _sgl_matrix_t m; + _sgl_identity(&m); + m.v[0][0] = cotan / aspect; + m.v[1][1] = cotan; + m.v[2][2] = -(zfar + znear) / delta_z; + m.v[2][3] = -1.0f; + m.v[3][2] = -2.0f * znear * zfar / delta_z; + m.v[3][3] = 0.0f; + _sgl_mul(dst, &m); +} + +static void _sgl_normalize(float v[3]) { + float r = sqrtf(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + if (r == 0.0f) { + return; + } + v[0] /= r; + v[1] /= r; + v[2] /= r; +} + +static void _sgl_cross(float v1[3], float v2[3], float res[3]) { + res[0] = v1[1]*v2[2] - v1[2]*v2[1]; + res[1] = v1[2]*v2[0] - v1[0]*v2[2]; + res[2] = v1[0]*v2[1] - v1[1]*v2[0]; +} + +static void _sgl_lookat(_sgl_matrix_t* dst, + float eye_x, float eye_y, float eye_z, + float center_x, float center_y, float center_z, + float up_x, float up_y, float up_z) +{ + float fwd[3], side[3], up[3]; + + fwd[0] = center_x - eye_x; fwd[1] = center_y - eye_y; fwd[2] = center_z - eye_z; + up[0] = up_x; up[1] = up_y; up[2] = up_z; + _sgl_normalize(fwd); + _sgl_cross(fwd, up, side); + _sgl_normalize(side); + _sgl_cross(side, fwd, up); + + _sgl_matrix_t m; + _sgl_identity(&m); + m.v[0][0] = side[0]; + m.v[1][0] = side[1]; + m.v[2][0] = side[2]; + m.v[0][1] = up[0]; + m.v[1][1] = up[1]; + m.v[2][1] = up[2]; + m.v[0][2] = -fwd[0]; + m.v[1][2] = -fwd[1]; + m.v[2][2] = -fwd[2]; + _sgl_mul(dst, &m); + _sgl_translate(dst, -eye_x, -eye_y, -eye_z); +} + +/* current top-of-stack projection matrix */ +static inline _sgl_matrix_t* _sgl_matrix_projection(void) { + return &_sgl.matrix_stack[SGL_MATRIXMODE_PROJECTION][_sgl.matrix_tos[SGL_MATRIXMODE_PROJECTION]]; +} + +/* get top-of-stack modelview matrix */ +static inline _sgl_matrix_t* _sgl_matrix_modelview(void) { + return &_sgl.matrix_stack[SGL_MATRIXMODE_MODELVIEW][_sgl.matrix_tos[SGL_MATRIXMODE_MODELVIEW]]; +} + +/* get top-of-stack texture matrix */ +static inline _sgl_matrix_t* _sgl_matrix_texture(void) { + return &_sgl.matrix_stack[SGL_MATRIXMODE_TEXTURE][_sgl.matrix_tos[SGL_MATRIXMODE_TEXTURE]]; +} + +/* get pointer to current top-of-stack of current matrix mode */ +static inline _sgl_matrix_t* _sgl_matrix(void) { + return &_sgl.matrix_stack[_sgl.cur_matrix_mode][_sgl.matrix_tos[_sgl.cur_matrix_mode]]; +} + +/*== PUBLIC FUNCTIONS ========================================================*/ +SOKOL_API_IMPL void sgl_setup(const sgl_desc_t* desc) { + SOKOL_ASSERT(desc); + memset(&_sgl, 0, sizeof(_sgl)); + _sgl.init_cookie = _SGL_INIT_COOKIE; + _sgl.desc = *desc; + _sgl.desc.pipeline_pool_size = _sgl_def(_sgl.desc.pipeline_pool_size, _SGL_DEFAULT_PIPELINE_POOL_SIZE); + _sgl.desc.max_vertices = _sgl_def(_sgl.desc.max_vertices, _SGL_DEFAULT_MAX_VERTICES); + _sgl.desc.max_commands = _sgl_def(_sgl.desc.max_commands, _SGL_DEFAULT_MAX_COMMANDS); + _sgl.desc.face_winding = _sgl_def(_sgl.desc.face_winding, SG_FACEWINDING_CCW); + + /* allocate buffers and pools */ + _sgl.num_vertices = _sgl.desc.max_vertices; + _sgl.num_uniforms = _sgl.desc.max_commands; + _sgl.num_commands = _sgl.num_uniforms; + _sgl.vertices = (_sgl_vertex_t*) SOKOL_MALLOC(_sgl.num_vertices * sizeof(_sgl_vertex_t)); + SOKOL_ASSERT(_sgl.vertices); + _sgl.uniforms = (_sgl_uniform_t*) SOKOL_MALLOC(_sgl.num_uniforms * sizeof(_sgl_uniform_t)); + SOKOL_ASSERT(_sgl.uniforms); + _sgl.commands = (_sgl_command_t*) SOKOL_MALLOC(_sgl.num_commands * sizeof(_sgl_command_t)); + SOKOL_ASSERT(_sgl.commands); + _sgl_setup_pipeline_pool(&_sgl.desc); + + /* create sokol-gfx resource objects */ + sg_push_debug_group("sokol-gl"); + + sg_buffer_desc vbuf_desc; + memset(&vbuf_desc, 0, sizeof(vbuf_desc)); + vbuf_desc.size = _sgl.num_vertices * sizeof(_sgl_vertex_t); + vbuf_desc.type = SG_BUFFERTYPE_VERTEXBUFFER; + vbuf_desc.usage = SG_USAGE_STREAM; + vbuf_desc.label = "sgl-vertex-buffer"; + _sgl.vbuf = sg_make_buffer(&vbuf_desc); + SOKOL_ASSERT(SG_INVALID_ID != _sgl.vbuf.id); + + uint32_t pixels[64]; + for (int i = 0; i < 64; i++) { + pixels[i] = 0xFFFFFFFF; + } + sg_image_desc img_desc; + memset(&img_desc, 0, sizeof(img_desc)); + img_desc.type = SG_IMAGETYPE_2D; + img_desc.width = 8; + img_desc.height = 8; + img_desc.num_mipmaps = 1; + img_desc.pixel_format = SG_PIXELFORMAT_RGBA8; + img_desc.min_filter = SG_FILTER_NEAREST; + img_desc.mag_filter = SG_FILTER_NEAREST; + img_desc.content.subimage[0][0].ptr = pixels; + img_desc.content.subimage[0][0].size = sizeof(pixels); + img_desc.label = "sgl-default-texture"; + _sgl.def_img = sg_make_image(&img_desc); + SOKOL_ASSERT(SG_INVALID_ID != _sgl.def_img.id); + _sgl.cur_img = _sgl.def_img; + + sg_shader_desc shd_desc; + memset(&shd_desc, 0, sizeof(shd_desc)); + shd_desc.attrs[0].name = "position"; + shd_desc.attrs[1].name = "texcoord0"; + shd_desc.attrs[2].name = "color0"; + shd_desc.attrs[0].sem_name = "POSITION"; + shd_desc.attrs[1].sem_name = "TEXCOORD"; + shd_desc.attrs[2].sem_name = "COLOR"; + sg_shader_uniform_block_desc* ub = &shd_desc.vs.uniform_blocks[0]; + ub->size = sizeof(_sgl_uniform_t); + ub->uniforms[0].name = "mvp"; + ub->uniforms[0].type = SG_UNIFORMTYPE_MAT4; + ub->uniforms[1].name = "tm"; + ub->uniforms[1].type = SG_UNIFORMTYPE_MAT4; + shd_desc.fs.images[0].name = "tex"; + shd_desc.fs.images[0].type = SG_IMAGETYPE_2D; + #if defined(SOKOL_D3D11) + shd_desc.vs.byte_code = _sgl_vs_bin; + shd_desc.vs.byte_code_size = sizeof(_sgl_vs_bin); + shd_desc.fs.byte_code = _sgl_fs_bin; + shd_desc.fs.byte_code_size = sizeof(_sgl_fs_bin); + #else + shd_desc.vs.source = _sgl_vs_src; + shd_desc.fs.source = _sgl_fs_src; + #endif + shd_desc.label = "sgl-shader"; + _sgl.shd = sg_make_shader(&shd_desc); + + /* create default pipeline object */ + sg_pipeline_desc def_pip_desc; + memset(&def_pip_desc, 0, sizeof(def_pip_desc)); + def_pip_desc.depth_stencil.depth_write_enabled = true; + _sgl.def_pip = _sgl_make_pipeline(&def_pip_desc); + sg_pop_debug_group(); + + /* default state */ + _sgl.rgba = 0xFFFFFFFF; + for (int i = 0; i < SGL_NUM_MATRIXMODES; i++) { + _sgl_identity(&_sgl.matrix_stack[i][0]); + } + _sgl.pip_stack[0] = _sgl.def_pip; + _sgl.matrix_dirty = true; +} + +SOKOL_API_IMPL void sgl_shutdown(void) { + SOKOL_ASSERT(_sgl.init_cookie == 0xABCDABCD); + SOKOL_FREE(_sgl.vertices); _sgl.vertices = 0; + SOKOL_FREE(_sgl.uniforms); _sgl.uniforms = 0; + SOKOL_FREE(_sgl.commands); _sgl.commands = 0; + sg_destroy_buffer(_sgl.vbuf); + sg_destroy_image(_sgl.def_img); + sg_destroy_shader(_sgl.shd); + _sgl_destroy_pipeline(_sgl.def_pip); + // FIXME: need to destroy ALL valid pipeline objects in pool here + _sgl_discard_pipeline_pool(); + _sgl.init_cookie = 0; +} + +SOKOL_API_IMPL sgl_error_t sgl_error(void) { + return _sgl.error; +} + +SOKOL_API_IMPL float sgl_rad(float deg) { + return (deg * (float)M_PI) / 180.0f; +} + +SOKOL_API_IMPL float sgl_deg(float rad) { + return (rad * 180.0f) / (float)M_PI; +} + +SOKOL_API_IMPL sgl_pipeline sgl_make_pipeline(const sg_pipeline_desc* desc) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + return _sgl_make_pipeline(desc); +} + +SOKOL_API_IMPL void sgl_destroy_pipeline(sgl_pipeline pip_id) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl_destroy_pipeline(pip_id); +} + +SOKOL_API_IMPL void sgl_load_pipeline(sgl_pipeline pip_id) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT((_sgl.pip_tos >= 0) && (_sgl.pip_tos < _SGL_MAX_STACK_DEPTH)); + _sgl.pip_stack[_sgl.pip_tos] = pip_id; +} + +SOKOL_API_IMPL void sgl_default_pipeline(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT((_sgl.pip_tos >= 0) && (_sgl.pip_tos < _SGL_MAX_STACK_DEPTH)); + _sgl.pip_stack[_sgl.pip_tos] = _sgl.def_pip; +} + +SOKOL_API_IMPL void sgl_push_pipeline(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + if (_sgl.pip_tos < (_SGL_MAX_STACK_DEPTH - 1)) { + _sgl.pip_tos++; + _sgl.pip_stack[_sgl.pip_tos] = _sgl.pip_stack[_sgl.pip_tos-1]; + } + else { + _sgl.error = SGL_ERROR_STACK_OVERFLOW; + } +} + +SOKOL_API_IMPL void sgl_pop_pipeline(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + if (_sgl.pip_tos > 0) { + _sgl.pip_tos--; + } + else { + _sgl.error = SGL_ERROR_STACK_UNDERFLOW; + } +} + +SOKOL_API_IMPL void sgl_defaults(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl.u = 0.0f; _sgl.v = 0.0f; + _sgl.rgba = 0xFFFFFFFF; + _sgl.texturing_enabled = false; + _sgl.cur_img = _sgl.def_img; + sgl_default_pipeline(); + _sgl_identity(_sgl_matrix_texture()); + _sgl_identity(_sgl_matrix_modelview()); + _sgl_identity(_sgl_matrix_projection()); + _sgl.cur_matrix_mode = SGL_MATRIXMODE_MODELVIEW; + _sgl.matrix_dirty = true; +} + +SOKOL_API_IMPL void sgl_viewport(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_command_t* cmd = _sgl_next_command(); + if (cmd) { + cmd->cmd = SGL_COMMAND_VIEWPORT; + cmd->args.viewport.x = x; + cmd->args.viewport.y = y; + cmd->args.viewport.w = w; + cmd->args.viewport.h = h; + cmd->args.viewport.origin_top_left = origin_top_left; + } +} + +SOKOL_API_IMPL void sgl_scissor_rect(int x, int y, int w, int h, bool origin_top_left) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_command_t* cmd = _sgl_next_command(); + if (cmd) { + cmd->cmd = SGL_COMMAND_SCISSOR_RECT; + cmd->args.scissor_rect.x = x; + cmd->args.scissor_rect.y = y; + cmd->args.scissor_rect.w = w; + cmd->args.scissor_rect.h = h; + cmd->args.scissor_rect.origin_top_left = origin_top_left; + } +} + +SOKOL_API_IMPL void sgl_enable_texture(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl.texturing_enabled = true; +} + +SOKOL_API_IMPL void sgl_disable_texture(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl.texturing_enabled = false; +} + +SOKOL_API_IMPL void sgl_texture(sg_image img) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + if (SG_INVALID_ID != img.id) { + _sgl.cur_img = img; + } + else { + _sgl.cur_img = _sgl.def_img; + } +} + +SOKOL_API_IMPL void sgl_begin_points(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_begin(SGL_PRIMITIVETYPE_POINTS); +} + +SOKOL_API_IMPL void sgl_begin_lines(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_begin(SGL_PRIMITIVETYPE_LINES); +} + +SOKOL_API_IMPL void sgl_begin_line_strip(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_begin(SGL_PRIMITIVETYPE_LINE_STRIP); +} + +SOKOL_API_IMPL void sgl_begin_triangles(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_begin(SGL_PRIMITIVETYPE_TRIANGLES); +} + +SOKOL_API_IMPL void sgl_begin_triangle_strip(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_begin(SGL_PRIMITIVETYPE_TRIANGLE_STRIP); +} + +SOKOL_API_IMPL void sgl_begin_quads(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(!_sgl.in_begin); + _sgl_begin(SGL_PRIMITIVETYPE_QUADS); +} + +SOKOL_API_IMPL void sgl_end(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT(_sgl.in_begin); + _sgl.in_begin = false; + if (_sgl.base_vertex == _sgl.cur_vertex) { + return; + } + bool matrix_dirty = _sgl.matrix_dirty; + if (matrix_dirty) { + _sgl.matrix_dirty = false; + _sgl_uniform_t* uni = _sgl_next_uniform(); + if (uni) { + _sgl_matmul4(&uni->mvp, _sgl_matrix_projection(), _sgl_matrix_modelview()); + uni->tm = *_sgl_matrix_texture(); + } + } + /* check if command can be merged with previous command */ + sg_pipeline pip = _sgl_get_pipeline(_sgl.pip_stack[_sgl.pip_tos], _sgl.cur_prim_type); + sg_image img = _sgl.texturing_enabled ? _sgl.cur_img : _sgl.def_img; + _sgl_command_t* prev_cmd = _sgl_prev_command(); + bool merge_cmd = false; + if (prev_cmd) { + if ((prev_cmd->cmd == SGL_COMMAND_DRAW) && + (_sgl.cur_prim_type != SGL_PRIMITIVETYPE_LINE_STRIP) && + (_sgl.cur_prim_type != SGL_PRIMITIVETYPE_TRIANGLE_STRIP) && + !matrix_dirty && + (prev_cmd->args.draw.img.id == img.id) && + (prev_cmd->args.draw.pip.id == pip.id)) + { + merge_cmd = true; + } + } + if (merge_cmd) { + /* draw command can be merged with the previous command */ + prev_cmd->args.draw.num_vertices += _sgl.cur_vertex - _sgl.base_vertex; + } + else { + /* append a new draw command */ + _sgl_command_t* cmd = _sgl_next_command(); + if (cmd) { + SOKOL_ASSERT(_sgl.cur_uniform > 0); + cmd->cmd = SGL_COMMAND_DRAW; + cmd->args.draw.img = img; + cmd->args.draw.pip = _sgl_get_pipeline(_sgl.pip_stack[_sgl.pip_tos], _sgl.cur_prim_type); + cmd->args.draw.base_vertex = _sgl.base_vertex; + cmd->args.draw.num_vertices = _sgl.cur_vertex - _sgl.base_vertex; + cmd->args.draw.uniform_index = _sgl.cur_uniform - 1; + } + } +} + +SOKOL_API_IMPL void sgl_t2f(float u, float v) { + _sgl.u = u; _sgl.v = v; +} + +SOKOL_API_IMPL void sgl_c3f(float r, float g, float b) { + _sgl.rgba = _sgl_pack_rgbaf(r, g, b, 1.0f); +} + +SOKOL_API_IMPL void sgl_c4f(float r, float g, float b, float a) { + _sgl.rgba = _sgl_pack_rgbaf(r, g, b, a); +} + +SOKOL_API_IMPL void sgl_c3b(uint8_t r, uint8_t g, uint8_t b) { + _sgl.rgba = _sgl_pack_rgbab(r, g, b, 255); +} + +SOKOL_API_IMPL void sgl_c4b(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + _sgl.rgba = _sgl_pack_rgbab(r, g, b, a); +} + +SOKOL_API_IMPL void sgl_c1i(uint32_t rgba) { + _sgl.rgba = rgba; +} + +SOKOL_API_IMPL void sgl_v2f(float x, float y) { + _sgl_vtx(x, y, 0.0f, _sgl.u, _sgl.v, _sgl.rgba); +} + +SOKOL_API_IMPL void sgl_v3f(float x, float y, float z) { + _sgl_vtx(x, y, z, _sgl.u, _sgl.v, _sgl.rgba); +} + +SOKOL_API_IMPL void sgl_v2f_t2f(float x, float y, float u, float v) { + _sgl_vtx(x, y, 0.0f, u, v, _sgl.rgba); +} + +SOKOL_API_IMPL void sgl_v3f_t2f(float x, float y, float z, float u, float v) { + _sgl_vtx(x, y, z, u, v, _sgl.rgba); +} + +SOKOL_API_IMPL void sgl_v2f_c3f(float x, float y, float r, float g, float b) { + _sgl_vtx(x, y, 0.0f, _sgl.u, _sgl.v, _sgl_pack_rgbaf(r, g, b, 1.0f)); +} + +SOKOL_API_IMPL void sgl_v2f_c3b(float x, float y, uint8_t r, uint8_t g, uint8_t b) { + _sgl_vtx(x, y, 0.0f, _sgl.u, _sgl.v, _sgl_pack_rgbab(r, g, b, 255)); +} + +SOKOL_API_IMPL void sgl_v2f_c4f(float x, float y, float r, float g, float b, float a) { + _sgl_vtx(x, y, 0.0f, _sgl.u, _sgl.v, _sgl_pack_rgbaf(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v2f_c4b(float x, float y, uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + _sgl_vtx(x, y, 0.0f, _sgl.u, _sgl.v, _sgl_pack_rgbab(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v2f_c1i(float x, float y, uint32_t rgba) { + _sgl_vtx(x, y, 0.0f, _sgl.u, _sgl.v, rgba); +} + +SOKOL_API_IMPL void sgl_v3f_c3f(float x, float y, float z, float r, float g, float b) { + _sgl_vtx(x, y, z, _sgl.u, _sgl.v, _sgl_pack_rgbaf(r, g, b, 1.0f)); +} + +SOKOL_API_IMPL void sgl_v3f_c3b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b) { + _sgl_vtx(x, y, z, _sgl.u, _sgl.v, _sgl_pack_rgbab(r, g, b, 255)); +} + +SOKOL_API_IMPL void sgl_v3f_c4f(float x, float y, float z, float r, float g, float b, float a) { + _sgl_vtx(x, y, z, _sgl.u, _sgl.v, _sgl_pack_rgbaf(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v3f_c4b(float x, float y, float z, uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + _sgl_vtx(x, y, z, _sgl.u, _sgl.v, _sgl_pack_rgbab(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v3f_c1i(float x, float y, float z, uint32_t rgba) { + _sgl_vtx(x, y, z, _sgl.u, _sgl.v, rgba); +} + +SOKOL_API_IMPL void sgl_v2f_t2f_c3f(float x, float y, float u, float v, float r, float g, float b) { + _sgl_vtx(x, y, 0.0f, u, v, _sgl_pack_rgbaf(r, g, b, 1.0f)); +} + +SOKOL_API_IMPL void sgl_v2f_t2f_c3b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b) { + _sgl_vtx(x, y, 0.0f, u, v, _sgl_pack_rgbab(r, g, b, 255)); +} + +SOKOL_API_IMPL void sgl_v2f_t2f_c4f(float x, float y, float u, float v, float r, float g, float b, float a) { + _sgl_vtx(x, y, 0.0f, u, v, _sgl_pack_rgbaf(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v2f_t2f_c4b(float x, float y, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + _sgl_vtx(x, y, 0.0f, u, v, _sgl_pack_rgbab(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v2f_t2f_c1i(float x, float y, float u, float v, uint32_t rgba) { + _sgl_vtx(x, y, 0.0f, u, v, rgba); +} + +SOKOL_API_IMPL void sgl_v3f_t2f_c3f(float x, float y, float z, float u, float v, float r, float g, float b) { + _sgl_vtx(x, y, z, u, v, _sgl_pack_rgbaf(r, g, b, 1.0f)); +} + +SOKOL_API_IMPL void sgl_v3f_t2f_c3b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b) { + _sgl_vtx(x, y, z, u, v, _sgl_pack_rgbab(r, g, b, 255)); +} + +SOKOL_API_IMPL void sgl_v3f_t2f_c4f(float x, float y, float z, float u, float v, float r, float g, float b, float a) { + _sgl_vtx(x, y, z, u, v, _sgl_pack_rgbaf(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v3f_t2f_c4b(float x, float y, float z, float u, float v, uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + _sgl_vtx(x, y, z, u, v, _sgl_pack_rgbab(r, g, b, a)); +} + +SOKOL_API_IMPL void sgl_v3f_t2f_c1i(float x, float y, float z, float u, float v, uint32_t rgba) { + _sgl_vtx(x, y, z, u, v, rgba); +} + +SOKOL_API_IMPL void sgl_matrix_mode_modelview(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.cur_matrix_mode = SGL_MATRIXMODE_MODELVIEW; +} + +SOKOL_API_IMPL void sgl_matrix_mode_projection(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.cur_matrix_mode = SGL_MATRIXMODE_PROJECTION; +} + +SOKOL_API_IMPL void sgl_matrix_mode_texture(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.cur_matrix_mode = SGL_MATRIXMODE_TEXTURE; +} + +SOKOL_API_IMPL void sgl_load_identity(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_identity(_sgl_matrix()); +} + +SOKOL_API_IMPL void sgl_load_matrix(const float m[16]) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + memcpy(&_sgl_matrix()->v[0][0], &m[0], 64); +} + +SOKOL_API_IMPL void sgl_load_transpose_matrix(const float m[16]) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_transpose(_sgl_matrix(), (const _sgl_matrix_t*) &m[0]); +} + +SOKOL_API_IMPL void sgl_mult_matrix(const float m[16]) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + const _sgl_matrix_t* m0 = (const _sgl_matrix_t*) &m[0]; + _sgl_mul(_sgl_matrix(), m0); +} + +SOKOL_API_IMPL void sgl_mult_transpose_matrix(const float m[16]) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_matrix_t m0; + _sgl_transpose(&m0, (const _sgl_matrix_t*) &m[0]); + _sgl_mul(_sgl_matrix(), &m0); +} + +SOKOL_API_IMPL void sgl_rotate(float angle_rad, float x, float y, float z) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_rotate(_sgl_matrix(), angle_rad, x, y, z); +} + +SOKOL_API_IMPL void sgl_scale(float x, float y, float z) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_scale(_sgl_matrix(), x, y, z); +} + +SOKOL_API_IMPL void sgl_translate(float x, float y, float z) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_translate(_sgl_matrix(), x, y, z); +} + +SOKOL_API_IMPL void sgl_frustum(float l, float r, float b, float t, float n, float f) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_frustum(_sgl_matrix(), l, r, b, t, n, f); +} + +SOKOL_API_IMPL void sgl_ortho(float l, float r, float b, float t, float n, float f) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_ortho(_sgl_matrix(), l, r, b, t, n, f); +} + +SOKOL_API_IMPL void sgl_perspective(float fov_y, float aspect, float z_near, float z_far) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_perspective(_sgl_matrix(), fov_y, aspect, z_near, z_far); +} + +SOKOL_API_IMPL void sgl_lookat(float eye_x, float eye_y, float eye_z, float center_x, float center_y, float center_z, float up_x, float up_y, float up_z) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + _sgl.matrix_dirty = true; + _sgl_lookat(_sgl_matrix(), eye_x, eye_y, eye_z, center_x, center_y, center_z, up_x, up_y, up_z); +} + +SOKOL_API_DECL void sgl_push_matrix(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT((_sgl.cur_matrix_mode >= 0) && (_sgl.cur_matrix_mode < SGL_NUM_MATRIXMODES)); + _sgl.matrix_dirty = true; + if (_sgl.matrix_tos[_sgl.cur_matrix_mode] < (_SGL_MAX_STACK_DEPTH - 1)) { + const _sgl_matrix_t* src = _sgl_matrix(); + _sgl.matrix_tos[_sgl.cur_matrix_mode]++; + _sgl_matrix_t* dst = _sgl_matrix(); + *dst = *src; + } + else { + _sgl.error = SGL_ERROR_STACK_OVERFLOW; + } +} + +SOKOL_API_DECL void sgl_pop_matrix(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + SOKOL_ASSERT((_sgl.cur_matrix_mode >= 0) && (_sgl.cur_matrix_mode < SGL_NUM_MATRIXMODES)); + _sgl.matrix_dirty = true; + if (_sgl.matrix_tos[_sgl.cur_matrix_mode] > 0) { + _sgl.matrix_tos[_sgl.cur_matrix_mode]--; + } + else { + _sgl.error = SGL_ERROR_STACK_UNDERFLOW; + } +} + +/* this renders the accumulated draw commands via sokol-gfx */ +SOKOL_API_IMPL void sgl_draw(void) { + SOKOL_ASSERT(_SGL_INIT_COOKIE == _sgl.init_cookie); + if ((_sgl.error == SGL_NO_ERROR) && (_sgl.cur_vertex > 0) && (_sgl.cur_command > 0)) { + uint32_t cur_pip_id = SG_INVALID_ID; + uint32_t cur_img_id = SG_INVALID_ID; + int cur_uniform_index = -1; + sg_push_debug_group("sokol-gl"); + sg_update_buffer(_sgl.vbuf, _sgl.vertices, _sgl.cur_vertex * sizeof(_sgl_vertex_t)); + _sgl.bind.vertex_buffers[0] = _sgl.vbuf; + for (int i = 0; i < _sgl.cur_command; i++) { + const _sgl_command_t* cmd = &_sgl.commands[i]; + switch (cmd->cmd) { + case SGL_COMMAND_VIEWPORT: + { + const _sgl_viewport_args_t* args = &cmd->args.viewport; + sg_apply_viewport(args->x, args->y, args->w, args->h, args->origin_top_left); + } + break; + case SGL_COMMAND_SCISSOR_RECT: + { + const _sgl_scissor_rect_args_t* args = &cmd->args.scissor_rect; + sg_apply_scissor_rect(args->x, args->y, args->w, args->h, args->origin_top_left); + } + break; + case SGL_COMMAND_DRAW: + { + const _sgl_draw_args_t* args = &cmd->args.draw; + if (args->pip.id != cur_pip_id) { + sg_apply_pipeline(args->pip); + cur_pip_id = args->pip.id; + /* when pipeline changes, also need to re-apply uniforms and bindings */ + cur_img_id = SG_INVALID_ID; + cur_uniform_index = -1; + } + if (cur_img_id != args->img.id) { + _sgl.bind.fs_images[0] = args->img; + sg_apply_bindings(&_sgl.bind); + cur_img_id = args->img.id; + } + if (cur_uniform_index != args->uniform_index) { + sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, &_sgl.uniforms[args->uniform_index], sizeof(_sgl_uniform_t)); + cur_uniform_index = args->uniform_index; + } + /* FIXME: what if number of vertices doesn't match the primitive type? */ + sg_draw(args->base_vertex, args->num_vertices, 1); + } + break; + } + } + sg_pop_debug_group(); + } + _sgl_rewind(); +} +#endif /* SOKOL_GL_IMPL */ diff --git a/sokol-app-sys/external/sokol/util/sokol_imgui.h b/sokol-app-sys/external/sokol/util/sokol_imgui.h new file mode 100644 index 00000000..f17be692 --- /dev/null +++ b/sokol-app-sys/external/sokol/util/sokol_imgui.h @@ -0,0 +1,1091 @@ +#ifndef SOKOL_IMGUI_INCLUDED +/* + sokol_imgui.h -- drop-in Dear ImGui renderer/event-handler for sokol_gfx.h + + Project URL: https://github.com/floooh/sokol + + Do this: + + #define SOKOL_IMGUI_IMPL + + before you include this file in *one* C or C++ file to create the + implementation. + + NOTE that the implementation can be compiled either as C++ or as C. + When compiled as C++, sokol_imgui.h will directly call into the + Dear ImGui C++ API. When compiled as C, sokol_imgui.h will call + cimgui.h functions instead. + + NOTE that the formerly separate header sokol_cimgui.h has been + merged into sokol_imgui.h + + The following defines are used by the implementation to select the + platform-specific embedded shader code (these are the same defines as + used by sokol_gfx.h and sokol_app.h): + + SOKOL_GLCORE33 + SOKOL_GLES2 + SOKOL_GLES3 + SOKOL_D3D11 + SOKOL_METAL + + Optionally provide the following configuration defines before including the + implementation: + + SOKOL_IMGUI_NO_SOKOL_APP - don't depend on sokol_app.h (see below for details) + + Optionally provide the following macros before including the implementation + to override defaults: + + SOKOL_ASSERT(c) - your own assert macro (default: assert(c)) + SOKOL_API_DECL - public function declaration prefix (default: extern) + SOKOL_API_IMPL - public function implementation prefix (default: -) + + If sokol_imgui.h is compiled as a DLL, define the following before + including the declaration or implementation: + + SOKOL_DLL + + On Windows, SOKOL_DLL will define SOKOL_API_DECL as __declspec(dllexport) + or __declspec(dllimport) as needed. + + Include the following headers before sokol_imgui.h (both before including + the declaration and implementation): + + sokol_gfx.h + sokol_app.h (except SOKOL_IMGUI_NO_SOKOL_APP) + + Additionally, include the following headers before including the + implementation: + + If the implementation is compiled as C++: + imgui.h + + If the implementation is compiled as C: + cimgui.h + + + FEATURE OVERVIEW: + ================= + sokol_imgui.h implements the initialization, rendering and event-handling + code for Dear ImGui (https://github.com/ocornut/imgui) on top of + sokol_gfx.h and (optionally) sokol_app.h. + + The sokol_app.h dependency is optional and used for input event handling. + If you only use sokol_gfx.h but not sokol_app.h in your application, + define SOKOL_IMGUI_NO_SOKOL_APP before including the implementation + of sokol_imgui.h, this will remove any dependency to sokol_app.h, but + you must feed input events into Dear ImGui yourself. + + sokol_imgui.h is not thread-safe, all calls must be made from the + same thread where sokol_gfx.h is running. + + HOWTO: + ====== + + --- To initialize sokol-imgui, call: + + simgui_setup(const simgui_desc_t* desc) + + This will initialize Dear ImGui and create sokol-gfx resources + (two buffers for vertices and indices, a font texture and a pipeline- + state-object). + + Use the following simgui_desc_t members to configure behaviour: + + int max_vertices + The maximum number of vertices used for UI rendering, default is 65536. + sokol-imgui will use this to compute the size of the vertex- + and index-buffers allocated via sokol_gfx.h + + sg_pixel_format color_format + The color pixel format of the render pass where the UI + will be rendered. The default is SG_PIXELFORMAT_RGBA8 + + sg_pixel_format depth_format + The depth-buffer pixel format of the render pass where + the UI will be rendered. The default is SG_PIXELFORMAT_DEPTHSTENCIL. + + int sample_count + The MSAA sample-count of the render pass where the UI + will be rendered. The default is 1. + + float dpi_scale + DPI scaling factor. Set this to the result of sapp_dpi_scale(). + To render in high resolution on a Retina Mac this would + typically be 2.0. The default value is 1.0 + + const char* ini_filename + Use this path as ImGui::GetIO().IniFilename. By default + this is 0, so that Dear ImGui will not do any + filesystem calls. + + bool no_default_font + Set this to true if you don't want to use ImGui's default + font. In this case you need to initialize the font + yourself after simgui_setup() is called. + + --- At the start of a frame, call: + + simgui_new_frame(int width, int height, double delta_time) + + 'width' and 'height' are the dimensions of the rendering surface, + passed to ImGui::GetIO().DisplaySize. + + 'delta_time' is the frame duration passed to ImGui::GetIO().DeltaTime. + + For example, if you're using sokol_app.h and render to the + default framebuffer: + + simgui_new_frame(sapp_width(), sapp_height(), delta_time); + + --- at the end of the frame, before the sg_end_pass() where you + want to render the UI, call: + + simgui_render() + + This will first call ImGui::Render(), and then render ImGui's draw list + through sokol_gfx.h + + --- if you're using sokol_app.h, from inside the sokol_app.h event callback, + call: + + bool simgui_handle_event(const sapp_event* ev); + + The return value is the value of ImGui::GetIO().WantCaptureKeyboard, + if this is true, you might want to skip keyboard input handling + in your own event handler. + + --- finally, on application shutdown, call + + simgui_shutdown() + + LICENSE + ======= + + zlib/libpng license + + Copyright (c) 2018 Andre Weissflog + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*/ +#define SOKOL_IMGUI_INCLUDED (1) +#include +#include + +#if !defined(SOKOL_GFX_INCLUDED) +#error "Please include sokol_gfx.h before sokol_imgui.h" +#endif +#if !defined(SOKOL_IMGUI_NO_SOKOL_APP) && !defined(SOKOL_APP_INCLUDED) +#error "Please include sokol_app.h before sokol_imgui.h" +#endif + +#ifndef SOKOL_API_DECL +#if defined(_WIN32) && defined(SOKOL_DLL) && defined(SOKOL_IMPL) +#define SOKOL_API_DECL __declspec(dllexport) +#elif defined(_WIN32) && defined(SOKOL_DLL) +#define SOKOL_API_DECL __declspec(dllimport) +#else +#define SOKOL_API_DECL extern +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct simgui_desc_t { + int max_vertices; + sg_pixel_format color_format; + sg_pixel_format depth_format; + int sample_count; + float dpi_scale; + const char* ini_filename; + bool no_default_font; +} simgui_desc_t; + +SOKOL_API_DECL void simgui_setup(const simgui_desc_t* desc); +SOKOL_API_DECL void simgui_new_frame(int width, int height, double delta_time); +SOKOL_API_DECL void simgui_render(void); +#if !defined(SOKOL_IMGUI_NO_SOKOL_APP) +SOKOL_API_DECL bool simgui_handle_event(const sapp_event* ev); +#endif +SOKOL_API_DECL void simgui_shutdown(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif /* SOKOL_IMGUI_INCLUDED */ + +/*-- IMPLEMENTATION ----------------------------------------------------------*/ +#ifdef SOKOL_IMGUI_IMPL +#define SOKOL_IMGUI_IMPL_INCLUDED (1) + +#if defined(__cplusplus) + #if !defined(IMGUI_VERSION) + #error "Please include imgui.h before the sokol_imgui.h implementation" + #endif +#else + #if !defined(CIMGUI_INCLUDED) + #error "Please include cimgui.h before the sokol_imgui.h implementation" + #endif +#endif + +#include /* offsetof */ +#include /* memset */ + +#ifndef SOKOL_API_IMPL +#define SOKOL_API_IMPL +#endif +#ifndef SOKOL_DEBUG + #ifndef NDEBUG + #define SOKOL_DEBUG (1) + #endif +#endif +#ifndef SOKOL_ASSERT + #include + #define SOKOL_ASSERT(c) assert(c) +#endif +#ifndef _SOKOL_PRIVATE + #if defined(__GNUC__) + #define _SOKOL_PRIVATE __attribute__((unused)) static + #else + #define _SOKOL_PRIVATE static + #endif +#endif + +/* helper macros */ +#define _simgui_def(val, def) (((val) == 0) ? (def) : (val)) + +typedef struct { + ImVec2 disp_size; +} _simgui_vs_params_t; + +typedef struct { + simgui_desc_t desc; + sg_buffer vbuf; + sg_buffer ibuf; + sg_image img; + sg_shader shd; + sg_pipeline pip; + #if !defined(SOKOL_IMGUI_NO_SOKOL_APP) + bool btn_down[SAPP_MAX_MOUSEBUTTONS]; + bool btn_up[SAPP_MAX_MOUSEBUTTONS]; + #endif +} _simgui_state_t; +static _simgui_state_t _simgui; + +/* embedded shader sources */ +#if defined(SOKOL_GLCORE33) +static const char* _simgui_vs_src = + "#version 330\n" + "uniform vec2 disp_size;\n" + "in vec2 position;\n" + "in vec2 texcoord0;\n" + "in vec4 color0;\n" + "out vec2 uv;\n" + "out vec4 color;\n" + "void main() {\n" + " gl_Position = vec4(((position/disp_size)-0.5)*vec2(2.0,-2.0), 0.5, 1.0);\n" + " uv = texcoord0;\n" + " color = color0;\n" + "}\n"; +static const char* _simgui_fs_src = + "#version 330\n" + "uniform sampler2D tex;\n" + "in vec2 uv;\n" + "in vec4 color;\n" + "out vec4 frag_color;\n" + "void main() {\n" + " frag_color = texture(tex, uv) * color;\n" + "}\n"; +#elif defined(SOKOL_GLES2) || defined(SOKOL_GLES3) +static const char* _simgui_vs_src = + "uniform vec2 disp_size;\n" + "attribute vec2 position;\n" + "attribute vec2 texcoord0;\n" + "attribute vec4 color0;\n" + "varying vec2 uv;\n" + "varying vec4 color;\n" + "void main() {\n" + " gl_Position = vec4(((position/disp_size)-0.5)*vec2(2.0,-2.0), 0.5, 1.0);\n" + " uv = texcoord0;\n" + " color = color0;\n" + "}\n"; +static const char* _simgui_fs_src = + "precision mediump float;\n" + "uniform sampler2D tex;\n" + "varying vec2 uv;\n" + "varying vec4 color;\n" + "void main() {\n" + " gl_FragColor = texture2D(tex, uv) * color;\n" + "}\n"; +#elif defined(SOKOL_METAL) +static const char* _simgui_vs_src = + "#include \n" + "using namespace metal;\n" + "struct params_t {\n" + " float2 disp_size;\n" + "};\n" + "struct vs_in {\n" + " float2 pos [[attribute(0)]];\n" + " float2 uv [[attribute(1)]];\n" + " float4 color [[attribute(2)]];\n" + "};\n" + "struct vs_out {\n" + " float4 pos [[position]];\n" + " float2 uv;\n" + " float4 color;\n" + "};\n" + "vertex vs_out _main(vs_in in [[stage_in]], constant params_t& params [[buffer(0)]]) {\n" + " vs_out out;\n" + " out.pos = float4(((in.pos / params.disp_size)-0.5)*float2(2.0,-2.0), 0.5, 1.0);\n" + " out.uv = in.uv;\n" + " out.color = in.color;\n" + " return out;\n" + "}\n"; +static const char* _simgui_fs_src = + "#include \n" + "using namespace metal;\n" + "struct fs_in {\n" + " float2 uv;\n" + " float4 color;\n" + "};\n" + "fragment float4 _main(fs_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) {\n" + " return tex.sample(smp, in.uv) * in.color;\n" + "}\n"; +#elif defined(SOKOL_D3D11) +/* + Shader blobs for D3D11, compiled with: + + fxc.exe /T vs_5_0 /Fh vs.h /Gec /O3 vs.hlsl + fxc.exe /T ps_5_0 /Fh fs.h /Gec /O3 fs.hlsl + + Vertex shader source: + + cbuffer params { + float2 disp_size; + }; + struct vs_in { + float2 pos: POSITION; + float2 uv: TEXCOORD0; + float4 color: COLOR0; + }; + struct vs_out { + float2 uv: TEXCOORD0; + float4 color: COLOR0; + float4 pos: SV_Position; + }; + vs_out main(vs_in inp) { + vs_out outp; + outp.pos = float4(((inp.pos/disp_size)-0.5)*float2(2.0,-2.0), 0.5, 1.0); + outp.uv = inp.uv; + outp.color = inp.color; + return outp; + } + + Fragment shader source: + + Texture2D tex: register(t0); + sampler smp: register(s0); + float4 main(float2 uv: TEXCOORD0, float4 color: COLOR0): SV_Target0 { + return tex.Sample(smp, uv) * color; + } +*/ +static const uint8_t _simgui_vs_bin[] = { + 68, 88, 66, 67, 204, 137, + 115, 177, 245, 67, 161, 195, + 58, 224, 90, 35, 76, 123, + 88, 146, 1, 0, 0, 0, + 244, 3, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 64, 1, 0, 0, 176, 1, + 0, 0, 36, 2, 0, 0, + 88, 3, 0, 0, 82, 68, + 69, 70, 4, 1, 0, 0, + 1, 0, 0, 0, 100, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 145, 0, 0, + 220, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 112, 97, 114, 97, + 109, 115, 0, 171, 92, 0, + 0, 0, 1, 0, 0, 0, + 124, 0, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 164, 0, + 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 2, 0, + 0, 0, 184, 0, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 100, 105, 115, 112, + 95, 115, 105, 122, 101, 0, + 102, 108, 111, 97, 116, 50, + 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 174, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 49, 48, 46, + 49, 0, 73, 83, 71, 78, + 104, 0, 0, 0, 3, 0, + 0, 0, 8, 0, 0, 0, + 80, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 3, 0, 0, + 89, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 3, 3, 0, 0, + 98, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 84, 69, 88, + 67, 79, 79, 82, 68, 0, + 67, 79, 76, 79, 82, 0, + 79, 83, 71, 78, 108, 0, + 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 12, 0, 0, 89, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 15, 0, 0, 0, 95, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 15, 0, 0, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 67, 79, 76, 79, 82, + 0, 83, 86, 95, 80, 111, + 115, 105, 116, 105, 111, 110, + 0, 171, 83, 72, 69, 88, + 44, 1, 0, 0, 80, 0, + 1, 0, 75, 0, 0, 0, + 106, 8, 0, 1, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 95, 0, 0, 3, + 50, 16, 16, 0, 0, 0, + 0, 0, 95, 0, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 95, 0, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + 50, 32, 16, 0, 0, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 1, 0, + 0, 0, 103, 0, 0, 4, + 242, 32, 16, 0, 2, 0, + 0, 0, 1, 0, 0, 0, + 104, 0, 0, 2, 1, 0, + 0, 0, 54, 0, 0, 5, + 50, 32, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 1, 0, 0, 0, 70, 30, + 16, 0, 2, 0, 0, 0, + 14, 0, 0, 8, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 0, 0, + 0, 0, 70, 128, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 10, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 191, + 0, 0, 0, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 56, 0, 0, 10, 50, 32, + 16, 0, 2, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 192, 0, 0, 0, 0, + 0, 0, 0, 0, 54, 0, + 0, 8, 194, 32, 16, 0, + 2, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 63, 0, 0, 128, 63, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 7, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; +static const uint8_t _simgui_fs_bin[] = { + 68, 88, 66, 67, 116, 27, + 191, 2, 170, 79, 42, 154, + 39, 13, 69, 105, 240, 12, + 136, 97, 1, 0, 0, 0, + 176, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 232, 0, 0, 0, 56, 1, + 0, 0, 108, 1, 0, 0, + 20, 2, 0, 0, 82, 68, + 69, 70, 172, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 145, 0, 0, + 132, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 128, 0, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, + 13, 0, 0, 0, 115, 109, + 112, 0, 116, 101, 120, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 49, + 48, 46, 49, 0, 73, 83, + 71, 78, 72, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 3, 3, + 0, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 15, + 0, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 67, + 79, 76, 79, 82, 0, 171, + 79, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 97, 114, 103, 101, + 116, 0, 171, 171, 83, 72, + 69, 88, 160, 0, 0, 0, + 80, 0, 0, 0, 40, 0, + 0, 0, 106, 8, 0, 1, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 0, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 69, 0, 0, 139, 194, 0, + 0, 128, 67, 85, 21, 0, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, + 0, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; +#else +#error "sokol_imgui.h: No sokol_gfx.h backend selected (SOKOL_GLCORE33, SOKOL_GLES2, SOKOL_GLES3, SOKOL_D3D11 or SOKOL_METAL)" +#endif + +SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) { + SOKOL_ASSERT(desc); + memset(&_simgui, 0, sizeof(_simgui)); + _simgui.desc = *desc; + _simgui.desc.max_vertices = _simgui_def(_simgui.desc.max_vertices, 65536); + _simgui.desc.dpi_scale = _simgui_def(_simgui.desc.dpi_scale, 1.0f); + /* can keep color_format, depth_format and sample_count as is, + since sokol_gfx.h will do its own default-value handling + */ + + /* initialize Dear ImGui */ + #if defined(__cplusplus) + ImGui::CreateContext(); + ImGui::StyleColorsDark(); + ImGuiIO* io = &ImGui::GetIO(); + if (!_simgui.desc.no_default_font) { + io->Fonts->AddFontDefault(); + } + #else + igCreateContext(NULL); + igStyleColorsDark(igGetStyle()); + ImGuiIO* io = igGetIO(); + if (!_simgui.desc.no_default_font) { + ImFontAtlas_AddFontDefault(io->Fonts, NULL); + } + #endif + io->IniFilename = _simgui.desc.ini_filename; + io->BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; + #if !defined(SOKOL_IMGUI_NO_SOKOL_APP) + io->KeyMap[ImGuiKey_Tab] = SAPP_KEYCODE_TAB; + io->KeyMap[ImGuiKey_LeftArrow] = SAPP_KEYCODE_LEFT; + io->KeyMap[ImGuiKey_RightArrow] = SAPP_KEYCODE_RIGHT; + io->KeyMap[ImGuiKey_UpArrow] = SAPP_KEYCODE_UP; + io->KeyMap[ImGuiKey_DownArrow] = SAPP_KEYCODE_DOWN; + io->KeyMap[ImGuiKey_PageUp] = SAPP_KEYCODE_PAGE_UP; + io->KeyMap[ImGuiKey_PageDown] = SAPP_KEYCODE_PAGE_DOWN; + io->KeyMap[ImGuiKey_Home] = SAPP_KEYCODE_HOME; + io->KeyMap[ImGuiKey_End] = SAPP_KEYCODE_END; + io->KeyMap[ImGuiKey_Delete] = SAPP_KEYCODE_DELETE; + io->KeyMap[ImGuiKey_Backspace] = SAPP_KEYCODE_BACKSPACE; + io->KeyMap[ImGuiKey_Space] = SAPP_KEYCODE_SPACE; + io->KeyMap[ImGuiKey_Enter] = SAPP_KEYCODE_ENTER; + io->KeyMap[ImGuiKey_Escape] = SAPP_KEYCODE_ESCAPE; + io->KeyMap[ImGuiKey_A] = SAPP_KEYCODE_A; + io->KeyMap[ImGuiKey_C] = SAPP_KEYCODE_C; + io->KeyMap[ImGuiKey_V] = SAPP_KEYCODE_V; + io->KeyMap[ImGuiKey_X] = SAPP_KEYCODE_X; + io->KeyMap[ImGuiKey_Y] = SAPP_KEYCODE_Y; + io->KeyMap[ImGuiKey_Z] = SAPP_KEYCODE_Z; + #endif + + /* create sokol-gfx resources */ + sg_push_debug_group("sokol-imgui"); + + /* NOTE: since we're in C++ mode here we can't use C99 designated init */ + sg_buffer_desc vb_desc; + memset(&vb_desc, 0, sizeof(vb_desc)); + vb_desc.usage = SG_USAGE_STREAM; + vb_desc.size = _simgui.desc.max_vertices * sizeof(ImDrawVert); + vb_desc.label = "sokol-imgui-vertices"; + _simgui.vbuf = sg_make_buffer(&vb_desc); + + sg_buffer_desc ib_desc; + memset(&ib_desc, 0, sizeof(ib_desc)); + ib_desc.type = SG_BUFFERTYPE_INDEXBUFFER; + ib_desc.usage = SG_USAGE_STREAM; + ib_desc.size = _simgui.desc.max_vertices * 3 * sizeof(uint16_t); + ib_desc.label = "sokol-imgui-indices"; + _simgui.ibuf = sg_make_buffer(&ib_desc); + + /* default font texture */ + if (!_simgui.desc.no_default_font) { + unsigned char* font_pixels; + int font_width, font_height; + #if defined(__cplusplus) + io->Fonts->GetTexDataAsRGBA32(&font_pixels, &font_width, &font_height); + #else + int bytes_per_pixel; + ImFontAtlas_GetTexDataAsRGBA32(io->Fonts, &font_pixels, &font_width, &font_height, &bytes_per_pixel); + #endif + sg_image_desc img_desc; + memset(&img_desc, 0, sizeof(img_desc)); + img_desc.width = font_width; + img_desc.height = font_height; + img_desc.pixel_format = SG_PIXELFORMAT_RGBA8; + img_desc.wrap_u = SG_WRAP_CLAMP_TO_EDGE; + img_desc.wrap_v = SG_WRAP_CLAMP_TO_EDGE; + img_desc.min_filter = SG_FILTER_LINEAR; + img_desc.mag_filter = SG_FILTER_LINEAR; + img_desc.content.subimage[0][0].ptr = font_pixels; + img_desc.content.subimage[0][0].size = font_width * font_height * sizeof(uint32_t); + img_desc.label = "sokol-imgui-font"; + _simgui.img = sg_make_image(&img_desc); + io->Fonts->TexID = (ImTextureID)(uintptr_t) _simgui.img.id; + } + + /* shader object for using the embedded shader source (or bytecode) */ + sg_shader_desc shd_desc; + memset(&shd_desc, 0, sizeof(shd_desc)); + sg_shader_uniform_block_desc* ub = &shd_desc.vs.uniform_blocks[0]; + ub->size = sizeof(_simgui_vs_params_t); + ub->uniforms[0].name = "disp_size"; + ub->uniforms[0].type = SG_UNIFORMTYPE_FLOAT2; + shd_desc.attrs[0].name = "position"; + shd_desc.attrs[0].sem_name = "POSITION"; + shd_desc.attrs[1].name = "texcoord0"; + shd_desc.attrs[1].sem_name = "TEXCOORD"; + shd_desc.attrs[2].name = "color0"; + shd_desc.attrs[2].sem_name = "COLOR"; + shd_desc.fs.images[0].name = "tex"; + shd_desc.fs.images[0].type = SG_IMAGETYPE_2D; + #if defined(SOKOL_D3D11) + shd_desc.vs.byte_code = _simgui_vs_bin; + shd_desc.vs.byte_code_size = sizeof(_simgui_vs_bin); + shd_desc.fs.byte_code = _simgui_fs_bin; + shd_desc.fs.byte_code_size = sizeof(_simgui_fs_bin); + #else + shd_desc.vs.source = _simgui_vs_src; + shd_desc.fs.source = _simgui_fs_src; + #endif + shd_desc.label = "sokol-imgui-shader"; + _simgui.shd = sg_make_shader(&shd_desc); + + /* pipeline object for imgui rendering */ + sg_pipeline_desc pip_desc; + memset(&pip_desc, 0, sizeof(pip_desc)); + pip_desc.layout.buffers[0].stride = sizeof(ImDrawVert); + { + sg_vertex_attr_desc* attr = &pip_desc.layout.attrs[0]; + attr->offset = offsetof(ImDrawVert, pos); + attr->format = SG_VERTEXFORMAT_FLOAT2; + } + { + sg_vertex_attr_desc* attr = &pip_desc.layout.attrs[1]; + attr->offset = offsetof(ImDrawVert, uv); + attr->format = SG_VERTEXFORMAT_FLOAT2; + } + { + sg_vertex_attr_desc* attr = &pip_desc.layout.attrs[2]; + attr->offset = offsetof(ImDrawVert, col); + attr->format = SG_VERTEXFORMAT_UBYTE4N; + } + pip_desc.shader = _simgui.shd; + pip_desc.index_type = SG_INDEXTYPE_UINT16; + pip_desc.blend.enabled = true; + pip_desc.blend.src_factor_rgb = SG_BLENDFACTOR_SRC_ALPHA; + pip_desc.blend.dst_factor_rgb = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA; + pip_desc.blend.color_write_mask = SG_COLORMASK_RGB; + pip_desc.blend.color_format = _simgui.desc.color_format; + pip_desc.blend.depth_format = _simgui.desc.depth_format; + pip_desc.rasterizer.sample_count = _simgui.desc.sample_count; + pip_desc.label = "sokol-imgui-pipeline"; + _simgui.pip = sg_make_pipeline(&pip_desc); + + sg_pop_debug_group(); +} + +SOKOL_API_IMPL void simgui_shutdown(void) { + #if defined(__cplusplus) + ImGui::DestroyContext(); + #else + igDestroyContext(0); + #endif + /* NOTE: it's valid to call the destroy funcs with SG_INVALID_ID */ + sg_destroy_pipeline(_simgui.pip); + sg_destroy_shader(_simgui.shd); + sg_destroy_image(_simgui.img); + sg_destroy_buffer(_simgui.ibuf); + sg_destroy_buffer(_simgui.vbuf); +} + +SOKOL_API_IMPL void simgui_new_frame(int width, int height, double delta_time) { + #if defined(__cplusplus) + ImGuiIO* io = &ImGui::GetIO(); + #else + ImGuiIO* io = igGetIO(); + #endif + io->DisplaySize.x = ((float) width) / _simgui.desc.dpi_scale; + io->DisplaySize.y = ((float) height) / _simgui.desc.dpi_scale; + io->DeltaTime = (float) delta_time; + #if !defined(SOKOL_IMGUI_NO_SOKOL_APP) + for (int i = 0; i < SAPP_MAX_MOUSEBUTTONS; i++) { + if (_simgui.btn_down[i]) { + _simgui.btn_down[i] = false; + io->MouseDown[i] = true; + } + else if (_simgui.btn_up[i]) { + _simgui.btn_up[i] = false; + io->MouseDown[i] = false; + } + } + if (io->WantTextInput && !sapp_keyboard_shown()) { + sapp_show_keyboard(true); + } + if (!io->WantTextInput && sapp_keyboard_shown()) { + sapp_show_keyboard(false); + } + #endif + #if defined(__cplusplus) + ImGui::NewFrame(); + #else + igNewFrame(); + #endif +} + +SOKOL_API_IMPL void simgui_render(void) { + #if defined(__cplusplus) + ImGui::Render(); + ImDrawData* draw_data = ImGui::GetDrawData(); + ImGuiIO* io = &ImGui::GetIO(); + #else + igRender(); + ImDrawData* draw_data = igGetDrawData(); + ImGuiIO* io = igGetIO(); + #endif + if (0 == draw_data) { + return; + } + if (draw_data->CmdListsCount == 0) { + return; + } + + /* render the ImGui command list */ + sg_push_debug_group("sokol-imgui"); + + const float dpi_scale = _simgui.desc.dpi_scale; + const int fb_width = (const int) (io->DisplaySize.x * dpi_scale); + const int fb_height = (const int) (io->DisplaySize.y * dpi_scale); + sg_apply_viewport(0, 0, fb_width, fb_height, true); + sg_apply_scissor_rect(0, 0, fb_width, fb_height, true); + + sg_apply_pipeline(_simgui.pip); + _simgui_vs_params_t vs_params; + vs_params.disp_size.x = io->DisplaySize.x; + vs_params.disp_size.y = io->DisplaySize.y; + sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, &vs_params, sizeof(vs_params)); + sg_bindings bind; + memset(&bind, 0, sizeof(bind)); + bind.vertex_buffers[0] = _simgui.vbuf; + bind.index_buffer = _simgui.ibuf; + ImTextureID tex_id = io->Fonts->TexID; + bind.fs_images[0].id = (uint32_t)(uintptr_t)tex_id; + for (int cl_index = 0; cl_index < draw_data->CmdListsCount; cl_index++) { + ImDrawList* cl = draw_data->CmdLists[cl_index]; + + /* append vertices and indices to buffers, record start offsets in draw state */ + #if defined(__cplusplus) + const int vtx_size = cl->VtxBuffer.size() * sizeof(ImDrawVert); + const int idx_size = cl->IdxBuffer.size() * sizeof(ImDrawIdx); + const ImDrawVert* vtx_ptr = &cl->VtxBuffer.front(); + const ImDrawIdx* idx_ptr = &cl->IdxBuffer.front(); + #else + const int vtx_size = cl->VtxBuffer.Size * sizeof(ImDrawVert); + const int idx_size = cl->IdxBuffer.Size * sizeof(ImDrawIdx); + const ImDrawVert* vtx_ptr = cl->VtxBuffer.Data; + const ImDrawIdx* idx_ptr = cl->IdxBuffer.Data; + #endif + const uint32_t vb_offset = sg_append_buffer(bind.vertex_buffers[0], vtx_ptr, vtx_size); + const uint32_t ib_offset = sg_append_buffer(bind.index_buffer, idx_ptr, idx_size); + /* don't render anything if the buffer is in overflow state (this is also + checked internally in sokol_gfx, draw calls that attempt to draw with + overflowed buffers will be silently dropped) + */ + if (sg_query_buffer_overflow(bind.vertex_buffers[0]) || + sg_query_buffer_overflow(bind.index_buffer)) + { + break; + } + bind.vertex_buffer_offsets[0] = vb_offset; + bind.index_buffer_offset = ib_offset; + sg_apply_bindings(&bind); + + int base_element = 0; + #if defined(__cplusplus) + const int num_cmds = cl->CmdBuffer.size(); + #else + const int num_cmds = cl->CmdBuffer.Size; + #endif + uint32_t vtx_offset = 0; + for (int cmd_index = 0; cmd_index < num_cmds; cmd_index++) { + ImDrawCmd* pcmd = &cl->CmdBuffer.Data[cmd_index]; + if (pcmd->UserCallback) { + pcmd->UserCallback(cl, pcmd); + } + else { + if ((tex_id != pcmd->TextureId) || (vtx_offset != pcmd->VtxOffset)) { + tex_id = pcmd->TextureId; + vtx_offset = pcmd->VtxOffset * sizeof(ImDrawVert); + bind.fs_images[0].id = (uint32_t)(uintptr_t)tex_id; + bind.vertex_buffer_offsets[0] = vb_offset + vtx_offset; + sg_apply_bindings(&bind); + } + const int scissor_x = (int) (pcmd->ClipRect.x * dpi_scale); + const int scissor_y = (int) (pcmd->ClipRect.y * dpi_scale); + const int scissor_w = (int) ((pcmd->ClipRect.z - pcmd->ClipRect.x) * dpi_scale); + const int scissor_h = (int) ((pcmd->ClipRect.w - pcmd->ClipRect.y) * dpi_scale); + sg_apply_scissor_rect(scissor_x, scissor_y, scissor_w, scissor_h, true); + sg_draw(base_element, pcmd->ElemCount, 1); + } + base_element += pcmd->ElemCount; + } + } + sg_apply_viewport(0, 0, fb_width, fb_height, true); + sg_apply_scissor_rect(0, 0, fb_width, fb_height, true); + sg_pop_debug_group(); +} + +#if !defined(SOKOL_IMGUI_NO_SOKOL_APP) +SOKOL_API_IMPL bool simgui_handle_event(const sapp_event* ev) { + const float dpi_scale = _simgui.desc.dpi_scale; + #if defined(__cplusplus) + ImGuiIO* io = &ImGui::GetIO(); + #else + ImGuiIO* io = igGetIO(); + #endif + io->KeyAlt = (ev->modifiers & SAPP_MODIFIER_ALT) != 0; + io->KeyCtrl = (ev->modifiers & SAPP_MODIFIER_CTRL) != 0; + io->KeyShift = (ev->modifiers & SAPP_MODIFIER_SHIFT) != 0; + io->KeySuper = (ev->modifiers & SAPP_MODIFIER_SUPER) != 0; + switch (ev->type) { + case SAPP_EVENTTYPE_MOUSE_DOWN: + io->MousePos.x = ev->mouse_x / dpi_scale; + io->MousePos.y = ev->mouse_y / dpi_scale; + if (ev->mouse_button < 3) { + _simgui.btn_down[ev->mouse_button] = true; + } + break; + case SAPP_EVENTTYPE_MOUSE_UP: + io->MousePos.x = ev->mouse_x / dpi_scale; + io->MousePos.y = ev->mouse_y / dpi_scale; + if (ev->mouse_button < 3) { + _simgui.btn_up[ev->mouse_button] = true; + } + break; + case SAPP_EVENTTYPE_MOUSE_MOVE: + io->MousePos.x = ev->mouse_x / dpi_scale; + io->MousePos.y = ev->mouse_y / dpi_scale; + break; + case SAPP_EVENTTYPE_MOUSE_ENTER: + case SAPP_EVENTTYPE_MOUSE_LEAVE: + for (int i = 0; i < 3; i++) { + _simgui.btn_down[i] = false; + _simgui.btn_up[i] = false; + io->MouseDown[i] = false; + } + break; + case SAPP_EVENTTYPE_MOUSE_SCROLL: + io->MouseWheelH = ev->scroll_x; + io->MouseWheel = ev->scroll_y; + break; + case SAPP_EVENTTYPE_TOUCHES_BEGAN: + _simgui.btn_down[0] = true; + io->MousePos.x = ev->touches[0].pos_x / dpi_scale; + io->MousePos.y = ev->touches[0].pos_y / dpi_scale; + break; + case SAPP_EVENTTYPE_TOUCHES_MOVED: + io->MousePos.x = ev->touches[0].pos_x / dpi_scale; + io->MousePos.y = ev->touches[0].pos_y / dpi_scale; + break; + case SAPP_EVENTTYPE_TOUCHES_ENDED: + _simgui.btn_up[0] = true; + io->MousePos.x = ev->touches[0].pos_x / dpi_scale; + io->MousePos.y = ev->touches[0].pos_y / dpi_scale; + break; + case SAPP_EVENTTYPE_TOUCHES_CANCELLED: + _simgui.btn_up[0] = _simgui.btn_down[0] = false; + break; + case SAPP_EVENTTYPE_KEY_DOWN: + io->KeysDown[ev->key_code] = true; + break; + case SAPP_EVENTTYPE_KEY_UP: + io->KeysDown[ev->key_code] = false; + break; + case SAPP_EVENTTYPE_CHAR: + #if defined(__cplusplus) + io->AddInputCharacter((ImWchar)ev->char_code); + #else + ImGuiIO_AddInputCharacter(io, (ImWchar)ev->char_code); + #endif + break; + default: + break; + } + return io->WantCaptureKeyboard; +} +#endif + +#endif /* SOKOL_IMPL */ diff --git a/sokol-app-sys/src/lib.rs b/sokol-app-sys/src/lib.rs new file mode 100644 index 00000000..e720ed41 --- /dev/null +++ b/sokol-app-sys/src/lib.rs @@ -0,0 +1,19 @@ +#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow(improper_ctypes)] // u128 types are not actually used anywhere, so the functions with u128 in signatures will be stripped anyway (I believe) + +#[cfg(target_os = "linux")] +pub mod sokol_app_linux; +#[cfg(target_os = "linux")] +pub use crate::sokol_app_linux as sokol_app; + +// bindgen --no-layout-tests external/sokol/sokol_app.h -- -D SOKOL_GLCORE33 -D SOKOL_IMPL -D SOKOL_NO_ENTRY -target x86_64-pc-windows-gnu > src/sokol_app_win.rs +#[cfg(target_os = "windows")] +pub mod sokol_app_win; +#[cfg(target_os = "windows")] +pub use crate::sokol_app_win as sokol_app; + +// bindgen --no-layout-tests external/sokol/sokol_app.h -- -I. -I/usr/lib/emscripten/system/include -I/usr/lib/emscripten/system/include/libc -I/usr/lib/emscripten/system/lib/libc/musl/arch/emscripten/ -D SOKOL_GLES3 -D SOKOL_IMPL -D SOKOL_NO_ENTRY -D __EMSCRIPTEN__ -target wasm32-unknown-emscripten -fvisibility=default > src/sokol_app_wasm.rs +#[cfg(target_arch = "wasm32")] +pub mod sokol_app_wasm; +#[cfg(target_arch = "wasm32")] +pub use crate::sokol_app_wasm as sokol_app; diff --git a/sokol-app-sys/src/sokol_app.c b/sokol-app-sys/src/sokol_app.c new file mode 100644 index 00000000..92eb05b6 --- /dev/null +++ b/sokol-app-sys/src/sokol_app.c @@ -0,0 +1,5 @@ +#define SOKOL_IMPL +#define SOKOL_NO_ENTRY +#define SOKOL_NO_DEPRECATED +#define SOKOL_TRACE_HOOKS +#include diff --git a/sokol-app-sys/src/sokol_app.rs b/sokol-app-sys/src/sokol_app.rs new file mode 100644 index 00000000..e69de29b diff --git a/sokol-app-sys/src/sokol_app_linux.rs b/sokol-app-sys/src/sokol_app_linux.rs new file mode 100644 index 00000000..e75d7d10 --- /dev/null +++ b/sokol-app-sys/src/sokol_app_linux.rs @@ -0,0 +1,44636 @@ +/* automatically generated by rust-bindgen */ + +pub const SOKOL_APP_INCLUDED: u32 = 1; +pub const _STDINT_H: u32 = 1; +pub const _FEATURES_H: u32 = 1; +pub const _DEFAULT_SOURCE: u32 = 1; +pub const __USE_ISOC11: u32 = 1; +pub const __USE_ISOC99: u32 = 1; +pub const __USE_ISOC95: u32 = 1; +pub const __USE_POSIX_IMPLICITLY: u32 = 1; +pub const _POSIX_SOURCE: u32 = 1; +pub const _POSIX_C_SOURCE: u32 = 200809; +pub const __USE_POSIX: u32 = 1; +pub const __USE_POSIX2: u32 = 1; +pub const __USE_POSIX199309: u32 = 1; +pub const __USE_POSIX199506: u32 = 1; +pub const __USE_XOPEN2K: u32 = 1; +pub const __USE_XOPEN2K8: u32 = 1; +pub const _ATFILE_SOURCE: u32 = 1; +pub const __USE_MISC: u32 = 1; +pub const __USE_ATFILE: u32 = 1; +pub const __USE_FORTIFY_LEVEL: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; +pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; +pub const _STDC_PREDEF_H: u32 = 1; +pub const __STDC_IEC_559__: u32 = 1; +pub const __STDC_IEC_559_COMPLEX__: u32 = 1; +pub const __STDC_ISO_10646__: u32 = 201706; +pub const __GNU_LIBRARY__: u32 = 6; +pub const __GLIBC__: u32 = 2; +pub const __GLIBC_MINOR__: u32 = 30; +pub const _SYS_CDEFS_H: u32 = 1; +pub const __glibc_c99_flexarr_available: u32 = 1; +pub const __WORDSIZE: u32 = 64; +pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; +pub const __SYSCALL_WORDSIZE: u32 = 64; +pub const __HAVE_GENERIC_SELECTION: u32 = 1; +pub const __GLIBC_USE_LIB_EXT2: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; +pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; +pub const _BITS_TYPES_H: u32 = 1; +pub const __TIMESIZE: u32 = 64; +pub const _BITS_TYPESIZES_H: u32 = 1; +pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; +pub const __INO_T_MATCHES_INO64_T: u32 = 1; +pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; +pub const __FD_SETSIZE: u32 = 1024; +pub const _BITS_TIME64_H: u32 = 1; +pub const _BITS_WCHAR_H: u32 = 1; +pub const _BITS_STDINT_INTN_H: u32 = 1; +pub const _BITS_STDINT_UINTN_H: u32 = 1; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i64 = -9223372036854775808; +pub const INT_FAST32_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u64 = 9223372036854775807; +pub const INT_FAST32_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: i32 = -1; +pub const UINT_FAST32_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 4294967295; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const SOKOL_APP_IMPL_INCLUDED: u32 = 1; +pub const _STRING_H: u32 = 1; +pub const _BITS_TYPES_LOCALE_T_H: u32 = 1; +pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; +pub const _STRINGS_H: u32 = 1; +pub const SOKOL_DEBUG: u32 = 1; +pub const _ASSERT_H: u32 = 1; +pub const _STDLIB_H: u32 = 1; +pub const WNOHANG: u32 = 1; +pub const WUNTRACED: u32 = 2; +pub const WSTOPPED: u32 = 2; +pub const WEXITED: u32 = 4; +pub const WCONTINUED: u32 = 8; +pub const WNOWAIT: u32 = 16777216; +pub const __WNOTHREAD: u32 = 536870912; +pub const __WALL: u32 = 1073741824; +pub const __WCLONE: u32 = 2147483648; +pub const __W_CONTINUED: u32 = 65535; +pub const __WCOREFLAG: u32 = 128; +pub const __HAVE_FLOAT128: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; +pub const __HAVE_FLOAT64X: u32 = 1; +pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; +pub const __HAVE_FLOAT16: u32 = 0; +pub const __HAVE_FLOAT32: u32 = 1; +pub const __HAVE_FLOAT64: u32 = 1; +pub const __HAVE_FLOAT32X: u32 = 1; +pub const __HAVE_FLOAT128X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; +pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; +pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; +pub const __ldiv_t_defined: u32 = 1; +pub const __lldiv_t_defined: u32 = 1; +pub const RAND_MAX: u32 = 2147483647; +pub const EXIT_FAILURE: u32 = 1; +pub const EXIT_SUCCESS: u32 = 0; +pub const _SYS_TYPES_H: u32 = 1; +pub const __clock_t_defined: u32 = 1; +pub const __clockid_t_defined: u32 = 1; +pub const __time_t_defined: u32 = 1; +pub const __timer_t_defined: u32 = 1; +pub const __BIT_TYPES_DEFINED__: u32 = 1; +pub const _ENDIAN_H: u32 = 1; +pub const __LITTLE_ENDIAN: u32 = 1234; +pub const __BIG_ENDIAN: u32 = 4321; +pub const __PDP_ENDIAN: u32 = 3412; +pub const __BYTE_ORDER: u32 = 1234; +pub const __FLOAT_WORD_ORDER: u32 = 1234; +pub const LITTLE_ENDIAN: u32 = 1234; +pub const BIG_ENDIAN: u32 = 4321; +pub const PDP_ENDIAN: u32 = 3412; +pub const BYTE_ORDER: u32 = 1234; +pub const _BITS_BYTESWAP_H: u32 = 1; +pub const _BITS_UINTN_IDENTITY_H: u32 = 1; +pub const _SYS_SELECT_H: u32 = 1; +pub const __FD_ZERO_STOS: &'static [u8; 6usize] = b"stosq\0"; +pub const __sigset_t_defined: u32 = 1; +pub const __timeval_defined: u32 = 1; +pub const _STRUCT_TIMESPEC: u32 = 1; +pub const FD_SETSIZE: u32 = 1024; +pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; +pub const _THREAD_SHARED_TYPES_H: u32 = 1; +pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; +pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; +pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; +pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; +pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; +pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; +pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; +pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; +pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; +pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; +pub const __PTHREAD_MUTEX_LOCK_ELISION: u32 = 1; +pub const __PTHREAD_MUTEX_NUSERS_AFTER_KIND: u32 = 0; +pub const __PTHREAD_MUTEX_USE_UNION: u32 = 0; +pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: u32 = 1; +pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; +pub const __have_pthread_attr_t: u32 = 1; +pub const _ALLOCA_H: u32 = 1; +pub const _STDIO_H: u32 = 1; +pub const __GNUC_VA_LIST: u32 = 1; +pub const _____fpos_t_defined: u32 = 1; +pub const ____mbstate_t_defined: u32 = 1; +pub const _____fpos64_t_defined: u32 = 1; +pub const ____FILE_defined: u32 = 1; +pub const __FILE_defined: u32 = 1; +pub const __struct_FILE_defined: u32 = 1; +pub const _IO_EOF_SEEN: u32 = 16; +pub const _IO_ERR_SEEN: u32 = 32; +pub const _IO_USER_LOCK: u32 = 32768; +pub const _IOFBF: u32 = 0; +pub const _IOLBF: u32 = 1; +pub const _IONBF: u32 = 2; +pub const BUFSIZ: u32 = 8192; +pub const EOF: i32 = -1; +pub const SEEK_SET: u32 = 0; +pub const SEEK_CUR: u32 = 1; +pub const SEEK_END: u32 = 2; +pub const P_tmpdir: &'static [u8; 5usize] = b"/tmp\0"; +pub const _BITS_STDIO_LIM_H: u32 = 1; +pub const L_tmpnam: u32 = 20; +pub const TMP_MAX: u32 = 238328; +pub const FILENAME_MAX: u32 = 4096; +pub const L_ctermid: u32 = 9; +pub const FOPEN_MAX: u32 = 16; +pub const X_PROTOCOL: u32 = 11; +pub const X_PROTOCOL_REVISION: u32 = 0; +pub const None: u32 = 0; +pub const ParentRelative: u32 = 1; +pub const CopyFromParent: u32 = 0; +pub const PointerWindow: u32 = 0; +pub const InputFocus: u32 = 1; +pub const PointerRoot: u32 = 1; +pub const AnyPropertyType: u32 = 0; +pub const AnyKey: u32 = 0; +pub const AnyButton: u32 = 0; +pub const AllTemporary: u32 = 0; +pub const CurrentTime: u32 = 0; +pub const NoSymbol: u32 = 0; +pub const NoEventMask: u32 = 0; +pub const KeyPressMask: u32 = 1; +pub const KeyReleaseMask: u32 = 2; +pub const ButtonPressMask: u32 = 4; +pub const ButtonReleaseMask: u32 = 8; +pub const EnterWindowMask: u32 = 16; +pub const LeaveWindowMask: u32 = 32; +pub const PointerMotionMask: u32 = 64; +pub const PointerMotionHintMask: u32 = 128; +pub const Button1MotionMask: u32 = 256; +pub const Button2MotionMask: u32 = 512; +pub const Button3MotionMask: u32 = 1024; +pub const Button4MotionMask: u32 = 2048; +pub const Button5MotionMask: u32 = 4096; +pub const ButtonMotionMask: u32 = 8192; +pub const KeymapStateMask: u32 = 16384; +pub const ExposureMask: u32 = 32768; +pub const VisibilityChangeMask: u32 = 65536; +pub const StructureNotifyMask: u32 = 131072; +pub const ResizeRedirectMask: u32 = 262144; +pub const SubstructureNotifyMask: u32 = 524288; +pub const SubstructureRedirectMask: u32 = 1048576; +pub const FocusChangeMask: u32 = 2097152; +pub const PropertyChangeMask: u32 = 4194304; +pub const ColormapChangeMask: u32 = 8388608; +pub const OwnerGrabButtonMask: u32 = 16777216; +pub const KeyPress: u32 = 2; +pub const KeyRelease: u32 = 3; +pub const ButtonPress: u32 = 4; +pub const ButtonRelease: u32 = 5; +pub const MotionNotify: u32 = 6; +pub const EnterNotify: u32 = 7; +pub const LeaveNotify: u32 = 8; +pub const FocusIn: u32 = 9; +pub const FocusOut: u32 = 10; +pub const KeymapNotify: u32 = 11; +pub const Expose: u32 = 12; +pub const GraphicsExpose: u32 = 13; +pub const NoExpose: u32 = 14; +pub const VisibilityNotify: u32 = 15; +pub const CreateNotify: u32 = 16; +pub const DestroyNotify: u32 = 17; +pub const UnmapNotify: u32 = 18; +pub const MapNotify: u32 = 19; +pub const MapRequest: u32 = 20; +pub const ReparentNotify: u32 = 21; +pub const ConfigureNotify: u32 = 22; +pub const ConfigureRequest: u32 = 23; +pub const GravityNotify: u32 = 24; +pub const ResizeRequest: u32 = 25; +pub const CirculateNotify: u32 = 26; +pub const CirculateRequest: u32 = 27; +pub const PropertyNotify: u32 = 28; +pub const SelectionClear: u32 = 29; +pub const SelectionRequest: u32 = 30; +pub const SelectionNotify: u32 = 31; +pub const ColormapNotify: u32 = 32; +pub const ClientMessage: u32 = 33; +pub const MappingNotify: u32 = 34; +pub const GenericEvent: u32 = 35; +pub const LASTEvent: u32 = 36; +pub const ShiftMask: u32 = 1; +pub const LockMask: u32 = 2; +pub const ControlMask: u32 = 4; +pub const Mod1Mask: u32 = 8; +pub const Mod2Mask: u32 = 16; +pub const Mod3Mask: u32 = 32; +pub const Mod4Mask: u32 = 64; +pub const Mod5Mask: u32 = 128; +pub const ShiftMapIndex: u32 = 0; +pub const LockMapIndex: u32 = 1; +pub const ControlMapIndex: u32 = 2; +pub const Mod1MapIndex: u32 = 3; +pub const Mod2MapIndex: u32 = 4; +pub const Mod3MapIndex: u32 = 5; +pub const Mod4MapIndex: u32 = 6; +pub const Mod5MapIndex: u32 = 7; +pub const Button1Mask: u32 = 256; +pub const Button2Mask: u32 = 512; +pub const Button3Mask: u32 = 1024; +pub const Button4Mask: u32 = 2048; +pub const Button5Mask: u32 = 4096; +pub const AnyModifier: u32 = 32768; +pub const Button1: u32 = 1; +pub const Button2: u32 = 2; +pub const Button3: u32 = 3; +pub const Button4: u32 = 4; +pub const Button5: u32 = 5; +pub const NotifyNormal: u32 = 0; +pub const NotifyGrab: u32 = 1; +pub const NotifyUngrab: u32 = 2; +pub const NotifyWhileGrabbed: u32 = 3; +pub const NotifyHint: u32 = 1; +pub const NotifyAncestor: u32 = 0; +pub const NotifyVirtual: u32 = 1; +pub const NotifyInferior: u32 = 2; +pub const NotifyNonlinear: u32 = 3; +pub const NotifyNonlinearVirtual: u32 = 4; +pub const NotifyPointer: u32 = 5; +pub const NotifyPointerRoot: u32 = 6; +pub const NotifyDetailNone: u32 = 7; +pub const VisibilityUnobscured: u32 = 0; +pub const VisibilityPartiallyObscured: u32 = 1; +pub const VisibilityFullyObscured: u32 = 2; +pub const PlaceOnTop: u32 = 0; +pub const PlaceOnBottom: u32 = 1; +pub const FamilyInternet: u32 = 0; +pub const FamilyDECnet: u32 = 1; +pub const FamilyChaos: u32 = 2; +pub const FamilyInternet6: u32 = 6; +pub const FamilyServerInterpreted: u32 = 5; +pub const PropertyNewValue: u32 = 0; +pub const PropertyDelete: u32 = 1; +pub const ColormapUninstalled: u32 = 0; +pub const ColormapInstalled: u32 = 1; +pub const GrabModeSync: u32 = 0; +pub const GrabModeAsync: u32 = 1; +pub const GrabSuccess: u32 = 0; +pub const AlreadyGrabbed: u32 = 1; +pub const GrabInvalidTime: u32 = 2; +pub const GrabNotViewable: u32 = 3; +pub const GrabFrozen: u32 = 4; +pub const AsyncPointer: u32 = 0; +pub const SyncPointer: u32 = 1; +pub const ReplayPointer: u32 = 2; +pub const AsyncKeyboard: u32 = 3; +pub const SyncKeyboard: u32 = 4; +pub const ReplayKeyboard: u32 = 5; +pub const AsyncBoth: u32 = 6; +pub const SyncBoth: u32 = 7; +pub const RevertToParent: u32 = 2; +pub const Success: u32 = 0; +pub const BadRequest: u32 = 1; +pub const BadValue: u32 = 2; +pub const BadWindow: u32 = 3; +pub const BadPixmap: u32 = 4; +pub const BadAtom: u32 = 5; +pub const BadCursor: u32 = 6; +pub const BadFont: u32 = 7; +pub const BadMatch: u32 = 8; +pub const BadDrawable: u32 = 9; +pub const BadAccess: u32 = 10; +pub const BadAlloc: u32 = 11; +pub const BadColor: u32 = 12; +pub const BadGC: u32 = 13; +pub const BadIDChoice: u32 = 14; +pub const BadName: u32 = 15; +pub const BadLength: u32 = 16; +pub const BadImplementation: u32 = 17; +pub const FirstExtensionError: u32 = 128; +pub const LastExtensionError: u32 = 255; +pub const InputOutput: u32 = 1; +pub const InputOnly: u32 = 2; +pub const CWBackPixmap: u32 = 1; +pub const CWBackPixel: u32 = 2; +pub const CWBorderPixmap: u32 = 4; +pub const CWBorderPixel: u32 = 8; +pub const CWBitGravity: u32 = 16; +pub const CWWinGravity: u32 = 32; +pub const CWBackingStore: u32 = 64; +pub const CWBackingPlanes: u32 = 128; +pub const CWBackingPixel: u32 = 256; +pub const CWOverrideRedirect: u32 = 512; +pub const CWSaveUnder: u32 = 1024; +pub const CWEventMask: u32 = 2048; +pub const CWDontPropagate: u32 = 4096; +pub const CWColormap: u32 = 8192; +pub const CWCursor: u32 = 16384; +pub const CWX: u32 = 1; +pub const CWY: u32 = 2; +pub const CWWidth: u32 = 4; +pub const CWHeight: u32 = 8; +pub const CWBorderWidth: u32 = 16; +pub const CWSibling: u32 = 32; +pub const CWStackMode: u32 = 64; +pub const ForgetGravity: u32 = 0; +pub const NorthWestGravity: u32 = 1; +pub const NorthGravity: u32 = 2; +pub const NorthEastGravity: u32 = 3; +pub const WestGravity: u32 = 4; +pub const CenterGravity: u32 = 5; +pub const EastGravity: u32 = 6; +pub const SouthWestGravity: u32 = 7; +pub const SouthGravity: u32 = 8; +pub const SouthEastGravity: u32 = 9; +pub const StaticGravity: u32 = 10; +pub const UnmapGravity: u32 = 0; +pub const NotUseful: u32 = 0; +pub const WhenMapped: u32 = 1; +pub const Always: u32 = 2; +pub const IsUnmapped: u32 = 0; +pub const IsUnviewable: u32 = 1; +pub const IsViewable: u32 = 2; +pub const SetModeInsert: u32 = 0; +pub const SetModeDelete: u32 = 1; +pub const DestroyAll: u32 = 0; +pub const RetainPermanent: u32 = 1; +pub const RetainTemporary: u32 = 2; +pub const Above: u32 = 0; +pub const Below: u32 = 1; +pub const TopIf: u32 = 2; +pub const BottomIf: u32 = 3; +pub const Opposite: u32 = 4; +pub const RaiseLowest: u32 = 0; +pub const LowerHighest: u32 = 1; +pub const PropModeReplace: u32 = 0; +pub const PropModePrepend: u32 = 1; +pub const PropModeAppend: u32 = 2; +pub const GXclear: u32 = 0; +pub const GXand: u32 = 1; +pub const GXandReverse: u32 = 2; +pub const GXcopy: u32 = 3; +pub const GXandInverted: u32 = 4; +pub const GXnoop: u32 = 5; +pub const GXxor: u32 = 6; +pub const GXor: u32 = 7; +pub const GXnor: u32 = 8; +pub const GXequiv: u32 = 9; +pub const GXinvert: u32 = 10; +pub const GXorReverse: u32 = 11; +pub const GXcopyInverted: u32 = 12; +pub const GXorInverted: u32 = 13; +pub const GXnand: u32 = 14; +pub const GXset: u32 = 15; +pub const LineSolid: u32 = 0; +pub const LineOnOffDash: u32 = 1; +pub const LineDoubleDash: u32 = 2; +pub const CapNotLast: u32 = 0; +pub const CapButt: u32 = 1; +pub const CapRound: u32 = 2; +pub const CapProjecting: u32 = 3; +pub const JoinMiter: u32 = 0; +pub const JoinRound: u32 = 1; +pub const JoinBevel: u32 = 2; +pub const FillSolid: u32 = 0; +pub const FillTiled: u32 = 1; +pub const FillStippled: u32 = 2; +pub const FillOpaqueStippled: u32 = 3; +pub const EvenOddRule: u32 = 0; +pub const WindingRule: u32 = 1; +pub const ClipByChildren: u32 = 0; +pub const IncludeInferiors: u32 = 1; +pub const Unsorted: u32 = 0; +pub const YSorted: u32 = 1; +pub const YXSorted: u32 = 2; +pub const YXBanded: u32 = 3; +pub const CoordModeOrigin: u32 = 0; +pub const CoordModePrevious: u32 = 1; +pub const Complex: u32 = 0; +pub const Nonconvex: u32 = 1; +pub const Convex: u32 = 2; +pub const ArcChord: u32 = 0; +pub const ArcPieSlice: u32 = 1; +pub const GCFunction: u32 = 1; +pub const GCPlaneMask: u32 = 2; +pub const GCForeground: u32 = 4; +pub const GCBackground: u32 = 8; +pub const GCLineWidth: u32 = 16; +pub const GCLineStyle: u32 = 32; +pub const GCCapStyle: u32 = 64; +pub const GCJoinStyle: u32 = 128; +pub const GCFillStyle: u32 = 256; +pub const GCFillRule: u32 = 512; +pub const GCTile: u32 = 1024; +pub const GCStipple: u32 = 2048; +pub const GCTileStipXOrigin: u32 = 4096; +pub const GCTileStipYOrigin: u32 = 8192; +pub const GCFont: u32 = 16384; +pub const GCSubwindowMode: u32 = 32768; +pub const GCGraphicsExposures: u32 = 65536; +pub const GCClipXOrigin: u32 = 131072; +pub const GCClipYOrigin: u32 = 262144; +pub const GCClipMask: u32 = 524288; +pub const GCDashOffset: u32 = 1048576; +pub const GCDashList: u32 = 2097152; +pub const GCArcMode: u32 = 4194304; +pub const GCLastBit: u32 = 22; +pub const FontLeftToRight: u32 = 0; +pub const FontRightToLeft: u32 = 1; +pub const FontChange: u32 = 255; +pub const XYBitmap: u32 = 0; +pub const XYPixmap: u32 = 1; +pub const ZPixmap: u32 = 2; +pub const AllocNone: u32 = 0; +pub const AllocAll: u32 = 1; +pub const DoRed: u32 = 1; +pub const DoGreen: u32 = 2; +pub const DoBlue: u32 = 4; +pub const CursorShape: u32 = 0; +pub const TileShape: u32 = 1; +pub const StippleShape: u32 = 2; +pub const AutoRepeatModeOff: u32 = 0; +pub const AutoRepeatModeOn: u32 = 1; +pub const AutoRepeatModeDefault: u32 = 2; +pub const LedModeOff: u32 = 0; +pub const LedModeOn: u32 = 1; +pub const KBKeyClickPercent: u32 = 1; +pub const KBBellPercent: u32 = 2; +pub const KBBellPitch: u32 = 4; +pub const KBBellDuration: u32 = 8; +pub const KBLed: u32 = 16; +pub const KBLedMode: u32 = 32; +pub const KBKey: u32 = 64; +pub const KBAutoRepeatMode: u32 = 128; +pub const MappingSuccess: u32 = 0; +pub const MappingBusy: u32 = 1; +pub const MappingFailed: u32 = 2; +pub const MappingModifier: u32 = 0; +pub const MappingKeyboard: u32 = 1; +pub const MappingPointer: u32 = 2; +pub const DontPreferBlanking: u32 = 0; +pub const PreferBlanking: u32 = 1; +pub const DefaultBlanking: u32 = 2; +pub const DisableScreenSaver: u32 = 0; +pub const DisableScreenInterval: u32 = 0; +pub const DontAllowExposures: u32 = 0; +pub const AllowExposures: u32 = 1; +pub const DefaultExposures: u32 = 2; +pub const ScreenSaverReset: u32 = 0; +pub const ScreenSaverActive: u32 = 1; +pub const HostInsert: u32 = 0; +pub const HostDelete: u32 = 1; +pub const EnableAccess: u32 = 1; +pub const DisableAccess: u32 = 0; +pub const StaticGray: u32 = 0; +pub const GrayScale: u32 = 1; +pub const StaticColor: u32 = 2; +pub const PseudoColor: u32 = 3; +pub const TrueColor: u32 = 4; +pub const DirectColor: u32 = 5; +pub const LSBFirst: u32 = 0; +pub const MSBFirst: u32 = 1; +pub const XlibSpecificationRelease: u32 = 6; +pub const NeedFunctionPrototypes: u32 = 1; +pub const NeedVarargsPrototypes: u32 = 1; +pub const NeedNestedPrototypes: u32 = 1; +pub const FUNCPROTO: u32 = 15; +pub const NeedWidePrototypes: u32 = 0; +pub const X_HAVE_UTF8_STRING: u32 = 1; +pub const True: u32 = 1; +pub const False: u32 = 0; +pub const QueuedAlready: u32 = 0; +pub const QueuedAfterReading: u32 = 1; +pub const QueuedAfterFlush: u32 = 2; +pub const XNRequiredCharSet: &'static [u8; 16usize] = b"requiredCharSet\0"; +pub const XNQueryOrientation: &'static [u8; 17usize] = b"queryOrientation\0"; +pub const XNBaseFontName: &'static [u8; 13usize] = b"baseFontName\0"; +pub const XNOMAutomatic: &'static [u8; 12usize] = b"omAutomatic\0"; +pub const XNMissingCharSet: &'static [u8; 15usize] = b"missingCharSet\0"; +pub const XNDefaultString: &'static [u8; 14usize] = b"defaultString\0"; +pub const XNOrientation: &'static [u8; 12usize] = b"orientation\0"; +pub const XNDirectionalDependentDrawing: &'static [u8; 28usize] = b"directionalDependentDrawing\0"; +pub const XNContextualDrawing: &'static [u8; 18usize] = b"contextualDrawing\0"; +pub const XNFontInfo: &'static [u8; 9usize] = b"fontInfo\0"; +pub const XIMPreeditArea: u32 = 1; +pub const XIMPreeditCallbacks: u32 = 2; +pub const XIMPreeditPosition: u32 = 4; +pub const XIMPreeditNothing: u32 = 8; +pub const XIMPreeditNone: u32 = 16; +pub const XIMStatusArea: u32 = 256; +pub const XIMStatusCallbacks: u32 = 512; +pub const XIMStatusNothing: u32 = 1024; +pub const XIMStatusNone: u32 = 2048; +pub const XNVaNestedList: &'static [u8; 15usize] = b"XNVaNestedList\0"; +pub const XNQueryInputStyle: &'static [u8; 16usize] = b"queryInputStyle\0"; +pub const XNClientWindow: &'static [u8; 13usize] = b"clientWindow\0"; +pub const XNInputStyle: &'static [u8; 11usize] = b"inputStyle\0"; +pub const XNFocusWindow: &'static [u8; 12usize] = b"focusWindow\0"; +pub const XNResourceName: &'static [u8; 13usize] = b"resourceName\0"; +pub const XNResourceClass: &'static [u8; 14usize] = b"resourceClass\0"; +pub const XNGeometryCallback: &'static [u8; 17usize] = b"geometryCallback\0"; +pub const XNDestroyCallback: &'static [u8; 16usize] = b"destroyCallback\0"; +pub const XNFilterEvents: &'static [u8; 13usize] = b"filterEvents\0"; +pub const XNPreeditStartCallback: &'static [u8; 21usize] = b"preeditStartCallback\0"; +pub const XNPreeditDoneCallback: &'static [u8; 20usize] = b"preeditDoneCallback\0"; +pub const XNPreeditDrawCallback: &'static [u8; 20usize] = b"preeditDrawCallback\0"; +pub const XNPreeditCaretCallback: &'static [u8; 21usize] = b"preeditCaretCallback\0"; +pub const XNPreeditStateNotifyCallback: &'static [u8; 27usize] = b"preeditStateNotifyCallback\0"; +pub const XNPreeditAttributes: &'static [u8; 18usize] = b"preeditAttributes\0"; +pub const XNStatusStartCallback: &'static [u8; 20usize] = b"statusStartCallback\0"; +pub const XNStatusDoneCallback: &'static [u8; 19usize] = b"statusDoneCallback\0"; +pub const XNStatusDrawCallback: &'static [u8; 19usize] = b"statusDrawCallback\0"; +pub const XNStatusAttributes: &'static [u8; 17usize] = b"statusAttributes\0"; +pub const XNArea: &'static [u8; 5usize] = b"area\0"; +pub const XNAreaNeeded: &'static [u8; 11usize] = b"areaNeeded\0"; +pub const XNSpotLocation: &'static [u8; 13usize] = b"spotLocation\0"; +pub const XNColormap: &'static [u8; 9usize] = b"colorMap\0"; +pub const XNStdColormap: &'static [u8; 12usize] = b"stdColorMap\0"; +pub const XNForeground: &'static [u8; 11usize] = b"foreground\0"; +pub const XNBackground: &'static [u8; 11usize] = b"background\0"; +pub const XNBackgroundPixmap: &'static [u8; 17usize] = b"backgroundPixmap\0"; +pub const XNFontSet: &'static [u8; 8usize] = b"fontSet\0"; +pub const XNLineSpace: &'static [u8; 10usize] = b"lineSpace\0"; +pub const XNCursor: &'static [u8; 7usize] = b"cursor\0"; +pub const XNQueryIMValuesList: &'static [u8; 18usize] = b"queryIMValuesList\0"; +pub const XNQueryICValuesList: &'static [u8; 18usize] = b"queryICValuesList\0"; +pub const XNVisiblePosition: &'static [u8; 16usize] = b"visiblePosition\0"; +pub const XNR6PreeditCallback: &'static [u8; 18usize] = b"r6PreeditCallback\0"; +pub const XNStringConversionCallback: &'static [u8; 25usize] = b"stringConversionCallback\0"; +pub const XNStringConversion: &'static [u8; 17usize] = b"stringConversion\0"; +pub const XNResetState: &'static [u8; 11usize] = b"resetState\0"; +pub const XNHotKey: &'static [u8; 7usize] = b"hotKey\0"; +pub const XNHotKeyState: &'static [u8; 12usize] = b"hotKeyState\0"; +pub const XNPreeditState: &'static [u8; 13usize] = b"preeditState\0"; +pub const XNSeparatorofNestedList: &'static [u8; 22usize] = b"separatorofNestedList\0"; +pub const XBufferOverflow: i32 = -1; +pub const XLookupNone: u32 = 1; +pub const XLookupChars: u32 = 2; +pub const XLookupKeySym: u32 = 3; +pub const XLookupBoth: u32 = 4; +pub const XIMReverse: u32 = 1; +pub const XIMUnderline: u32 = 2; +pub const XIMHighlight: u32 = 4; +pub const XIMPrimary: u32 = 32; +pub const XIMSecondary: u32 = 64; +pub const XIMTertiary: u32 = 128; +pub const XIMVisibleToForward: u32 = 256; +pub const XIMVisibleToBackword: u32 = 512; +pub const XIMVisibleToCenter: u32 = 1024; +pub const XIMPreeditUnKnown: u32 = 0; +pub const XIMPreeditEnable: u32 = 1; +pub const XIMPreeditDisable: u32 = 2; +pub const XIMInitialState: u32 = 1; +pub const XIMPreserveState: u32 = 2; +pub const XIMStringConversionLeftEdge: u32 = 1; +pub const XIMStringConversionRightEdge: u32 = 2; +pub const XIMStringConversionTopEdge: u32 = 4; +pub const XIMStringConversionBottomEdge: u32 = 8; +pub const XIMStringConversionConcealed: u32 = 16; +pub const XIMStringConversionWrapped: u32 = 32; +pub const XIMStringConversionBuffer: u32 = 1; +pub const XIMStringConversionLine: u32 = 2; +pub const XIMStringConversionWord: u32 = 3; +pub const XIMStringConversionChar: u32 = 4; +pub const XIMStringConversionSubstitution: u32 = 1; +pub const XIMStringConversionRetrieval: u32 = 2; +pub const XIMHotKeyStateON: u32 = 1; +pub const XIMHotKeyStateOFF: u32 = 2; +pub const X_kbUseExtension: u32 = 0; +pub const X_kbSelectEvents: u32 = 1; +pub const X_kbBell: u32 = 3; +pub const X_kbGetState: u32 = 4; +pub const X_kbLatchLockState: u32 = 5; +pub const X_kbGetControls: u32 = 6; +pub const X_kbSetControls: u32 = 7; +pub const X_kbGetMap: u32 = 8; +pub const X_kbSetMap: u32 = 9; +pub const X_kbGetCompatMap: u32 = 10; +pub const X_kbSetCompatMap: u32 = 11; +pub const X_kbGetIndicatorState: u32 = 12; +pub const X_kbGetIndicatorMap: u32 = 13; +pub const X_kbSetIndicatorMap: u32 = 14; +pub const X_kbGetNamedIndicator: u32 = 15; +pub const X_kbSetNamedIndicator: u32 = 16; +pub const X_kbGetNames: u32 = 17; +pub const X_kbSetNames: u32 = 18; +pub const X_kbGetGeometry: u32 = 19; +pub const X_kbSetGeometry: u32 = 20; +pub const X_kbPerClientFlags: u32 = 21; +pub const X_kbListComponents: u32 = 22; +pub const X_kbGetKbdByName: u32 = 23; +pub const X_kbGetDeviceInfo: u32 = 24; +pub const X_kbSetDeviceInfo: u32 = 25; +pub const X_kbSetDebuggingFlags: u32 = 101; +pub const XkbEventCode: u32 = 0; +pub const XkbNumberEvents: u32 = 1; +pub const XkbNewKeyboardNotify: u32 = 0; +pub const XkbMapNotify: u32 = 1; +pub const XkbStateNotify: u32 = 2; +pub const XkbControlsNotify: u32 = 3; +pub const XkbIndicatorStateNotify: u32 = 4; +pub const XkbIndicatorMapNotify: u32 = 5; +pub const XkbNamesNotify: u32 = 6; +pub const XkbCompatMapNotify: u32 = 7; +pub const XkbBellNotify: u32 = 8; +pub const XkbActionMessage: u32 = 9; +pub const XkbAccessXNotify: u32 = 10; +pub const XkbExtensionDeviceNotify: u32 = 11; +pub const XkbNewKeyboardNotifyMask: u32 = 1; +pub const XkbMapNotifyMask: u32 = 2; +pub const XkbStateNotifyMask: u32 = 4; +pub const XkbControlsNotifyMask: u32 = 8; +pub const XkbIndicatorStateNotifyMask: u32 = 16; +pub const XkbIndicatorMapNotifyMask: u32 = 32; +pub const XkbNamesNotifyMask: u32 = 64; +pub const XkbCompatMapNotifyMask: u32 = 128; +pub const XkbBellNotifyMask: u32 = 256; +pub const XkbActionMessageMask: u32 = 512; +pub const XkbAccessXNotifyMask: u32 = 1024; +pub const XkbExtensionDeviceNotifyMask: u32 = 2048; +pub const XkbAllEventsMask: u32 = 4095; +pub const XkbNKN_KeycodesMask: u32 = 1; +pub const XkbNKN_GeometryMask: u32 = 2; +pub const XkbNKN_DeviceIDMask: u32 = 4; +pub const XkbAllNewKeyboardEventsMask: u32 = 7; +pub const XkbAXN_SKPress: u32 = 0; +pub const XkbAXN_SKAccept: u32 = 1; +pub const XkbAXN_SKReject: u32 = 2; +pub const XkbAXN_SKRelease: u32 = 3; +pub const XkbAXN_BKAccept: u32 = 4; +pub const XkbAXN_BKReject: u32 = 5; +pub const XkbAXN_AXKWarning: u32 = 6; +pub const XkbAXN_SKPressMask: u32 = 1; +pub const XkbAXN_SKAcceptMask: u32 = 2; +pub const XkbAXN_SKRejectMask: u32 = 4; +pub const XkbAXN_SKReleaseMask: u32 = 8; +pub const XkbAXN_BKAcceptMask: u32 = 16; +pub const XkbAXN_BKRejectMask: u32 = 32; +pub const XkbAXN_AXKWarningMask: u32 = 64; +pub const XkbAllAccessXEventsMask: u32 = 127; +pub const XkbAllBellEventsMask: u32 = 1; +pub const XkbAllActionMessagesMask: u32 = 1; +pub const XkbKeyboard: u32 = 0; +pub const XkbNumberErrors: u32 = 1; +pub const XkbErr_BadDevice: u32 = 255; +pub const XkbErr_BadClass: u32 = 254; +pub const XkbErr_BadId: u32 = 253; +pub const XkbClientMapMask: u32 = 1; +pub const XkbServerMapMask: u32 = 2; +pub const XkbCompatMapMask: u32 = 4; +pub const XkbIndicatorMapMask: u32 = 8; +pub const XkbNamesMask: u32 = 16; +pub const XkbGeometryMask: u32 = 32; +pub const XkbControlsMask: u32 = 64; +pub const XkbAllComponentsMask: u32 = 127; +pub const XkbModifierStateMask: u32 = 1; +pub const XkbModifierBaseMask: u32 = 2; +pub const XkbModifierLatchMask: u32 = 4; +pub const XkbModifierLockMask: u32 = 8; +pub const XkbGroupStateMask: u32 = 16; +pub const XkbGroupBaseMask: u32 = 32; +pub const XkbGroupLatchMask: u32 = 64; +pub const XkbGroupLockMask: u32 = 128; +pub const XkbCompatStateMask: u32 = 256; +pub const XkbGrabModsMask: u32 = 512; +pub const XkbCompatGrabModsMask: u32 = 1024; +pub const XkbLookupModsMask: u32 = 2048; +pub const XkbCompatLookupModsMask: u32 = 4096; +pub const XkbPointerButtonMask: u32 = 8192; +pub const XkbAllStateComponentsMask: u32 = 16383; +pub const XkbRepeatKeysMask: u32 = 1; +pub const XkbSlowKeysMask: u32 = 2; +pub const XkbBounceKeysMask: u32 = 4; +pub const XkbStickyKeysMask: u32 = 8; +pub const XkbMouseKeysMask: u32 = 16; +pub const XkbMouseKeysAccelMask: u32 = 32; +pub const XkbAccessXKeysMask: u32 = 64; +pub const XkbAccessXTimeoutMask: u32 = 128; +pub const XkbAccessXFeedbackMask: u32 = 256; +pub const XkbAudibleBellMask: u32 = 512; +pub const XkbOverlay1Mask: u32 = 1024; +pub const XkbOverlay2Mask: u32 = 2048; +pub const XkbIgnoreGroupLockMask: u32 = 4096; +pub const XkbGroupsWrapMask: u32 = 134217728; +pub const XkbInternalModsMask: u32 = 268435456; +pub const XkbIgnoreLockModsMask: u32 = 536870912; +pub const XkbPerKeyRepeatMask: u32 = 1073741824; +pub const XkbControlsEnabledMask: u32 = 2147483648; +pub const XkbAccessXOptionsMask: u32 = 264; +pub const XkbAllBooleanCtrlsMask: u32 = 8191; +pub const XkbAllControlsMask: u32 = 4160757759; +pub const XkbAllControlEventsMask: u32 = 4160757759; +pub const XkbAX_SKPressFBMask: u32 = 1; +pub const XkbAX_SKAcceptFBMask: u32 = 2; +pub const XkbAX_FeatureFBMask: u32 = 4; +pub const XkbAX_SlowWarnFBMask: u32 = 8; +pub const XkbAX_IndicatorFBMask: u32 = 16; +pub const XkbAX_StickyKeysFBMask: u32 = 32; +pub const XkbAX_TwoKeysMask: u32 = 64; +pub const XkbAX_LatchToLockMask: u32 = 128; +pub const XkbAX_SKReleaseFBMask: u32 = 256; +pub const XkbAX_SKRejectFBMask: u32 = 512; +pub const XkbAX_BKRejectFBMask: u32 = 1024; +pub const XkbAX_DumbBellFBMask: u32 = 2048; +pub const XkbAX_FBOptionsMask: u32 = 3903; +pub const XkbAX_SKOptionsMask: u32 = 192; +pub const XkbAX_AllOptionsMask: u32 = 4095; +pub const XkbUseCoreKbd: u32 = 256; +pub const XkbUseCorePtr: u32 = 512; +pub const XkbDfltXIClass: u32 = 768; +pub const XkbDfltXIId: u32 = 1024; +pub const XkbAllXIClasses: u32 = 1280; +pub const XkbAllXIIds: u32 = 1536; +pub const XkbXINone: u32 = 65280; +pub const XkbNoModifier: u32 = 255; +pub const XkbNoShiftLevel: u32 = 255; +pub const XkbNoShape: u32 = 255; +pub const XkbNoIndicator: u32 = 255; +pub const XkbNoModifierMask: u32 = 0; +pub const XkbAllModifiersMask: u32 = 255; +pub const XkbAllVirtualModsMask: u32 = 65535; +pub const XkbNumKbdGroups: u32 = 4; +pub const XkbMaxKbdGroup: u32 = 3; +pub const XkbMaxMouseKeysBtn: u32 = 4; +pub const XkbGroup1Index: u32 = 0; +pub const XkbGroup2Index: u32 = 1; +pub const XkbGroup3Index: u32 = 2; +pub const XkbGroup4Index: u32 = 3; +pub const XkbAnyGroup: u32 = 254; +pub const XkbAllGroups: u32 = 255; +pub const XkbGroup1Mask: u32 = 1; +pub const XkbGroup2Mask: u32 = 2; +pub const XkbGroup3Mask: u32 = 4; +pub const XkbGroup4Mask: u32 = 8; +pub const XkbAnyGroupMask: u32 = 128; +pub const XkbAllGroupsMask: u32 = 15; +pub const XkbWrapIntoRange: u32 = 0; +pub const XkbClampIntoRange: u32 = 64; +pub const XkbRedirectIntoRange: u32 = 128; +pub const XkbSA_ClearLocks: u32 = 1; +pub const XkbSA_LatchToLock: u32 = 2; +pub const XkbSA_LockNoLock: u32 = 1; +pub const XkbSA_LockNoUnlock: u32 = 2; +pub const XkbSA_UseModMapMods: u32 = 4; +pub const XkbSA_GroupAbsolute: u32 = 4; +pub const XkbSA_UseDfltButton: u32 = 0; +pub const XkbSA_NoAcceleration: u32 = 1; +pub const XkbSA_MoveAbsoluteX: u32 = 2; +pub const XkbSA_MoveAbsoluteY: u32 = 4; +pub const XkbSA_ISODfltIsGroup: u32 = 128; +pub const XkbSA_ISONoAffectMods: u32 = 64; +pub const XkbSA_ISONoAffectGroup: u32 = 32; +pub const XkbSA_ISONoAffectPtr: u32 = 16; +pub const XkbSA_ISONoAffectCtrls: u32 = 8; +pub const XkbSA_ISOAffectMask: u32 = 120; +pub const XkbSA_MessageOnPress: u32 = 1; +pub const XkbSA_MessageOnRelease: u32 = 2; +pub const XkbSA_MessageGenKeyEvent: u32 = 4; +pub const XkbSA_AffectDfltBtn: u32 = 1; +pub const XkbSA_DfltBtnAbsolute: u32 = 4; +pub const XkbSA_SwitchApplication: u32 = 1; +pub const XkbSA_SwitchAbsolute: u32 = 4; +pub const XkbSA_IgnoreVal: u32 = 0; +pub const XkbSA_SetValMin: u32 = 16; +pub const XkbSA_SetValCenter: u32 = 32; +pub const XkbSA_SetValMax: u32 = 48; +pub const XkbSA_SetValRelative: u32 = 64; +pub const XkbSA_SetValAbsolute: u32 = 80; +pub const XkbSA_ValOpMask: u32 = 112; +pub const XkbSA_ValScaleMask: u32 = 7; +pub const XkbSA_NoAction: u32 = 0; +pub const XkbSA_SetMods: u32 = 1; +pub const XkbSA_LatchMods: u32 = 2; +pub const XkbSA_LockMods: u32 = 3; +pub const XkbSA_SetGroup: u32 = 4; +pub const XkbSA_LatchGroup: u32 = 5; +pub const XkbSA_LockGroup: u32 = 6; +pub const XkbSA_MovePtr: u32 = 7; +pub const XkbSA_PtrBtn: u32 = 8; +pub const XkbSA_LockPtrBtn: u32 = 9; +pub const XkbSA_SetPtrDflt: u32 = 10; +pub const XkbSA_ISOLock: u32 = 11; +pub const XkbSA_Terminate: u32 = 12; +pub const XkbSA_SwitchScreen: u32 = 13; +pub const XkbSA_SetControls: u32 = 14; +pub const XkbSA_LockControls: u32 = 15; +pub const XkbSA_ActionMessage: u32 = 16; +pub const XkbSA_RedirectKey: u32 = 17; +pub const XkbSA_DeviceBtn: u32 = 18; +pub const XkbSA_LockDeviceBtn: u32 = 19; +pub const XkbSA_DeviceValuator: u32 = 20; +pub const XkbSA_LastAction: u32 = 20; +pub const XkbSA_NumActions: u32 = 21; +pub const XkbSA_XFree86Private: u32 = 134; +pub const XkbSA_BreakLatch: u32 = 1045249; +pub const XkbKB_Permanent: u32 = 128; +pub const XkbKB_OpMask: u32 = 127; +pub const XkbKB_Default: u32 = 0; +pub const XkbKB_Lock: u32 = 1; +pub const XkbKB_RadioGroup: u32 = 2; +pub const XkbKB_Overlay1: u32 = 3; +pub const XkbKB_Overlay2: u32 = 4; +pub const XkbKB_RGAllowNone: u32 = 128; +pub const XkbMinLegalKeyCode: u32 = 8; +pub const XkbMaxLegalKeyCode: u32 = 255; +pub const XkbMaxKeyCount: u32 = 248; +pub const XkbPerKeyBitArraySize: u32 = 32; +pub const XkbNumModifiers: u32 = 8; +pub const XkbNumVirtualMods: u32 = 16; +pub const XkbNumIndicators: u32 = 32; +pub const XkbAllIndicatorsMask: u32 = 4294967295; +pub const XkbMaxRadioGroups: u32 = 32; +pub const XkbAllRadioGroupsMask: u32 = 4294967295; +pub const XkbMaxShiftLevel: u32 = 63; +pub const XkbMaxSymsPerKey: u32 = 252; +pub const XkbRGMaxMembers: u32 = 12; +pub const XkbActionMessageLength: u32 = 6; +pub const XkbKeyNameLength: u32 = 4; +pub const XkbMaxRedirectCount: u32 = 8; +pub const XkbGeomPtsPerMM: u32 = 10; +pub const XkbGeomMaxColors: u32 = 32; +pub const XkbGeomMaxLabelColors: u32 = 3; +pub const XkbGeomMaxPriority: u32 = 255; +pub const XkbOneLevelIndex: u32 = 0; +pub const XkbTwoLevelIndex: u32 = 1; +pub const XkbAlphabeticIndex: u32 = 2; +pub const XkbKeypadIndex: u32 = 3; +pub const XkbLastRequiredType: u32 = 3; +pub const XkbNumRequiredTypes: u32 = 4; +pub const XkbMaxKeyTypes: u32 = 255; +pub const XkbOneLevelMask: u32 = 1; +pub const XkbTwoLevelMask: u32 = 2; +pub const XkbAlphabeticMask: u32 = 4; +pub const XkbKeypadMask: u32 = 8; +pub const XkbAllRequiredTypes: u32 = 15; +pub const XkbName: &'static [u8; 10usize] = b"XKEYBOARD\0"; +pub const XkbMajorVersion: u32 = 1; +pub const XkbMinorVersion: u32 = 0; +pub const XkbExplicitKeyTypesMask: u32 = 15; +pub const XkbExplicitKeyType1Mask: u32 = 1; +pub const XkbExplicitKeyType2Mask: u32 = 2; +pub const XkbExplicitKeyType3Mask: u32 = 4; +pub const XkbExplicitKeyType4Mask: u32 = 8; +pub const XkbExplicitInterpretMask: u32 = 16; +pub const XkbExplicitAutoRepeatMask: u32 = 32; +pub const XkbExplicitBehaviorMask: u32 = 64; +pub const XkbExplicitVModMapMask: u32 = 128; +pub const XkbAllExplicitMask: u32 = 255; +pub const XkbKeyTypesMask: u32 = 1; +pub const XkbKeySymsMask: u32 = 2; +pub const XkbModifierMapMask: u32 = 4; +pub const XkbExplicitComponentsMask: u32 = 8; +pub const XkbKeyActionsMask: u32 = 16; +pub const XkbKeyBehaviorsMask: u32 = 32; +pub const XkbVirtualModsMask: u32 = 64; +pub const XkbVirtualModMapMask: u32 = 128; +pub const XkbAllClientInfoMask: u32 = 7; +pub const XkbAllServerInfoMask: u32 = 248; +pub const XkbAllMapComponentsMask: u32 = 255; +pub const XkbSI_AutoRepeat: u32 = 1; +pub const XkbSI_LockingKey: u32 = 2; +pub const XkbSI_LevelOneOnly: u32 = 128; +pub const XkbSI_OpMask: u32 = 127; +pub const XkbSI_NoneOf: u32 = 0; +pub const XkbSI_AnyOfOrNone: u32 = 1; +pub const XkbSI_AnyOf: u32 = 2; +pub const XkbSI_AllOf: u32 = 3; +pub const XkbSI_Exactly: u32 = 4; +pub const XkbIM_NoExplicit: u32 = 128; +pub const XkbIM_NoAutomatic: u32 = 64; +pub const XkbIM_LEDDrivesKB: u32 = 32; +pub const XkbIM_UseBase: u32 = 1; +pub const XkbIM_UseLatched: u32 = 2; +pub const XkbIM_UseLocked: u32 = 4; +pub const XkbIM_UseEffective: u32 = 8; +pub const XkbIM_UseCompat: u32 = 16; +pub const XkbIM_UseNone: u32 = 0; +pub const XkbIM_UseAnyGroup: u32 = 15; +pub const XkbIM_UseAnyMods: u32 = 31; +pub const XkbSymInterpMask: u32 = 1; +pub const XkbGroupCompatMask: u32 = 2; +pub const XkbAllCompatMask: u32 = 3; +pub const XkbKeycodesNameMask: u32 = 1; +pub const XkbGeometryNameMask: u32 = 2; +pub const XkbSymbolsNameMask: u32 = 4; +pub const XkbPhysSymbolsNameMask: u32 = 8; +pub const XkbTypesNameMask: u32 = 16; +pub const XkbCompatNameMask: u32 = 32; +pub const XkbKeyTypeNamesMask: u32 = 64; +pub const XkbKTLevelNamesMask: u32 = 128; +pub const XkbIndicatorNamesMask: u32 = 256; +pub const XkbKeyNamesMask: u32 = 512; +pub const XkbKeyAliasesMask: u32 = 1024; +pub const XkbVirtualModNamesMask: u32 = 2048; +pub const XkbGroupNamesMask: u32 = 4096; +pub const XkbRGNamesMask: u32 = 8192; +pub const XkbComponentNamesMask: u32 = 63; +pub const XkbAllNamesMask: u32 = 16383; +pub const XkbGBN_TypesMask: u32 = 1; +pub const XkbGBN_CompatMapMask: u32 = 2; +pub const XkbGBN_ClientSymbolsMask: u32 = 4; +pub const XkbGBN_ServerSymbolsMask: u32 = 8; +pub const XkbGBN_SymbolsMask: u32 = 12; +pub const XkbGBN_IndicatorMapMask: u32 = 16; +pub const XkbGBN_KeyNamesMask: u32 = 32; +pub const XkbGBN_GeometryMask: u32 = 64; +pub const XkbGBN_OtherNamesMask: u32 = 128; +pub const XkbGBN_AllComponentsMask: u32 = 255; +pub const XkbLC_Hidden: u32 = 1; +pub const XkbLC_Default: u32 = 2; +pub const XkbLC_Partial: u32 = 4; +pub const XkbLC_AlphanumericKeys: u32 = 256; +pub const XkbLC_ModifierKeys: u32 = 512; +pub const XkbLC_KeypadKeys: u32 = 1024; +pub const XkbLC_FunctionKeys: u32 = 2048; +pub const XkbLC_AlternateGroup: u32 = 4096; +pub const XkbXI_KeyboardsMask: u32 = 1; +pub const XkbXI_ButtonActionsMask: u32 = 2; +pub const XkbXI_IndicatorNamesMask: u32 = 4; +pub const XkbXI_IndicatorMapsMask: u32 = 8; +pub const XkbXI_IndicatorStateMask: u32 = 16; +pub const XkbXI_UnsupportedFeatureMask: u32 = 32768; +pub const XkbXI_AllFeaturesMask: u32 = 31; +pub const XkbXI_AllDeviceFeaturesMask: u32 = 30; +pub const XkbXI_IndicatorsMask: u32 = 28; +pub const XkbAllExtensionDeviceEventsMask: u32 = 32799; +pub const XkbPCF_DetectableAutoRepeatMask: u32 = 1; +pub const XkbPCF_GrabsUseXKBStateMask: u32 = 2; +pub const XkbPCF_AutoResetControlsMask: u32 = 4; +pub const XkbPCF_LookupStateWhenGrabbed: u32 = 8; +pub const XkbPCF_SendEventUsesXKBState: u32 = 16; +pub const XkbPCF_AllFlagsMask: u32 = 31; +pub const XkbDF_DisableLocks: u32 = 1; +pub const XkbAnyActionDataSize: u32 = 7; +pub const XkbOD_Success: u32 = 0; +pub const XkbOD_BadLibraryVersion: u32 = 1; +pub const XkbOD_ConnectionRefused: u32 = 2; +pub const XkbOD_NonXkbServer: u32 = 3; +pub const XkbOD_BadServerVersion: u32 = 4; +pub const XkbLC_ForceLatin1Lookup: u32 = 1; +pub const XkbLC_ConsumeLookupMods: u32 = 2; +pub const XkbLC_AlwaysConsumeShiftAndLock: u32 = 4; +pub const XkbLC_IgnoreNewKeyboards: u32 = 8; +pub const XkbLC_ControlFallback: u32 = 16; +pub const XkbLC_ConsumeKeysOnComposeFail: u32 = 536870912; +pub const XkbLC_ComposeLED: u32 = 1073741824; +pub const XkbLC_BeepOnComposeFail: u32 = 2147483648; +pub const XkbLC_AllComposeControls: u32 = 3221225472; +pub const XkbLC_AllControls: u32 = 3221225503; +pub const XrmEnumAllLevels: u32 = 0; +pub const XrmEnumOneLevel: u32 = 1; +pub const RANDR_NAME: &'static [u8; 6usize] = b"RANDR\0"; +pub const RANDR_MAJOR: u32 = 1; +pub const RANDR_MINOR: u32 = 6; +pub const RRNumberErrors: u32 = 5; +pub const RRNumberEvents: u32 = 2; +pub const RRNumberRequests: u32 = 47; +pub const X_RRQueryVersion: u32 = 0; +pub const X_RROldGetScreenInfo: u32 = 1; +pub const X_RR1_0SetScreenConfig: u32 = 2; +pub const X_RRSetScreenConfig: u32 = 2; +pub const X_RROldScreenChangeSelectInput: u32 = 3; +pub const X_RRSelectInput: u32 = 4; +pub const X_RRGetScreenInfo: u32 = 5; +pub const X_RRGetScreenSizeRange: u32 = 6; +pub const X_RRSetScreenSize: u32 = 7; +pub const X_RRGetScreenResources: u32 = 8; +pub const X_RRGetOutputInfo: u32 = 9; +pub const X_RRListOutputProperties: u32 = 10; +pub const X_RRQueryOutputProperty: u32 = 11; +pub const X_RRConfigureOutputProperty: u32 = 12; +pub const X_RRChangeOutputProperty: u32 = 13; +pub const X_RRDeleteOutputProperty: u32 = 14; +pub const X_RRGetOutputProperty: u32 = 15; +pub const X_RRCreateMode: u32 = 16; +pub const X_RRDestroyMode: u32 = 17; +pub const X_RRAddOutputMode: u32 = 18; +pub const X_RRDeleteOutputMode: u32 = 19; +pub const X_RRGetCrtcInfo: u32 = 20; +pub const X_RRSetCrtcConfig: u32 = 21; +pub const X_RRGetCrtcGammaSize: u32 = 22; +pub const X_RRGetCrtcGamma: u32 = 23; +pub const X_RRSetCrtcGamma: u32 = 24; +pub const X_RRGetScreenResourcesCurrent: u32 = 25; +pub const X_RRSetCrtcTransform: u32 = 26; +pub const X_RRGetCrtcTransform: u32 = 27; +pub const X_RRGetPanning: u32 = 28; +pub const X_RRSetPanning: u32 = 29; +pub const X_RRSetOutputPrimary: u32 = 30; +pub const X_RRGetOutputPrimary: u32 = 31; +pub const RRTransformUnit: u32 = 1; +pub const RRTransformScaleUp: u32 = 2; +pub const RRTransformScaleDown: u32 = 4; +pub const RRTransformProjective: u32 = 8; +pub const X_RRGetProviders: u32 = 32; +pub const X_RRGetProviderInfo: u32 = 33; +pub const X_RRSetProviderOffloadSink: u32 = 34; +pub const X_RRSetProviderOutputSource: u32 = 35; +pub const X_RRListProviderProperties: u32 = 36; +pub const X_RRQueryProviderProperty: u32 = 37; +pub const X_RRConfigureProviderProperty: u32 = 38; +pub const X_RRChangeProviderProperty: u32 = 39; +pub const X_RRDeleteProviderProperty: u32 = 40; +pub const X_RRGetProviderProperty: u32 = 41; +pub const X_RRGetMonitors: u32 = 42; +pub const X_RRSetMonitor: u32 = 43; +pub const X_RRDeleteMonitor: u32 = 44; +pub const X_RRCreateLease: u32 = 45; +pub const X_RRFreeLease: u32 = 46; +pub const RRScreenChangeNotifyMask: u32 = 1; +pub const RRCrtcChangeNotifyMask: u32 = 2; +pub const RROutputChangeNotifyMask: u32 = 4; +pub const RROutputPropertyNotifyMask: u32 = 8; +pub const RRProviderChangeNotifyMask: u32 = 16; +pub const RRProviderPropertyNotifyMask: u32 = 32; +pub const RRResourceChangeNotifyMask: u32 = 64; +pub const RRLeaseNotifyMask: u32 = 128; +pub const RRScreenChangeNotify: u32 = 0; +pub const RRNotify: u32 = 1; +pub const RRNotify_CrtcChange: u32 = 0; +pub const RRNotify_OutputChange: u32 = 1; +pub const RRNotify_OutputProperty: u32 = 2; +pub const RRNotify_ProviderChange: u32 = 3; +pub const RRNotify_ProviderProperty: u32 = 4; +pub const RRNotify_ResourceChange: u32 = 5; +pub const RRNotify_Lease: u32 = 6; +pub const RR_Rotate_0: u32 = 1; +pub const RR_Rotate_90: u32 = 2; +pub const RR_Rotate_180: u32 = 4; +pub const RR_Rotate_270: u32 = 8; +pub const RR_Reflect_X: u32 = 16; +pub const RR_Reflect_Y: u32 = 32; +pub const RRSetConfigSuccess: u32 = 0; +pub const RRSetConfigInvalidConfigTime: u32 = 1; +pub const RRSetConfigInvalidTime: u32 = 2; +pub const RRSetConfigFailed: u32 = 3; +pub const RR_HSyncPositive: u32 = 1; +pub const RR_HSyncNegative: u32 = 2; +pub const RR_VSyncPositive: u32 = 4; +pub const RR_VSyncNegative: u32 = 8; +pub const RR_Interlace: u32 = 16; +pub const RR_DoubleScan: u32 = 32; +pub const RR_CSync: u32 = 64; +pub const RR_CSyncPositive: u32 = 128; +pub const RR_CSyncNegative: u32 = 256; +pub const RR_HSkewPresent: u32 = 512; +pub const RR_BCast: u32 = 1024; +pub const RR_PixelMultiplex: u32 = 2048; +pub const RR_DoubleClock: u32 = 4096; +pub const RR_ClockDivideBy2: u32 = 8192; +pub const RR_Connected: u32 = 0; +pub const RR_Disconnected: u32 = 1; +pub const RR_UnknownConnection: u32 = 2; +pub const BadRROutput: u32 = 0; +pub const BadRRCrtc: u32 = 1; +pub const BadRRMode: u32 = 2; +pub const BadRRProvider: u32 = 3; +pub const BadRRLease: u32 = 4; +pub const RR_PROPERTY_BACKLIGHT: &'static [u8; 10usize] = b"Backlight\0"; +pub const RR_PROPERTY_RANDR_EDID: &'static [u8; 5usize] = b"EDID\0"; +pub const RR_PROPERTY_SIGNAL_FORMAT: &'static [u8; 13usize] = b"SignalFormat\0"; +pub const RR_PROPERTY_SIGNAL_PROPERTIES: &'static [u8; 17usize] = b"SignalProperties\0"; +pub const RR_PROPERTY_CONNECTOR_TYPE: &'static [u8; 14usize] = b"ConnectorType\0"; +pub const RR_PROPERTY_CONNECTOR_NUMBER: &'static [u8; 16usize] = b"ConnectorNumber\0"; +pub const RR_PROPERTY_COMPATIBILITY_LIST: &'static [u8; 18usize] = b"CompatibilityList\0"; +pub const RR_PROPERTY_CLONE_LIST: &'static [u8; 10usize] = b"CloneList\0"; +pub const RR_PROPERTY_BORDER: &'static [u8; 7usize] = b"Border\0"; +pub const RR_PROPERTY_BORDER_DIMENSIONS: &'static [u8; 17usize] = b"BorderDimensions\0"; +pub const RR_PROPERTY_GUID: &'static [u8; 5usize] = b"GUID\0"; +pub const RR_PROPERTY_RANDR_TILE: &'static [u8; 5usize] = b"TILE\0"; +pub const RR_PROPERTY_NON_DESKTOP: &'static [u8; 12usize] = b"non-desktop\0"; +pub const RR_Capability_None: u32 = 0; +pub const RR_Capability_SourceOutput: u32 = 1; +pub const RR_Capability_SinkOutput: u32 = 2; +pub const RR_Capability_SourceOffload: u32 = 4; +pub const RR_Capability_SinkOffload: u32 = 8; +pub const XK_VoidSymbol: u32 = 16777215; +pub const XK_BackSpace: u32 = 65288; +pub const XK_Tab: u32 = 65289; +pub const XK_Linefeed: u32 = 65290; +pub const XK_Clear: u32 = 65291; +pub const XK_Return: u32 = 65293; +pub const XK_Pause: u32 = 65299; +pub const XK_Scroll_Lock: u32 = 65300; +pub const XK_Sys_Req: u32 = 65301; +pub const XK_Escape: u32 = 65307; +pub const XK_Delete: u32 = 65535; +pub const XK_Multi_key: u32 = 65312; +pub const XK_Codeinput: u32 = 65335; +pub const XK_SingleCandidate: u32 = 65340; +pub const XK_MultipleCandidate: u32 = 65341; +pub const XK_PreviousCandidate: u32 = 65342; +pub const XK_Kanji: u32 = 65313; +pub const XK_Muhenkan: u32 = 65314; +pub const XK_Henkan_Mode: u32 = 65315; +pub const XK_Henkan: u32 = 65315; +pub const XK_Romaji: u32 = 65316; +pub const XK_Hiragana: u32 = 65317; +pub const XK_Katakana: u32 = 65318; +pub const XK_Hiragana_Katakana: u32 = 65319; +pub const XK_Zenkaku: u32 = 65320; +pub const XK_Hankaku: u32 = 65321; +pub const XK_Zenkaku_Hankaku: u32 = 65322; +pub const XK_Touroku: u32 = 65323; +pub const XK_Massyo: u32 = 65324; +pub const XK_Kana_Lock: u32 = 65325; +pub const XK_Kana_Shift: u32 = 65326; +pub const XK_Eisu_Shift: u32 = 65327; +pub const XK_Eisu_toggle: u32 = 65328; +pub const XK_Kanji_Bangou: u32 = 65335; +pub const XK_Zen_Koho: u32 = 65341; +pub const XK_Mae_Koho: u32 = 65342; +pub const XK_Home: u32 = 65360; +pub const XK_Left: u32 = 65361; +pub const XK_Up: u32 = 65362; +pub const XK_Right: u32 = 65363; +pub const XK_Down: u32 = 65364; +pub const XK_Prior: u32 = 65365; +pub const XK_Page_Up: u32 = 65365; +pub const XK_Next: u32 = 65366; +pub const XK_Page_Down: u32 = 65366; +pub const XK_End: u32 = 65367; +pub const XK_Begin: u32 = 65368; +pub const XK_Select: u32 = 65376; +pub const XK_Print: u32 = 65377; +pub const XK_Execute: u32 = 65378; +pub const XK_Insert: u32 = 65379; +pub const XK_Undo: u32 = 65381; +pub const XK_Redo: u32 = 65382; +pub const XK_Menu: u32 = 65383; +pub const XK_Find: u32 = 65384; +pub const XK_Cancel: u32 = 65385; +pub const XK_Help: u32 = 65386; +pub const XK_Break: u32 = 65387; +pub const XK_Mode_switch: u32 = 65406; +pub const XK_script_switch: u32 = 65406; +pub const XK_Num_Lock: u32 = 65407; +pub const XK_KP_Space: u32 = 65408; +pub const XK_KP_Tab: u32 = 65417; +pub const XK_KP_Enter: u32 = 65421; +pub const XK_KP_F1: u32 = 65425; +pub const XK_KP_F2: u32 = 65426; +pub const XK_KP_F3: u32 = 65427; +pub const XK_KP_F4: u32 = 65428; +pub const XK_KP_Home: u32 = 65429; +pub const XK_KP_Left: u32 = 65430; +pub const XK_KP_Up: u32 = 65431; +pub const XK_KP_Right: u32 = 65432; +pub const XK_KP_Down: u32 = 65433; +pub const XK_KP_Prior: u32 = 65434; +pub const XK_KP_Page_Up: u32 = 65434; +pub const XK_KP_Next: u32 = 65435; +pub const XK_KP_Page_Down: u32 = 65435; +pub const XK_KP_End: u32 = 65436; +pub const XK_KP_Begin: u32 = 65437; +pub const XK_KP_Insert: u32 = 65438; +pub const XK_KP_Delete: u32 = 65439; +pub const XK_KP_Equal: u32 = 65469; +pub const XK_KP_Multiply: u32 = 65450; +pub const XK_KP_Add: u32 = 65451; +pub const XK_KP_Separator: u32 = 65452; +pub const XK_KP_Subtract: u32 = 65453; +pub const XK_KP_Decimal: u32 = 65454; +pub const XK_KP_Divide: u32 = 65455; +pub const XK_KP_0: u32 = 65456; +pub const XK_KP_1: u32 = 65457; +pub const XK_KP_2: u32 = 65458; +pub const XK_KP_3: u32 = 65459; +pub const XK_KP_4: u32 = 65460; +pub const XK_KP_5: u32 = 65461; +pub const XK_KP_6: u32 = 65462; +pub const XK_KP_7: u32 = 65463; +pub const XK_KP_8: u32 = 65464; +pub const XK_KP_9: u32 = 65465; +pub const XK_F1: u32 = 65470; +pub const XK_F2: u32 = 65471; +pub const XK_F3: u32 = 65472; +pub const XK_F4: u32 = 65473; +pub const XK_F5: u32 = 65474; +pub const XK_F6: u32 = 65475; +pub const XK_F7: u32 = 65476; +pub const XK_F8: u32 = 65477; +pub const XK_F9: u32 = 65478; +pub const XK_F10: u32 = 65479; +pub const XK_F11: u32 = 65480; +pub const XK_L1: u32 = 65480; +pub const XK_F12: u32 = 65481; +pub const XK_L2: u32 = 65481; +pub const XK_F13: u32 = 65482; +pub const XK_L3: u32 = 65482; +pub const XK_F14: u32 = 65483; +pub const XK_L4: u32 = 65483; +pub const XK_F15: u32 = 65484; +pub const XK_L5: u32 = 65484; +pub const XK_F16: u32 = 65485; +pub const XK_L6: u32 = 65485; +pub const XK_F17: u32 = 65486; +pub const XK_L7: u32 = 65486; +pub const XK_F18: u32 = 65487; +pub const XK_L8: u32 = 65487; +pub const XK_F19: u32 = 65488; +pub const XK_L9: u32 = 65488; +pub const XK_F20: u32 = 65489; +pub const XK_L10: u32 = 65489; +pub const XK_F21: u32 = 65490; +pub const XK_R1: u32 = 65490; +pub const XK_F22: u32 = 65491; +pub const XK_R2: u32 = 65491; +pub const XK_F23: u32 = 65492; +pub const XK_R3: u32 = 65492; +pub const XK_F24: u32 = 65493; +pub const XK_R4: u32 = 65493; +pub const XK_F25: u32 = 65494; +pub const XK_R5: u32 = 65494; +pub const XK_F26: u32 = 65495; +pub const XK_R6: u32 = 65495; +pub const XK_F27: u32 = 65496; +pub const XK_R7: u32 = 65496; +pub const XK_F28: u32 = 65497; +pub const XK_R8: u32 = 65497; +pub const XK_F29: u32 = 65498; +pub const XK_R9: u32 = 65498; +pub const XK_F30: u32 = 65499; +pub const XK_R10: u32 = 65499; +pub const XK_F31: u32 = 65500; +pub const XK_R11: u32 = 65500; +pub const XK_F32: u32 = 65501; +pub const XK_R12: u32 = 65501; +pub const XK_F33: u32 = 65502; +pub const XK_R13: u32 = 65502; +pub const XK_F34: u32 = 65503; +pub const XK_R14: u32 = 65503; +pub const XK_F35: u32 = 65504; +pub const XK_R15: u32 = 65504; +pub const XK_Shift_L: u32 = 65505; +pub const XK_Shift_R: u32 = 65506; +pub const XK_Control_L: u32 = 65507; +pub const XK_Control_R: u32 = 65508; +pub const XK_Caps_Lock: u32 = 65509; +pub const XK_Shift_Lock: u32 = 65510; +pub const XK_Meta_L: u32 = 65511; +pub const XK_Meta_R: u32 = 65512; +pub const XK_Alt_L: u32 = 65513; +pub const XK_Alt_R: u32 = 65514; +pub const XK_Super_L: u32 = 65515; +pub const XK_Super_R: u32 = 65516; +pub const XK_Hyper_L: u32 = 65517; +pub const XK_Hyper_R: u32 = 65518; +pub const XK_ISO_Lock: u32 = 65025; +pub const XK_ISO_Level2_Latch: u32 = 65026; +pub const XK_ISO_Level3_Shift: u32 = 65027; +pub const XK_ISO_Level3_Latch: u32 = 65028; +pub const XK_ISO_Level3_Lock: u32 = 65029; +pub const XK_ISO_Level5_Shift: u32 = 65041; +pub const XK_ISO_Level5_Latch: u32 = 65042; +pub const XK_ISO_Level5_Lock: u32 = 65043; +pub const XK_ISO_Group_Shift: u32 = 65406; +pub const XK_ISO_Group_Latch: u32 = 65030; +pub const XK_ISO_Group_Lock: u32 = 65031; +pub const XK_ISO_Next_Group: u32 = 65032; +pub const XK_ISO_Next_Group_Lock: u32 = 65033; +pub const XK_ISO_Prev_Group: u32 = 65034; +pub const XK_ISO_Prev_Group_Lock: u32 = 65035; +pub const XK_ISO_First_Group: u32 = 65036; +pub const XK_ISO_First_Group_Lock: u32 = 65037; +pub const XK_ISO_Last_Group: u32 = 65038; +pub const XK_ISO_Last_Group_Lock: u32 = 65039; +pub const XK_ISO_Left_Tab: u32 = 65056; +pub const XK_ISO_Move_Line_Up: u32 = 65057; +pub const XK_ISO_Move_Line_Down: u32 = 65058; +pub const XK_ISO_Partial_Line_Up: u32 = 65059; +pub const XK_ISO_Partial_Line_Down: u32 = 65060; +pub const XK_ISO_Partial_Space_Left: u32 = 65061; +pub const XK_ISO_Partial_Space_Right: u32 = 65062; +pub const XK_ISO_Set_Margin_Left: u32 = 65063; +pub const XK_ISO_Set_Margin_Right: u32 = 65064; +pub const XK_ISO_Release_Margin_Left: u32 = 65065; +pub const XK_ISO_Release_Margin_Right: u32 = 65066; +pub const XK_ISO_Release_Both_Margins: u32 = 65067; +pub const XK_ISO_Fast_Cursor_Left: u32 = 65068; +pub const XK_ISO_Fast_Cursor_Right: u32 = 65069; +pub const XK_ISO_Fast_Cursor_Up: u32 = 65070; +pub const XK_ISO_Fast_Cursor_Down: u32 = 65071; +pub const XK_ISO_Continuous_Underline: u32 = 65072; +pub const XK_ISO_Discontinuous_Underline: u32 = 65073; +pub const XK_ISO_Emphasize: u32 = 65074; +pub const XK_ISO_Center_Object: u32 = 65075; +pub const XK_ISO_Enter: u32 = 65076; +pub const XK_dead_grave: u32 = 65104; +pub const XK_dead_acute: u32 = 65105; +pub const XK_dead_circumflex: u32 = 65106; +pub const XK_dead_tilde: u32 = 65107; +pub const XK_dead_perispomeni: u32 = 65107; +pub const XK_dead_macron: u32 = 65108; +pub const XK_dead_breve: u32 = 65109; +pub const XK_dead_abovedot: u32 = 65110; +pub const XK_dead_diaeresis: u32 = 65111; +pub const XK_dead_abovering: u32 = 65112; +pub const XK_dead_doubleacute: u32 = 65113; +pub const XK_dead_caron: u32 = 65114; +pub const XK_dead_cedilla: u32 = 65115; +pub const XK_dead_ogonek: u32 = 65116; +pub const XK_dead_iota: u32 = 65117; +pub const XK_dead_voiced_sound: u32 = 65118; +pub const XK_dead_semivoiced_sound: u32 = 65119; +pub const XK_dead_belowdot: u32 = 65120; +pub const XK_dead_hook: u32 = 65121; +pub const XK_dead_horn: u32 = 65122; +pub const XK_dead_stroke: u32 = 65123; +pub const XK_dead_abovecomma: u32 = 65124; +pub const XK_dead_psili: u32 = 65124; +pub const XK_dead_abovereversedcomma: u32 = 65125; +pub const XK_dead_dasia: u32 = 65125; +pub const XK_dead_doublegrave: u32 = 65126; +pub const XK_dead_belowring: u32 = 65127; +pub const XK_dead_belowmacron: u32 = 65128; +pub const XK_dead_belowcircumflex: u32 = 65129; +pub const XK_dead_belowtilde: u32 = 65130; +pub const XK_dead_belowbreve: u32 = 65131; +pub const XK_dead_belowdiaeresis: u32 = 65132; +pub const XK_dead_invertedbreve: u32 = 65133; +pub const XK_dead_belowcomma: u32 = 65134; +pub const XK_dead_currency: u32 = 65135; +pub const XK_dead_lowline: u32 = 65168; +pub const XK_dead_aboveverticalline: u32 = 65169; +pub const XK_dead_belowverticalline: u32 = 65170; +pub const XK_dead_longsolidusoverlay: u32 = 65171; +pub const XK_dead_a: u32 = 65152; +pub const XK_dead_A: u32 = 65153; +pub const XK_dead_e: u32 = 65154; +pub const XK_dead_E: u32 = 65155; +pub const XK_dead_i: u32 = 65156; +pub const XK_dead_I: u32 = 65157; +pub const XK_dead_o: u32 = 65158; +pub const XK_dead_O: u32 = 65159; +pub const XK_dead_u: u32 = 65160; +pub const XK_dead_U: u32 = 65161; +pub const XK_dead_small_schwa: u32 = 65162; +pub const XK_dead_capital_schwa: u32 = 65163; +pub const XK_dead_greek: u32 = 65164; +pub const XK_First_Virtual_Screen: u32 = 65232; +pub const XK_Prev_Virtual_Screen: u32 = 65233; +pub const XK_Next_Virtual_Screen: u32 = 65234; +pub const XK_Last_Virtual_Screen: u32 = 65236; +pub const XK_Terminate_Server: u32 = 65237; +pub const XK_AccessX_Enable: u32 = 65136; +pub const XK_AccessX_Feedback_Enable: u32 = 65137; +pub const XK_RepeatKeys_Enable: u32 = 65138; +pub const XK_SlowKeys_Enable: u32 = 65139; +pub const XK_BounceKeys_Enable: u32 = 65140; +pub const XK_StickyKeys_Enable: u32 = 65141; +pub const XK_MouseKeys_Enable: u32 = 65142; +pub const XK_MouseKeys_Accel_Enable: u32 = 65143; +pub const XK_Overlay1_Enable: u32 = 65144; +pub const XK_Overlay2_Enable: u32 = 65145; +pub const XK_AudibleBell_Enable: u32 = 65146; +pub const XK_Pointer_Left: u32 = 65248; +pub const XK_Pointer_Right: u32 = 65249; +pub const XK_Pointer_Up: u32 = 65250; +pub const XK_Pointer_Down: u32 = 65251; +pub const XK_Pointer_UpLeft: u32 = 65252; +pub const XK_Pointer_UpRight: u32 = 65253; +pub const XK_Pointer_DownLeft: u32 = 65254; +pub const XK_Pointer_DownRight: u32 = 65255; +pub const XK_Pointer_Button_Dflt: u32 = 65256; +pub const XK_Pointer_Button1: u32 = 65257; +pub const XK_Pointer_Button2: u32 = 65258; +pub const XK_Pointer_Button3: u32 = 65259; +pub const XK_Pointer_Button4: u32 = 65260; +pub const XK_Pointer_Button5: u32 = 65261; +pub const XK_Pointer_DblClick_Dflt: u32 = 65262; +pub const XK_Pointer_DblClick1: u32 = 65263; +pub const XK_Pointer_DblClick2: u32 = 65264; +pub const XK_Pointer_DblClick3: u32 = 65265; +pub const XK_Pointer_DblClick4: u32 = 65266; +pub const XK_Pointer_DblClick5: u32 = 65267; +pub const XK_Pointer_Drag_Dflt: u32 = 65268; +pub const XK_Pointer_Drag1: u32 = 65269; +pub const XK_Pointer_Drag2: u32 = 65270; +pub const XK_Pointer_Drag3: u32 = 65271; +pub const XK_Pointer_Drag4: u32 = 65272; +pub const XK_Pointer_Drag5: u32 = 65277; +pub const XK_Pointer_EnableKeys: u32 = 65273; +pub const XK_Pointer_Accelerate: u32 = 65274; +pub const XK_Pointer_DfltBtnNext: u32 = 65275; +pub const XK_Pointer_DfltBtnPrev: u32 = 65276; +pub const XK_ch: u32 = 65184; +pub const XK_Ch: u32 = 65185; +pub const XK_CH: u32 = 65186; +pub const XK_c_h: u32 = 65187; +pub const XK_C_h: u32 = 65188; +pub const XK_C_H: u32 = 65189; +pub const XK_space: u32 = 32; +pub const XK_exclam: u32 = 33; +pub const XK_quotedbl: u32 = 34; +pub const XK_numbersign: u32 = 35; +pub const XK_dollar: u32 = 36; +pub const XK_percent: u32 = 37; +pub const XK_ampersand: u32 = 38; +pub const XK_apostrophe: u32 = 39; +pub const XK_quoteright: u32 = 39; +pub const XK_parenleft: u32 = 40; +pub const XK_parenright: u32 = 41; +pub const XK_asterisk: u32 = 42; +pub const XK_plus: u32 = 43; +pub const XK_comma: u32 = 44; +pub const XK_minus: u32 = 45; +pub const XK_period: u32 = 46; +pub const XK_slash: u32 = 47; +pub const XK_0: u32 = 48; +pub const XK_1: u32 = 49; +pub const XK_2: u32 = 50; +pub const XK_3: u32 = 51; +pub const XK_4: u32 = 52; +pub const XK_5: u32 = 53; +pub const XK_6: u32 = 54; +pub const XK_7: u32 = 55; +pub const XK_8: u32 = 56; +pub const XK_9: u32 = 57; +pub const XK_colon: u32 = 58; +pub const XK_semicolon: u32 = 59; +pub const XK_less: u32 = 60; +pub const XK_equal: u32 = 61; +pub const XK_greater: u32 = 62; +pub const XK_question: u32 = 63; +pub const XK_at: u32 = 64; +pub const XK_A: u32 = 65; +pub const XK_B: u32 = 66; +pub const XK_C: u32 = 67; +pub const XK_D: u32 = 68; +pub const XK_E: u32 = 69; +pub const XK_F: u32 = 70; +pub const XK_G: u32 = 71; +pub const XK_H: u32 = 72; +pub const XK_I: u32 = 73; +pub const XK_J: u32 = 74; +pub const XK_K: u32 = 75; +pub const XK_L: u32 = 76; +pub const XK_M: u32 = 77; +pub const XK_N: u32 = 78; +pub const XK_O: u32 = 79; +pub const XK_P: u32 = 80; +pub const XK_Q: u32 = 81; +pub const XK_R: u32 = 82; +pub const XK_S: u32 = 83; +pub const XK_T: u32 = 84; +pub const XK_U: u32 = 85; +pub const XK_V: u32 = 86; +pub const XK_W: u32 = 87; +pub const XK_X: u32 = 88; +pub const XK_Y: u32 = 89; +pub const XK_Z: u32 = 90; +pub const XK_bracketleft: u32 = 91; +pub const XK_backslash: u32 = 92; +pub const XK_bracketright: u32 = 93; +pub const XK_asciicircum: u32 = 94; +pub const XK_underscore: u32 = 95; +pub const XK_grave: u32 = 96; +pub const XK_quoteleft: u32 = 96; +pub const XK_a: u32 = 97; +pub const XK_b: u32 = 98; +pub const XK_c: u32 = 99; +pub const XK_d: u32 = 100; +pub const XK_e: u32 = 101; +pub const XK_f: u32 = 102; +pub const XK_g: u32 = 103; +pub const XK_h: u32 = 104; +pub const XK_i: u32 = 105; +pub const XK_j: u32 = 106; +pub const XK_k: u32 = 107; +pub const XK_l: u32 = 108; +pub const XK_m: u32 = 109; +pub const XK_n: u32 = 110; +pub const XK_o: u32 = 111; +pub const XK_p: u32 = 112; +pub const XK_q: u32 = 113; +pub const XK_r: u32 = 114; +pub const XK_s: u32 = 115; +pub const XK_t: u32 = 116; +pub const XK_u: u32 = 117; +pub const XK_v: u32 = 118; +pub const XK_w: u32 = 119; +pub const XK_x: u32 = 120; +pub const XK_y: u32 = 121; +pub const XK_z: u32 = 122; +pub const XK_braceleft: u32 = 123; +pub const XK_bar: u32 = 124; +pub const XK_braceright: u32 = 125; +pub const XK_asciitilde: u32 = 126; +pub const XK_nobreakspace: u32 = 160; +pub const XK_exclamdown: u32 = 161; +pub const XK_cent: u32 = 162; +pub const XK_sterling: u32 = 163; +pub const XK_currency: u32 = 164; +pub const XK_yen: u32 = 165; +pub const XK_brokenbar: u32 = 166; +pub const XK_section: u32 = 167; +pub const XK_diaeresis: u32 = 168; +pub const XK_copyright: u32 = 169; +pub const XK_ordfeminine: u32 = 170; +pub const XK_guillemotleft: u32 = 171; +pub const XK_notsign: u32 = 172; +pub const XK_hyphen: u32 = 173; +pub const XK_registered: u32 = 174; +pub const XK_macron: u32 = 175; +pub const XK_degree: u32 = 176; +pub const XK_plusminus: u32 = 177; +pub const XK_twosuperior: u32 = 178; +pub const XK_threesuperior: u32 = 179; +pub const XK_acute: u32 = 180; +pub const XK_mu: u32 = 181; +pub const XK_paragraph: u32 = 182; +pub const XK_periodcentered: u32 = 183; +pub const XK_cedilla: u32 = 184; +pub const XK_onesuperior: u32 = 185; +pub const XK_masculine: u32 = 186; +pub const XK_guillemotright: u32 = 187; +pub const XK_onequarter: u32 = 188; +pub const XK_onehalf: u32 = 189; +pub const XK_threequarters: u32 = 190; +pub const XK_questiondown: u32 = 191; +pub const XK_Agrave: u32 = 192; +pub const XK_Aacute: u32 = 193; +pub const XK_Acircumflex: u32 = 194; +pub const XK_Atilde: u32 = 195; +pub const XK_Adiaeresis: u32 = 196; +pub const XK_Aring: u32 = 197; +pub const XK_AE: u32 = 198; +pub const XK_Ccedilla: u32 = 199; +pub const XK_Egrave: u32 = 200; +pub const XK_Eacute: u32 = 201; +pub const XK_Ecircumflex: u32 = 202; +pub const XK_Ediaeresis: u32 = 203; +pub const XK_Igrave: u32 = 204; +pub const XK_Iacute: u32 = 205; +pub const XK_Icircumflex: u32 = 206; +pub const XK_Idiaeresis: u32 = 207; +pub const XK_ETH: u32 = 208; +pub const XK_Eth: u32 = 208; +pub const XK_Ntilde: u32 = 209; +pub const XK_Ograve: u32 = 210; +pub const XK_Oacute: u32 = 211; +pub const XK_Ocircumflex: u32 = 212; +pub const XK_Otilde: u32 = 213; +pub const XK_Odiaeresis: u32 = 214; +pub const XK_multiply: u32 = 215; +pub const XK_Oslash: u32 = 216; +pub const XK_Ooblique: u32 = 216; +pub const XK_Ugrave: u32 = 217; +pub const XK_Uacute: u32 = 218; +pub const XK_Ucircumflex: u32 = 219; +pub const XK_Udiaeresis: u32 = 220; +pub const XK_Yacute: u32 = 221; +pub const XK_THORN: u32 = 222; +pub const XK_Thorn: u32 = 222; +pub const XK_ssharp: u32 = 223; +pub const XK_agrave: u32 = 224; +pub const XK_aacute: u32 = 225; +pub const XK_acircumflex: u32 = 226; +pub const XK_atilde: u32 = 227; +pub const XK_adiaeresis: u32 = 228; +pub const XK_aring: u32 = 229; +pub const XK_ae: u32 = 230; +pub const XK_ccedilla: u32 = 231; +pub const XK_egrave: u32 = 232; +pub const XK_eacute: u32 = 233; +pub const XK_ecircumflex: u32 = 234; +pub const XK_ediaeresis: u32 = 235; +pub const XK_igrave: u32 = 236; +pub const XK_iacute: u32 = 237; +pub const XK_icircumflex: u32 = 238; +pub const XK_idiaeresis: u32 = 239; +pub const XK_eth: u32 = 240; +pub const XK_ntilde: u32 = 241; +pub const XK_ograve: u32 = 242; +pub const XK_oacute: u32 = 243; +pub const XK_ocircumflex: u32 = 244; +pub const XK_otilde: u32 = 245; +pub const XK_odiaeresis: u32 = 246; +pub const XK_division: u32 = 247; +pub const XK_oslash: u32 = 248; +pub const XK_ooblique: u32 = 248; +pub const XK_ugrave: u32 = 249; +pub const XK_uacute: u32 = 250; +pub const XK_ucircumflex: u32 = 251; +pub const XK_udiaeresis: u32 = 252; +pub const XK_yacute: u32 = 253; +pub const XK_thorn: u32 = 254; +pub const XK_ydiaeresis: u32 = 255; +pub const XK_Aogonek: u32 = 417; +pub const XK_breve: u32 = 418; +pub const XK_Lstroke: u32 = 419; +pub const XK_Lcaron: u32 = 421; +pub const XK_Sacute: u32 = 422; +pub const XK_Scaron: u32 = 425; +pub const XK_Scedilla: u32 = 426; +pub const XK_Tcaron: u32 = 427; +pub const XK_Zacute: u32 = 428; +pub const XK_Zcaron: u32 = 430; +pub const XK_Zabovedot: u32 = 431; +pub const XK_aogonek: u32 = 433; +pub const XK_ogonek: u32 = 434; +pub const XK_lstroke: u32 = 435; +pub const XK_lcaron: u32 = 437; +pub const XK_sacute: u32 = 438; +pub const XK_caron: u32 = 439; +pub const XK_scaron: u32 = 441; +pub const XK_scedilla: u32 = 442; +pub const XK_tcaron: u32 = 443; +pub const XK_zacute: u32 = 444; +pub const XK_doubleacute: u32 = 445; +pub const XK_zcaron: u32 = 446; +pub const XK_zabovedot: u32 = 447; +pub const XK_Racute: u32 = 448; +pub const XK_Abreve: u32 = 451; +pub const XK_Lacute: u32 = 453; +pub const XK_Cacute: u32 = 454; +pub const XK_Ccaron: u32 = 456; +pub const XK_Eogonek: u32 = 458; +pub const XK_Ecaron: u32 = 460; +pub const XK_Dcaron: u32 = 463; +pub const XK_Dstroke: u32 = 464; +pub const XK_Nacute: u32 = 465; +pub const XK_Ncaron: u32 = 466; +pub const XK_Odoubleacute: u32 = 469; +pub const XK_Rcaron: u32 = 472; +pub const XK_Uring: u32 = 473; +pub const XK_Udoubleacute: u32 = 475; +pub const XK_Tcedilla: u32 = 478; +pub const XK_racute: u32 = 480; +pub const XK_abreve: u32 = 483; +pub const XK_lacute: u32 = 485; +pub const XK_cacute: u32 = 486; +pub const XK_ccaron: u32 = 488; +pub const XK_eogonek: u32 = 490; +pub const XK_ecaron: u32 = 492; +pub const XK_dcaron: u32 = 495; +pub const XK_dstroke: u32 = 496; +pub const XK_nacute: u32 = 497; +pub const XK_ncaron: u32 = 498; +pub const XK_odoubleacute: u32 = 501; +pub const XK_rcaron: u32 = 504; +pub const XK_uring: u32 = 505; +pub const XK_udoubleacute: u32 = 507; +pub const XK_tcedilla: u32 = 510; +pub const XK_abovedot: u32 = 511; +pub const XK_Hstroke: u32 = 673; +pub const XK_Hcircumflex: u32 = 678; +pub const XK_Iabovedot: u32 = 681; +pub const XK_Gbreve: u32 = 683; +pub const XK_Jcircumflex: u32 = 684; +pub const XK_hstroke: u32 = 689; +pub const XK_hcircumflex: u32 = 694; +pub const XK_idotless: u32 = 697; +pub const XK_gbreve: u32 = 699; +pub const XK_jcircumflex: u32 = 700; +pub const XK_Cabovedot: u32 = 709; +pub const XK_Ccircumflex: u32 = 710; +pub const XK_Gabovedot: u32 = 725; +pub const XK_Gcircumflex: u32 = 728; +pub const XK_Ubreve: u32 = 733; +pub const XK_Scircumflex: u32 = 734; +pub const XK_cabovedot: u32 = 741; +pub const XK_ccircumflex: u32 = 742; +pub const XK_gabovedot: u32 = 757; +pub const XK_gcircumflex: u32 = 760; +pub const XK_ubreve: u32 = 765; +pub const XK_scircumflex: u32 = 766; +pub const XK_kra: u32 = 930; +pub const XK_kappa: u32 = 930; +pub const XK_Rcedilla: u32 = 931; +pub const XK_Itilde: u32 = 933; +pub const XK_Lcedilla: u32 = 934; +pub const XK_Emacron: u32 = 938; +pub const XK_Gcedilla: u32 = 939; +pub const XK_Tslash: u32 = 940; +pub const XK_rcedilla: u32 = 947; +pub const XK_itilde: u32 = 949; +pub const XK_lcedilla: u32 = 950; +pub const XK_emacron: u32 = 954; +pub const XK_gcedilla: u32 = 955; +pub const XK_tslash: u32 = 956; +pub const XK_ENG: u32 = 957; +pub const XK_eng: u32 = 959; +pub const XK_Amacron: u32 = 960; +pub const XK_Iogonek: u32 = 967; +pub const XK_Eabovedot: u32 = 972; +pub const XK_Imacron: u32 = 975; +pub const XK_Ncedilla: u32 = 977; +pub const XK_Omacron: u32 = 978; +pub const XK_Kcedilla: u32 = 979; +pub const XK_Uogonek: u32 = 985; +pub const XK_Utilde: u32 = 989; +pub const XK_Umacron: u32 = 990; +pub const XK_amacron: u32 = 992; +pub const XK_iogonek: u32 = 999; +pub const XK_eabovedot: u32 = 1004; +pub const XK_imacron: u32 = 1007; +pub const XK_ncedilla: u32 = 1009; +pub const XK_omacron: u32 = 1010; +pub const XK_kcedilla: u32 = 1011; +pub const XK_uogonek: u32 = 1017; +pub const XK_utilde: u32 = 1021; +pub const XK_umacron: u32 = 1022; +pub const XK_Wcircumflex: u32 = 16777588; +pub const XK_wcircumflex: u32 = 16777589; +pub const XK_Ycircumflex: u32 = 16777590; +pub const XK_ycircumflex: u32 = 16777591; +pub const XK_Babovedot: u32 = 16784898; +pub const XK_babovedot: u32 = 16784899; +pub const XK_Dabovedot: u32 = 16784906; +pub const XK_dabovedot: u32 = 16784907; +pub const XK_Fabovedot: u32 = 16784926; +pub const XK_fabovedot: u32 = 16784927; +pub const XK_Mabovedot: u32 = 16784960; +pub const XK_mabovedot: u32 = 16784961; +pub const XK_Pabovedot: u32 = 16784982; +pub const XK_pabovedot: u32 = 16784983; +pub const XK_Sabovedot: u32 = 16784992; +pub const XK_sabovedot: u32 = 16784993; +pub const XK_Tabovedot: u32 = 16785002; +pub const XK_tabovedot: u32 = 16785003; +pub const XK_Wgrave: u32 = 16785024; +pub const XK_wgrave: u32 = 16785025; +pub const XK_Wacute: u32 = 16785026; +pub const XK_wacute: u32 = 16785027; +pub const XK_Wdiaeresis: u32 = 16785028; +pub const XK_wdiaeresis: u32 = 16785029; +pub const XK_Ygrave: u32 = 16785138; +pub const XK_ygrave: u32 = 16785139; +pub const XK_OE: u32 = 5052; +pub const XK_oe: u32 = 5053; +pub const XK_Ydiaeresis: u32 = 5054; +pub const XK_overline: u32 = 1150; +pub const XK_kana_fullstop: u32 = 1185; +pub const XK_kana_openingbracket: u32 = 1186; +pub const XK_kana_closingbracket: u32 = 1187; +pub const XK_kana_comma: u32 = 1188; +pub const XK_kana_conjunctive: u32 = 1189; +pub const XK_kana_middledot: u32 = 1189; +pub const XK_kana_WO: u32 = 1190; +pub const XK_kana_a: u32 = 1191; +pub const XK_kana_i: u32 = 1192; +pub const XK_kana_u: u32 = 1193; +pub const XK_kana_e: u32 = 1194; +pub const XK_kana_o: u32 = 1195; +pub const XK_kana_ya: u32 = 1196; +pub const XK_kana_yu: u32 = 1197; +pub const XK_kana_yo: u32 = 1198; +pub const XK_kana_tsu: u32 = 1199; +pub const XK_kana_tu: u32 = 1199; +pub const XK_prolongedsound: u32 = 1200; +pub const XK_kana_A: u32 = 1201; +pub const XK_kana_I: u32 = 1202; +pub const XK_kana_U: u32 = 1203; +pub const XK_kana_E: u32 = 1204; +pub const XK_kana_O: u32 = 1205; +pub const XK_kana_KA: u32 = 1206; +pub const XK_kana_KI: u32 = 1207; +pub const XK_kana_KU: u32 = 1208; +pub const XK_kana_KE: u32 = 1209; +pub const XK_kana_KO: u32 = 1210; +pub const XK_kana_SA: u32 = 1211; +pub const XK_kana_SHI: u32 = 1212; +pub const XK_kana_SU: u32 = 1213; +pub const XK_kana_SE: u32 = 1214; +pub const XK_kana_SO: u32 = 1215; +pub const XK_kana_TA: u32 = 1216; +pub const XK_kana_CHI: u32 = 1217; +pub const XK_kana_TI: u32 = 1217; +pub const XK_kana_TSU: u32 = 1218; +pub const XK_kana_TU: u32 = 1218; +pub const XK_kana_TE: u32 = 1219; +pub const XK_kana_TO: u32 = 1220; +pub const XK_kana_NA: u32 = 1221; +pub const XK_kana_NI: u32 = 1222; +pub const XK_kana_NU: u32 = 1223; +pub const XK_kana_NE: u32 = 1224; +pub const XK_kana_NO: u32 = 1225; +pub const XK_kana_HA: u32 = 1226; +pub const XK_kana_HI: u32 = 1227; +pub const XK_kana_FU: u32 = 1228; +pub const XK_kana_HU: u32 = 1228; +pub const XK_kana_HE: u32 = 1229; +pub const XK_kana_HO: u32 = 1230; +pub const XK_kana_MA: u32 = 1231; +pub const XK_kana_MI: u32 = 1232; +pub const XK_kana_MU: u32 = 1233; +pub const XK_kana_ME: u32 = 1234; +pub const XK_kana_MO: u32 = 1235; +pub const XK_kana_YA: u32 = 1236; +pub const XK_kana_YU: u32 = 1237; +pub const XK_kana_YO: u32 = 1238; +pub const XK_kana_RA: u32 = 1239; +pub const XK_kana_RI: u32 = 1240; +pub const XK_kana_RU: u32 = 1241; +pub const XK_kana_RE: u32 = 1242; +pub const XK_kana_RO: u32 = 1243; +pub const XK_kana_WA: u32 = 1244; +pub const XK_kana_N: u32 = 1245; +pub const XK_voicedsound: u32 = 1246; +pub const XK_semivoicedsound: u32 = 1247; +pub const XK_kana_switch: u32 = 65406; +pub const XK_Farsi_0: u32 = 16778992; +pub const XK_Farsi_1: u32 = 16778993; +pub const XK_Farsi_2: u32 = 16778994; +pub const XK_Farsi_3: u32 = 16778995; +pub const XK_Farsi_4: u32 = 16778996; +pub const XK_Farsi_5: u32 = 16778997; +pub const XK_Farsi_6: u32 = 16778998; +pub const XK_Farsi_7: u32 = 16778999; +pub const XK_Farsi_8: u32 = 16779000; +pub const XK_Farsi_9: u32 = 16779001; +pub const XK_Arabic_percent: u32 = 16778858; +pub const XK_Arabic_superscript_alef: u32 = 16778864; +pub const XK_Arabic_tteh: u32 = 16778873; +pub const XK_Arabic_peh: u32 = 16778878; +pub const XK_Arabic_tcheh: u32 = 16778886; +pub const XK_Arabic_ddal: u32 = 16778888; +pub const XK_Arabic_rreh: u32 = 16778897; +pub const XK_Arabic_comma: u32 = 1452; +pub const XK_Arabic_fullstop: u32 = 16778964; +pub const XK_Arabic_0: u32 = 16778848; +pub const XK_Arabic_1: u32 = 16778849; +pub const XK_Arabic_2: u32 = 16778850; +pub const XK_Arabic_3: u32 = 16778851; +pub const XK_Arabic_4: u32 = 16778852; +pub const XK_Arabic_5: u32 = 16778853; +pub const XK_Arabic_6: u32 = 16778854; +pub const XK_Arabic_7: u32 = 16778855; +pub const XK_Arabic_8: u32 = 16778856; +pub const XK_Arabic_9: u32 = 16778857; +pub const XK_Arabic_semicolon: u32 = 1467; +pub const XK_Arabic_question_mark: u32 = 1471; +pub const XK_Arabic_hamza: u32 = 1473; +pub const XK_Arabic_maddaonalef: u32 = 1474; +pub const XK_Arabic_hamzaonalef: u32 = 1475; +pub const XK_Arabic_hamzaonwaw: u32 = 1476; +pub const XK_Arabic_hamzaunderalef: u32 = 1477; +pub const XK_Arabic_hamzaonyeh: u32 = 1478; +pub const XK_Arabic_alef: u32 = 1479; +pub const XK_Arabic_beh: u32 = 1480; +pub const XK_Arabic_tehmarbuta: u32 = 1481; +pub const XK_Arabic_teh: u32 = 1482; +pub const XK_Arabic_theh: u32 = 1483; +pub const XK_Arabic_jeem: u32 = 1484; +pub const XK_Arabic_hah: u32 = 1485; +pub const XK_Arabic_khah: u32 = 1486; +pub const XK_Arabic_dal: u32 = 1487; +pub const XK_Arabic_thal: u32 = 1488; +pub const XK_Arabic_ra: u32 = 1489; +pub const XK_Arabic_zain: u32 = 1490; +pub const XK_Arabic_seen: u32 = 1491; +pub const XK_Arabic_sheen: u32 = 1492; +pub const XK_Arabic_sad: u32 = 1493; +pub const XK_Arabic_dad: u32 = 1494; +pub const XK_Arabic_tah: u32 = 1495; +pub const XK_Arabic_zah: u32 = 1496; +pub const XK_Arabic_ain: u32 = 1497; +pub const XK_Arabic_ghain: u32 = 1498; +pub const XK_Arabic_tatweel: u32 = 1504; +pub const XK_Arabic_feh: u32 = 1505; +pub const XK_Arabic_qaf: u32 = 1506; +pub const XK_Arabic_kaf: u32 = 1507; +pub const XK_Arabic_lam: u32 = 1508; +pub const XK_Arabic_meem: u32 = 1509; +pub const XK_Arabic_noon: u32 = 1510; +pub const XK_Arabic_ha: u32 = 1511; +pub const XK_Arabic_heh: u32 = 1511; +pub const XK_Arabic_waw: u32 = 1512; +pub const XK_Arabic_alefmaksura: u32 = 1513; +pub const XK_Arabic_yeh: u32 = 1514; +pub const XK_Arabic_fathatan: u32 = 1515; +pub const XK_Arabic_dammatan: u32 = 1516; +pub const XK_Arabic_kasratan: u32 = 1517; +pub const XK_Arabic_fatha: u32 = 1518; +pub const XK_Arabic_damma: u32 = 1519; +pub const XK_Arabic_kasra: u32 = 1520; +pub const XK_Arabic_shadda: u32 = 1521; +pub const XK_Arabic_sukun: u32 = 1522; +pub const XK_Arabic_madda_above: u32 = 16778835; +pub const XK_Arabic_hamza_above: u32 = 16778836; +pub const XK_Arabic_hamza_below: u32 = 16778837; +pub const XK_Arabic_jeh: u32 = 16778904; +pub const XK_Arabic_veh: u32 = 16778916; +pub const XK_Arabic_keheh: u32 = 16778921; +pub const XK_Arabic_gaf: u32 = 16778927; +pub const XK_Arabic_noon_ghunna: u32 = 16778938; +pub const XK_Arabic_heh_doachashmee: u32 = 16778942; +pub const XK_Farsi_yeh: u32 = 16778956; +pub const XK_Arabic_farsi_yeh: u32 = 16778956; +pub const XK_Arabic_yeh_baree: u32 = 16778962; +pub const XK_Arabic_heh_goal: u32 = 16778945; +pub const XK_Arabic_switch: u32 = 65406; +pub const XK_Cyrillic_GHE_bar: u32 = 16778386; +pub const XK_Cyrillic_ghe_bar: u32 = 16778387; +pub const XK_Cyrillic_ZHE_descender: u32 = 16778390; +pub const XK_Cyrillic_zhe_descender: u32 = 16778391; +pub const XK_Cyrillic_KA_descender: u32 = 16778394; +pub const XK_Cyrillic_ka_descender: u32 = 16778395; +pub const XK_Cyrillic_KA_vertstroke: u32 = 16778396; +pub const XK_Cyrillic_ka_vertstroke: u32 = 16778397; +pub const XK_Cyrillic_EN_descender: u32 = 16778402; +pub const XK_Cyrillic_en_descender: u32 = 16778403; +pub const XK_Cyrillic_U_straight: u32 = 16778414; +pub const XK_Cyrillic_u_straight: u32 = 16778415; +pub const XK_Cyrillic_U_straight_bar: u32 = 16778416; +pub const XK_Cyrillic_u_straight_bar: u32 = 16778417; +pub const XK_Cyrillic_HA_descender: u32 = 16778418; +pub const XK_Cyrillic_ha_descender: u32 = 16778419; +pub const XK_Cyrillic_CHE_descender: u32 = 16778422; +pub const XK_Cyrillic_che_descender: u32 = 16778423; +pub const XK_Cyrillic_CHE_vertstroke: u32 = 16778424; +pub const XK_Cyrillic_che_vertstroke: u32 = 16778425; +pub const XK_Cyrillic_SHHA: u32 = 16778426; +pub const XK_Cyrillic_shha: u32 = 16778427; +pub const XK_Cyrillic_SCHWA: u32 = 16778456; +pub const XK_Cyrillic_schwa: u32 = 16778457; +pub const XK_Cyrillic_I_macron: u32 = 16778466; +pub const XK_Cyrillic_i_macron: u32 = 16778467; +pub const XK_Cyrillic_O_bar: u32 = 16778472; +pub const XK_Cyrillic_o_bar: u32 = 16778473; +pub const XK_Cyrillic_U_macron: u32 = 16778478; +pub const XK_Cyrillic_u_macron: u32 = 16778479; +pub const XK_Serbian_dje: u32 = 1697; +pub const XK_Macedonia_gje: u32 = 1698; +pub const XK_Cyrillic_io: u32 = 1699; +pub const XK_Ukrainian_ie: u32 = 1700; +pub const XK_Ukranian_je: u32 = 1700; +pub const XK_Macedonia_dse: u32 = 1701; +pub const XK_Ukrainian_i: u32 = 1702; +pub const XK_Ukranian_i: u32 = 1702; +pub const XK_Ukrainian_yi: u32 = 1703; +pub const XK_Ukranian_yi: u32 = 1703; +pub const XK_Cyrillic_je: u32 = 1704; +pub const XK_Serbian_je: u32 = 1704; +pub const XK_Cyrillic_lje: u32 = 1705; +pub const XK_Serbian_lje: u32 = 1705; +pub const XK_Cyrillic_nje: u32 = 1706; +pub const XK_Serbian_nje: u32 = 1706; +pub const XK_Serbian_tshe: u32 = 1707; +pub const XK_Macedonia_kje: u32 = 1708; +pub const XK_Ukrainian_ghe_with_upturn: u32 = 1709; +pub const XK_Byelorussian_shortu: u32 = 1710; +pub const XK_Cyrillic_dzhe: u32 = 1711; +pub const XK_Serbian_dze: u32 = 1711; +pub const XK_numerosign: u32 = 1712; +pub const XK_Serbian_DJE: u32 = 1713; +pub const XK_Macedonia_GJE: u32 = 1714; +pub const XK_Cyrillic_IO: u32 = 1715; +pub const XK_Ukrainian_IE: u32 = 1716; +pub const XK_Ukranian_JE: u32 = 1716; +pub const XK_Macedonia_DSE: u32 = 1717; +pub const XK_Ukrainian_I: u32 = 1718; +pub const XK_Ukranian_I: u32 = 1718; +pub const XK_Ukrainian_YI: u32 = 1719; +pub const XK_Ukranian_YI: u32 = 1719; +pub const XK_Cyrillic_JE: u32 = 1720; +pub const XK_Serbian_JE: u32 = 1720; +pub const XK_Cyrillic_LJE: u32 = 1721; +pub const XK_Serbian_LJE: u32 = 1721; +pub const XK_Cyrillic_NJE: u32 = 1722; +pub const XK_Serbian_NJE: u32 = 1722; +pub const XK_Serbian_TSHE: u32 = 1723; +pub const XK_Macedonia_KJE: u32 = 1724; +pub const XK_Ukrainian_GHE_WITH_UPTURN: u32 = 1725; +pub const XK_Byelorussian_SHORTU: u32 = 1726; +pub const XK_Cyrillic_DZHE: u32 = 1727; +pub const XK_Serbian_DZE: u32 = 1727; +pub const XK_Cyrillic_yu: u32 = 1728; +pub const XK_Cyrillic_a: u32 = 1729; +pub const XK_Cyrillic_be: u32 = 1730; +pub const XK_Cyrillic_tse: u32 = 1731; +pub const XK_Cyrillic_de: u32 = 1732; +pub const XK_Cyrillic_ie: u32 = 1733; +pub const XK_Cyrillic_ef: u32 = 1734; +pub const XK_Cyrillic_ghe: u32 = 1735; +pub const XK_Cyrillic_ha: u32 = 1736; +pub const XK_Cyrillic_i: u32 = 1737; +pub const XK_Cyrillic_shorti: u32 = 1738; +pub const XK_Cyrillic_ka: u32 = 1739; +pub const XK_Cyrillic_el: u32 = 1740; +pub const XK_Cyrillic_em: u32 = 1741; +pub const XK_Cyrillic_en: u32 = 1742; +pub const XK_Cyrillic_o: u32 = 1743; +pub const XK_Cyrillic_pe: u32 = 1744; +pub const XK_Cyrillic_ya: u32 = 1745; +pub const XK_Cyrillic_er: u32 = 1746; +pub const XK_Cyrillic_es: u32 = 1747; +pub const XK_Cyrillic_te: u32 = 1748; +pub const XK_Cyrillic_u: u32 = 1749; +pub const XK_Cyrillic_zhe: u32 = 1750; +pub const XK_Cyrillic_ve: u32 = 1751; +pub const XK_Cyrillic_softsign: u32 = 1752; +pub const XK_Cyrillic_yeru: u32 = 1753; +pub const XK_Cyrillic_ze: u32 = 1754; +pub const XK_Cyrillic_sha: u32 = 1755; +pub const XK_Cyrillic_e: u32 = 1756; +pub const XK_Cyrillic_shcha: u32 = 1757; +pub const XK_Cyrillic_che: u32 = 1758; +pub const XK_Cyrillic_hardsign: u32 = 1759; +pub const XK_Cyrillic_YU: u32 = 1760; +pub const XK_Cyrillic_A: u32 = 1761; +pub const XK_Cyrillic_BE: u32 = 1762; +pub const XK_Cyrillic_TSE: u32 = 1763; +pub const XK_Cyrillic_DE: u32 = 1764; +pub const XK_Cyrillic_IE: u32 = 1765; +pub const XK_Cyrillic_EF: u32 = 1766; +pub const XK_Cyrillic_GHE: u32 = 1767; +pub const XK_Cyrillic_HA: u32 = 1768; +pub const XK_Cyrillic_I: u32 = 1769; +pub const XK_Cyrillic_SHORTI: u32 = 1770; +pub const XK_Cyrillic_KA: u32 = 1771; +pub const XK_Cyrillic_EL: u32 = 1772; +pub const XK_Cyrillic_EM: u32 = 1773; +pub const XK_Cyrillic_EN: u32 = 1774; +pub const XK_Cyrillic_O: u32 = 1775; +pub const XK_Cyrillic_PE: u32 = 1776; +pub const XK_Cyrillic_YA: u32 = 1777; +pub const XK_Cyrillic_ER: u32 = 1778; +pub const XK_Cyrillic_ES: u32 = 1779; +pub const XK_Cyrillic_TE: u32 = 1780; +pub const XK_Cyrillic_U: u32 = 1781; +pub const XK_Cyrillic_ZHE: u32 = 1782; +pub const XK_Cyrillic_VE: u32 = 1783; +pub const XK_Cyrillic_SOFTSIGN: u32 = 1784; +pub const XK_Cyrillic_YERU: u32 = 1785; +pub const XK_Cyrillic_ZE: u32 = 1786; +pub const XK_Cyrillic_SHA: u32 = 1787; +pub const XK_Cyrillic_E: u32 = 1788; +pub const XK_Cyrillic_SHCHA: u32 = 1789; +pub const XK_Cyrillic_CHE: u32 = 1790; +pub const XK_Cyrillic_HARDSIGN: u32 = 1791; +pub const XK_Greek_ALPHAaccent: u32 = 1953; +pub const XK_Greek_EPSILONaccent: u32 = 1954; +pub const XK_Greek_ETAaccent: u32 = 1955; +pub const XK_Greek_IOTAaccent: u32 = 1956; +pub const XK_Greek_IOTAdieresis: u32 = 1957; +pub const XK_Greek_IOTAdiaeresis: u32 = 1957; +pub const XK_Greek_OMICRONaccent: u32 = 1959; +pub const XK_Greek_UPSILONaccent: u32 = 1960; +pub const XK_Greek_UPSILONdieresis: u32 = 1961; +pub const XK_Greek_OMEGAaccent: u32 = 1963; +pub const XK_Greek_accentdieresis: u32 = 1966; +pub const XK_Greek_horizbar: u32 = 1967; +pub const XK_Greek_alphaaccent: u32 = 1969; +pub const XK_Greek_epsilonaccent: u32 = 1970; +pub const XK_Greek_etaaccent: u32 = 1971; +pub const XK_Greek_iotaaccent: u32 = 1972; +pub const XK_Greek_iotadieresis: u32 = 1973; +pub const XK_Greek_iotaaccentdieresis: u32 = 1974; +pub const XK_Greek_omicronaccent: u32 = 1975; +pub const XK_Greek_upsilonaccent: u32 = 1976; +pub const XK_Greek_upsilondieresis: u32 = 1977; +pub const XK_Greek_upsilonaccentdieresis: u32 = 1978; +pub const XK_Greek_omegaaccent: u32 = 1979; +pub const XK_Greek_ALPHA: u32 = 1985; +pub const XK_Greek_BETA: u32 = 1986; +pub const XK_Greek_GAMMA: u32 = 1987; +pub const XK_Greek_DELTA: u32 = 1988; +pub const XK_Greek_EPSILON: u32 = 1989; +pub const XK_Greek_ZETA: u32 = 1990; +pub const XK_Greek_ETA: u32 = 1991; +pub const XK_Greek_THETA: u32 = 1992; +pub const XK_Greek_IOTA: u32 = 1993; +pub const XK_Greek_KAPPA: u32 = 1994; +pub const XK_Greek_LAMDA: u32 = 1995; +pub const XK_Greek_LAMBDA: u32 = 1995; +pub const XK_Greek_MU: u32 = 1996; +pub const XK_Greek_NU: u32 = 1997; +pub const XK_Greek_XI: u32 = 1998; +pub const XK_Greek_OMICRON: u32 = 1999; +pub const XK_Greek_PI: u32 = 2000; +pub const XK_Greek_RHO: u32 = 2001; +pub const XK_Greek_SIGMA: u32 = 2002; +pub const XK_Greek_TAU: u32 = 2004; +pub const XK_Greek_UPSILON: u32 = 2005; +pub const XK_Greek_PHI: u32 = 2006; +pub const XK_Greek_CHI: u32 = 2007; +pub const XK_Greek_PSI: u32 = 2008; +pub const XK_Greek_OMEGA: u32 = 2009; +pub const XK_Greek_alpha: u32 = 2017; +pub const XK_Greek_beta: u32 = 2018; +pub const XK_Greek_gamma: u32 = 2019; +pub const XK_Greek_delta: u32 = 2020; +pub const XK_Greek_epsilon: u32 = 2021; +pub const XK_Greek_zeta: u32 = 2022; +pub const XK_Greek_eta: u32 = 2023; +pub const XK_Greek_theta: u32 = 2024; +pub const XK_Greek_iota: u32 = 2025; +pub const XK_Greek_kappa: u32 = 2026; +pub const XK_Greek_lamda: u32 = 2027; +pub const XK_Greek_lambda: u32 = 2027; +pub const XK_Greek_mu: u32 = 2028; +pub const XK_Greek_nu: u32 = 2029; +pub const XK_Greek_xi: u32 = 2030; +pub const XK_Greek_omicron: u32 = 2031; +pub const XK_Greek_pi: u32 = 2032; +pub const XK_Greek_rho: u32 = 2033; +pub const XK_Greek_sigma: u32 = 2034; +pub const XK_Greek_finalsmallsigma: u32 = 2035; +pub const XK_Greek_tau: u32 = 2036; +pub const XK_Greek_upsilon: u32 = 2037; +pub const XK_Greek_phi: u32 = 2038; +pub const XK_Greek_chi: u32 = 2039; +pub const XK_Greek_psi: u32 = 2040; +pub const XK_Greek_omega: u32 = 2041; +pub const XK_Greek_switch: u32 = 65406; +pub const XK_hebrew_doublelowline: u32 = 3295; +pub const XK_hebrew_aleph: u32 = 3296; +pub const XK_hebrew_bet: u32 = 3297; +pub const XK_hebrew_beth: u32 = 3297; +pub const XK_hebrew_gimel: u32 = 3298; +pub const XK_hebrew_gimmel: u32 = 3298; +pub const XK_hebrew_dalet: u32 = 3299; +pub const XK_hebrew_daleth: u32 = 3299; +pub const XK_hebrew_he: u32 = 3300; +pub const XK_hebrew_waw: u32 = 3301; +pub const XK_hebrew_zain: u32 = 3302; +pub const XK_hebrew_zayin: u32 = 3302; +pub const XK_hebrew_chet: u32 = 3303; +pub const XK_hebrew_het: u32 = 3303; +pub const XK_hebrew_tet: u32 = 3304; +pub const XK_hebrew_teth: u32 = 3304; +pub const XK_hebrew_yod: u32 = 3305; +pub const XK_hebrew_finalkaph: u32 = 3306; +pub const XK_hebrew_kaph: u32 = 3307; +pub const XK_hebrew_lamed: u32 = 3308; +pub const XK_hebrew_finalmem: u32 = 3309; +pub const XK_hebrew_mem: u32 = 3310; +pub const XK_hebrew_finalnun: u32 = 3311; +pub const XK_hebrew_nun: u32 = 3312; +pub const XK_hebrew_samech: u32 = 3313; +pub const XK_hebrew_samekh: u32 = 3313; +pub const XK_hebrew_ayin: u32 = 3314; +pub const XK_hebrew_finalpe: u32 = 3315; +pub const XK_hebrew_pe: u32 = 3316; +pub const XK_hebrew_finalzade: u32 = 3317; +pub const XK_hebrew_finalzadi: u32 = 3317; +pub const XK_hebrew_zade: u32 = 3318; +pub const XK_hebrew_zadi: u32 = 3318; +pub const XK_hebrew_qoph: u32 = 3319; +pub const XK_hebrew_kuf: u32 = 3319; +pub const XK_hebrew_resh: u32 = 3320; +pub const XK_hebrew_shin: u32 = 3321; +pub const XK_hebrew_taw: u32 = 3322; +pub const XK_hebrew_taf: u32 = 3322; +pub const XK_Hebrew_switch: u32 = 65406; +pub const XK_Thai_kokai: u32 = 3489; +pub const XK_Thai_khokhai: u32 = 3490; +pub const XK_Thai_khokhuat: u32 = 3491; +pub const XK_Thai_khokhwai: u32 = 3492; +pub const XK_Thai_khokhon: u32 = 3493; +pub const XK_Thai_khorakhang: u32 = 3494; +pub const XK_Thai_ngongu: u32 = 3495; +pub const XK_Thai_chochan: u32 = 3496; +pub const XK_Thai_choching: u32 = 3497; +pub const XK_Thai_chochang: u32 = 3498; +pub const XK_Thai_soso: u32 = 3499; +pub const XK_Thai_chochoe: u32 = 3500; +pub const XK_Thai_yoying: u32 = 3501; +pub const XK_Thai_dochada: u32 = 3502; +pub const XK_Thai_topatak: u32 = 3503; +pub const XK_Thai_thothan: u32 = 3504; +pub const XK_Thai_thonangmontho: u32 = 3505; +pub const XK_Thai_thophuthao: u32 = 3506; +pub const XK_Thai_nonen: u32 = 3507; +pub const XK_Thai_dodek: u32 = 3508; +pub const XK_Thai_totao: u32 = 3509; +pub const XK_Thai_thothung: u32 = 3510; +pub const XK_Thai_thothahan: u32 = 3511; +pub const XK_Thai_thothong: u32 = 3512; +pub const XK_Thai_nonu: u32 = 3513; +pub const XK_Thai_bobaimai: u32 = 3514; +pub const XK_Thai_popla: u32 = 3515; +pub const XK_Thai_phophung: u32 = 3516; +pub const XK_Thai_fofa: u32 = 3517; +pub const XK_Thai_phophan: u32 = 3518; +pub const XK_Thai_fofan: u32 = 3519; +pub const XK_Thai_phosamphao: u32 = 3520; +pub const XK_Thai_moma: u32 = 3521; +pub const XK_Thai_yoyak: u32 = 3522; +pub const XK_Thai_rorua: u32 = 3523; +pub const XK_Thai_ru: u32 = 3524; +pub const XK_Thai_loling: u32 = 3525; +pub const XK_Thai_lu: u32 = 3526; +pub const XK_Thai_wowaen: u32 = 3527; +pub const XK_Thai_sosala: u32 = 3528; +pub const XK_Thai_sorusi: u32 = 3529; +pub const XK_Thai_sosua: u32 = 3530; +pub const XK_Thai_hohip: u32 = 3531; +pub const XK_Thai_lochula: u32 = 3532; +pub const XK_Thai_oang: u32 = 3533; +pub const XK_Thai_honokhuk: u32 = 3534; +pub const XK_Thai_paiyannoi: u32 = 3535; +pub const XK_Thai_saraa: u32 = 3536; +pub const XK_Thai_maihanakat: u32 = 3537; +pub const XK_Thai_saraaa: u32 = 3538; +pub const XK_Thai_saraam: u32 = 3539; +pub const XK_Thai_sarai: u32 = 3540; +pub const XK_Thai_saraii: u32 = 3541; +pub const XK_Thai_saraue: u32 = 3542; +pub const XK_Thai_sarauee: u32 = 3543; +pub const XK_Thai_sarau: u32 = 3544; +pub const XK_Thai_sarauu: u32 = 3545; +pub const XK_Thai_phinthu: u32 = 3546; +pub const XK_Thai_maihanakat_maitho: u32 = 3550; +pub const XK_Thai_baht: u32 = 3551; +pub const XK_Thai_sarae: u32 = 3552; +pub const XK_Thai_saraae: u32 = 3553; +pub const XK_Thai_sarao: u32 = 3554; +pub const XK_Thai_saraaimaimuan: u32 = 3555; +pub const XK_Thai_saraaimaimalai: u32 = 3556; +pub const XK_Thai_lakkhangyao: u32 = 3557; +pub const XK_Thai_maiyamok: u32 = 3558; +pub const XK_Thai_maitaikhu: u32 = 3559; +pub const XK_Thai_maiek: u32 = 3560; +pub const XK_Thai_maitho: u32 = 3561; +pub const XK_Thai_maitri: u32 = 3562; +pub const XK_Thai_maichattawa: u32 = 3563; +pub const XK_Thai_thanthakhat: u32 = 3564; +pub const XK_Thai_nikhahit: u32 = 3565; +pub const XK_Thai_leksun: u32 = 3568; +pub const XK_Thai_leknung: u32 = 3569; +pub const XK_Thai_leksong: u32 = 3570; +pub const XK_Thai_leksam: u32 = 3571; +pub const XK_Thai_leksi: u32 = 3572; +pub const XK_Thai_lekha: u32 = 3573; +pub const XK_Thai_lekhok: u32 = 3574; +pub const XK_Thai_lekchet: u32 = 3575; +pub const XK_Thai_lekpaet: u32 = 3576; +pub const XK_Thai_lekkao: u32 = 3577; +pub const XK_Hangul: u32 = 65329; +pub const XK_Hangul_Start: u32 = 65330; +pub const XK_Hangul_End: u32 = 65331; +pub const XK_Hangul_Hanja: u32 = 65332; +pub const XK_Hangul_Jamo: u32 = 65333; +pub const XK_Hangul_Romaja: u32 = 65334; +pub const XK_Hangul_Codeinput: u32 = 65335; +pub const XK_Hangul_Jeonja: u32 = 65336; +pub const XK_Hangul_Banja: u32 = 65337; +pub const XK_Hangul_PreHanja: u32 = 65338; +pub const XK_Hangul_PostHanja: u32 = 65339; +pub const XK_Hangul_SingleCandidate: u32 = 65340; +pub const XK_Hangul_MultipleCandidate: u32 = 65341; +pub const XK_Hangul_PreviousCandidate: u32 = 65342; +pub const XK_Hangul_Special: u32 = 65343; +pub const XK_Hangul_switch: u32 = 65406; +pub const XK_Hangul_Kiyeog: u32 = 3745; +pub const XK_Hangul_SsangKiyeog: u32 = 3746; +pub const XK_Hangul_KiyeogSios: u32 = 3747; +pub const XK_Hangul_Nieun: u32 = 3748; +pub const XK_Hangul_NieunJieuj: u32 = 3749; +pub const XK_Hangul_NieunHieuh: u32 = 3750; +pub const XK_Hangul_Dikeud: u32 = 3751; +pub const XK_Hangul_SsangDikeud: u32 = 3752; +pub const XK_Hangul_Rieul: u32 = 3753; +pub const XK_Hangul_RieulKiyeog: u32 = 3754; +pub const XK_Hangul_RieulMieum: u32 = 3755; +pub const XK_Hangul_RieulPieub: u32 = 3756; +pub const XK_Hangul_RieulSios: u32 = 3757; +pub const XK_Hangul_RieulTieut: u32 = 3758; +pub const XK_Hangul_RieulPhieuf: u32 = 3759; +pub const XK_Hangul_RieulHieuh: u32 = 3760; +pub const XK_Hangul_Mieum: u32 = 3761; +pub const XK_Hangul_Pieub: u32 = 3762; +pub const XK_Hangul_SsangPieub: u32 = 3763; +pub const XK_Hangul_PieubSios: u32 = 3764; +pub const XK_Hangul_Sios: u32 = 3765; +pub const XK_Hangul_SsangSios: u32 = 3766; +pub const XK_Hangul_Ieung: u32 = 3767; +pub const XK_Hangul_Jieuj: u32 = 3768; +pub const XK_Hangul_SsangJieuj: u32 = 3769; +pub const XK_Hangul_Cieuc: u32 = 3770; +pub const XK_Hangul_Khieuq: u32 = 3771; +pub const XK_Hangul_Tieut: u32 = 3772; +pub const XK_Hangul_Phieuf: u32 = 3773; +pub const XK_Hangul_Hieuh: u32 = 3774; +pub const XK_Hangul_A: u32 = 3775; +pub const XK_Hangul_AE: u32 = 3776; +pub const XK_Hangul_YA: u32 = 3777; +pub const XK_Hangul_YAE: u32 = 3778; +pub const XK_Hangul_EO: u32 = 3779; +pub const XK_Hangul_E: u32 = 3780; +pub const XK_Hangul_YEO: u32 = 3781; +pub const XK_Hangul_YE: u32 = 3782; +pub const XK_Hangul_O: u32 = 3783; +pub const XK_Hangul_WA: u32 = 3784; +pub const XK_Hangul_WAE: u32 = 3785; +pub const XK_Hangul_OE: u32 = 3786; +pub const XK_Hangul_YO: u32 = 3787; +pub const XK_Hangul_U: u32 = 3788; +pub const XK_Hangul_WEO: u32 = 3789; +pub const XK_Hangul_WE: u32 = 3790; +pub const XK_Hangul_WI: u32 = 3791; +pub const XK_Hangul_YU: u32 = 3792; +pub const XK_Hangul_EU: u32 = 3793; +pub const XK_Hangul_YI: u32 = 3794; +pub const XK_Hangul_I: u32 = 3795; +pub const XK_Hangul_J_Kiyeog: u32 = 3796; +pub const XK_Hangul_J_SsangKiyeog: u32 = 3797; +pub const XK_Hangul_J_KiyeogSios: u32 = 3798; +pub const XK_Hangul_J_Nieun: u32 = 3799; +pub const XK_Hangul_J_NieunJieuj: u32 = 3800; +pub const XK_Hangul_J_NieunHieuh: u32 = 3801; +pub const XK_Hangul_J_Dikeud: u32 = 3802; +pub const XK_Hangul_J_Rieul: u32 = 3803; +pub const XK_Hangul_J_RieulKiyeog: u32 = 3804; +pub const XK_Hangul_J_RieulMieum: u32 = 3805; +pub const XK_Hangul_J_RieulPieub: u32 = 3806; +pub const XK_Hangul_J_RieulSios: u32 = 3807; +pub const XK_Hangul_J_RieulTieut: u32 = 3808; +pub const XK_Hangul_J_RieulPhieuf: u32 = 3809; +pub const XK_Hangul_J_RieulHieuh: u32 = 3810; +pub const XK_Hangul_J_Mieum: u32 = 3811; +pub const XK_Hangul_J_Pieub: u32 = 3812; +pub const XK_Hangul_J_PieubSios: u32 = 3813; +pub const XK_Hangul_J_Sios: u32 = 3814; +pub const XK_Hangul_J_SsangSios: u32 = 3815; +pub const XK_Hangul_J_Ieung: u32 = 3816; +pub const XK_Hangul_J_Jieuj: u32 = 3817; +pub const XK_Hangul_J_Cieuc: u32 = 3818; +pub const XK_Hangul_J_Khieuq: u32 = 3819; +pub const XK_Hangul_J_Tieut: u32 = 3820; +pub const XK_Hangul_J_Phieuf: u32 = 3821; +pub const XK_Hangul_J_Hieuh: u32 = 3822; +pub const XK_Hangul_RieulYeorinHieuh: u32 = 3823; +pub const XK_Hangul_SunkyeongeumMieum: u32 = 3824; +pub const XK_Hangul_SunkyeongeumPieub: u32 = 3825; +pub const XK_Hangul_PanSios: u32 = 3826; +pub const XK_Hangul_KkogjiDalrinIeung: u32 = 3827; +pub const XK_Hangul_SunkyeongeumPhieuf: u32 = 3828; +pub const XK_Hangul_YeorinHieuh: u32 = 3829; +pub const XK_Hangul_AraeA: u32 = 3830; +pub const XK_Hangul_AraeAE: u32 = 3831; +pub const XK_Hangul_J_PanSios: u32 = 3832; +pub const XK_Hangul_J_KkogjiDalrinIeung: u32 = 3833; +pub const XK_Hangul_J_YeorinHieuh: u32 = 3834; +pub const XK_Korean_Won: u32 = 3839; +pub const XK_Armenian_ligature_ew: u32 = 16778631; +pub const XK_Armenian_full_stop: u32 = 16778633; +pub const XK_Armenian_verjaket: u32 = 16778633; +pub const XK_Armenian_separation_mark: u32 = 16778589; +pub const XK_Armenian_but: u32 = 16778589; +pub const XK_Armenian_hyphen: u32 = 16778634; +pub const XK_Armenian_yentamna: u32 = 16778634; +pub const XK_Armenian_exclam: u32 = 16778588; +pub const XK_Armenian_amanak: u32 = 16778588; +pub const XK_Armenian_accent: u32 = 16778587; +pub const XK_Armenian_shesht: u32 = 16778587; +pub const XK_Armenian_question: u32 = 16778590; +pub const XK_Armenian_paruyk: u32 = 16778590; +pub const XK_Armenian_AYB: u32 = 16778545; +pub const XK_Armenian_ayb: u32 = 16778593; +pub const XK_Armenian_BEN: u32 = 16778546; +pub const XK_Armenian_ben: u32 = 16778594; +pub const XK_Armenian_GIM: u32 = 16778547; +pub const XK_Armenian_gim: u32 = 16778595; +pub const XK_Armenian_DA: u32 = 16778548; +pub const XK_Armenian_da: u32 = 16778596; +pub const XK_Armenian_YECH: u32 = 16778549; +pub const XK_Armenian_yech: u32 = 16778597; +pub const XK_Armenian_ZA: u32 = 16778550; +pub const XK_Armenian_za: u32 = 16778598; +pub const XK_Armenian_E: u32 = 16778551; +pub const XK_Armenian_e: u32 = 16778599; +pub const XK_Armenian_AT: u32 = 16778552; +pub const XK_Armenian_at: u32 = 16778600; +pub const XK_Armenian_TO: u32 = 16778553; +pub const XK_Armenian_to: u32 = 16778601; +pub const XK_Armenian_ZHE: u32 = 16778554; +pub const XK_Armenian_zhe: u32 = 16778602; +pub const XK_Armenian_INI: u32 = 16778555; +pub const XK_Armenian_ini: u32 = 16778603; +pub const XK_Armenian_LYUN: u32 = 16778556; +pub const XK_Armenian_lyun: u32 = 16778604; +pub const XK_Armenian_KHE: u32 = 16778557; +pub const XK_Armenian_khe: u32 = 16778605; +pub const XK_Armenian_TSA: u32 = 16778558; +pub const XK_Armenian_tsa: u32 = 16778606; +pub const XK_Armenian_KEN: u32 = 16778559; +pub const XK_Armenian_ken: u32 = 16778607; +pub const XK_Armenian_HO: u32 = 16778560; +pub const XK_Armenian_ho: u32 = 16778608; +pub const XK_Armenian_DZA: u32 = 16778561; +pub const XK_Armenian_dza: u32 = 16778609; +pub const XK_Armenian_GHAT: u32 = 16778562; +pub const XK_Armenian_ghat: u32 = 16778610; +pub const XK_Armenian_TCHE: u32 = 16778563; +pub const XK_Armenian_tche: u32 = 16778611; +pub const XK_Armenian_MEN: u32 = 16778564; +pub const XK_Armenian_men: u32 = 16778612; +pub const XK_Armenian_HI: u32 = 16778565; +pub const XK_Armenian_hi: u32 = 16778613; +pub const XK_Armenian_NU: u32 = 16778566; +pub const XK_Armenian_nu: u32 = 16778614; +pub const XK_Armenian_SHA: u32 = 16778567; +pub const XK_Armenian_sha: u32 = 16778615; +pub const XK_Armenian_VO: u32 = 16778568; +pub const XK_Armenian_vo: u32 = 16778616; +pub const XK_Armenian_CHA: u32 = 16778569; +pub const XK_Armenian_cha: u32 = 16778617; +pub const XK_Armenian_PE: u32 = 16778570; +pub const XK_Armenian_pe: u32 = 16778618; +pub const XK_Armenian_JE: u32 = 16778571; +pub const XK_Armenian_je: u32 = 16778619; +pub const XK_Armenian_RA: u32 = 16778572; +pub const XK_Armenian_ra: u32 = 16778620; +pub const XK_Armenian_SE: u32 = 16778573; +pub const XK_Armenian_se: u32 = 16778621; +pub const XK_Armenian_VEV: u32 = 16778574; +pub const XK_Armenian_vev: u32 = 16778622; +pub const XK_Armenian_TYUN: u32 = 16778575; +pub const XK_Armenian_tyun: u32 = 16778623; +pub const XK_Armenian_RE: u32 = 16778576; +pub const XK_Armenian_re: u32 = 16778624; +pub const XK_Armenian_TSO: u32 = 16778577; +pub const XK_Armenian_tso: u32 = 16778625; +pub const XK_Armenian_VYUN: u32 = 16778578; +pub const XK_Armenian_vyun: u32 = 16778626; +pub const XK_Armenian_PYUR: u32 = 16778579; +pub const XK_Armenian_pyur: u32 = 16778627; +pub const XK_Armenian_KE: u32 = 16778580; +pub const XK_Armenian_ke: u32 = 16778628; +pub const XK_Armenian_O: u32 = 16778581; +pub const XK_Armenian_o: u32 = 16778629; +pub const XK_Armenian_FE: u32 = 16778582; +pub const XK_Armenian_fe: u32 = 16778630; +pub const XK_Armenian_apostrophe: u32 = 16778586; +pub const XK_Georgian_an: u32 = 16781520; +pub const XK_Georgian_ban: u32 = 16781521; +pub const XK_Georgian_gan: u32 = 16781522; +pub const XK_Georgian_don: u32 = 16781523; +pub const XK_Georgian_en: u32 = 16781524; +pub const XK_Georgian_vin: u32 = 16781525; +pub const XK_Georgian_zen: u32 = 16781526; +pub const XK_Georgian_tan: u32 = 16781527; +pub const XK_Georgian_in: u32 = 16781528; +pub const XK_Georgian_kan: u32 = 16781529; +pub const XK_Georgian_las: u32 = 16781530; +pub const XK_Georgian_man: u32 = 16781531; +pub const XK_Georgian_nar: u32 = 16781532; +pub const XK_Georgian_on: u32 = 16781533; +pub const XK_Georgian_par: u32 = 16781534; +pub const XK_Georgian_zhar: u32 = 16781535; +pub const XK_Georgian_rae: u32 = 16781536; +pub const XK_Georgian_san: u32 = 16781537; +pub const XK_Georgian_tar: u32 = 16781538; +pub const XK_Georgian_un: u32 = 16781539; +pub const XK_Georgian_phar: u32 = 16781540; +pub const XK_Georgian_khar: u32 = 16781541; +pub const XK_Georgian_ghan: u32 = 16781542; +pub const XK_Georgian_qar: u32 = 16781543; +pub const XK_Georgian_shin: u32 = 16781544; +pub const XK_Georgian_chin: u32 = 16781545; +pub const XK_Georgian_can: u32 = 16781546; +pub const XK_Georgian_jil: u32 = 16781547; +pub const XK_Georgian_cil: u32 = 16781548; +pub const XK_Georgian_char: u32 = 16781549; +pub const XK_Georgian_xan: u32 = 16781550; +pub const XK_Georgian_jhan: u32 = 16781551; +pub const XK_Georgian_hae: u32 = 16781552; +pub const XK_Georgian_he: u32 = 16781553; +pub const XK_Georgian_hie: u32 = 16781554; +pub const XK_Georgian_we: u32 = 16781555; +pub const XK_Georgian_har: u32 = 16781556; +pub const XK_Georgian_hoe: u32 = 16781557; +pub const XK_Georgian_fi: u32 = 16781558; +pub const XK_Xabovedot: u32 = 16785034; +pub const XK_Ibreve: u32 = 16777516; +pub const XK_Zstroke: u32 = 16777653; +pub const XK_Gcaron: u32 = 16777702; +pub const XK_Ocaron: u32 = 16777681; +pub const XK_Obarred: u32 = 16777631; +pub const XK_xabovedot: u32 = 16785035; +pub const XK_ibreve: u32 = 16777517; +pub const XK_zstroke: u32 = 16777654; +pub const XK_gcaron: u32 = 16777703; +pub const XK_ocaron: u32 = 16777682; +pub const XK_obarred: u32 = 16777845; +pub const XK_SCHWA: u32 = 16777615; +pub const XK_schwa: u32 = 16777817; +pub const XK_EZH: u32 = 16777655; +pub const XK_ezh: u32 = 16777874; +pub const XK_Lbelowdot: u32 = 16784950; +pub const XK_lbelowdot: u32 = 16784951; +pub const XK_Abelowdot: u32 = 16785056; +pub const XK_abelowdot: u32 = 16785057; +pub const XK_Ahook: u32 = 16785058; +pub const XK_ahook: u32 = 16785059; +pub const XK_Acircumflexacute: u32 = 16785060; +pub const XK_acircumflexacute: u32 = 16785061; +pub const XK_Acircumflexgrave: u32 = 16785062; +pub const XK_acircumflexgrave: u32 = 16785063; +pub const XK_Acircumflexhook: u32 = 16785064; +pub const XK_acircumflexhook: u32 = 16785065; +pub const XK_Acircumflextilde: u32 = 16785066; +pub const XK_acircumflextilde: u32 = 16785067; +pub const XK_Acircumflexbelowdot: u32 = 16785068; +pub const XK_acircumflexbelowdot: u32 = 16785069; +pub const XK_Abreveacute: u32 = 16785070; +pub const XK_abreveacute: u32 = 16785071; +pub const XK_Abrevegrave: u32 = 16785072; +pub const XK_abrevegrave: u32 = 16785073; +pub const XK_Abrevehook: u32 = 16785074; +pub const XK_abrevehook: u32 = 16785075; +pub const XK_Abrevetilde: u32 = 16785076; +pub const XK_abrevetilde: u32 = 16785077; +pub const XK_Abrevebelowdot: u32 = 16785078; +pub const XK_abrevebelowdot: u32 = 16785079; +pub const XK_Ebelowdot: u32 = 16785080; +pub const XK_ebelowdot: u32 = 16785081; +pub const XK_Ehook: u32 = 16785082; +pub const XK_ehook: u32 = 16785083; +pub const XK_Etilde: u32 = 16785084; +pub const XK_etilde: u32 = 16785085; +pub const XK_Ecircumflexacute: u32 = 16785086; +pub const XK_ecircumflexacute: u32 = 16785087; +pub const XK_Ecircumflexgrave: u32 = 16785088; +pub const XK_ecircumflexgrave: u32 = 16785089; +pub const XK_Ecircumflexhook: u32 = 16785090; +pub const XK_ecircumflexhook: u32 = 16785091; +pub const XK_Ecircumflextilde: u32 = 16785092; +pub const XK_ecircumflextilde: u32 = 16785093; +pub const XK_Ecircumflexbelowdot: u32 = 16785094; +pub const XK_ecircumflexbelowdot: u32 = 16785095; +pub const XK_Ihook: u32 = 16785096; +pub const XK_ihook: u32 = 16785097; +pub const XK_Ibelowdot: u32 = 16785098; +pub const XK_ibelowdot: u32 = 16785099; +pub const XK_Obelowdot: u32 = 16785100; +pub const XK_obelowdot: u32 = 16785101; +pub const XK_Ohook: u32 = 16785102; +pub const XK_ohook: u32 = 16785103; +pub const XK_Ocircumflexacute: u32 = 16785104; +pub const XK_ocircumflexacute: u32 = 16785105; +pub const XK_Ocircumflexgrave: u32 = 16785106; +pub const XK_ocircumflexgrave: u32 = 16785107; +pub const XK_Ocircumflexhook: u32 = 16785108; +pub const XK_ocircumflexhook: u32 = 16785109; +pub const XK_Ocircumflextilde: u32 = 16785110; +pub const XK_ocircumflextilde: u32 = 16785111; +pub const XK_Ocircumflexbelowdot: u32 = 16785112; +pub const XK_ocircumflexbelowdot: u32 = 16785113; +pub const XK_Ohornacute: u32 = 16785114; +pub const XK_ohornacute: u32 = 16785115; +pub const XK_Ohorngrave: u32 = 16785116; +pub const XK_ohorngrave: u32 = 16785117; +pub const XK_Ohornhook: u32 = 16785118; +pub const XK_ohornhook: u32 = 16785119; +pub const XK_Ohorntilde: u32 = 16785120; +pub const XK_ohorntilde: u32 = 16785121; +pub const XK_Ohornbelowdot: u32 = 16785122; +pub const XK_ohornbelowdot: u32 = 16785123; +pub const XK_Ubelowdot: u32 = 16785124; +pub const XK_ubelowdot: u32 = 16785125; +pub const XK_Uhook: u32 = 16785126; +pub const XK_uhook: u32 = 16785127; +pub const XK_Uhornacute: u32 = 16785128; +pub const XK_uhornacute: u32 = 16785129; +pub const XK_Uhorngrave: u32 = 16785130; +pub const XK_uhorngrave: u32 = 16785131; +pub const XK_Uhornhook: u32 = 16785132; +pub const XK_uhornhook: u32 = 16785133; +pub const XK_Uhorntilde: u32 = 16785134; +pub const XK_uhorntilde: u32 = 16785135; +pub const XK_Uhornbelowdot: u32 = 16785136; +pub const XK_uhornbelowdot: u32 = 16785137; +pub const XK_Ybelowdot: u32 = 16785140; +pub const XK_ybelowdot: u32 = 16785141; +pub const XK_Yhook: u32 = 16785142; +pub const XK_yhook: u32 = 16785143; +pub const XK_Ytilde: u32 = 16785144; +pub const XK_ytilde: u32 = 16785145; +pub const XK_Ohorn: u32 = 16777632; +pub const XK_ohorn: u32 = 16777633; +pub const XK_Uhorn: u32 = 16777647; +pub const XK_uhorn: u32 = 16777648; +pub const XK_EcuSign: u32 = 16785568; +pub const XK_ColonSign: u32 = 16785569; +pub const XK_CruzeiroSign: u32 = 16785570; +pub const XK_FFrancSign: u32 = 16785571; +pub const XK_LiraSign: u32 = 16785572; +pub const XK_MillSign: u32 = 16785573; +pub const XK_NairaSign: u32 = 16785574; +pub const XK_PesetaSign: u32 = 16785575; +pub const XK_RupeeSign: u32 = 16785576; +pub const XK_WonSign: u32 = 16785577; +pub const XK_NewSheqelSign: u32 = 16785578; +pub const XK_DongSign: u32 = 16785579; +pub const XK_EuroSign: u32 = 8364; +pub const XK_zerosuperior: u32 = 16785520; +pub const XK_foursuperior: u32 = 16785524; +pub const XK_fivesuperior: u32 = 16785525; +pub const XK_sixsuperior: u32 = 16785526; +pub const XK_sevensuperior: u32 = 16785527; +pub const XK_eightsuperior: u32 = 16785528; +pub const XK_ninesuperior: u32 = 16785529; +pub const XK_zerosubscript: u32 = 16785536; +pub const XK_onesubscript: u32 = 16785537; +pub const XK_twosubscript: u32 = 16785538; +pub const XK_threesubscript: u32 = 16785539; +pub const XK_foursubscript: u32 = 16785540; +pub const XK_fivesubscript: u32 = 16785541; +pub const XK_sixsubscript: u32 = 16785542; +pub const XK_sevensubscript: u32 = 16785543; +pub const XK_eightsubscript: u32 = 16785544; +pub const XK_ninesubscript: u32 = 16785545; +pub const XK_partdifferential: u32 = 16785922; +pub const XK_emptyset: u32 = 16785925; +pub const XK_elementof: u32 = 16785928; +pub const XK_notelementof: u32 = 16785929; +pub const XK_containsas: u32 = 16785931; +pub const XK_squareroot: u32 = 16785946; +pub const XK_cuberoot: u32 = 16785947; +pub const XK_fourthroot: u32 = 16785948; +pub const XK_dintegral: u32 = 16785964; +pub const XK_tintegral: u32 = 16785965; +pub const XK_because: u32 = 16785973; +pub const XK_approxeq: u32 = 16785992; +pub const XK_notapproxeq: u32 = 16785991; +pub const XK_notidentical: u32 = 16786018; +pub const XK_stricteq: u32 = 16786019; +pub const XK_braille_dot_1: u32 = 65521; +pub const XK_braille_dot_2: u32 = 65522; +pub const XK_braille_dot_3: u32 = 65523; +pub const XK_braille_dot_4: u32 = 65524; +pub const XK_braille_dot_5: u32 = 65525; +pub const XK_braille_dot_6: u32 = 65526; +pub const XK_braille_dot_7: u32 = 65527; +pub const XK_braille_dot_8: u32 = 65528; +pub const XK_braille_dot_9: u32 = 65529; +pub const XK_braille_dot_10: u32 = 65530; +pub const XK_braille_blank: u32 = 16787456; +pub const XK_braille_dots_1: u32 = 16787457; +pub const XK_braille_dots_2: u32 = 16787458; +pub const XK_braille_dots_12: u32 = 16787459; +pub const XK_braille_dots_3: u32 = 16787460; +pub const XK_braille_dots_13: u32 = 16787461; +pub const XK_braille_dots_23: u32 = 16787462; +pub const XK_braille_dots_123: u32 = 16787463; +pub const XK_braille_dots_4: u32 = 16787464; +pub const XK_braille_dots_14: u32 = 16787465; +pub const XK_braille_dots_24: u32 = 16787466; +pub const XK_braille_dots_124: u32 = 16787467; +pub const XK_braille_dots_34: u32 = 16787468; +pub const XK_braille_dots_134: u32 = 16787469; +pub const XK_braille_dots_234: u32 = 16787470; +pub const XK_braille_dots_1234: u32 = 16787471; +pub const XK_braille_dots_5: u32 = 16787472; +pub const XK_braille_dots_15: u32 = 16787473; +pub const XK_braille_dots_25: u32 = 16787474; +pub const XK_braille_dots_125: u32 = 16787475; +pub const XK_braille_dots_35: u32 = 16787476; +pub const XK_braille_dots_135: u32 = 16787477; +pub const XK_braille_dots_235: u32 = 16787478; +pub const XK_braille_dots_1235: u32 = 16787479; +pub const XK_braille_dots_45: u32 = 16787480; +pub const XK_braille_dots_145: u32 = 16787481; +pub const XK_braille_dots_245: u32 = 16787482; +pub const XK_braille_dots_1245: u32 = 16787483; +pub const XK_braille_dots_345: u32 = 16787484; +pub const XK_braille_dots_1345: u32 = 16787485; +pub const XK_braille_dots_2345: u32 = 16787486; +pub const XK_braille_dots_12345: u32 = 16787487; +pub const XK_braille_dots_6: u32 = 16787488; +pub const XK_braille_dots_16: u32 = 16787489; +pub const XK_braille_dots_26: u32 = 16787490; +pub const XK_braille_dots_126: u32 = 16787491; +pub const XK_braille_dots_36: u32 = 16787492; +pub const XK_braille_dots_136: u32 = 16787493; +pub const XK_braille_dots_236: u32 = 16787494; +pub const XK_braille_dots_1236: u32 = 16787495; +pub const XK_braille_dots_46: u32 = 16787496; +pub const XK_braille_dots_146: u32 = 16787497; +pub const XK_braille_dots_246: u32 = 16787498; +pub const XK_braille_dots_1246: u32 = 16787499; +pub const XK_braille_dots_346: u32 = 16787500; +pub const XK_braille_dots_1346: u32 = 16787501; +pub const XK_braille_dots_2346: u32 = 16787502; +pub const XK_braille_dots_12346: u32 = 16787503; +pub const XK_braille_dots_56: u32 = 16787504; +pub const XK_braille_dots_156: u32 = 16787505; +pub const XK_braille_dots_256: u32 = 16787506; +pub const XK_braille_dots_1256: u32 = 16787507; +pub const XK_braille_dots_356: u32 = 16787508; +pub const XK_braille_dots_1356: u32 = 16787509; +pub const XK_braille_dots_2356: u32 = 16787510; +pub const XK_braille_dots_12356: u32 = 16787511; +pub const XK_braille_dots_456: u32 = 16787512; +pub const XK_braille_dots_1456: u32 = 16787513; +pub const XK_braille_dots_2456: u32 = 16787514; +pub const XK_braille_dots_12456: u32 = 16787515; +pub const XK_braille_dots_3456: u32 = 16787516; +pub const XK_braille_dots_13456: u32 = 16787517; +pub const XK_braille_dots_23456: u32 = 16787518; +pub const XK_braille_dots_123456: u32 = 16787519; +pub const XK_braille_dots_7: u32 = 16787520; +pub const XK_braille_dots_17: u32 = 16787521; +pub const XK_braille_dots_27: u32 = 16787522; +pub const XK_braille_dots_127: u32 = 16787523; +pub const XK_braille_dots_37: u32 = 16787524; +pub const XK_braille_dots_137: u32 = 16787525; +pub const XK_braille_dots_237: u32 = 16787526; +pub const XK_braille_dots_1237: u32 = 16787527; +pub const XK_braille_dots_47: u32 = 16787528; +pub const XK_braille_dots_147: u32 = 16787529; +pub const XK_braille_dots_247: u32 = 16787530; +pub const XK_braille_dots_1247: u32 = 16787531; +pub const XK_braille_dots_347: u32 = 16787532; +pub const XK_braille_dots_1347: u32 = 16787533; +pub const XK_braille_dots_2347: u32 = 16787534; +pub const XK_braille_dots_12347: u32 = 16787535; +pub const XK_braille_dots_57: u32 = 16787536; +pub const XK_braille_dots_157: u32 = 16787537; +pub const XK_braille_dots_257: u32 = 16787538; +pub const XK_braille_dots_1257: u32 = 16787539; +pub const XK_braille_dots_357: u32 = 16787540; +pub const XK_braille_dots_1357: u32 = 16787541; +pub const XK_braille_dots_2357: u32 = 16787542; +pub const XK_braille_dots_12357: u32 = 16787543; +pub const XK_braille_dots_457: u32 = 16787544; +pub const XK_braille_dots_1457: u32 = 16787545; +pub const XK_braille_dots_2457: u32 = 16787546; +pub const XK_braille_dots_12457: u32 = 16787547; +pub const XK_braille_dots_3457: u32 = 16787548; +pub const XK_braille_dots_13457: u32 = 16787549; +pub const XK_braille_dots_23457: u32 = 16787550; +pub const XK_braille_dots_123457: u32 = 16787551; +pub const XK_braille_dots_67: u32 = 16787552; +pub const XK_braille_dots_167: u32 = 16787553; +pub const XK_braille_dots_267: u32 = 16787554; +pub const XK_braille_dots_1267: u32 = 16787555; +pub const XK_braille_dots_367: u32 = 16787556; +pub const XK_braille_dots_1367: u32 = 16787557; +pub const XK_braille_dots_2367: u32 = 16787558; +pub const XK_braille_dots_12367: u32 = 16787559; +pub const XK_braille_dots_467: u32 = 16787560; +pub const XK_braille_dots_1467: u32 = 16787561; +pub const XK_braille_dots_2467: u32 = 16787562; +pub const XK_braille_dots_12467: u32 = 16787563; +pub const XK_braille_dots_3467: u32 = 16787564; +pub const XK_braille_dots_13467: u32 = 16787565; +pub const XK_braille_dots_23467: u32 = 16787566; +pub const XK_braille_dots_123467: u32 = 16787567; +pub const XK_braille_dots_567: u32 = 16787568; +pub const XK_braille_dots_1567: u32 = 16787569; +pub const XK_braille_dots_2567: u32 = 16787570; +pub const XK_braille_dots_12567: u32 = 16787571; +pub const XK_braille_dots_3567: u32 = 16787572; +pub const XK_braille_dots_13567: u32 = 16787573; +pub const XK_braille_dots_23567: u32 = 16787574; +pub const XK_braille_dots_123567: u32 = 16787575; +pub const XK_braille_dots_4567: u32 = 16787576; +pub const XK_braille_dots_14567: u32 = 16787577; +pub const XK_braille_dots_24567: u32 = 16787578; +pub const XK_braille_dots_124567: u32 = 16787579; +pub const XK_braille_dots_34567: u32 = 16787580; +pub const XK_braille_dots_134567: u32 = 16787581; +pub const XK_braille_dots_234567: u32 = 16787582; +pub const XK_braille_dots_1234567: u32 = 16787583; +pub const XK_braille_dots_8: u32 = 16787584; +pub const XK_braille_dots_18: u32 = 16787585; +pub const XK_braille_dots_28: u32 = 16787586; +pub const XK_braille_dots_128: u32 = 16787587; +pub const XK_braille_dots_38: u32 = 16787588; +pub const XK_braille_dots_138: u32 = 16787589; +pub const XK_braille_dots_238: u32 = 16787590; +pub const XK_braille_dots_1238: u32 = 16787591; +pub const XK_braille_dots_48: u32 = 16787592; +pub const XK_braille_dots_148: u32 = 16787593; +pub const XK_braille_dots_248: u32 = 16787594; +pub const XK_braille_dots_1248: u32 = 16787595; +pub const XK_braille_dots_348: u32 = 16787596; +pub const XK_braille_dots_1348: u32 = 16787597; +pub const XK_braille_dots_2348: u32 = 16787598; +pub const XK_braille_dots_12348: u32 = 16787599; +pub const XK_braille_dots_58: u32 = 16787600; +pub const XK_braille_dots_158: u32 = 16787601; +pub const XK_braille_dots_258: u32 = 16787602; +pub const XK_braille_dots_1258: u32 = 16787603; +pub const XK_braille_dots_358: u32 = 16787604; +pub const XK_braille_dots_1358: u32 = 16787605; +pub const XK_braille_dots_2358: u32 = 16787606; +pub const XK_braille_dots_12358: u32 = 16787607; +pub const XK_braille_dots_458: u32 = 16787608; +pub const XK_braille_dots_1458: u32 = 16787609; +pub const XK_braille_dots_2458: u32 = 16787610; +pub const XK_braille_dots_12458: u32 = 16787611; +pub const XK_braille_dots_3458: u32 = 16787612; +pub const XK_braille_dots_13458: u32 = 16787613; +pub const XK_braille_dots_23458: u32 = 16787614; +pub const XK_braille_dots_123458: u32 = 16787615; +pub const XK_braille_dots_68: u32 = 16787616; +pub const XK_braille_dots_168: u32 = 16787617; +pub const XK_braille_dots_268: u32 = 16787618; +pub const XK_braille_dots_1268: u32 = 16787619; +pub const XK_braille_dots_368: u32 = 16787620; +pub const XK_braille_dots_1368: u32 = 16787621; +pub const XK_braille_dots_2368: u32 = 16787622; +pub const XK_braille_dots_12368: u32 = 16787623; +pub const XK_braille_dots_468: u32 = 16787624; +pub const XK_braille_dots_1468: u32 = 16787625; +pub const XK_braille_dots_2468: u32 = 16787626; +pub const XK_braille_dots_12468: u32 = 16787627; +pub const XK_braille_dots_3468: u32 = 16787628; +pub const XK_braille_dots_13468: u32 = 16787629; +pub const XK_braille_dots_23468: u32 = 16787630; +pub const XK_braille_dots_123468: u32 = 16787631; +pub const XK_braille_dots_568: u32 = 16787632; +pub const XK_braille_dots_1568: u32 = 16787633; +pub const XK_braille_dots_2568: u32 = 16787634; +pub const XK_braille_dots_12568: u32 = 16787635; +pub const XK_braille_dots_3568: u32 = 16787636; +pub const XK_braille_dots_13568: u32 = 16787637; +pub const XK_braille_dots_23568: u32 = 16787638; +pub const XK_braille_dots_123568: u32 = 16787639; +pub const XK_braille_dots_4568: u32 = 16787640; +pub const XK_braille_dots_14568: u32 = 16787641; +pub const XK_braille_dots_24568: u32 = 16787642; +pub const XK_braille_dots_124568: u32 = 16787643; +pub const XK_braille_dots_34568: u32 = 16787644; +pub const XK_braille_dots_134568: u32 = 16787645; +pub const XK_braille_dots_234568: u32 = 16787646; +pub const XK_braille_dots_1234568: u32 = 16787647; +pub const XK_braille_dots_78: u32 = 16787648; +pub const XK_braille_dots_178: u32 = 16787649; +pub const XK_braille_dots_278: u32 = 16787650; +pub const XK_braille_dots_1278: u32 = 16787651; +pub const XK_braille_dots_378: u32 = 16787652; +pub const XK_braille_dots_1378: u32 = 16787653; +pub const XK_braille_dots_2378: u32 = 16787654; +pub const XK_braille_dots_12378: u32 = 16787655; +pub const XK_braille_dots_478: u32 = 16787656; +pub const XK_braille_dots_1478: u32 = 16787657; +pub const XK_braille_dots_2478: u32 = 16787658; +pub const XK_braille_dots_12478: u32 = 16787659; +pub const XK_braille_dots_3478: u32 = 16787660; +pub const XK_braille_dots_13478: u32 = 16787661; +pub const XK_braille_dots_23478: u32 = 16787662; +pub const XK_braille_dots_123478: u32 = 16787663; +pub const XK_braille_dots_578: u32 = 16787664; +pub const XK_braille_dots_1578: u32 = 16787665; +pub const XK_braille_dots_2578: u32 = 16787666; +pub const XK_braille_dots_12578: u32 = 16787667; +pub const XK_braille_dots_3578: u32 = 16787668; +pub const XK_braille_dots_13578: u32 = 16787669; +pub const XK_braille_dots_23578: u32 = 16787670; +pub const XK_braille_dots_123578: u32 = 16787671; +pub const XK_braille_dots_4578: u32 = 16787672; +pub const XK_braille_dots_14578: u32 = 16787673; +pub const XK_braille_dots_24578: u32 = 16787674; +pub const XK_braille_dots_124578: u32 = 16787675; +pub const XK_braille_dots_34578: u32 = 16787676; +pub const XK_braille_dots_134578: u32 = 16787677; +pub const XK_braille_dots_234578: u32 = 16787678; +pub const XK_braille_dots_1234578: u32 = 16787679; +pub const XK_braille_dots_678: u32 = 16787680; +pub const XK_braille_dots_1678: u32 = 16787681; +pub const XK_braille_dots_2678: u32 = 16787682; +pub const XK_braille_dots_12678: u32 = 16787683; +pub const XK_braille_dots_3678: u32 = 16787684; +pub const XK_braille_dots_13678: u32 = 16787685; +pub const XK_braille_dots_23678: u32 = 16787686; +pub const XK_braille_dots_123678: u32 = 16787687; +pub const XK_braille_dots_4678: u32 = 16787688; +pub const XK_braille_dots_14678: u32 = 16787689; +pub const XK_braille_dots_24678: u32 = 16787690; +pub const XK_braille_dots_124678: u32 = 16787691; +pub const XK_braille_dots_34678: u32 = 16787692; +pub const XK_braille_dots_134678: u32 = 16787693; +pub const XK_braille_dots_234678: u32 = 16787694; +pub const XK_braille_dots_1234678: u32 = 16787695; +pub const XK_braille_dots_5678: u32 = 16787696; +pub const XK_braille_dots_15678: u32 = 16787697; +pub const XK_braille_dots_25678: u32 = 16787698; +pub const XK_braille_dots_125678: u32 = 16787699; +pub const XK_braille_dots_35678: u32 = 16787700; +pub const XK_braille_dots_135678: u32 = 16787701; +pub const XK_braille_dots_235678: u32 = 16787702; +pub const XK_braille_dots_1235678: u32 = 16787703; +pub const XK_braille_dots_45678: u32 = 16787704; +pub const XK_braille_dots_145678: u32 = 16787705; +pub const XK_braille_dots_245678: u32 = 16787706; +pub const XK_braille_dots_1245678: u32 = 16787707; +pub const XK_braille_dots_345678: u32 = 16787708; +pub const XK_braille_dots_1345678: u32 = 16787709; +pub const XK_braille_dots_2345678: u32 = 16787710; +pub const XK_braille_dots_12345678: u32 = 16787711; +pub const XK_Sinh_ng: u32 = 16780674; +pub const XK_Sinh_h2: u32 = 16780675; +pub const XK_Sinh_a: u32 = 16780677; +pub const XK_Sinh_aa: u32 = 16780678; +pub const XK_Sinh_ae: u32 = 16780679; +pub const XK_Sinh_aee: u32 = 16780680; +pub const XK_Sinh_i: u32 = 16780681; +pub const XK_Sinh_ii: u32 = 16780682; +pub const XK_Sinh_u: u32 = 16780683; +pub const XK_Sinh_uu: u32 = 16780684; +pub const XK_Sinh_ri: u32 = 16780685; +pub const XK_Sinh_rii: u32 = 16780686; +pub const XK_Sinh_lu: u32 = 16780687; +pub const XK_Sinh_luu: u32 = 16780688; +pub const XK_Sinh_e: u32 = 16780689; +pub const XK_Sinh_ee: u32 = 16780690; +pub const XK_Sinh_ai: u32 = 16780691; +pub const XK_Sinh_o: u32 = 16780692; +pub const XK_Sinh_oo: u32 = 16780693; +pub const XK_Sinh_au: u32 = 16780694; +pub const XK_Sinh_ka: u32 = 16780698; +pub const XK_Sinh_kha: u32 = 16780699; +pub const XK_Sinh_ga: u32 = 16780700; +pub const XK_Sinh_gha: u32 = 16780701; +pub const XK_Sinh_ng2: u32 = 16780702; +pub const XK_Sinh_nga: u32 = 16780703; +pub const XK_Sinh_ca: u32 = 16780704; +pub const XK_Sinh_cha: u32 = 16780705; +pub const XK_Sinh_ja: u32 = 16780706; +pub const XK_Sinh_jha: u32 = 16780707; +pub const XK_Sinh_nya: u32 = 16780708; +pub const XK_Sinh_jnya: u32 = 16780709; +pub const XK_Sinh_nja: u32 = 16780710; +pub const XK_Sinh_tta: u32 = 16780711; +pub const XK_Sinh_ttha: u32 = 16780712; +pub const XK_Sinh_dda: u32 = 16780713; +pub const XK_Sinh_ddha: u32 = 16780714; +pub const XK_Sinh_nna: u32 = 16780715; +pub const XK_Sinh_ndda: u32 = 16780716; +pub const XK_Sinh_tha: u32 = 16780717; +pub const XK_Sinh_thha: u32 = 16780718; +pub const XK_Sinh_dha: u32 = 16780719; +pub const XK_Sinh_dhha: u32 = 16780720; +pub const XK_Sinh_na: u32 = 16780721; +pub const XK_Sinh_ndha: u32 = 16780723; +pub const XK_Sinh_pa: u32 = 16780724; +pub const XK_Sinh_pha: u32 = 16780725; +pub const XK_Sinh_ba: u32 = 16780726; +pub const XK_Sinh_bha: u32 = 16780727; +pub const XK_Sinh_ma: u32 = 16780728; +pub const XK_Sinh_mba: u32 = 16780729; +pub const XK_Sinh_ya: u32 = 16780730; +pub const XK_Sinh_ra: u32 = 16780731; +pub const XK_Sinh_la: u32 = 16780733; +pub const XK_Sinh_va: u32 = 16780736; +pub const XK_Sinh_sha: u32 = 16780737; +pub const XK_Sinh_ssha: u32 = 16780738; +pub const XK_Sinh_sa: u32 = 16780739; +pub const XK_Sinh_ha: u32 = 16780740; +pub const XK_Sinh_lla: u32 = 16780741; +pub const XK_Sinh_fa: u32 = 16780742; +pub const XK_Sinh_al: u32 = 16780746; +pub const XK_Sinh_aa2: u32 = 16780751; +pub const XK_Sinh_ae2: u32 = 16780752; +pub const XK_Sinh_aee2: u32 = 16780753; +pub const XK_Sinh_i2: u32 = 16780754; +pub const XK_Sinh_ii2: u32 = 16780755; +pub const XK_Sinh_u2: u32 = 16780756; +pub const XK_Sinh_uu2: u32 = 16780758; +pub const XK_Sinh_ru2: u32 = 16780760; +pub const XK_Sinh_e2: u32 = 16780761; +pub const XK_Sinh_ee2: u32 = 16780762; +pub const XK_Sinh_ai2: u32 = 16780763; +pub const XK_Sinh_o2: u32 = 16780764; +pub const XK_Sinh_oo2: u32 = 16780765; +pub const XK_Sinh_au2: u32 = 16780766; +pub const XK_Sinh_lu2: u32 = 16780767; +pub const XK_Sinh_ruu2: u32 = 16780786; +pub const XK_Sinh_luu2: u32 = 16780787; +pub const XK_Sinh_kunddaliya: u32 = 16780788; +pub const NoValue: u32 = 0; +pub const XValue: u32 = 1; +pub const YValue: u32 = 2; +pub const WidthValue: u32 = 4; +pub const HeightValue: u32 = 8; +pub const AllValues: u32 = 15; +pub const XNegative: u32 = 16; +pub const YNegative: u32 = 32; +pub const USPosition: u32 = 1; +pub const USSize: u32 = 2; +pub const PPosition: u32 = 4; +pub const PSize: u32 = 8; +pub const PMinSize: u32 = 16; +pub const PMaxSize: u32 = 32; +pub const PResizeInc: u32 = 64; +pub const PAspect: u32 = 128; +pub const PBaseSize: u32 = 256; +pub const PWinGravity: u32 = 512; +pub const PAllHints: u32 = 252; +pub const InputHint: u32 = 1; +pub const StateHint: u32 = 2; +pub const IconPixmapHint: u32 = 4; +pub const IconWindowHint: u32 = 8; +pub const IconPositionHint: u32 = 16; +pub const IconMaskHint: u32 = 32; +pub const WindowGroupHint: u32 = 64; +pub const AllHints: u32 = 127; +pub const XUrgencyHint: u32 = 256; +pub const WithdrawnState: u32 = 0; +pub const NormalState: u32 = 1; +pub const IconicState: u32 = 3; +pub const DontCareState: u32 = 0; +pub const ZoomState: u32 = 2; +pub const InactiveState: u32 = 4; +pub const XNoMemory: i32 = -1; +pub const XLocaleNotSupported: i32 = -2; +pub const XConverterNotFound: i32 = -3; +pub const RectangleOut: u32 = 0; +pub const RectangleIn: u32 = 1; +pub const RectanglePart: u32 = 2; +pub const VisualNoMask: u32 = 0; +pub const VisualIDMask: u32 = 1; +pub const VisualScreenMask: u32 = 2; +pub const VisualDepthMask: u32 = 4; +pub const VisualClassMask: u32 = 8; +pub const VisualRedMaskMask: u32 = 16; +pub const VisualGreenMaskMask: u32 = 32; +pub const VisualBlueMaskMask: u32 = 64; +pub const VisualColormapSizeMask: u32 = 128; +pub const VisualBitsPerRGBMask: u32 = 256; +pub const VisualAllMask: u32 = 511; +pub const BitmapSuccess: u32 = 0; +pub const BitmapOpenFailed: u32 = 1; +pub const BitmapFileInvalid: u32 = 2; +pub const BitmapNoMemory: u32 = 3; +pub const XCSUCCESS: u32 = 0; +pub const XCNOMEM: u32 = 1; +pub const XCNOENT: u32 = 2; +pub const RENDER_NAME: &'static [u8; 7usize] = b"RENDER\0"; +pub const RENDER_MAJOR: u32 = 0; +pub const RENDER_MINOR: u32 = 11; +pub const X_RenderQueryVersion: u32 = 0; +pub const X_RenderQueryPictFormats: u32 = 1; +pub const X_RenderQueryPictIndexValues: u32 = 2; +pub const X_RenderQueryDithers: u32 = 3; +pub const X_RenderCreatePicture: u32 = 4; +pub const X_RenderChangePicture: u32 = 5; +pub const X_RenderSetPictureClipRectangles: u32 = 6; +pub const X_RenderFreePicture: u32 = 7; +pub const X_RenderComposite: u32 = 8; +pub const X_RenderScale: u32 = 9; +pub const X_RenderTrapezoids: u32 = 10; +pub const X_RenderTriangles: u32 = 11; +pub const X_RenderTriStrip: u32 = 12; +pub const X_RenderTriFan: u32 = 13; +pub const X_RenderColorTrapezoids: u32 = 14; +pub const X_RenderColorTriangles: u32 = 15; +pub const X_RenderCreateGlyphSet: u32 = 17; +pub const X_RenderReferenceGlyphSet: u32 = 18; +pub const X_RenderFreeGlyphSet: u32 = 19; +pub const X_RenderAddGlyphs: u32 = 20; +pub const X_RenderAddGlyphsFromPicture: u32 = 21; +pub const X_RenderFreeGlyphs: u32 = 22; +pub const X_RenderCompositeGlyphs8: u32 = 23; +pub const X_RenderCompositeGlyphs16: u32 = 24; +pub const X_RenderCompositeGlyphs32: u32 = 25; +pub const X_RenderFillRectangles: u32 = 26; +pub const X_RenderCreateCursor: u32 = 27; +pub const X_RenderSetPictureTransform: u32 = 28; +pub const X_RenderQueryFilters: u32 = 29; +pub const X_RenderSetPictureFilter: u32 = 30; +pub const X_RenderCreateAnimCursor: u32 = 31; +pub const X_RenderAddTraps: u32 = 32; +pub const X_RenderCreateSolidFill: u32 = 33; +pub const X_RenderCreateLinearGradient: u32 = 34; +pub const X_RenderCreateRadialGradient: u32 = 35; +pub const X_RenderCreateConicalGradient: u32 = 36; +pub const RenderNumberRequests: u32 = 37; +pub const BadPictFormat: u32 = 0; +pub const BadPicture: u32 = 1; +pub const BadPictOp: u32 = 2; +pub const BadGlyphSet: u32 = 3; +pub const BadGlyph: u32 = 4; +pub const RenderNumberErrors: u32 = 5; +pub const PictTypeIndexed: u32 = 0; +pub const PictTypeDirect: u32 = 1; +pub const PictOpMinimum: u32 = 0; +pub const PictOpClear: u32 = 0; +pub const PictOpSrc: u32 = 1; +pub const PictOpDst: u32 = 2; +pub const PictOpOver: u32 = 3; +pub const PictOpOverReverse: u32 = 4; +pub const PictOpIn: u32 = 5; +pub const PictOpInReverse: u32 = 6; +pub const PictOpOut: u32 = 7; +pub const PictOpOutReverse: u32 = 8; +pub const PictOpAtop: u32 = 9; +pub const PictOpAtopReverse: u32 = 10; +pub const PictOpXor: u32 = 11; +pub const PictOpAdd: u32 = 12; +pub const PictOpSaturate: u32 = 13; +pub const PictOpMaximum: u32 = 13; +pub const PictOpDisjointMinimum: u32 = 16; +pub const PictOpDisjointClear: u32 = 16; +pub const PictOpDisjointSrc: u32 = 17; +pub const PictOpDisjointDst: u32 = 18; +pub const PictOpDisjointOver: u32 = 19; +pub const PictOpDisjointOverReverse: u32 = 20; +pub const PictOpDisjointIn: u32 = 21; +pub const PictOpDisjointInReverse: u32 = 22; +pub const PictOpDisjointOut: u32 = 23; +pub const PictOpDisjointOutReverse: u32 = 24; +pub const PictOpDisjointAtop: u32 = 25; +pub const PictOpDisjointAtopReverse: u32 = 26; +pub const PictOpDisjointXor: u32 = 27; +pub const PictOpDisjointMaximum: u32 = 27; +pub const PictOpConjointMinimum: u32 = 32; +pub const PictOpConjointClear: u32 = 32; +pub const PictOpConjointSrc: u32 = 33; +pub const PictOpConjointDst: u32 = 34; +pub const PictOpConjointOver: u32 = 35; +pub const PictOpConjointOverReverse: u32 = 36; +pub const PictOpConjointIn: u32 = 37; +pub const PictOpConjointInReverse: u32 = 38; +pub const PictOpConjointOut: u32 = 39; +pub const PictOpConjointOutReverse: u32 = 40; +pub const PictOpConjointAtop: u32 = 41; +pub const PictOpConjointAtopReverse: u32 = 42; +pub const PictOpConjointXor: u32 = 43; +pub const PictOpConjointMaximum: u32 = 43; +pub const PictOpBlendMinimum: u32 = 48; +pub const PictOpMultiply: u32 = 48; +pub const PictOpScreen: u32 = 49; +pub const PictOpOverlay: u32 = 50; +pub const PictOpDarken: u32 = 51; +pub const PictOpLighten: u32 = 52; +pub const PictOpColorDodge: u32 = 53; +pub const PictOpColorBurn: u32 = 54; +pub const PictOpHardLight: u32 = 55; +pub const PictOpSoftLight: u32 = 56; +pub const PictOpDifference: u32 = 57; +pub const PictOpExclusion: u32 = 58; +pub const PictOpHSLHue: u32 = 59; +pub const PictOpHSLSaturation: u32 = 60; +pub const PictOpHSLColor: u32 = 61; +pub const PictOpHSLLuminosity: u32 = 62; +pub const PictOpBlendMaximum: u32 = 62; +pub const PolyEdgeSharp: u32 = 0; +pub const PolyEdgeSmooth: u32 = 1; +pub const PolyModePrecise: u32 = 0; +pub const PolyModeImprecise: u32 = 1; +pub const CPRepeat: u32 = 1; +pub const CPAlphaMap: u32 = 2; +pub const CPAlphaXOrigin: u32 = 4; +pub const CPAlphaYOrigin: u32 = 8; +pub const CPClipXOrigin: u32 = 16; +pub const CPClipYOrigin: u32 = 32; +pub const CPClipMask: u32 = 64; +pub const CPGraphicsExposure: u32 = 128; +pub const CPSubwindowMode: u32 = 256; +pub const CPPolyEdge: u32 = 512; +pub const CPPolyMode: u32 = 1024; +pub const CPDither: u32 = 2048; +pub const CPComponentAlpha: u32 = 4096; +pub const CPLastBit: u32 = 12; +pub const FilterNearest: &'static [u8; 8usize] = b"nearest\0"; +pub const FilterBilinear: &'static [u8; 9usize] = b"bilinear\0"; +pub const FilterConvolution: &'static [u8; 12usize] = b"convolution\0"; +pub const FilterFast: &'static [u8; 5usize] = b"fast\0"; +pub const FilterGood: &'static [u8; 5usize] = b"good\0"; +pub const FilterBest: &'static [u8; 5usize] = b"best\0"; +pub const FilterAliasNone: i32 = -1; +pub const SubPixelUnknown: u32 = 0; +pub const SubPixelHorizontalRGB: u32 = 1; +pub const SubPixelHorizontalBGR: u32 = 2; +pub const SubPixelVerticalRGB: u32 = 3; +pub const SubPixelVerticalBGR: u32 = 4; +pub const SubPixelNone: u32 = 5; +pub const RepeatNone: u32 = 0; +pub const RepeatNormal: u32 = 1; +pub const RepeatPad: u32 = 2; +pub const RepeatReflect: u32 = 3; +pub const PictFormatID: u32 = 1; +pub const PictFormatType: u32 = 2; +pub const PictFormatDepth: u32 = 4; +pub const PictFormatRed: u32 = 8; +pub const PictFormatRedMask: u32 = 16; +pub const PictFormatGreen: u32 = 32; +pub const PictFormatGreenMask: u32 = 64; +pub const PictFormatBlue: u32 = 128; +pub const PictFormatBlueMask: u32 = 256; +pub const PictFormatAlpha: u32 = 512; +pub const PictFormatAlphaMask: u32 = 1024; +pub const PictFormatColormap: u32 = 2048; +pub const PictStandardARGB32: u32 = 0; +pub const PictStandardRGB24: u32 = 1; +pub const PictStandardA8: u32 = 2; +pub const PictStandardA4: u32 = 3; +pub const PictStandardA1: u32 = 4; +pub const PictStandardNUM: u32 = 5; +pub const XMD_H: u32 = 1; +pub const GL_VERSION_1_1: u32 = 1; +pub const GL_VERSION_1_2: u32 = 1; +pub const GL_VERSION_1_3: u32 = 1; +pub const GL_ARB_imaging: u32 = 1; +pub const GL_FALSE: u32 = 0; +pub const GL_TRUE: u32 = 1; +pub const GL_BYTE: u32 = 5120; +pub const GL_UNSIGNED_BYTE: u32 = 5121; +pub const GL_SHORT: u32 = 5122; +pub const GL_UNSIGNED_SHORT: u32 = 5123; +pub const GL_INT: u32 = 5124; +pub const GL_UNSIGNED_INT: u32 = 5125; +pub const GL_FLOAT: u32 = 5126; +pub const GL_2_BYTES: u32 = 5127; +pub const GL_3_BYTES: u32 = 5128; +pub const GL_4_BYTES: u32 = 5129; +pub const GL_DOUBLE: u32 = 5130; +pub const GL_POINTS: u32 = 0; +pub const GL_LINES: u32 = 1; +pub const GL_LINE_LOOP: u32 = 2; +pub const GL_LINE_STRIP: u32 = 3; +pub const GL_TRIANGLES: u32 = 4; +pub const GL_TRIANGLE_STRIP: u32 = 5; +pub const GL_TRIANGLE_FAN: u32 = 6; +pub const GL_QUADS: u32 = 7; +pub const GL_QUAD_STRIP: u32 = 8; +pub const GL_POLYGON: u32 = 9; +pub const GL_VERTEX_ARRAY: u32 = 32884; +pub const GL_NORMAL_ARRAY: u32 = 32885; +pub const GL_COLOR_ARRAY: u32 = 32886; +pub const GL_INDEX_ARRAY: u32 = 32887; +pub const GL_TEXTURE_COORD_ARRAY: u32 = 32888; +pub const GL_EDGE_FLAG_ARRAY: u32 = 32889; +pub const GL_VERTEX_ARRAY_SIZE: u32 = 32890; +pub const GL_VERTEX_ARRAY_TYPE: u32 = 32891; +pub const GL_VERTEX_ARRAY_STRIDE: u32 = 32892; +pub const GL_NORMAL_ARRAY_TYPE: u32 = 32894; +pub const GL_NORMAL_ARRAY_STRIDE: u32 = 32895; +pub const GL_COLOR_ARRAY_SIZE: u32 = 32897; +pub const GL_COLOR_ARRAY_TYPE: u32 = 32898; +pub const GL_COLOR_ARRAY_STRIDE: u32 = 32899; +pub const GL_INDEX_ARRAY_TYPE: u32 = 32901; +pub const GL_INDEX_ARRAY_STRIDE: u32 = 32902; +pub const GL_TEXTURE_COORD_ARRAY_SIZE: u32 = 32904; +pub const GL_TEXTURE_COORD_ARRAY_TYPE: u32 = 32905; +pub const GL_TEXTURE_COORD_ARRAY_STRIDE: u32 = 32906; +pub const GL_EDGE_FLAG_ARRAY_STRIDE: u32 = 32908; +pub const GL_VERTEX_ARRAY_POINTER: u32 = 32910; +pub const GL_NORMAL_ARRAY_POINTER: u32 = 32911; +pub const GL_COLOR_ARRAY_POINTER: u32 = 32912; +pub const GL_INDEX_ARRAY_POINTER: u32 = 32913; +pub const GL_TEXTURE_COORD_ARRAY_POINTER: u32 = 32914; +pub const GL_EDGE_FLAG_ARRAY_POINTER: u32 = 32915; +pub const GL_V2F: u32 = 10784; +pub const GL_V3F: u32 = 10785; +pub const GL_C4UB_V2F: u32 = 10786; +pub const GL_C4UB_V3F: u32 = 10787; +pub const GL_C3F_V3F: u32 = 10788; +pub const GL_N3F_V3F: u32 = 10789; +pub const GL_C4F_N3F_V3F: u32 = 10790; +pub const GL_T2F_V3F: u32 = 10791; +pub const GL_T4F_V4F: u32 = 10792; +pub const GL_T2F_C4UB_V3F: u32 = 10793; +pub const GL_T2F_C3F_V3F: u32 = 10794; +pub const GL_T2F_N3F_V3F: u32 = 10795; +pub const GL_T2F_C4F_N3F_V3F: u32 = 10796; +pub const GL_T4F_C4F_N3F_V4F: u32 = 10797; +pub const GL_MATRIX_MODE: u32 = 2976; +pub const GL_MODELVIEW: u32 = 5888; +pub const GL_PROJECTION: u32 = 5889; +pub const GL_TEXTURE: u32 = 5890; +pub const GL_POINT_SMOOTH: u32 = 2832; +pub const GL_POINT_SIZE: u32 = 2833; +pub const GL_POINT_SIZE_GRANULARITY: u32 = 2835; +pub const GL_POINT_SIZE_RANGE: u32 = 2834; +pub const GL_LINE_SMOOTH: u32 = 2848; +pub const GL_LINE_STIPPLE: u32 = 2852; +pub const GL_LINE_STIPPLE_PATTERN: u32 = 2853; +pub const GL_LINE_STIPPLE_REPEAT: u32 = 2854; +pub const GL_LINE_WIDTH: u32 = 2849; +pub const GL_LINE_WIDTH_GRANULARITY: u32 = 2851; +pub const GL_LINE_WIDTH_RANGE: u32 = 2850; +pub const GL_POINT: u32 = 6912; +pub const GL_LINE: u32 = 6913; +pub const GL_FILL: u32 = 6914; +pub const GL_CW: u32 = 2304; +pub const GL_CCW: u32 = 2305; +pub const GL_FRONT: u32 = 1028; +pub const GL_BACK: u32 = 1029; +pub const GL_POLYGON_MODE: u32 = 2880; +pub const GL_POLYGON_SMOOTH: u32 = 2881; +pub const GL_POLYGON_STIPPLE: u32 = 2882; +pub const GL_EDGE_FLAG: u32 = 2883; +pub const GL_CULL_FACE: u32 = 2884; +pub const GL_CULL_FACE_MODE: u32 = 2885; +pub const GL_FRONT_FACE: u32 = 2886; +pub const GL_POLYGON_OFFSET_FACTOR: u32 = 32824; +pub const GL_POLYGON_OFFSET_UNITS: u32 = 10752; +pub const GL_POLYGON_OFFSET_POINT: u32 = 10753; +pub const GL_POLYGON_OFFSET_LINE: u32 = 10754; +pub const GL_POLYGON_OFFSET_FILL: u32 = 32823; +pub const GL_COMPILE: u32 = 4864; +pub const GL_COMPILE_AND_EXECUTE: u32 = 4865; +pub const GL_LIST_BASE: u32 = 2866; +pub const GL_LIST_INDEX: u32 = 2867; +pub const GL_LIST_MODE: u32 = 2864; +pub const GL_NEVER: u32 = 512; +pub const GL_LESS: u32 = 513; +pub const GL_EQUAL: u32 = 514; +pub const GL_LEQUAL: u32 = 515; +pub const GL_GREATER: u32 = 516; +pub const GL_NOTEQUAL: u32 = 517; +pub const GL_GEQUAL: u32 = 518; +pub const GL_ALWAYS: u32 = 519; +pub const GL_DEPTH_TEST: u32 = 2929; +pub const GL_DEPTH_BITS: u32 = 3414; +pub const GL_DEPTH_CLEAR_VALUE: u32 = 2931; +pub const GL_DEPTH_FUNC: u32 = 2932; +pub const GL_DEPTH_RANGE: u32 = 2928; +pub const GL_DEPTH_WRITEMASK: u32 = 2930; +pub const GL_DEPTH_COMPONENT: u32 = 6402; +pub const GL_LIGHTING: u32 = 2896; +pub const GL_LIGHT0: u32 = 16384; +pub const GL_LIGHT1: u32 = 16385; +pub const GL_LIGHT2: u32 = 16386; +pub const GL_LIGHT3: u32 = 16387; +pub const GL_LIGHT4: u32 = 16388; +pub const GL_LIGHT5: u32 = 16389; +pub const GL_LIGHT6: u32 = 16390; +pub const GL_LIGHT7: u32 = 16391; +pub const GL_SPOT_EXPONENT: u32 = 4613; +pub const GL_SPOT_CUTOFF: u32 = 4614; +pub const GL_CONSTANT_ATTENUATION: u32 = 4615; +pub const GL_LINEAR_ATTENUATION: u32 = 4616; +pub const GL_QUADRATIC_ATTENUATION: u32 = 4617; +pub const GL_AMBIENT: u32 = 4608; +pub const GL_DIFFUSE: u32 = 4609; +pub const GL_SPECULAR: u32 = 4610; +pub const GL_SHININESS: u32 = 5633; +pub const GL_EMISSION: u32 = 5632; +pub const GL_POSITION: u32 = 4611; +pub const GL_SPOT_DIRECTION: u32 = 4612; +pub const GL_AMBIENT_AND_DIFFUSE: u32 = 5634; +pub const GL_COLOR_INDEXES: u32 = 5635; +pub const GL_LIGHT_MODEL_TWO_SIDE: u32 = 2898; +pub const GL_LIGHT_MODEL_LOCAL_VIEWER: u32 = 2897; +pub const GL_LIGHT_MODEL_AMBIENT: u32 = 2899; +pub const GL_FRONT_AND_BACK: u32 = 1032; +pub const GL_SHADE_MODEL: u32 = 2900; +pub const GL_FLAT: u32 = 7424; +pub const GL_SMOOTH: u32 = 7425; +pub const GL_COLOR_MATERIAL: u32 = 2903; +pub const GL_COLOR_MATERIAL_FACE: u32 = 2901; +pub const GL_COLOR_MATERIAL_PARAMETER: u32 = 2902; +pub const GL_NORMALIZE: u32 = 2977; +pub const GL_CLIP_PLANE0: u32 = 12288; +pub const GL_CLIP_PLANE1: u32 = 12289; +pub const GL_CLIP_PLANE2: u32 = 12290; +pub const GL_CLIP_PLANE3: u32 = 12291; +pub const GL_CLIP_PLANE4: u32 = 12292; +pub const GL_CLIP_PLANE5: u32 = 12293; +pub const GL_ACCUM_RED_BITS: u32 = 3416; +pub const GL_ACCUM_GREEN_BITS: u32 = 3417; +pub const GL_ACCUM_BLUE_BITS: u32 = 3418; +pub const GL_ACCUM_ALPHA_BITS: u32 = 3419; +pub const GL_ACCUM_CLEAR_VALUE: u32 = 2944; +pub const GL_ACCUM: u32 = 256; +pub const GL_ADD: u32 = 260; +pub const GL_LOAD: u32 = 257; +pub const GL_MULT: u32 = 259; +pub const GL_RETURN: u32 = 258; +pub const GL_ALPHA_TEST: u32 = 3008; +pub const GL_ALPHA_TEST_REF: u32 = 3010; +pub const GL_ALPHA_TEST_FUNC: u32 = 3009; +pub const GL_BLEND: u32 = 3042; +pub const GL_BLEND_SRC: u32 = 3041; +pub const GL_BLEND_DST: u32 = 3040; +pub const GL_ZERO: u32 = 0; +pub const GL_ONE: u32 = 1; +pub const GL_SRC_COLOR: u32 = 768; +pub const GL_ONE_MINUS_SRC_COLOR: u32 = 769; +pub const GL_SRC_ALPHA: u32 = 770; +pub const GL_ONE_MINUS_SRC_ALPHA: u32 = 771; +pub const GL_DST_ALPHA: u32 = 772; +pub const GL_ONE_MINUS_DST_ALPHA: u32 = 773; +pub const GL_DST_COLOR: u32 = 774; +pub const GL_ONE_MINUS_DST_COLOR: u32 = 775; +pub const GL_SRC_ALPHA_SATURATE: u32 = 776; +pub const GL_FEEDBACK: u32 = 7169; +pub const GL_RENDER: u32 = 7168; +pub const GL_SELECT: u32 = 7170; +pub const GL_2D: u32 = 1536; +pub const GL_3D: u32 = 1537; +pub const GL_3D_COLOR: u32 = 1538; +pub const GL_3D_COLOR_TEXTURE: u32 = 1539; +pub const GL_4D_COLOR_TEXTURE: u32 = 1540; +pub const GL_POINT_TOKEN: u32 = 1793; +pub const GL_LINE_TOKEN: u32 = 1794; +pub const GL_LINE_RESET_TOKEN: u32 = 1799; +pub const GL_POLYGON_TOKEN: u32 = 1795; +pub const GL_BITMAP_TOKEN: u32 = 1796; +pub const GL_DRAW_PIXEL_TOKEN: u32 = 1797; +pub const GL_COPY_PIXEL_TOKEN: u32 = 1798; +pub const GL_PASS_THROUGH_TOKEN: u32 = 1792; +pub const GL_FEEDBACK_BUFFER_POINTER: u32 = 3568; +pub const GL_FEEDBACK_BUFFER_SIZE: u32 = 3569; +pub const GL_FEEDBACK_BUFFER_TYPE: u32 = 3570; +pub const GL_SELECTION_BUFFER_POINTER: u32 = 3571; +pub const GL_SELECTION_BUFFER_SIZE: u32 = 3572; +pub const GL_FOG: u32 = 2912; +pub const GL_FOG_MODE: u32 = 2917; +pub const GL_FOG_DENSITY: u32 = 2914; +pub const GL_FOG_COLOR: u32 = 2918; +pub const GL_FOG_INDEX: u32 = 2913; +pub const GL_FOG_START: u32 = 2915; +pub const GL_FOG_END: u32 = 2916; +pub const GL_LINEAR: u32 = 9729; +pub const GL_EXP: u32 = 2048; +pub const GL_EXP2: u32 = 2049; +pub const GL_LOGIC_OP: u32 = 3057; +pub const GL_INDEX_LOGIC_OP: u32 = 3057; +pub const GL_COLOR_LOGIC_OP: u32 = 3058; +pub const GL_LOGIC_OP_MODE: u32 = 3056; +pub const GL_CLEAR: u32 = 5376; +pub const GL_SET: u32 = 5391; +pub const GL_COPY: u32 = 5379; +pub const GL_COPY_INVERTED: u32 = 5388; +pub const GL_NOOP: u32 = 5381; +pub const GL_INVERT: u32 = 5386; +pub const GL_AND: u32 = 5377; +pub const GL_NAND: u32 = 5390; +pub const GL_OR: u32 = 5383; +pub const GL_NOR: u32 = 5384; +pub const GL_XOR: u32 = 5382; +pub const GL_EQUIV: u32 = 5385; +pub const GL_AND_REVERSE: u32 = 5378; +pub const GL_AND_INVERTED: u32 = 5380; +pub const GL_OR_REVERSE: u32 = 5387; +pub const GL_OR_INVERTED: u32 = 5389; +pub const GL_STENCIL_BITS: u32 = 3415; +pub const GL_STENCIL_TEST: u32 = 2960; +pub const GL_STENCIL_CLEAR_VALUE: u32 = 2961; +pub const GL_STENCIL_FUNC: u32 = 2962; +pub const GL_STENCIL_VALUE_MASK: u32 = 2963; +pub const GL_STENCIL_FAIL: u32 = 2964; +pub const GL_STENCIL_PASS_DEPTH_FAIL: u32 = 2965; +pub const GL_STENCIL_PASS_DEPTH_PASS: u32 = 2966; +pub const GL_STENCIL_REF: u32 = 2967; +pub const GL_STENCIL_WRITEMASK: u32 = 2968; +pub const GL_STENCIL_INDEX: u32 = 6401; +pub const GL_KEEP: u32 = 7680; +pub const GL_REPLACE: u32 = 7681; +pub const GL_INCR: u32 = 7682; +pub const GL_DECR: u32 = 7683; +pub const GL_NONE: u32 = 0; +pub const GL_LEFT: u32 = 1030; +pub const GL_RIGHT: u32 = 1031; +pub const GL_FRONT_LEFT: u32 = 1024; +pub const GL_FRONT_RIGHT: u32 = 1025; +pub const GL_BACK_LEFT: u32 = 1026; +pub const GL_BACK_RIGHT: u32 = 1027; +pub const GL_AUX0: u32 = 1033; +pub const GL_AUX1: u32 = 1034; +pub const GL_AUX2: u32 = 1035; +pub const GL_AUX3: u32 = 1036; +pub const GL_COLOR_INDEX: u32 = 6400; +pub const GL_RED: u32 = 6403; +pub const GL_GREEN: u32 = 6404; +pub const GL_BLUE: u32 = 6405; +pub const GL_ALPHA: u32 = 6406; +pub const GL_LUMINANCE: u32 = 6409; +pub const GL_LUMINANCE_ALPHA: u32 = 6410; +pub const GL_ALPHA_BITS: u32 = 3413; +pub const GL_RED_BITS: u32 = 3410; +pub const GL_GREEN_BITS: u32 = 3411; +pub const GL_BLUE_BITS: u32 = 3412; +pub const GL_INDEX_BITS: u32 = 3409; +pub const GL_SUBPIXEL_BITS: u32 = 3408; +pub const GL_AUX_BUFFERS: u32 = 3072; +pub const GL_READ_BUFFER: u32 = 3074; +pub const GL_DRAW_BUFFER: u32 = 3073; +pub const GL_DOUBLEBUFFER: u32 = 3122; +pub const GL_STEREO: u32 = 3123; +pub const GL_BITMAP: u32 = 6656; +pub const GL_COLOR: u32 = 6144; +pub const GL_DEPTH: u32 = 6145; +pub const GL_STENCIL: u32 = 6146; +pub const GL_DITHER: u32 = 3024; +pub const GL_RGB: u32 = 6407; +pub const GL_RGBA: u32 = 6408; +pub const GL_MAX_LIST_NESTING: u32 = 2865; +pub const GL_MAX_EVAL_ORDER: u32 = 3376; +pub const GL_MAX_LIGHTS: u32 = 3377; +pub const GL_MAX_CLIP_PLANES: u32 = 3378; +pub const GL_MAX_TEXTURE_SIZE: u32 = 3379; +pub const GL_MAX_PIXEL_MAP_TABLE: u32 = 3380; +pub const GL_MAX_ATTRIB_STACK_DEPTH: u32 = 3381; +pub const GL_MAX_MODELVIEW_STACK_DEPTH: u32 = 3382; +pub const GL_MAX_NAME_STACK_DEPTH: u32 = 3383; +pub const GL_MAX_PROJECTION_STACK_DEPTH: u32 = 3384; +pub const GL_MAX_TEXTURE_STACK_DEPTH: u32 = 3385; +pub const GL_MAX_VIEWPORT_DIMS: u32 = 3386; +pub const GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: u32 = 3387; +pub const GL_ATTRIB_STACK_DEPTH: u32 = 2992; +pub const GL_CLIENT_ATTRIB_STACK_DEPTH: u32 = 2993; +pub const GL_COLOR_CLEAR_VALUE: u32 = 3106; +pub const GL_COLOR_WRITEMASK: u32 = 3107; +pub const GL_CURRENT_INDEX: u32 = 2817; +pub const GL_CURRENT_COLOR: u32 = 2816; +pub const GL_CURRENT_NORMAL: u32 = 2818; +pub const GL_CURRENT_RASTER_COLOR: u32 = 2820; +pub const GL_CURRENT_RASTER_DISTANCE: u32 = 2825; +pub const GL_CURRENT_RASTER_INDEX: u32 = 2821; +pub const GL_CURRENT_RASTER_POSITION: u32 = 2823; +pub const GL_CURRENT_RASTER_TEXTURE_COORDS: u32 = 2822; +pub const GL_CURRENT_RASTER_POSITION_VALID: u32 = 2824; +pub const GL_CURRENT_TEXTURE_COORDS: u32 = 2819; +pub const GL_INDEX_CLEAR_VALUE: u32 = 3104; +pub const GL_INDEX_MODE: u32 = 3120; +pub const GL_INDEX_WRITEMASK: u32 = 3105; +pub const GL_MODELVIEW_MATRIX: u32 = 2982; +pub const GL_MODELVIEW_STACK_DEPTH: u32 = 2979; +pub const GL_NAME_STACK_DEPTH: u32 = 3440; +pub const GL_PROJECTION_MATRIX: u32 = 2983; +pub const GL_PROJECTION_STACK_DEPTH: u32 = 2980; +pub const GL_RENDER_MODE: u32 = 3136; +pub const GL_RGBA_MODE: u32 = 3121; +pub const GL_TEXTURE_MATRIX: u32 = 2984; +pub const GL_TEXTURE_STACK_DEPTH: u32 = 2981; +pub const GL_VIEWPORT: u32 = 2978; +pub const GL_AUTO_NORMAL: u32 = 3456; +pub const GL_MAP1_COLOR_4: u32 = 3472; +pub const GL_MAP1_INDEX: u32 = 3473; +pub const GL_MAP1_NORMAL: u32 = 3474; +pub const GL_MAP1_TEXTURE_COORD_1: u32 = 3475; +pub const GL_MAP1_TEXTURE_COORD_2: u32 = 3476; +pub const GL_MAP1_TEXTURE_COORD_3: u32 = 3477; +pub const GL_MAP1_TEXTURE_COORD_4: u32 = 3478; +pub const GL_MAP1_VERTEX_3: u32 = 3479; +pub const GL_MAP1_VERTEX_4: u32 = 3480; +pub const GL_MAP2_COLOR_4: u32 = 3504; +pub const GL_MAP2_INDEX: u32 = 3505; +pub const GL_MAP2_NORMAL: u32 = 3506; +pub const GL_MAP2_TEXTURE_COORD_1: u32 = 3507; +pub const GL_MAP2_TEXTURE_COORD_2: u32 = 3508; +pub const GL_MAP2_TEXTURE_COORD_3: u32 = 3509; +pub const GL_MAP2_TEXTURE_COORD_4: u32 = 3510; +pub const GL_MAP2_VERTEX_3: u32 = 3511; +pub const GL_MAP2_VERTEX_4: u32 = 3512; +pub const GL_MAP1_GRID_DOMAIN: u32 = 3536; +pub const GL_MAP1_GRID_SEGMENTS: u32 = 3537; +pub const GL_MAP2_GRID_DOMAIN: u32 = 3538; +pub const GL_MAP2_GRID_SEGMENTS: u32 = 3539; +pub const GL_COEFF: u32 = 2560; +pub const GL_ORDER: u32 = 2561; +pub const GL_DOMAIN: u32 = 2562; +pub const GL_PERSPECTIVE_CORRECTION_HINT: u32 = 3152; +pub const GL_POINT_SMOOTH_HINT: u32 = 3153; +pub const GL_LINE_SMOOTH_HINT: u32 = 3154; +pub const GL_POLYGON_SMOOTH_HINT: u32 = 3155; +pub const GL_FOG_HINT: u32 = 3156; +pub const GL_DONT_CARE: u32 = 4352; +pub const GL_FASTEST: u32 = 4353; +pub const GL_NICEST: u32 = 4354; +pub const GL_SCISSOR_BOX: u32 = 3088; +pub const GL_SCISSOR_TEST: u32 = 3089; +pub const GL_MAP_COLOR: u32 = 3344; +pub const GL_MAP_STENCIL: u32 = 3345; +pub const GL_INDEX_SHIFT: u32 = 3346; +pub const GL_INDEX_OFFSET: u32 = 3347; +pub const GL_RED_SCALE: u32 = 3348; +pub const GL_RED_BIAS: u32 = 3349; +pub const GL_GREEN_SCALE: u32 = 3352; +pub const GL_GREEN_BIAS: u32 = 3353; +pub const GL_BLUE_SCALE: u32 = 3354; +pub const GL_BLUE_BIAS: u32 = 3355; +pub const GL_ALPHA_SCALE: u32 = 3356; +pub const GL_ALPHA_BIAS: u32 = 3357; +pub const GL_DEPTH_SCALE: u32 = 3358; +pub const GL_DEPTH_BIAS: u32 = 3359; +pub const GL_PIXEL_MAP_S_TO_S_SIZE: u32 = 3249; +pub const GL_PIXEL_MAP_I_TO_I_SIZE: u32 = 3248; +pub const GL_PIXEL_MAP_I_TO_R_SIZE: u32 = 3250; +pub const GL_PIXEL_MAP_I_TO_G_SIZE: u32 = 3251; +pub const GL_PIXEL_MAP_I_TO_B_SIZE: u32 = 3252; +pub const GL_PIXEL_MAP_I_TO_A_SIZE: u32 = 3253; +pub const GL_PIXEL_MAP_R_TO_R_SIZE: u32 = 3254; +pub const GL_PIXEL_MAP_G_TO_G_SIZE: u32 = 3255; +pub const GL_PIXEL_MAP_B_TO_B_SIZE: u32 = 3256; +pub const GL_PIXEL_MAP_A_TO_A_SIZE: u32 = 3257; +pub const GL_PIXEL_MAP_S_TO_S: u32 = 3185; +pub const GL_PIXEL_MAP_I_TO_I: u32 = 3184; +pub const GL_PIXEL_MAP_I_TO_R: u32 = 3186; +pub const GL_PIXEL_MAP_I_TO_G: u32 = 3187; +pub const GL_PIXEL_MAP_I_TO_B: u32 = 3188; +pub const GL_PIXEL_MAP_I_TO_A: u32 = 3189; +pub const GL_PIXEL_MAP_R_TO_R: u32 = 3190; +pub const GL_PIXEL_MAP_G_TO_G: u32 = 3191; +pub const GL_PIXEL_MAP_B_TO_B: u32 = 3192; +pub const GL_PIXEL_MAP_A_TO_A: u32 = 3193; +pub const GL_PACK_ALIGNMENT: u32 = 3333; +pub const GL_PACK_LSB_FIRST: u32 = 3329; +pub const GL_PACK_ROW_LENGTH: u32 = 3330; +pub const GL_PACK_SKIP_PIXELS: u32 = 3332; +pub const GL_PACK_SKIP_ROWS: u32 = 3331; +pub const GL_PACK_SWAP_BYTES: u32 = 3328; +pub const GL_UNPACK_ALIGNMENT: u32 = 3317; +pub const GL_UNPACK_LSB_FIRST: u32 = 3313; +pub const GL_UNPACK_ROW_LENGTH: u32 = 3314; +pub const GL_UNPACK_SKIP_PIXELS: u32 = 3316; +pub const GL_UNPACK_SKIP_ROWS: u32 = 3315; +pub const GL_UNPACK_SWAP_BYTES: u32 = 3312; +pub const GL_ZOOM_X: u32 = 3350; +pub const GL_ZOOM_Y: u32 = 3351; +pub const GL_TEXTURE_ENV: u32 = 8960; +pub const GL_TEXTURE_ENV_MODE: u32 = 8704; +pub const GL_TEXTURE_1D: u32 = 3552; +pub const GL_TEXTURE_2D: u32 = 3553; +pub const GL_TEXTURE_WRAP_S: u32 = 10242; +pub const GL_TEXTURE_WRAP_T: u32 = 10243; +pub const GL_TEXTURE_MAG_FILTER: u32 = 10240; +pub const GL_TEXTURE_MIN_FILTER: u32 = 10241; +pub const GL_TEXTURE_ENV_COLOR: u32 = 8705; +pub const GL_TEXTURE_GEN_S: u32 = 3168; +pub const GL_TEXTURE_GEN_T: u32 = 3169; +pub const GL_TEXTURE_GEN_R: u32 = 3170; +pub const GL_TEXTURE_GEN_Q: u32 = 3171; +pub const GL_TEXTURE_GEN_MODE: u32 = 9472; +pub const GL_TEXTURE_BORDER_COLOR: u32 = 4100; +pub const GL_TEXTURE_WIDTH: u32 = 4096; +pub const GL_TEXTURE_HEIGHT: u32 = 4097; +pub const GL_TEXTURE_BORDER: u32 = 4101; +pub const GL_TEXTURE_COMPONENTS: u32 = 4099; +pub const GL_TEXTURE_RED_SIZE: u32 = 32860; +pub const GL_TEXTURE_GREEN_SIZE: u32 = 32861; +pub const GL_TEXTURE_BLUE_SIZE: u32 = 32862; +pub const GL_TEXTURE_ALPHA_SIZE: u32 = 32863; +pub const GL_TEXTURE_LUMINANCE_SIZE: u32 = 32864; +pub const GL_TEXTURE_INTENSITY_SIZE: u32 = 32865; +pub const GL_NEAREST_MIPMAP_NEAREST: u32 = 9984; +pub const GL_NEAREST_MIPMAP_LINEAR: u32 = 9986; +pub const GL_LINEAR_MIPMAP_NEAREST: u32 = 9985; +pub const GL_LINEAR_MIPMAP_LINEAR: u32 = 9987; +pub const GL_OBJECT_LINEAR: u32 = 9217; +pub const GL_OBJECT_PLANE: u32 = 9473; +pub const GL_EYE_LINEAR: u32 = 9216; +pub const GL_EYE_PLANE: u32 = 9474; +pub const GL_SPHERE_MAP: u32 = 9218; +pub const GL_DECAL: u32 = 8449; +pub const GL_MODULATE: u32 = 8448; +pub const GL_NEAREST: u32 = 9728; +pub const GL_REPEAT: u32 = 10497; +pub const GL_CLAMP: u32 = 10496; +pub const GL_S: u32 = 8192; +pub const GL_T: u32 = 8193; +pub const GL_R: u32 = 8194; +pub const GL_Q: u32 = 8195; +pub const GL_VENDOR: u32 = 7936; +pub const GL_RENDERER: u32 = 7937; +pub const GL_VERSION: u32 = 7938; +pub const GL_EXTENSIONS: u32 = 7939; +pub const GL_NO_ERROR: u32 = 0; +pub const GL_INVALID_ENUM: u32 = 1280; +pub const GL_INVALID_VALUE: u32 = 1281; +pub const GL_INVALID_OPERATION: u32 = 1282; +pub const GL_STACK_OVERFLOW: u32 = 1283; +pub const GL_STACK_UNDERFLOW: u32 = 1284; +pub const GL_OUT_OF_MEMORY: u32 = 1285; +pub const GL_CURRENT_BIT: u32 = 1; +pub const GL_POINT_BIT: u32 = 2; +pub const GL_LINE_BIT: u32 = 4; +pub const GL_POLYGON_BIT: u32 = 8; +pub const GL_POLYGON_STIPPLE_BIT: u32 = 16; +pub const GL_PIXEL_MODE_BIT: u32 = 32; +pub const GL_LIGHTING_BIT: u32 = 64; +pub const GL_FOG_BIT: u32 = 128; +pub const GL_DEPTH_BUFFER_BIT: u32 = 256; +pub const GL_ACCUM_BUFFER_BIT: u32 = 512; +pub const GL_STENCIL_BUFFER_BIT: u32 = 1024; +pub const GL_VIEWPORT_BIT: u32 = 2048; +pub const GL_TRANSFORM_BIT: u32 = 4096; +pub const GL_ENABLE_BIT: u32 = 8192; +pub const GL_COLOR_BUFFER_BIT: u32 = 16384; +pub const GL_HINT_BIT: u32 = 32768; +pub const GL_EVAL_BIT: u32 = 65536; +pub const GL_LIST_BIT: u32 = 131072; +pub const GL_TEXTURE_BIT: u32 = 262144; +pub const GL_SCISSOR_BIT: u32 = 524288; +pub const GL_ALL_ATTRIB_BITS: u32 = 4294967295; +pub const GL_PROXY_TEXTURE_1D: u32 = 32867; +pub const GL_PROXY_TEXTURE_2D: u32 = 32868; +pub const GL_TEXTURE_PRIORITY: u32 = 32870; +pub const GL_TEXTURE_RESIDENT: u32 = 32871; +pub const GL_TEXTURE_BINDING_1D: u32 = 32872; +pub const GL_TEXTURE_BINDING_2D: u32 = 32873; +pub const GL_TEXTURE_INTERNAL_FORMAT: u32 = 4099; +pub const GL_ALPHA4: u32 = 32827; +pub const GL_ALPHA8: u32 = 32828; +pub const GL_ALPHA12: u32 = 32829; +pub const GL_ALPHA16: u32 = 32830; +pub const GL_LUMINANCE4: u32 = 32831; +pub const GL_LUMINANCE8: u32 = 32832; +pub const GL_LUMINANCE12: u32 = 32833; +pub const GL_LUMINANCE16: u32 = 32834; +pub const GL_LUMINANCE4_ALPHA4: u32 = 32835; +pub const GL_LUMINANCE6_ALPHA2: u32 = 32836; +pub const GL_LUMINANCE8_ALPHA8: u32 = 32837; +pub const GL_LUMINANCE12_ALPHA4: u32 = 32838; +pub const GL_LUMINANCE12_ALPHA12: u32 = 32839; +pub const GL_LUMINANCE16_ALPHA16: u32 = 32840; +pub const GL_INTENSITY: u32 = 32841; +pub const GL_INTENSITY4: u32 = 32842; +pub const GL_INTENSITY8: u32 = 32843; +pub const GL_INTENSITY12: u32 = 32844; +pub const GL_INTENSITY16: u32 = 32845; +pub const GL_R3_G3_B2: u32 = 10768; +pub const GL_RGB4: u32 = 32847; +pub const GL_RGB5: u32 = 32848; +pub const GL_RGB8: u32 = 32849; +pub const GL_RGB10: u32 = 32850; +pub const GL_RGB12: u32 = 32851; +pub const GL_RGB16: u32 = 32852; +pub const GL_RGBA2: u32 = 32853; +pub const GL_RGBA4: u32 = 32854; +pub const GL_RGB5_A1: u32 = 32855; +pub const GL_RGBA8: u32 = 32856; +pub const GL_RGB10_A2: u32 = 32857; +pub const GL_RGBA12: u32 = 32858; +pub const GL_RGBA16: u32 = 32859; +pub const GL_CLIENT_PIXEL_STORE_BIT: u32 = 1; +pub const GL_CLIENT_VERTEX_ARRAY_BIT: u32 = 2; +pub const GL_ALL_CLIENT_ATTRIB_BITS: u32 = 4294967295; +pub const GL_CLIENT_ALL_ATTRIB_BITS: u32 = 4294967295; +pub const GL_RESCALE_NORMAL: u32 = 32826; +pub const GL_CLAMP_TO_EDGE: u32 = 33071; +pub const GL_MAX_ELEMENTS_VERTICES: u32 = 33000; +pub const GL_MAX_ELEMENTS_INDICES: u32 = 33001; +pub const GL_BGR: u32 = 32992; +pub const GL_BGRA: u32 = 32993; +pub const GL_UNSIGNED_BYTE_3_3_2: u32 = 32818; +pub const GL_UNSIGNED_BYTE_2_3_3_REV: u32 = 33634; +pub const GL_UNSIGNED_SHORT_5_6_5: u32 = 33635; +pub const GL_UNSIGNED_SHORT_5_6_5_REV: u32 = 33636; +pub const GL_UNSIGNED_SHORT_4_4_4_4: u32 = 32819; +pub const GL_UNSIGNED_SHORT_4_4_4_4_REV: u32 = 33637; +pub const GL_UNSIGNED_SHORT_5_5_5_1: u32 = 32820; +pub const GL_UNSIGNED_SHORT_1_5_5_5_REV: u32 = 33638; +pub const GL_UNSIGNED_INT_8_8_8_8: u32 = 32821; +pub const GL_UNSIGNED_INT_8_8_8_8_REV: u32 = 33639; +pub const GL_UNSIGNED_INT_10_10_10_2: u32 = 32822; +pub const GL_UNSIGNED_INT_2_10_10_10_REV: u32 = 33640; +pub const GL_LIGHT_MODEL_COLOR_CONTROL: u32 = 33272; +pub const GL_SINGLE_COLOR: u32 = 33273; +pub const GL_SEPARATE_SPECULAR_COLOR: u32 = 33274; +pub const GL_TEXTURE_MIN_LOD: u32 = 33082; +pub const GL_TEXTURE_MAX_LOD: u32 = 33083; +pub const GL_TEXTURE_BASE_LEVEL: u32 = 33084; +pub const GL_TEXTURE_MAX_LEVEL: u32 = 33085; +pub const GL_SMOOTH_POINT_SIZE_RANGE: u32 = 2834; +pub const GL_SMOOTH_POINT_SIZE_GRANULARITY: u32 = 2835; +pub const GL_SMOOTH_LINE_WIDTH_RANGE: u32 = 2850; +pub const GL_SMOOTH_LINE_WIDTH_GRANULARITY: u32 = 2851; +pub const GL_ALIASED_POINT_SIZE_RANGE: u32 = 33901; +pub const GL_ALIASED_LINE_WIDTH_RANGE: u32 = 33902; +pub const GL_PACK_SKIP_IMAGES: u32 = 32875; +pub const GL_PACK_IMAGE_HEIGHT: u32 = 32876; +pub const GL_UNPACK_SKIP_IMAGES: u32 = 32877; +pub const GL_UNPACK_IMAGE_HEIGHT: u32 = 32878; +pub const GL_TEXTURE_3D: u32 = 32879; +pub const GL_PROXY_TEXTURE_3D: u32 = 32880; +pub const GL_TEXTURE_DEPTH: u32 = 32881; +pub const GL_TEXTURE_WRAP_R: u32 = 32882; +pub const GL_MAX_3D_TEXTURE_SIZE: u32 = 32883; +pub const GL_TEXTURE_BINDING_3D: u32 = 32874; +pub const GL_CONSTANT_COLOR: u32 = 32769; +pub const GL_ONE_MINUS_CONSTANT_COLOR: u32 = 32770; +pub const GL_CONSTANT_ALPHA: u32 = 32771; +pub const GL_ONE_MINUS_CONSTANT_ALPHA: u32 = 32772; +pub const GL_COLOR_TABLE: u32 = 32976; +pub const GL_POST_CONVOLUTION_COLOR_TABLE: u32 = 32977; +pub const GL_POST_COLOR_MATRIX_COLOR_TABLE: u32 = 32978; +pub const GL_PROXY_COLOR_TABLE: u32 = 32979; +pub const GL_PROXY_POST_CONVOLUTION_COLOR_TABLE: u32 = 32980; +pub const GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE: u32 = 32981; +pub const GL_COLOR_TABLE_SCALE: u32 = 32982; +pub const GL_COLOR_TABLE_BIAS: u32 = 32983; +pub const GL_COLOR_TABLE_FORMAT: u32 = 32984; +pub const GL_COLOR_TABLE_WIDTH: u32 = 32985; +pub const GL_COLOR_TABLE_RED_SIZE: u32 = 32986; +pub const GL_COLOR_TABLE_GREEN_SIZE: u32 = 32987; +pub const GL_COLOR_TABLE_BLUE_SIZE: u32 = 32988; +pub const GL_COLOR_TABLE_ALPHA_SIZE: u32 = 32989; +pub const GL_COLOR_TABLE_LUMINANCE_SIZE: u32 = 32990; +pub const GL_COLOR_TABLE_INTENSITY_SIZE: u32 = 32991; +pub const GL_CONVOLUTION_1D: u32 = 32784; +pub const GL_CONVOLUTION_2D: u32 = 32785; +pub const GL_SEPARABLE_2D: u32 = 32786; +pub const GL_CONVOLUTION_BORDER_MODE: u32 = 32787; +pub const GL_CONVOLUTION_FILTER_SCALE: u32 = 32788; +pub const GL_CONVOLUTION_FILTER_BIAS: u32 = 32789; +pub const GL_REDUCE: u32 = 32790; +pub const GL_CONVOLUTION_FORMAT: u32 = 32791; +pub const GL_CONVOLUTION_WIDTH: u32 = 32792; +pub const GL_CONVOLUTION_HEIGHT: u32 = 32793; +pub const GL_MAX_CONVOLUTION_WIDTH: u32 = 32794; +pub const GL_MAX_CONVOLUTION_HEIGHT: u32 = 32795; +pub const GL_POST_CONVOLUTION_RED_SCALE: u32 = 32796; +pub const GL_POST_CONVOLUTION_GREEN_SCALE: u32 = 32797; +pub const GL_POST_CONVOLUTION_BLUE_SCALE: u32 = 32798; +pub const GL_POST_CONVOLUTION_ALPHA_SCALE: u32 = 32799; +pub const GL_POST_CONVOLUTION_RED_BIAS: u32 = 32800; +pub const GL_POST_CONVOLUTION_GREEN_BIAS: u32 = 32801; +pub const GL_POST_CONVOLUTION_BLUE_BIAS: u32 = 32802; +pub const GL_POST_CONVOLUTION_ALPHA_BIAS: u32 = 32803; +pub const GL_CONSTANT_BORDER: u32 = 33105; +pub const GL_REPLICATE_BORDER: u32 = 33107; +pub const GL_CONVOLUTION_BORDER_COLOR: u32 = 33108; +pub const GL_COLOR_MATRIX: u32 = 32945; +pub const GL_COLOR_MATRIX_STACK_DEPTH: u32 = 32946; +pub const GL_MAX_COLOR_MATRIX_STACK_DEPTH: u32 = 32947; +pub const GL_POST_COLOR_MATRIX_RED_SCALE: u32 = 32948; +pub const GL_POST_COLOR_MATRIX_GREEN_SCALE: u32 = 32949; +pub const GL_POST_COLOR_MATRIX_BLUE_SCALE: u32 = 32950; +pub const GL_POST_COLOR_MATRIX_ALPHA_SCALE: u32 = 32951; +pub const GL_POST_COLOR_MATRIX_RED_BIAS: u32 = 32952; +pub const GL_POST_COLOR_MATRIX_GREEN_BIAS: u32 = 32953; +pub const GL_POST_COLOR_MATRIX_BLUE_BIAS: u32 = 32954; +pub const GL_POST_COLOR_MATRIX_ALPHA_BIAS: u32 = 32955; +pub const GL_HISTOGRAM: u32 = 32804; +pub const GL_PROXY_HISTOGRAM: u32 = 32805; +pub const GL_HISTOGRAM_WIDTH: u32 = 32806; +pub const GL_HISTOGRAM_FORMAT: u32 = 32807; +pub const GL_HISTOGRAM_RED_SIZE: u32 = 32808; +pub const GL_HISTOGRAM_GREEN_SIZE: u32 = 32809; +pub const GL_HISTOGRAM_BLUE_SIZE: u32 = 32810; +pub const GL_HISTOGRAM_ALPHA_SIZE: u32 = 32811; +pub const GL_HISTOGRAM_LUMINANCE_SIZE: u32 = 32812; +pub const GL_HISTOGRAM_SINK: u32 = 32813; +pub const GL_MINMAX: u32 = 32814; +pub const GL_MINMAX_FORMAT: u32 = 32815; +pub const GL_MINMAX_SINK: u32 = 32816; +pub const GL_TABLE_TOO_LARGE: u32 = 32817; +pub const GL_BLEND_EQUATION: u32 = 32777; +pub const GL_MIN: u32 = 32775; +pub const GL_MAX: u32 = 32776; +pub const GL_FUNC_ADD: u32 = 32774; +pub const GL_FUNC_SUBTRACT: u32 = 32778; +pub const GL_FUNC_REVERSE_SUBTRACT: u32 = 32779; +pub const GL_BLEND_COLOR: u32 = 32773; +pub const GL_TEXTURE0: u32 = 33984; +pub const GL_TEXTURE1: u32 = 33985; +pub const GL_TEXTURE2: u32 = 33986; +pub const GL_TEXTURE3: u32 = 33987; +pub const GL_TEXTURE4: u32 = 33988; +pub const GL_TEXTURE5: u32 = 33989; +pub const GL_TEXTURE6: u32 = 33990; +pub const GL_TEXTURE7: u32 = 33991; +pub const GL_TEXTURE8: u32 = 33992; +pub const GL_TEXTURE9: u32 = 33993; +pub const GL_TEXTURE10: u32 = 33994; +pub const GL_TEXTURE11: u32 = 33995; +pub const GL_TEXTURE12: u32 = 33996; +pub const GL_TEXTURE13: u32 = 33997; +pub const GL_TEXTURE14: u32 = 33998; +pub const GL_TEXTURE15: u32 = 33999; +pub const GL_TEXTURE16: u32 = 34000; +pub const GL_TEXTURE17: u32 = 34001; +pub const GL_TEXTURE18: u32 = 34002; +pub const GL_TEXTURE19: u32 = 34003; +pub const GL_TEXTURE20: u32 = 34004; +pub const GL_TEXTURE21: u32 = 34005; +pub const GL_TEXTURE22: u32 = 34006; +pub const GL_TEXTURE23: u32 = 34007; +pub const GL_TEXTURE24: u32 = 34008; +pub const GL_TEXTURE25: u32 = 34009; +pub const GL_TEXTURE26: u32 = 34010; +pub const GL_TEXTURE27: u32 = 34011; +pub const GL_TEXTURE28: u32 = 34012; +pub const GL_TEXTURE29: u32 = 34013; +pub const GL_TEXTURE30: u32 = 34014; +pub const GL_TEXTURE31: u32 = 34015; +pub const GL_ACTIVE_TEXTURE: u32 = 34016; +pub const GL_CLIENT_ACTIVE_TEXTURE: u32 = 34017; +pub const GL_MAX_TEXTURE_UNITS: u32 = 34018; +pub const GL_NORMAL_MAP: u32 = 34065; +pub const GL_REFLECTION_MAP: u32 = 34066; +pub const GL_TEXTURE_CUBE_MAP: u32 = 34067; +pub const GL_TEXTURE_BINDING_CUBE_MAP: u32 = 34068; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X: u32 = 34069; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X: u32 = 34070; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y: u32 = 34071; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: u32 = 34072; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z: u32 = 34073; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: u32 = 34074; +pub const GL_PROXY_TEXTURE_CUBE_MAP: u32 = 34075; +pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE: u32 = 34076; +pub const GL_COMPRESSED_ALPHA: u32 = 34025; +pub const GL_COMPRESSED_LUMINANCE: u32 = 34026; +pub const GL_COMPRESSED_LUMINANCE_ALPHA: u32 = 34027; +pub const GL_COMPRESSED_INTENSITY: u32 = 34028; +pub const GL_COMPRESSED_RGB: u32 = 34029; +pub const GL_COMPRESSED_RGBA: u32 = 34030; +pub const GL_TEXTURE_COMPRESSION_HINT: u32 = 34031; +pub const GL_TEXTURE_COMPRESSED_IMAGE_SIZE: u32 = 34464; +pub const GL_TEXTURE_COMPRESSED: u32 = 34465; +pub const GL_NUM_COMPRESSED_TEXTURE_FORMATS: u32 = 34466; +pub const GL_COMPRESSED_TEXTURE_FORMATS: u32 = 34467; +pub const GL_MULTISAMPLE: u32 = 32925; +pub const GL_SAMPLE_ALPHA_TO_COVERAGE: u32 = 32926; +pub const GL_SAMPLE_ALPHA_TO_ONE: u32 = 32927; +pub const GL_SAMPLE_COVERAGE: u32 = 32928; +pub const GL_SAMPLE_BUFFERS: u32 = 32936; +pub const GL_SAMPLES: u32 = 32937; +pub const GL_SAMPLE_COVERAGE_VALUE: u32 = 32938; +pub const GL_SAMPLE_COVERAGE_INVERT: u32 = 32939; +pub const GL_MULTISAMPLE_BIT: u32 = 536870912; +pub const GL_TRANSPOSE_MODELVIEW_MATRIX: u32 = 34019; +pub const GL_TRANSPOSE_PROJECTION_MATRIX: u32 = 34020; +pub const GL_TRANSPOSE_TEXTURE_MATRIX: u32 = 34021; +pub const GL_TRANSPOSE_COLOR_MATRIX: u32 = 34022; +pub const GL_COMBINE: u32 = 34160; +pub const GL_COMBINE_RGB: u32 = 34161; +pub const GL_COMBINE_ALPHA: u32 = 34162; +pub const GL_SOURCE0_RGB: u32 = 34176; +pub const GL_SOURCE1_RGB: u32 = 34177; +pub const GL_SOURCE2_RGB: u32 = 34178; +pub const GL_SOURCE0_ALPHA: u32 = 34184; +pub const GL_SOURCE1_ALPHA: u32 = 34185; +pub const GL_SOURCE2_ALPHA: u32 = 34186; +pub const GL_OPERAND0_RGB: u32 = 34192; +pub const GL_OPERAND1_RGB: u32 = 34193; +pub const GL_OPERAND2_RGB: u32 = 34194; +pub const GL_OPERAND0_ALPHA: u32 = 34200; +pub const GL_OPERAND1_ALPHA: u32 = 34201; +pub const GL_OPERAND2_ALPHA: u32 = 34202; +pub const GL_RGB_SCALE: u32 = 34163; +pub const GL_ADD_SIGNED: u32 = 34164; +pub const GL_INTERPOLATE: u32 = 34165; +pub const GL_SUBTRACT: u32 = 34023; +pub const GL_CONSTANT: u32 = 34166; +pub const GL_PRIMARY_COLOR: u32 = 34167; +pub const GL_PREVIOUS: u32 = 34168; +pub const GL_DOT3_RGB: u32 = 34478; +pub const GL_DOT3_RGBA: u32 = 34479; +pub const GL_CLAMP_TO_BORDER: u32 = 33069; +pub const GL_ARB_multitexture: u32 = 1; +pub const GL_TEXTURE0_ARB: u32 = 33984; +pub const GL_TEXTURE1_ARB: u32 = 33985; +pub const GL_TEXTURE2_ARB: u32 = 33986; +pub const GL_TEXTURE3_ARB: u32 = 33987; +pub const GL_TEXTURE4_ARB: u32 = 33988; +pub const GL_TEXTURE5_ARB: u32 = 33989; +pub const GL_TEXTURE6_ARB: u32 = 33990; +pub const GL_TEXTURE7_ARB: u32 = 33991; +pub const GL_TEXTURE8_ARB: u32 = 33992; +pub const GL_TEXTURE9_ARB: u32 = 33993; +pub const GL_TEXTURE10_ARB: u32 = 33994; +pub const GL_TEXTURE11_ARB: u32 = 33995; +pub const GL_TEXTURE12_ARB: u32 = 33996; +pub const GL_TEXTURE13_ARB: u32 = 33997; +pub const GL_TEXTURE14_ARB: u32 = 33998; +pub const GL_TEXTURE15_ARB: u32 = 33999; +pub const GL_TEXTURE16_ARB: u32 = 34000; +pub const GL_TEXTURE17_ARB: u32 = 34001; +pub const GL_TEXTURE18_ARB: u32 = 34002; +pub const GL_TEXTURE19_ARB: u32 = 34003; +pub const GL_TEXTURE20_ARB: u32 = 34004; +pub const GL_TEXTURE21_ARB: u32 = 34005; +pub const GL_TEXTURE22_ARB: u32 = 34006; +pub const GL_TEXTURE23_ARB: u32 = 34007; +pub const GL_TEXTURE24_ARB: u32 = 34008; +pub const GL_TEXTURE25_ARB: u32 = 34009; +pub const GL_TEXTURE26_ARB: u32 = 34010; +pub const GL_TEXTURE27_ARB: u32 = 34011; +pub const GL_TEXTURE28_ARB: u32 = 34012; +pub const GL_TEXTURE29_ARB: u32 = 34013; +pub const GL_TEXTURE30_ARB: u32 = 34014; +pub const GL_TEXTURE31_ARB: u32 = 34015; +pub const GL_ACTIVE_TEXTURE_ARB: u32 = 34016; +pub const GL_CLIENT_ACTIVE_TEXTURE_ARB: u32 = 34017; +pub const GL_MAX_TEXTURE_UNITS_ARB: u32 = 34018; +pub const __gl_glext_h_: u32 = 1; +pub const GL_GLEXT_VERSION: u32 = 20190805; +pub const KHRONOS_SUPPORT_INT64: u32 = 1; +pub const KHRONOS_SUPPORT_FLOAT: u32 = 1; +pub const KHRONOS_MAX_ENUM: u32 = 2147483647; +pub const GL_VERSION_1_4: u32 = 1; +pub const GL_BLEND_DST_RGB: u32 = 32968; +pub const GL_BLEND_SRC_RGB: u32 = 32969; +pub const GL_BLEND_DST_ALPHA: u32 = 32970; +pub const GL_BLEND_SRC_ALPHA: u32 = 32971; +pub const GL_POINT_FADE_THRESHOLD_SIZE: u32 = 33064; +pub const GL_DEPTH_COMPONENT16: u32 = 33189; +pub const GL_DEPTH_COMPONENT24: u32 = 33190; +pub const GL_DEPTH_COMPONENT32: u32 = 33191; +pub const GL_MIRRORED_REPEAT: u32 = 33648; +pub const GL_MAX_TEXTURE_LOD_BIAS: u32 = 34045; +pub const GL_TEXTURE_LOD_BIAS: u32 = 34049; +pub const GL_INCR_WRAP: u32 = 34055; +pub const GL_DECR_WRAP: u32 = 34056; +pub const GL_TEXTURE_DEPTH_SIZE: u32 = 34890; +pub const GL_TEXTURE_COMPARE_MODE: u32 = 34892; +pub const GL_TEXTURE_COMPARE_FUNC: u32 = 34893; +pub const GL_POINT_SIZE_MIN: u32 = 33062; +pub const GL_POINT_SIZE_MAX: u32 = 33063; +pub const GL_POINT_DISTANCE_ATTENUATION: u32 = 33065; +pub const GL_GENERATE_MIPMAP: u32 = 33169; +pub const GL_GENERATE_MIPMAP_HINT: u32 = 33170; +pub const GL_FOG_COORDINATE_SOURCE: u32 = 33872; +pub const GL_FOG_COORDINATE: u32 = 33873; +pub const GL_FRAGMENT_DEPTH: u32 = 33874; +pub const GL_CURRENT_FOG_COORDINATE: u32 = 33875; +pub const GL_FOG_COORDINATE_ARRAY_TYPE: u32 = 33876; +pub const GL_FOG_COORDINATE_ARRAY_STRIDE: u32 = 33877; +pub const GL_FOG_COORDINATE_ARRAY_POINTER: u32 = 33878; +pub const GL_FOG_COORDINATE_ARRAY: u32 = 33879; +pub const GL_COLOR_SUM: u32 = 33880; +pub const GL_CURRENT_SECONDARY_COLOR: u32 = 33881; +pub const GL_SECONDARY_COLOR_ARRAY_SIZE: u32 = 33882; +pub const GL_SECONDARY_COLOR_ARRAY_TYPE: u32 = 33883; +pub const GL_SECONDARY_COLOR_ARRAY_STRIDE: u32 = 33884; +pub const GL_SECONDARY_COLOR_ARRAY_POINTER: u32 = 33885; +pub const GL_SECONDARY_COLOR_ARRAY: u32 = 33886; +pub const GL_TEXTURE_FILTER_CONTROL: u32 = 34048; +pub const GL_DEPTH_TEXTURE_MODE: u32 = 34891; +pub const GL_COMPARE_R_TO_TEXTURE: u32 = 34894; +pub const GL_VERSION_1_5: u32 = 1; +pub const GL_BUFFER_SIZE: u32 = 34660; +pub const GL_BUFFER_USAGE: u32 = 34661; +pub const GL_QUERY_COUNTER_BITS: u32 = 34916; +pub const GL_CURRENT_QUERY: u32 = 34917; +pub const GL_QUERY_RESULT: u32 = 34918; +pub const GL_QUERY_RESULT_AVAILABLE: u32 = 34919; +pub const GL_ARRAY_BUFFER: u32 = 34962; +pub const GL_ELEMENT_ARRAY_BUFFER: u32 = 34963; +pub const GL_ARRAY_BUFFER_BINDING: u32 = 34964; +pub const GL_ELEMENT_ARRAY_BUFFER_BINDING: u32 = 34965; +pub const GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: u32 = 34975; +pub const GL_READ_ONLY: u32 = 35000; +pub const GL_WRITE_ONLY: u32 = 35001; +pub const GL_READ_WRITE: u32 = 35002; +pub const GL_BUFFER_ACCESS: u32 = 35003; +pub const GL_BUFFER_MAPPED: u32 = 35004; +pub const GL_BUFFER_MAP_POINTER: u32 = 35005; +pub const GL_STREAM_DRAW: u32 = 35040; +pub const GL_STREAM_READ: u32 = 35041; +pub const GL_STREAM_COPY: u32 = 35042; +pub const GL_STATIC_DRAW: u32 = 35044; +pub const GL_STATIC_READ: u32 = 35045; +pub const GL_STATIC_COPY: u32 = 35046; +pub const GL_DYNAMIC_DRAW: u32 = 35048; +pub const GL_DYNAMIC_READ: u32 = 35049; +pub const GL_DYNAMIC_COPY: u32 = 35050; +pub const GL_SAMPLES_PASSED: u32 = 35092; +pub const GL_SRC1_ALPHA: u32 = 34185; +pub const GL_VERTEX_ARRAY_BUFFER_BINDING: u32 = 34966; +pub const GL_NORMAL_ARRAY_BUFFER_BINDING: u32 = 34967; +pub const GL_COLOR_ARRAY_BUFFER_BINDING: u32 = 34968; +pub const GL_INDEX_ARRAY_BUFFER_BINDING: u32 = 34969; +pub const GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: u32 = 34970; +pub const GL_EDGE_FLAG_ARRAY_BUFFER_BINDING: u32 = 34971; +pub const GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING: u32 = 34972; +pub const GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING: u32 = 34973; +pub const GL_WEIGHT_ARRAY_BUFFER_BINDING: u32 = 34974; +pub const GL_FOG_COORD_SRC: u32 = 33872; +pub const GL_FOG_COORD: u32 = 33873; +pub const GL_CURRENT_FOG_COORD: u32 = 33875; +pub const GL_FOG_COORD_ARRAY_TYPE: u32 = 33876; +pub const GL_FOG_COORD_ARRAY_STRIDE: u32 = 33877; +pub const GL_FOG_COORD_ARRAY_POINTER: u32 = 33878; +pub const GL_FOG_COORD_ARRAY: u32 = 33879; +pub const GL_FOG_COORD_ARRAY_BUFFER_BINDING: u32 = 34973; +pub const GL_SRC0_RGB: u32 = 34176; +pub const GL_SRC1_RGB: u32 = 34177; +pub const GL_SRC2_RGB: u32 = 34178; +pub const GL_SRC0_ALPHA: u32 = 34184; +pub const GL_SRC2_ALPHA: u32 = 34186; +pub const GL_VERSION_2_0: u32 = 1; +pub const GL_BLEND_EQUATION_RGB: u32 = 32777; +pub const GL_VERTEX_ATTRIB_ARRAY_ENABLED: u32 = 34338; +pub const GL_VERTEX_ATTRIB_ARRAY_SIZE: u32 = 34339; +pub const GL_VERTEX_ATTRIB_ARRAY_STRIDE: u32 = 34340; +pub const GL_VERTEX_ATTRIB_ARRAY_TYPE: u32 = 34341; +pub const GL_CURRENT_VERTEX_ATTRIB: u32 = 34342; +pub const GL_VERTEX_PROGRAM_POINT_SIZE: u32 = 34370; +pub const GL_VERTEX_ATTRIB_ARRAY_POINTER: u32 = 34373; +pub const GL_STENCIL_BACK_FUNC: u32 = 34816; +pub const GL_STENCIL_BACK_FAIL: u32 = 34817; +pub const GL_STENCIL_BACK_PASS_DEPTH_FAIL: u32 = 34818; +pub const GL_STENCIL_BACK_PASS_DEPTH_PASS: u32 = 34819; +pub const GL_MAX_DRAW_BUFFERS: u32 = 34852; +pub const GL_DRAW_BUFFER0: u32 = 34853; +pub const GL_DRAW_BUFFER1: u32 = 34854; +pub const GL_DRAW_BUFFER2: u32 = 34855; +pub const GL_DRAW_BUFFER3: u32 = 34856; +pub const GL_DRAW_BUFFER4: u32 = 34857; +pub const GL_DRAW_BUFFER5: u32 = 34858; +pub const GL_DRAW_BUFFER6: u32 = 34859; +pub const GL_DRAW_BUFFER7: u32 = 34860; +pub const GL_DRAW_BUFFER8: u32 = 34861; +pub const GL_DRAW_BUFFER9: u32 = 34862; +pub const GL_DRAW_BUFFER10: u32 = 34863; +pub const GL_DRAW_BUFFER11: u32 = 34864; +pub const GL_DRAW_BUFFER12: u32 = 34865; +pub const GL_DRAW_BUFFER13: u32 = 34866; +pub const GL_DRAW_BUFFER14: u32 = 34867; +pub const GL_DRAW_BUFFER15: u32 = 34868; +pub const GL_BLEND_EQUATION_ALPHA: u32 = 34877; +pub const GL_MAX_VERTEX_ATTRIBS: u32 = 34921; +pub const GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: u32 = 34922; +pub const GL_MAX_TEXTURE_IMAGE_UNITS: u32 = 34930; +pub const GL_FRAGMENT_SHADER: u32 = 35632; +pub const GL_VERTEX_SHADER: u32 = 35633; +pub const GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: u32 = 35657; +pub const GL_MAX_VERTEX_UNIFORM_COMPONENTS: u32 = 35658; +pub const GL_MAX_VARYING_FLOATS: u32 = 35659; +pub const GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: u32 = 35660; +pub const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: u32 = 35661; +pub const GL_SHADER_TYPE: u32 = 35663; +pub const GL_FLOAT_VEC2: u32 = 35664; +pub const GL_FLOAT_VEC3: u32 = 35665; +pub const GL_FLOAT_VEC4: u32 = 35666; +pub const GL_INT_VEC2: u32 = 35667; +pub const GL_INT_VEC3: u32 = 35668; +pub const GL_INT_VEC4: u32 = 35669; +pub const GL_BOOL: u32 = 35670; +pub const GL_BOOL_VEC2: u32 = 35671; +pub const GL_BOOL_VEC3: u32 = 35672; +pub const GL_BOOL_VEC4: u32 = 35673; +pub const GL_FLOAT_MAT2: u32 = 35674; +pub const GL_FLOAT_MAT3: u32 = 35675; +pub const GL_FLOAT_MAT4: u32 = 35676; +pub const GL_SAMPLER_1D: u32 = 35677; +pub const GL_SAMPLER_2D: u32 = 35678; +pub const GL_SAMPLER_3D: u32 = 35679; +pub const GL_SAMPLER_CUBE: u32 = 35680; +pub const GL_SAMPLER_1D_SHADOW: u32 = 35681; +pub const GL_SAMPLER_2D_SHADOW: u32 = 35682; +pub const GL_DELETE_STATUS: u32 = 35712; +pub const GL_COMPILE_STATUS: u32 = 35713; +pub const GL_LINK_STATUS: u32 = 35714; +pub const GL_VALIDATE_STATUS: u32 = 35715; +pub const GL_INFO_LOG_LENGTH: u32 = 35716; +pub const GL_ATTACHED_SHADERS: u32 = 35717; +pub const GL_ACTIVE_UNIFORMS: u32 = 35718; +pub const GL_ACTIVE_UNIFORM_MAX_LENGTH: u32 = 35719; +pub const GL_SHADER_SOURCE_LENGTH: u32 = 35720; +pub const GL_ACTIVE_ATTRIBUTES: u32 = 35721; +pub const GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: u32 = 35722; +pub const GL_FRAGMENT_SHADER_DERIVATIVE_HINT: u32 = 35723; +pub const GL_SHADING_LANGUAGE_VERSION: u32 = 35724; +pub const GL_CURRENT_PROGRAM: u32 = 35725; +pub const GL_POINT_SPRITE_COORD_ORIGIN: u32 = 36000; +pub const GL_LOWER_LEFT: u32 = 36001; +pub const GL_UPPER_LEFT: u32 = 36002; +pub const GL_STENCIL_BACK_REF: u32 = 36003; +pub const GL_STENCIL_BACK_VALUE_MASK: u32 = 36004; +pub const GL_STENCIL_BACK_WRITEMASK: u32 = 36005; +pub const GL_VERTEX_PROGRAM_TWO_SIDE: u32 = 34371; +pub const GL_POINT_SPRITE: u32 = 34913; +pub const GL_COORD_REPLACE: u32 = 34914; +pub const GL_MAX_TEXTURE_COORDS: u32 = 34929; +pub const GL_VERSION_2_1: u32 = 1; +pub const GL_PIXEL_PACK_BUFFER: u32 = 35051; +pub const GL_PIXEL_UNPACK_BUFFER: u32 = 35052; +pub const GL_PIXEL_PACK_BUFFER_BINDING: u32 = 35053; +pub const GL_PIXEL_UNPACK_BUFFER_BINDING: u32 = 35055; +pub const GL_FLOAT_MAT2x3: u32 = 35685; +pub const GL_FLOAT_MAT2x4: u32 = 35686; +pub const GL_FLOAT_MAT3x2: u32 = 35687; +pub const GL_FLOAT_MAT3x4: u32 = 35688; +pub const GL_FLOAT_MAT4x2: u32 = 35689; +pub const GL_FLOAT_MAT4x3: u32 = 35690; +pub const GL_SRGB: u32 = 35904; +pub const GL_SRGB8: u32 = 35905; +pub const GL_SRGB_ALPHA: u32 = 35906; +pub const GL_SRGB8_ALPHA8: u32 = 35907; +pub const GL_COMPRESSED_SRGB: u32 = 35912; +pub const GL_COMPRESSED_SRGB_ALPHA: u32 = 35913; +pub const GL_CURRENT_RASTER_SECONDARY_COLOR: u32 = 33887; +pub const GL_SLUMINANCE_ALPHA: u32 = 35908; +pub const GL_SLUMINANCE8_ALPHA8: u32 = 35909; +pub const GL_SLUMINANCE: u32 = 35910; +pub const GL_SLUMINANCE8: u32 = 35911; +pub const GL_COMPRESSED_SLUMINANCE: u32 = 35914; +pub const GL_COMPRESSED_SLUMINANCE_ALPHA: u32 = 35915; +pub const GL_VERSION_3_0: u32 = 1; +pub const GL_COMPARE_REF_TO_TEXTURE: u32 = 34894; +pub const GL_CLIP_DISTANCE0: u32 = 12288; +pub const GL_CLIP_DISTANCE1: u32 = 12289; +pub const GL_CLIP_DISTANCE2: u32 = 12290; +pub const GL_CLIP_DISTANCE3: u32 = 12291; +pub const GL_CLIP_DISTANCE4: u32 = 12292; +pub const GL_CLIP_DISTANCE5: u32 = 12293; +pub const GL_CLIP_DISTANCE6: u32 = 12294; +pub const GL_CLIP_DISTANCE7: u32 = 12295; +pub const GL_MAX_CLIP_DISTANCES: u32 = 3378; +pub const GL_MAJOR_VERSION: u32 = 33307; +pub const GL_MINOR_VERSION: u32 = 33308; +pub const GL_NUM_EXTENSIONS: u32 = 33309; +pub const GL_CONTEXT_FLAGS: u32 = 33310; +pub const GL_COMPRESSED_RED: u32 = 33317; +pub const GL_COMPRESSED_RG: u32 = 33318; +pub const GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT: u32 = 1; +pub const GL_RGBA32F: u32 = 34836; +pub const GL_RGB32F: u32 = 34837; +pub const GL_RGBA16F: u32 = 34842; +pub const GL_RGB16F: u32 = 34843; +pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER: u32 = 35069; +pub const GL_MAX_ARRAY_TEXTURE_LAYERS: u32 = 35071; +pub const GL_MIN_PROGRAM_TEXEL_OFFSET: u32 = 35076; +pub const GL_MAX_PROGRAM_TEXEL_OFFSET: u32 = 35077; +pub const GL_CLAMP_READ_COLOR: u32 = 35100; +pub const GL_FIXED_ONLY: u32 = 35101; +pub const GL_MAX_VARYING_COMPONENTS: u32 = 35659; +pub const GL_TEXTURE_1D_ARRAY: u32 = 35864; +pub const GL_PROXY_TEXTURE_1D_ARRAY: u32 = 35865; +pub const GL_TEXTURE_2D_ARRAY: u32 = 35866; +pub const GL_PROXY_TEXTURE_2D_ARRAY: u32 = 35867; +pub const GL_TEXTURE_BINDING_1D_ARRAY: u32 = 35868; +pub const GL_TEXTURE_BINDING_2D_ARRAY: u32 = 35869; +pub const GL_R11F_G11F_B10F: u32 = 35898; +pub const GL_UNSIGNED_INT_10F_11F_11F_REV: u32 = 35899; +pub const GL_RGB9_E5: u32 = 35901; +pub const GL_UNSIGNED_INT_5_9_9_9_REV: u32 = 35902; +pub const GL_TEXTURE_SHARED_SIZE: u32 = 35903; +pub const GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: u32 = 35958; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE: u32 = 35967; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: u32 = 35968; +pub const GL_TRANSFORM_FEEDBACK_VARYINGS: u32 = 35971; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_START: u32 = 35972; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: u32 = 35973; +pub const GL_PRIMITIVES_GENERATED: u32 = 35975; +pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: u32 = 35976; +pub const GL_RASTERIZER_DISCARD: u32 = 35977; +pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: u32 = 35978; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: u32 = 35979; +pub const GL_INTERLEAVED_ATTRIBS: u32 = 35980; +pub const GL_SEPARATE_ATTRIBS: u32 = 35981; +pub const GL_TRANSFORM_FEEDBACK_BUFFER: u32 = 35982; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: u32 = 35983; +pub const GL_RGBA32UI: u32 = 36208; +pub const GL_RGB32UI: u32 = 36209; +pub const GL_RGBA16UI: u32 = 36214; +pub const GL_RGB16UI: u32 = 36215; +pub const GL_RGBA8UI: u32 = 36220; +pub const GL_RGB8UI: u32 = 36221; +pub const GL_RGBA32I: u32 = 36226; +pub const GL_RGB32I: u32 = 36227; +pub const GL_RGBA16I: u32 = 36232; +pub const GL_RGB16I: u32 = 36233; +pub const GL_RGBA8I: u32 = 36238; +pub const GL_RGB8I: u32 = 36239; +pub const GL_RED_INTEGER: u32 = 36244; +pub const GL_GREEN_INTEGER: u32 = 36245; +pub const GL_BLUE_INTEGER: u32 = 36246; +pub const GL_RGB_INTEGER: u32 = 36248; +pub const GL_RGBA_INTEGER: u32 = 36249; +pub const GL_BGR_INTEGER: u32 = 36250; +pub const GL_BGRA_INTEGER: u32 = 36251; +pub const GL_SAMPLER_1D_ARRAY: u32 = 36288; +pub const GL_SAMPLER_2D_ARRAY: u32 = 36289; +pub const GL_SAMPLER_1D_ARRAY_SHADOW: u32 = 36291; +pub const GL_SAMPLER_2D_ARRAY_SHADOW: u32 = 36292; +pub const GL_SAMPLER_CUBE_SHADOW: u32 = 36293; +pub const GL_UNSIGNED_INT_VEC2: u32 = 36294; +pub const GL_UNSIGNED_INT_VEC3: u32 = 36295; +pub const GL_UNSIGNED_INT_VEC4: u32 = 36296; +pub const GL_INT_SAMPLER_1D: u32 = 36297; +pub const GL_INT_SAMPLER_2D: u32 = 36298; +pub const GL_INT_SAMPLER_3D: u32 = 36299; +pub const GL_INT_SAMPLER_CUBE: u32 = 36300; +pub const GL_INT_SAMPLER_1D_ARRAY: u32 = 36302; +pub const GL_INT_SAMPLER_2D_ARRAY: u32 = 36303; +pub const GL_UNSIGNED_INT_SAMPLER_1D: u32 = 36305; +pub const GL_UNSIGNED_INT_SAMPLER_2D: u32 = 36306; +pub const GL_UNSIGNED_INT_SAMPLER_3D: u32 = 36307; +pub const GL_UNSIGNED_INT_SAMPLER_CUBE: u32 = 36308; +pub const GL_UNSIGNED_INT_SAMPLER_1D_ARRAY: u32 = 36310; +pub const GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: u32 = 36311; +pub const GL_QUERY_WAIT: u32 = 36371; +pub const GL_QUERY_NO_WAIT: u32 = 36372; +pub const GL_QUERY_BY_REGION_WAIT: u32 = 36373; +pub const GL_QUERY_BY_REGION_NO_WAIT: u32 = 36374; +pub const GL_BUFFER_ACCESS_FLAGS: u32 = 37151; +pub const GL_BUFFER_MAP_LENGTH: u32 = 37152; +pub const GL_BUFFER_MAP_OFFSET: u32 = 37153; +pub const GL_DEPTH_COMPONENT32F: u32 = 36012; +pub const GL_DEPTH32F_STENCIL8: u32 = 36013; +pub const GL_FLOAT_32_UNSIGNED_INT_24_8_REV: u32 = 36269; +pub const GL_INVALID_FRAMEBUFFER_OPERATION: u32 = 1286; +pub const GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: u32 = 33296; +pub const GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: u32 = 33297; +pub const GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: u32 = 33298; +pub const GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: u32 = 33299; +pub const GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: u32 = 33300; +pub const GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: u32 = 33301; +pub const GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: u32 = 33302; +pub const GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: u32 = 33303; +pub const GL_FRAMEBUFFER_DEFAULT: u32 = 33304; +pub const GL_FRAMEBUFFER_UNDEFINED: u32 = 33305; +pub const GL_DEPTH_STENCIL_ATTACHMENT: u32 = 33306; +pub const GL_MAX_RENDERBUFFER_SIZE: u32 = 34024; +pub const GL_DEPTH_STENCIL: u32 = 34041; +pub const GL_UNSIGNED_INT_24_8: u32 = 34042; +pub const GL_DEPTH24_STENCIL8: u32 = 35056; +pub const GL_TEXTURE_STENCIL_SIZE: u32 = 35057; +pub const GL_TEXTURE_RED_TYPE: u32 = 35856; +pub const GL_TEXTURE_GREEN_TYPE: u32 = 35857; +pub const GL_TEXTURE_BLUE_TYPE: u32 = 35858; +pub const GL_TEXTURE_ALPHA_TYPE: u32 = 35859; +pub const GL_TEXTURE_DEPTH_TYPE: u32 = 35862; +pub const GL_UNSIGNED_NORMALIZED: u32 = 35863; +pub const GL_FRAMEBUFFER_BINDING: u32 = 36006; +pub const GL_DRAW_FRAMEBUFFER_BINDING: u32 = 36006; +pub const GL_RENDERBUFFER_BINDING: u32 = 36007; +pub const GL_READ_FRAMEBUFFER: u32 = 36008; +pub const GL_DRAW_FRAMEBUFFER: u32 = 36009; +pub const GL_READ_FRAMEBUFFER_BINDING: u32 = 36010; +pub const GL_RENDERBUFFER_SAMPLES: u32 = 36011; +pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: u32 = 36048; +pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: u32 = 36049; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: u32 = 36050; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: u32 = 36051; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: u32 = 36052; +pub const GL_FRAMEBUFFER_COMPLETE: u32 = 36053; +pub const GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: u32 = 36054; +pub const GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: u32 = 36055; +pub const GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: u32 = 36059; +pub const GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: u32 = 36060; +pub const GL_FRAMEBUFFER_UNSUPPORTED: u32 = 36061; +pub const GL_MAX_COLOR_ATTACHMENTS: u32 = 36063; +pub const GL_COLOR_ATTACHMENT0: u32 = 36064; +pub const GL_COLOR_ATTACHMENT1: u32 = 36065; +pub const GL_COLOR_ATTACHMENT2: u32 = 36066; +pub const GL_COLOR_ATTACHMENT3: u32 = 36067; +pub const GL_COLOR_ATTACHMENT4: u32 = 36068; +pub const GL_COLOR_ATTACHMENT5: u32 = 36069; +pub const GL_COLOR_ATTACHMENT6: u32 = 36070; +pub const GL_COLOR_ATTACHMENT7: u32 = 36071; +pub const GL_COLOR_ATTACHMENT8: u32 = 36072; +pub const GL_COLOR_ATTACHMENT9: u32 = 36073; +pub const GL_COLOR_ATTACHMENT10: u32 = 36074; +pub const GL_COLOR_ATTACHMENT11: u32 = 36075; +pub const GL_COLOR_ATTACHMENT12: u32 = 36076; +pub const GL_COLOR_ATTACHMENT13: u32 = 36077; +pub const GL_COLOR_ATTACHMENT14: u32 = 36078; +pub const GL_COLOR_ATTACHMENT15: u32 = 36079; +pub const GL_COLOR_ATTACHMENT16: u32 = 36080; +pub const GL_COLOR_ATTACHMENT17: u32 = 36081; +pub const GL_COLOR_ATTACHMENT18: u32 = 36082; +pub const GL_COLOR_ATTACHMENT19: u32 = 36083; +pub const GL_COLOR_ATTACHMENT20: u32 = 36084; +pub const GL_COLOR_ATTACHMENT21: u32 = 36085; +pub const GL_COLOR_ATTACHMENT22: u32 = 36086; +pub const GL_COLOR_ATTACHMENT23: u32 = 36087; +pub const GL_COLOR_ATTACHMENT24: u32 = 36088; +pub const GL_COLOR_ATTACHMENT25: u32 = 36089; +pub const GL_COLOR_ATTACHMENT26: u32 = 36090; +pub const GL_COLOR_ATTACHMENT27: u32 = 36091; +pub const GL_COLOR_ATTACHMENT28: u32 = 36092; +pub const GL_COLOR_ATTACHMENT29: u32 = 36093; +pub const GL_COLOR_ATTACHMENT30: u32 = 36094; +pub const GL_COLOR_ATTACHMENT31: u32 = 36095; +pub const GL_DEPTH_ATTACHMENT: u32 = 36096; +pub const GL_STENCIL_ATTACHMENT: u32 = 36128; +pub const GL_FRAMEBUFFER: u32 = 36160; +pub const GL_RENDERBUFFER: u32 = 36161; +pub const GL_RENDERBUFFER_WIDTH: u32 = 36162; +pub const GL_RENDERBUFFER_HEIGHT: u32 = 36163; +pub const GL_RENDERBUFFER_INTERNAL_FORMAT: u32 = 36164; +pub const GL_STENCIL_INDEX1: u32 = 36166; +pub const GL_STENCIL_INDEX4: u32 = 36167; +pub const GL_STENCIL_INDEX8: u32 = 36168; +pub const GL_STENCIL_INDEX16: u32 = 36169; +pub const GL_RENDERBUFFER_RED_SIZE: u32 = 36176; +pub const GL_RENDERBUFFER_GREEN_SIZE: u32 = 36177; +pub const GL_RENDERBUFFER_BLUE_SIZE: u32 = 36178; +pub const GL_RENDERBUFFER_ALPHA_SIZE: u32 = 36179; +pub const GL_RENDERBUFFER_DEPTH_SIZE: u32 = 36180; +pub const GL_RENDERBUFFER_STENCIL_SIZE: u32 = 36181; +pub const GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: u32 = 36182; +pub const GL_MAX_SAMPLES: u32 = 36183; +pub const GL_INDEX: u32 = 33314; +pub const GL_TEXTURE_LUMINANCE_TYPE: u32 = 35860; +pub const GL_TEXTURE_INTENSITY_TYPE: u32 = 35861; +pub const GL_FRAMEBUFFER_SRGB: u32 = 36281; +pub const GL_HALF_FLOAT: u32 = 5131; +pub const GL_MAP_READ_BIT: u32 = 1; +pub const GL_MAP_WRITE_BIT: u32 = 2; +pub const GL_MAP_INVALIDATE_RANGE_BIT: u32 = 4; +pub const GL_MAP_INVALIDATE_BUFFER_BIT: u32 = 8; +pub const GL_MAP_FLUSH_EXPLICIT_BIT: u32 = 16; +pub const GL_MAP_UNSYNCHRONIZED_BIT: u32 = 32; +pub const GL_COMPRESSED_RED_RGTC1: u32 = 36283; +pub const GL_COMPRESSED_SIGNED_RED_RGTC1: u32 = 36284; +pub const GL_COMPRESSED_RG_RGTC2: u32 = 36285; +pub const GL_COMPRESSED_SIGNED_RG_RGTC2: u32 = 36286; +pub const GL_RG: u32 = 33319; +pub const GL_RG_INTEGER: u32 = 33320; +pub const GL_R8: u32 = 33321; +pub const GL_R16: u32 = 33322; +pub const GL_RG8: u32 = 33323; +pub const GL_RG16: u32 = 33324; +pub const GL_R16F: u32 = 33325; +pub const GL_R32F: u32 = 33326; +pub const GL_RG16F: u32 = 33327; +pub const GL_RG32F: u32 = 33328; +pub const GL_R8I: u32 = 33329; +pub const GL_R8UI: u32 = 33330; +pub const GL_R16I: u32 = 33331; +pub const GL_R16UI: u32 = 33332; +pub const GL_R32I: u32 = 33333; +pub const GL_R32UI: u32 = 33334; +pub const GL_RG8I: u32 = 33335; +pub const GL_RG8UI: u32 = 33336; +pub const GL_RG16I: u32 = 33337; +pub const GL_RG16UI: u32 = 33338; +pub const GL_RG32I: u32 = 33339; +pub const GL_RG32UI: u32 = 33340; +pub const GL_VERTEX_ARRAY_BINDING: u32 = 34229; +pub const GL_CLAMP_VERTEX_COLOR: u32 = 35098; +pub const GL_CLAMP_FRAGMENT_COLOR: u32 = 35099; +pub const GL_ALPHA_INTEGER: u32 = 36247; +pub const GL_VERSION_3_1: u32 = 1; +pub const GL_SAMPLER_2D_RECT: u32 = 35683; +pub const GL_SAMPLER_2D_RECT_SHADOW: u32 = 35684; +pub const GL_SAMPLER_BUFFER: u32 = 36290; +pub const GL_INT_SAMPLER_2D_RECT: u32 = 36301; +pub const GL_INT_SAMPLER_BUFFER: u32 = 36304; +pub const GL_UNSIGNED_INT_SAMPLER_2D_RECT: u32 = 36309; +pub const GL_UNSIGNED_INT_SAMPLER_BUFFER: u32 = 36312; +pub const GL_TEXTURE_BUFFER: u32 = 35882; +pub const GL_MAX_TEXTURE_BUFFER_SIZE: u32 = 35883; +pub const GL_TEXTURE_BINDING_BUFFER: u32 = 35884; +pub const GL_TEXTURE_BUFFER_DATA_STORE_BINDING: u32 = 35885; +pub const GL_TEXTURE_RECTANGLE: u32 = 34037; +pub const GL_TEXTURE_BINDING_RECTANGLE: u32 = 34038; +pub const GL_PROXY_TEXTURE_RECTANGLE: u32 = 34039; +pub const GL_MAX_RECTANGLE_TEXTURE_SIZE: u32 = 34040; +pub const GL_R8_SNORM: u32 = 36756; +pub const GL_RG8_SNORM: u32 = 36757; +pub const GL_RGB8_SNORM: u32 = 36758; +pub const GL_RGBA8_SNORM: u32 = 36759; +pub const GL_R16_SNORM: u32 = 36760; +pub const GL_RG16_SNORM: u32 = 36761; +pub const GL_RGB16_SNORM: u32 = 36762; +pub const GL_RGBA16_SNORM: u32 = 36763; +pub const GL_SIGNED_NORMALIZED: u32 = 36764; +pub const GL_PRIMITIVE_RESTART: u32 = 36765; +pub const GL_PRIMITIVE_RESTART_INDEX: u32 = 36766; +pub const GL_COPY_READ_BUFFER: u32 = 36662; +pub const GL_COPY_WRITE_BUFFER: u32 = 36663; +pub const GL_UNIFORM_BUFFER: u32 = 35345; +pub const GL_UNIFORM_BUFFER_BINDING: u32 = 35368; +pub const GL_UNIFORM_BUFFER_START: u32 = 35369; +pub const GL_UNIFORM_BUFFER_SIZE: u32 = 35370; +pub const GL_MAX_VERTEX_UNIFORM_BLOCKS: u32 = 35371; +pub const GL_MAX_GEOMETRY_UNIFORM_BLOCKS: u32 = 35372; +pub const GL_MAX_FRAGMENT_UNIFORM_BLOCKS: u32 = 35373; +pub const GL_MAX_COMBINED_UNIFORM_BLOCKS: u32 = 35374; +pub const GL_MAX_UNIFORM_BUFFER_BINDINGS: u32 = 35375; +pub const GL_MAX_UNIFORM_BLOCK_SIZE: u32 = 35376; +pub const GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: u32 = 35377; +pub const GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS: u32 = 35378; +pub const GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: u32 = 35379; +pub const GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: u32 = 35380; +pub const GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: u32 = 35381; +pub const GL_ACTIVE_UNIFORM_BLOCKS: u32 = 35382; +pub const GL_UNIFORM_TYPE: u32 = 35383; +pub const GL_UNIFORM_SIZE: u32 = 35384; +pub const GL_UNIFORM_NAME_LENGTH: u32 = 35385; +pub const GL_UNIFORM_BLOCK_INDEX: u32 = 35386; +pub const GL_UNIFORM_OFFSET: u32 = 35387; +pub const GL_UNIFORM_ARRAY_STRIDE: u32 = 35388; +pub const GL_UNIFORM_MATRIX_STRIDE: u32 = 35389; +pub const GL_UNIFORM_IS_ROW_MAJOR: u32 = 35390; +pub const GL_UNIFORM_BLOCK_BINDING: u32 = 35391; +pub const GL_UNIFORM_BLOCK_DATA_SIZE: u32 = 35392; +pub const GL_UNIFORM_BLOCK_NAME_LENGTH: u32 = 35393; +pub const GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: u32 = 35394; +pub const GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: u32 = 35395; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: u32 = 35396; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER: u32 = 35397; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: u32 = 35398; +pub const GL_INVALID_INDEX: u32 = 4294967295; +pub const GL_VERSION_3_2: u32 = 1; +pub const GL_CONTEXT_CORE_PROFILE_BIT: u32 = 1; +pub const GL_CONTEXT_COMPATIBILITY_PROFILE_BIT: u32 = 2; +pub const GL_LINES_ADJACENCY: u32 = 10; +pub const GL_LINE_STRIP_ADJACENCY: u32 = 11; +pub const GL_TRIANGLES_ADJACENCY: u32 = 12; +pub const GL_TRIANGLE_STRIP_ADJACENCY: u32 = 13; +pub const GL_PROGRAM_POINT_SIZE: u32 = 34370; +pub const GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS: u32 = 35881; +pub const GL_FRAMEBUFFER_ATTACHMENT_LAYERED: u32 = 36263; +pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: u32 = 36264; +pub const GL_GEOMETRY_SHADER: u32 = 36313; +pub const GL_GEOMETRY_VERTICES_OUT: u32 = 35094; +pub const GL_GEOMETRY_INPUT_TYPE: u32 = 35095; +pub const GL_GEOMETRY_OUTPUT_TYPE: u32 = 35096; +pub const GL_MAX_GEOMETRY_UNIFORM_COMPONENTS: u32 = 36319; +pub const GL_MAX_GEOMETRY_OUTPUT_VERTICES: u32 = 36320; +pub const GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS: u32 = 36321; +pub const GL_MAX_VERTEX_OUTPUT_COMPONENTS: u32 = 37154; +pub const GL_MAX_GEOMETRY_INPUT_COMPONENTS: u32 = 37155; +pub const GL_MAX_GEOMETRY_OUTPUT_COMPONENTS: u32 = 37156; +pub const GL_MAX_FRAGMENT_INPUT_COMPONENTS: u32 = 37157; +pub const GL_CONTEXT_PROFILE_MASK: u32 = 37158; +pub const GL_DEPTH_CLAMP: u32 = 34383; +pub const GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: u32 = 36428; +pub const GL_FIRST_VERTEX_CONVENTION: u32 = 36429; +pub const GL_LAST_VERTEX_CONVENTION: u32 = 36430; +pub const GL_PROVOKING_VERTEX: u32 = 36431; +pub const GL_TEXTURE_CUBE_MAP_SEAMLESS: u32 = 34895; +pub const GL_MAX_SERVER_WAIT_TIMEOUT: u32 = 37137; +pub const GL_OBJECT_TYPE: u32 = 37138; +pub const GL_SYNC_CONDITION: u32 = 37139; +pub const GL_SYNC_STATUS: u32 = 37140; +pub const GL_SYNC_FLAGS: u32 = 37141; +pub const GL_SYNC_FENCE: u32 = 37142; +pub const GL_SYNC_GPU_COMMANDS_COMPLETE: u32 = 37143; +pub const GL_UNSIGNALED: u32 = 37144; +pub const GL_SIGNALED: u32 = 37145; +pub const GL_ALREADY_SIGNALED: u32 = 37146; +pub const GL_TIMEOUT_EXPIRED: u32 = 37147; +pub const GL_CONDITION_SATISFIED: u32 = 37148; +pub const GL_WAIT_FAILED: u32 = 37149; +pub const GL_TIMEOUT_IGNORED: i32 = -1; +pub const GL_SYNC_FLUSH_COMMANDS_BIT: u32 = 1; +pub const GL_SAMPLE_POSITION: u32 = 36432; +pub const GL_SAMPLE_MASK: u32 = 36433; +pub const GL_SAMPLE_MASK_VALUE: u32 = 36434; +pub const GL_MAX_SAMPLE_MASK_WORDS: u32 = 36441; +pub const GL_TEXTURE_2D_MULTISAMPLE: u32 = 37120; +pub const GL_PROXY_TEXTURE_2D_MULTISAMPLE: u32 = 37121; +pub const GL_TEXTURE_2D_MULTISAMPLE_ARRAY: u32 = 37122; +pub const GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: u32 = 37123; +pub const GL_TEXTURE_BINDING_2D_MULTISAMPLE: u32 = 37124; +pub const GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY: u32 = 37125; +pub const GL_TEXTURE_SAMPLES: u32 = 37126; +pub const GL_TEXTURE_FIXED_SAMPLE_LOCATIONS: u32 = 37127; +pub const GL_SAMPLER_2D_MULTISAMPLE: u32 = 37128; +pub const GL_INT_SAMPLER_2D_MULTISAMPLE: u32 = 37129; +pub const GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE: u32 = 37130; +pub const GL_SAMPLER_2D_MULTISAMPLE_ARRAY: u32 = 37131; +pub const GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: u32 = 37132; +pub const GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: u32 = 37133; +pub const GL_MAX_COLOR_TEXTURE_SAMPLES: u32 = 37134; +pub const GL_MAX_DEPTH_TEXTURE_SAMPLES: u32 = 37135; +pub const GL_MAX_INTEGER_SAMPLES: u32 = 37136; +pub const GL_VERSION_3_3: u32 = 1; +pub const GL_VERTEX_ATTRIB_ARRAY_DIVISOR: u32 = 35070; +pub const GL_SRC1_COLOR: u32 = 35065; +pub const GL_ONE_MINUS_SRC1_COLOR: u32 = 35066; +pub const GL_ONE_MINUS_SRC1_ALPHA: u32 = 35067; +pub const GL_MAX_DUAL_SOURCE_DRAW_BUFFERS: u32 = 35068; +pub const GL_ANY_SAMPLES_PASSED: u32 = 35887; +pub const GL_SAMPLER_BINDING: u32 = 35097; +pub const GL_RGB10_A2UI: u32 = 36975; +pub const GL_TEXTURE_SWIZZLE_R: u32 = 36418; +pub const GL_TEXTURE_SWIZZLE_G: u32 = 36419; +pub const GL_TEXTURE_SWIZZLE_B: u32 = 36420; +pub const GL_TEXTURE_SWIZZLE_A: u32 = 36421; +pub const GL_TEXTURE_SWIZZLE_RGBA: u32 = 36422; +pub const GL_TIME_ELAPSED: u32 = 35007; +pub const GL_TIMESTAMP: u32 = 36392; +pub const GL_INT_2_10_10_10_REV: u32 = 36255; +pub const GL_VERSION_4_0: u32 = 1; +pub const GL_SAMPLE_SHADING: u32 = 35894; +pub const GL_MIN_SAMPLE_SHADING_VALUE: u32 = 35895; +pub const GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET: u32 = 36446; +pub const GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET: u32 = 36447; +pub const GL_TEXTURE_CUBE_MAP_ARRAY: u32 = 36873; +pub const GL_TEXTURE_BINDING_CUBE_MAP_ARRAY: u32 = 36874; +pub const GL_PROXY_TEXTURE_CUBE_MAP_ARRAY: u32 = 36875; +pub const GL_SAMPLER_CUBE_MAP_ARRAY: u32 = 36876; +pub const GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW: u32 = 36877; +pub const GL_INT_SAMPLER_CUBE_MAP_ARRAY: u32 = 36878; +pub const GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY: u32 = 36879; +pub const GL_DRAW_INDIRECT_BUFFER: u32 = 36671; +pub const GL_DRAW_INDIRECT_BUFFER_BINDING: u32 = 36675; +pub const GL_GEOMETRY_SHADER_INVOCATIONS: u32 = 34943; +pub const GL_MAX_GEOMETRY_SHADER_INVOCATIONS: u32 = 36442; +pub const GL_MIN_FRAGMENT_INTERPOLATION_OFFSET: u32 = 36443; +pub const GL_MAX_FRAGMENT_INTERPOLATION_OFFSET: u32 = 36444; +pub const GL_FRAGMENT_INTERPOLATION_OFFSET_BITS: u32 = 36445; +pub const GL_MAX_VERTEX_STREAMS: u32 = 36465; +pub const GL_DOUBLE_VEC2: u32 = 36860; +pub const GL_DOUBLE_VEC3: u32 = 36861; +pub const GL_DOUBLE_VEC4: u32 = 36862; +pub const GL_DOUBLE_MAT2: u32 = 36678; +pub const GL_DOUBLE_MAT3: u32 = 36679; +pub const GL_DOUBLE_MAT4: u32 = 36680; +pub const GL_DOUBLE_MAT2x3: u32 = 36681; +pub const GL_DOUBLE_MAT2x4: u32 = 36682; +pub const GL_DOUBLE_MAT3x2: u32 = 36683; +pub const GL_DOUBLE_MAT3x4: u32 = 36684; +pub const GL_DOUBLE_MAT4x2: u32 = 36685; +pub const GL_DOUBLE_MAT4x3: u32 = 36686; +pub const GL_ACTIVE_SUBROUTINES: u32 = 36325; +pub const GL_ACTIVE_SUBROUTINE_UNIFORMS: u32 = 36326; +pub const GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS: u32 = 36423; +pub const GL_ACTIVE_SUBROUTINE_MAX_LENGTH: u32 = 36424; +pub const GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH: u32 = 36425; +pub const GL_MAX_SUBROUTINES: u32 = 36327; +pub const GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS: u32 = 36328; +pub const GL_NUM_COMPATIBLE_SUBROUTINES: u32 = 36426; +pub const GL_COMPATIBLE_SUBROUTINES: u32 = 36427; +pub const GL_PATCHES: u32 = 14; +pub const GL_PATCH_VERTICES: u32 = 36466; +pub const GL_PATCH_DEFAULT_INNER_LEVEL: u32 = 36467; +pub const GL_PATCH_DEFAULT_OUTER_LEVEL: u32 = 36468; +pub const GL_TESS_CONTROL_OUTPUT_VERTICES: u32 = 36469; +pub const GL_TESS_GEN_MODE: u32 = 36470; +pub const GL_TESS_GEN_SPACING: u32 = 36471; +pub const GL_TESS_GEN_VERTEX_ORDER: u32 = 36472; +pub const GL_TESS_GEN_POINT_MODE: u32 = 36473; +pub const GL_ISOLINES: u32 = 36474; +pub const GL_FRACTIONAL_ODD: u32 = 36475; +pub const GL_FRACTIONAL_EVEN: u32 = 36476; +pub const GL_MAX_PATCH_VERTICES: u32 = 36477; +pub const GL_MAX_TESS_GEN_LEVEL: u32 = 36478; +pub const GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS: u32 = 36479; +pub const GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS: u32 = 36480; +pub const GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS: u32 = 36481; +pub const GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS: u32 = 36482; +pub const GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS: u32 = 36483; +pub const GL_MAX_TESS_PATCH_COMPONENTS: u32 = 36484; +pub const GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS: u32 = 36485; +pub const GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS: u32 = 36486; +pub const GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS: u32 = 36489; +pub const GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS: u32 = 36490; +pub const GL_MAX_TESS_CONTROL_INPUT_COMPONENTS: u32 = 34924; +pub const GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS: u32 = 34925; +pub const GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS: u32 = 36382; +pub const GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS: u32 = 36383; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER: u32 = 34032; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER: u32 = 34033; +pub const GL_TESS_EVALUATION_SHADER: u32 = 36487; +pub const GL_TESS_CONTROL_SHADER: u32 = 36488; +pub const GL_TRANSFORM_FEEDBACK: u32 = 36386; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED: u32 = 36387; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE: u32 = 36388; +pub const GL_TRANSFORM_FEEDBACK_BINDING: u32 = 36389; +pub const GL_MAX_TRANSFORM_FEEDBACK_BUFFERS: u32 = 36464; +pub const GL_VERSION_4_1: u32 = 1; +pub const GL_FIXED: u32 = 5132; +pub const GL_IMPLEMENTATION_COLOR_READ_TYPE: u32 = 35738; +pub const GL_IMPLEMENTATION_COLOR_READ_FORMAT: u32 = 35739; +pub const GL_LOW_FLOAT: u32 = 36336; +pub const GL_MEDIUM_FLOAT: u32 = 36337; +pub const GL_HIGH_FLOAT: u32 = 36338; +pub const GL_LOW_INT: u32 = 36339; +pub const GL_MEDIUM_INT: u32 = 36340; +pub const GL_HIGH_INT: u32 = 36341; +pub const GL_SHADER_COMPILER: u32 = 36346; +pub const GL_SHADER_BINARY_FORMATS: u32 = 36344; +pub const GL_NUM_SHADER_BINARY_FORMATS: u32 = 36345; +pub const GL_MAX_VERTEX_UNIFORM_VECTORS: u32 = 36347; +pub const GL_MAX_VARYING_VECTORS: u32 = 36348; +pub const GL_MAX_FRAGMENT_UNIFORM_VECTORS: u32 = 36349; +pub const GL_RGB565: u32 = 36194; +pub const GL_PROGRAM_BINARY_RETRIEVABLE_HINT: u32 = 33367; +pub const GL_PROGRAM_BINARY_LENGTH: u32 = 34625; +pub const GL_NUM_PROGRAM_BINARY_FORMATS: u32 = 34814; +pub const GL_PROGRAM_BINARY_FORMATS: u32 = 34815; +pub const GL_VERTEX_SHADER_BIT: u32 = 1; +pub const GL_FRAGMENT_SHADER_BIT: u32 = 2; +pub const GL_GEOMETRY_SHADER_BIT: u32 = 4; +pub const GL_TESS_CONTROL_SHADER_BIT: u32 = 8; +pub const GL_TESS_EVALUATION_SHADER_BIT: u32 = 16; +pub const GL_ALL_SHADER_BITS: u32 = 4294967295; +pub const GL_PROGRAM_SEPARABLE: u32 = 33368; +pub const GL_ACTIVE_PROGRAM: u32 = 33369; +pub const GL_PROGRAM_PIPELINE_BINDING: u32 = 33370; +pub const GL_MAX_VIEWPORTS: u32 = 33371; +pub const GL_VIEWPORT_SUBPIXEL_BITS: u32 = 33372; +pub const GL_VIEWPORT_BOUNDS_RANGE: u32 = 33373; +pub const GL_LAYER_PROVOKING_VERTEX: u32 = 33374; +pub const GL_VIEWPORT_INDEX_PROVOKING_VERTEX: u32 = 33375; +pub const GL_UNDEFINED_VERTEX: u32 = 33376; +pub const GL_VERSION_4_2: u32 = 1; +pub const GL_COPY_READ_BUFFER_BINDING: u32 = 36662; +pub const GL_COPY_WRITE_BUFFER_BINDING: u32 = 36663; +pub const GL_TRANSFORM_FEEDBACK_ACTIVE: u32 = 36388; +pub const GL_TRANSFORM_FEEDBACK_PAUSED: u32 = 36387; +pub const GL_UNPACK_COMPRESSED_BLOCK_WIDTH: u32 = 37159; +pub const GL_UNPACK_COMPRESSED_BLOCK_HEIGHT: u32 = 37160; +pub const GL_UNPACK_COMPRESSED_BLOCK_DEPTH: u32 = 37161; +pub const GL_UNPACK_COMPRESSED_BLOCK_SIZE: u32 = 37162; +pub const GL_PACK_COMPRESSED_BLOCK_WIDTH: u32 = 37163; +pub const GL_PACK_COMPRESSED_BLOCK_HEIGHT: u32 = 37164; +pub const GL_PACK_COMPRESSED_BLOCK_DEPTH: u32 = 37165; +pub const GL_PACK_COMPRESSED_BLOCK_SIZE: u32 = 37166; +pub const GL_NUM_SAMPLE_COUNTS: u32 = 37760; +pub const GL_MIN_MAP_BUFFER_ALIGNMENT: u32 = 37052; +pub const GL_ATOMIC_COUNTER_BUFFER: u32 = 37568; +pub const GL_ATOMIC_COUNTER_BUFFER_BINDING: u32 = 37569; +pub const GL_ATOMIC_COUNTER_BUFFER_START: u32 = 37570; +pub const GL_ATOMIC_COUNTER_BUFFER_SIZE: u32 = 37571; +pub const GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE: u32 = 37572; +pub const GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS: u32 = 37573; +pub const GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES: u32 = 37574; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER: u32 = 37575; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER: u32 = 37576; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER: u32 = 37577; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER: u32 = 37578; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER: u32 = 37579; +pub const GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS: u32 = 37580; +pub const GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS: u32 = 37581; +pub const GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS: u32 = 37582; +pub const GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS: u32 = 37583; +pub const GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS: u32 = 37584; +pub const GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS: u32 = 37585; +pub const GL_MAX_VERTEX_ATOMIC_COUNTERS: u32 = 37586; +pub const GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS: u32 = 37587; +pub const GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS: u32 = 37588; +pub const GL_MAX_GEOMETRY_ATOMIC_COUNTERS: u32 = 37589; +pub const GL_MAX_FRAGMENT_ATOMIC_COUNTERS: u32 = 37590; +pub const GL_MAX_COMBINED_ATOMIC_COUNTERS: u32 = 37591; +pub const GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE: u32 = 37592; +pub const GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS: u32 = 37596; +pub const GL_ACTIVE_ATOMIC_COUNTER_BUFFERS: u32 = 37593; +pub const GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX: u32 = 37594; +pub const GL_UNSIGNED_INT_ATOMIC_COUNTER: u32 = 37595; +pub const GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT: u32 = 1; +pub const GL_ELEMENT_ARRAY_BARRIER_BIT: u32 = 2; +pub const GL_UNIFORM_BARRIER_BIT: u32 = 4; +pub const GL_TEXTURE_FETCH_BARRIER_BIT: u32 = 8; +pub const GL_SHADER_IMAGE_ACCESS_BARRIER_BIT: u32 = 32; +pub const GL_COMMAND_BARRIER_BIT: u32 = 64; +pub const GL_PIXEL_BUFFER_BARRIER_BIT: u32 = 128; +pub const GL_TEXTURE_UPDATE_BARRIER_BIT: u32 = 256; +pub const GL_BUFFER_UPDATE_BARRIER_BIT: u32 = 512; +pub const GL_FRAMEBUFFER_BARRIER_BIT: u32 = 1024; +pub const GL_TRANSFORM_FEEDBACK_BARRIER_BIT: u32 = 2048; +pub const GL_ATOMIC_COUNTER_BARRIER_BIT: u32 = 4096; +pub const GL_ALL_BARRIER_BITS: u32 = 4294967295; +pub const GL_MAX_IMAGE_UNITS: u32 = 36664; +pub const GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS: u32 = 36665; +pub const GL_IMAGE_BINDING_NAME: u32 = 36666; +pub const GL_IMAGE_BINDING_LEVEL: u32 = 36667; +pub const GL_IMAGE_BINDING_LAYERED: u32 = 36668; +pub const GL_IMAGE_BINDING_LAYER: u32 = 36669; +pub const GL_IMAGE_BINDING_ACCESS: u32 = 36670; +pub const GL_IMAGE_1D: u32 = 36940; +pub const GL_IMAGE_2D: u32 = 36941; +pub const GL_IMAGE_3D: u32 = 36942; +pub const GL_IMAGE_2D_RECT: u32 = 36943; +pub const GL_IMAGE_CUBE: u32 = 36944; +pub const GL_IMAGE_BUFFER: u32 = 36945; +pub const GL_IMAGE_1D_ARRAY: u32 = 36946; +pub const GL_IMAGE_2D_ARRAY: u32 = 36947; +pub const GL_IMAGE_CUBE_MAP_ARRAY: u32 = 36948; +pub const GL_IMAGE_2D_MULTISAMPLE: u32 = 36949; +pub const GL_IMAGE_2D_MULTISAMPLE_ARRAY: u32 = 36950; +pub const GL_INT_IMAGE_1D: u32 = 36951; +pub const GL_INT_IMAGE_2D: u32 = 36952; +pub const GL_INT_IMAGE_3D: u32 = 36953; +pub const GL_INT_IMAGE_2D_RECT: u32 = 36954; +pub const GL_INT_IMAGE_CUBE: u32 = 36955; +pub const GL_INT_IMAGE_BUFFER: u32 = 36956; +pub const GL_INT_IMAGE_1D_ARRAY: u32 = 36957; +pub const GL_INT_IMAGE_2D_ARRAY: u32 = 36958; +pub const GL_INT_IMAGE_CUBE_MAP_ARRAY: u32 = 36959; +pub const GL_INT_IMAGE_2D_MULTISAMPLE: u32 = 36960; +pub const GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY: u32 = 36961; +pub const GL_UNSIGNED_INT_IMAGE_1D: u32 = 36962; +pub const GL_UNSIGNED_INT_IMAGE_2D: u32 = 36963; +pub const GL_UNSIGNED_INT_IMAGE_3D: u32 = 36964; +pub const GL_UNSIGNED_INT_IMAGE_2D_RECT: u32 = 36965; +pub const GL_UNSIGNED_INT_IMAGE_CUBE: u32 = 36966; +pub const GL_UNSIGNED_INT_IMAGE_BUFFER: u32 = 36967; +pub const GL_UNSIGNED_INT_IMAGE_1D_ARRAY: u32 = 36968; +pub const GL_UNSIGNED_INT_IMAGE_2D_ARRAY: u32 = 36969; +pub const GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY: u32 = 36970; +pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE: u32 = 36971; +pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY: u32 = 36972; +pub const GL_MAX_IMAGE_SAMPLES: u32 = 36973; +pub const GL_IMAGE_BINDING_FORMAT: u32 = 36974; +pub const GL_IMAGE_FORMAT_COMPATIBILITY_TYPE: u32 = 37063; +pub const GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE: u32 = 37064; +pub const GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS: u32 = 37065; +pub const GL_MAX_VERTEX_IMAGE_UNIFORMS: u32 = 37066; +pub const GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS: u32 = 37067; +pub const GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS: u32 = 37068; +pub const GL_MAX_GEOMETRY_IMAGE_UNIFORMS: u32 = 37069; +pub const GL_MAX_FRAGMENT_IMAGE_UNIFORMS: u32 = 37070; +pub const GL_MAX_COMBINED_IMAGE_UNIFORMS: u32 = 37071; +pub const GL_COMPRESSED_RGBA_BPTC_UNORM: u32 = 36492; +pub const GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM: u32 = 36493; +pub const GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT: u32 = 36494; +pub const GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT: u32 = 36495; +pub const GL_TEXTURE_IMMUTABLE_FORMAT: u32 = 37167; +pub const GL_VERSION_4_3: u32 = 1; +pub const GL_NUM_SHADING_LANGUAGE_VERSIONS: u32 = 33513; +pub const GL_VERTEX_ATTRIB_ARRAY_LONG: u32 = 34638; +pub const GL_COMPRESSED_RGB8_ETC2: u32 = 37492; +pub const GL_COMPRESSED_SRGB8_ETC2: u32 = 37493; +pub const GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: u32 = 37494; +pub const GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: u32 = 37495; +pub const GL_COMPRESSED_RGBA8_ETC2_EAC: u32 = 37496; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: u32 = 37497; +pub const GL_COMPRESSED_R11_EAC: u32 = 37488; +pub const GL_COMPRESSED_SIGNED_R11_EAC: u32 = 37489; +pub const GL_COMPRESSED_RG11_EAC: u32 = 37490; +pub const GL_COMPRESSED_SIGNED_RG11_EAC: u32 = 37491; +pub const GL_PRIMITIVE_RESTART_FIXED_INDEX: u32 = 36201; +pub const GL_ANY_SAMPLES_PASSED_CONSERVATIVE: u32 = 36202; +pub const GL_MAX_ELEMENT_INDEX: u32 = 36203; +pub const GL_COMPUTE_SHADER: u32 = 37305; +pub const GL_MAX_COMPUTE_UNIFORM_BLOCKS: u32 = 37307; +pub const GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS: u32 = 37308; +pub const GL_MAX_COMPUTE_IMAGE_UNIFORMS: u32 = 37309; +pub const GL_MAX_COMPUTE_SHARED_MEMORY_SIZE: u32 = 33378; +pub const GL_MAX_COMPUTE_UNIFORM_COMPONENTS: u32 = 33379; +pub const GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS: u32 = 33380; +pub const GL_MAX_COMPUTE_ATOMIC_COUNTERS: u32 = 33381; +pub const GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS: u32 = 33382; +pub const GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS: u32 = 37099; +pub const GL_MAX_COMPUTE_WORK_GROUP_COUNT: u32 = 37310; +pub const GL_MAX_COMPUTE_WORK_GROUP_SIZE: u32 = 37311; +pub const GL_COMPUTE_WORK_GROUP_SIZE: u32 = 33383; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER: u32 = 37100; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER: u32 = 37101; +pub const GL_DISPATCH_INDIRECT_BUFFER: u32 = 37102; +pub const GL_DISPATCH_INDIRECT_BUFFER_BINDING: u32 = 37103; +pub const GL_COMPUTE_SHADER_BIT: u32 = 32; +pub const GL_DEBUG_OUTPUT_SYNCHRONOUS: u32 = 33346; +pub const GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH: u32 = 33347; +pub const GL_DEBUG_CALLBACK_FUNCTION: u32 = 33348; +pub const GL_DEBUG_CALLBACK_USER_PARAM: u32 = 33349; +pub const GL_DEBUG_SOURCE_API: u32 = 33350; +pub const GL_DEBUG_SOURCE_WINDOW_SYSTEM: u32 = 33351; +pub const GL_DEBUG_SOURCE_SHADER_COMPILER: u32 = 33352; +pub const GL_DEBUG_SOURCE_THIRD_PARTY: u32 = 33353; +pub const GL_DEBUG_SOURCE_APPLICATION: u32 = 33354; +pub const GL_DEBUG_SOURCE_OTHER: u32 = 33355; +pub const GL_DEBUG_TYPE_ERROR: u32 = 33356; +pub const GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: u32 = 33357; +pub const GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: u32 = 33358; +pub const GL_DEBUG_TYPE_PORTABILITY: u32 = 33359; +pub const GL_DEBUG_TYPE_PERFORMANCE: u32 = 33360; +pub const GL_DEBUG_TYPE_OTHER: u32 = 33361; +pub const GL_MAX_DEBUG_MESSAGE_LENGTH: u32 = 37187; +pub const GL_MAX_DEBUG_LOGGED_MESSAGES: u32 = 37188; +pub const GL_DEBUG_LOGGED_MESSAGES: u32 = 37189; +pub const GL_DEBUG_SEVERITY_HIGH: u32 = 37190; +pub const GL_DEBUG_SEVERITY_MEDIUM: u32 = 37191; +pub const GL_DEBUG_SEVERITY_LOW: u32 = 37192; +pub const GL_DEBUG_TYPE_MARKER: u32 = 33384; +pub const GL_DEBUG_TYPE_PUSH_GROUP: u32 = 33385; +pub const GL_DEBUG_TYPE_POP_GROUP: u32 = 33386; +pub const GL_DEBUG_SEVERITY_NOTIFICATION: u32 = 33387; +pub const GL_MAX_DEBUG_GROUP_STACK_DEPTH: u32 = 33388; +pub const GL_DEBUG_GROUP_STACK_DEPTH: u32 = 33389; +pub const GL_BUFFER: u32 = 33504; +pub const GL_SHADER: u32 = 33505; +pub const GL_PROGRAM: u32 = 33506; +pub const GL_QUERY: u32 = 33507; +pub const GL_PROGRAM_PIPELINE: u32 = 33508; +pub const GL_SAMPLER: u32 = 33510; +pub const GL_MAX_LABEL_LENGTH: u32 = 33512; +pub const GL_DEBUG_OUTPUT: u32 = 37600; +pub const GL_CONTEXT_FLAG_DEBUG_BIT: u32 = 2; +pub const GL_MAX_UNIFORM_LOCATIONS: u32 = 33390; +pub const GL_FRAMEBUFFER_DEFAULT_WIDTH: u32 = 37648; +pub const GL_FRAMEBUFFER_DEFAULT_HEIGHT: u32 = 37649; +pub const GL_FRAMEBUFFER_DEFAULT_LAYERS: u32 = 37650; +pub const GL_FRAMEBUFFER_DEFAULT_SAMPLES: u32 = 37651; +pub const GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: u32 = 37652; +pub const GL_MAX_FRAMEBUFFER_WIDTH: u32 = 37653; +pub const GL_MAX_FRAMEBUFFER_HEIGHT: u32 = 37654; +pub const GL_MAX_FRAMEBUFFER_LAYERS: u32 = 37655; +pub const GL_MAX_FRAMEBUFFER_SAMPLES: u32 = 37656; +pub const GL_INTERNALFORMAT_SUPPORTED: u32 = 33391; +pub const GL_INTERNALFORMAT_PREFERRED: u32 = 33392; +pub const GL_INTERNALFORMAT_RED_SIZE: u32 = 33393; +pub const GL_INTERNALFORMAT_GREEN_SIZE: u32 = 33394; +pub const GL_INTERNALFORMAT_BLUE_SIZE: u32 = 33395; +pub const GL_INTERNALFORMAT_ALPHA_SIZE: u32 = 33396; +pub const GL_INTERNALFORMAT_DEPTH_SIZE: u32 = 33397; +pub const GL_INTERNALFORMAT_STENCIL_SIZE: u32 = 33398; +pub const GL_INTERNALFORMAT_SHARED_SIZE: u32 = 33399; +pub const GL_INTERNALFORMAT_RED_TYPE: u32 = 33400; +pub const GL_INTERNALFORMAT_GREEN_TYPE: u32 = 33401; +pub const GL_INTERNALFORMAT_BLUE_TYPE: u32 = 33402; +pub const GL_INTERNALFORMAT_ALPHA_TYPE: u32 = 33403; +pub const GL_INTERNALFORMAT_DEPTH_TYPE: u32 = 33404; +pub const GL_INTERNALFORMAT_STENCIL_TYPE: u32 = 33405; +pub const GL_MAX_WIDTH: u32 = 33406; +pub const GL_MAX_HEIGHT: u32 = 33407; +pub const GL_MAX_DEPTH: u32 = 33408; +pub const GL_MAX_LAYERS: u32 = 33409; +pub const GL_MAX_COMBINED_DIMENSIONS: u32 = 33410; +pub const GL_COLOR_COMPONENTS: u32 = 33411; +pub const GL_DEPTH_COMPONENTS: u32 = 33412; +pub const GL_STENCIL_COMPONENTS: u32 = 33413; +pub const GL_COLOR_RENDERABLE: u32 = 33414; +pub const GL_DEPTH_RENDERABLE: u32 = 33415; +pub const GL_STENCIL_RENDERABLE: u32 = 33416; +pub const GL_FRAMEBUFFER_RENDERABLE: u32 = 33417; +pub const GL_FRAMEBUFFER_RENDERABLE_LAYERED: u32 = 33418; +pub const GL_FRAMEBUFFER_BLEND: u32 = 33419; +pub const GL_READ_PIXELS: u32 = 33420; +pub const GL_READ_PIXELS_FORMAT: u32 = 33421; +pub const GL_READ_PIXELS_TYPE: u32 = 33422; +pub const GL_TEXTURE_IMAGE_FORMAT: u32 = 33423; +pub const GL_TEXTURE_IMAGE_TYPE: u32 = 33424; +pub const GL_GET_TEXTURE_IMAGE_FORMAT: u32 = 33425; +pub const GL_GET_TEXTURE_IMAGE_TYPE: u32 = 33426; +pub const GL_MIPMAP: u32 = 33427; +pub const GL_MANUAL_GENERATE_MIPMAP: u32 = 33428; +pub const GL_AUTO_GENERATE_MIPMAP: u32 = 33429; +pub const GL_COLOR_ENCODING: u32 = 33430; +pub const GL_SRGB_READ: u32 = 33431; +pub const GL_SRGB_WRITE: u32 = 33432; +pub const GL_FILTER: u32 = 33434; +pub const GL_VERTEX_TEXTURE: u32 = 33435; +pub const GL_TESS_CONTROL_TEXTURE: u32 = 33436; +pub const GL_TESS_EVALUATION_TEXTURE: u32 = 33437; +pub const GL_GEOMETRY_TEXTURE: u32 = 33438; +pub const GL_FRAGMENT_TEXTURE: u32 = 33439; +pub const GL_COMPUTE_TEXTURE: u32 = 33440; +pub const GL_TEXTURE_SHADOW: u32 = 33441; +pub const GL_TEXTURE_GATHER: u32 = 33442; +pub const GL_TEXTURE_GATHER_SHADOW: u32 = 33443; +pub const GL_SHADER_IMAGE_LOAD: u32 = 33444; +pub const GL_SHADER_IMAGE_STORE: u32 = 33445; +pub const GL_SHADER_IMAGE_ATOMIC: u32 = 33446; +pub const GL_IMAGE_TEXEL_SIZE: u32 = 33447; +pub const GL_IMAGE_COMPATIBILITY_CLASS: u32 = 33448; +pub const GL_IMAGE_PIXEL_FORMAT: u32 = 33449; +pub const GL_IMAGE_PIXEL_TYPE: u32 = 33450; +pub const GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST: u32 = 33452; +pub const GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST: u32 = 33453; +pub const GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE: u32 = 33454; +pub const GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE: u32 = 33455; +pub const GL_TEXTURE_COMPRESSED_BLOCK_WIDTH: u32 = 33457; +pub const GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT: u32 = 33458; +pub const GL_TEXTURE_COMPRESSED_BLOCK_SIZE: u32 = 33459; +pub const GL_CLEAR_BUFFER: u32 = 33460; +pub const GL_TEXTURE_VIEW: u32 = 33461; +pub const GL_VIEW_COMPATIBILITY_CLASS: u32 = 33462; +pub const GL_FULL_SUPPORT: u32 = 33463; +pub const GL_CAVEAT_SUPPORT: u32 = 33464; +pub const GL_IMAGE_CLASS_4_X_32: u32 = 33465; +pub const GL_IMAGE_CLASS_2_X_32: u32 = 33466; +pub const GL_IMAGE_CLASS_1_X_32: u32 = 33467; +pub const GL_IMAGE_CLASS_4_X_16: u32 = 33468; +pub const GL_IMAGE_CLASS_2_X_16: u32 = 33469; +pub const GL_IMAGE_CLASS_1_X_16: u32 = 33470; +pub const GL_IMAGE_CLASS_4_X_8: u32 = 33471; +pub const GL_IMAGE_CLASS_2_X_8: u32 = 33472; +pub const GL_IMAGE_CLASS_1_X_8: u32 = 33473; +pub const GL_IMAGE_CLASS_11_11_10: u32 = 33474; +pub const GL_IMAGE_CLASS_10_10_10_2: u32 = 33475; +pub const GL_VIEW_CLASS_128_BITS: u32 = 33476; +pub const GL_VIEW_CLASS_96_BITS: u32 = 33477; +pub const GL_VIEW_CLASS_64_BITS: u32 = 33478; +pub const GL_VIEW_CLASS_48_BITS: u32 = 33479; +pub const GL_VIEW_CLASS_32_BITS: u32 = 33480; +pub const GL_VIEW_CLASS_24_BITS: u32 = 33481; +pub const GL_VIEW_CLASS_16_BITS: u32 = 33482; +pub const GL_VIEW_CLASS_8_BITS: u32 = 33483; +pub const GL_VIEW_CLASS_S3TC_DXT1_RGB: u32 = 33484; +pub const GL_VIEW_CLASS_S3TC_DXT1_RGBA: u32 = 33485; +pub const GL_VIEW_CLASS_S3TC_DXT3_RGBA: u32 = 33486; +pub const GL_VIEW_CLASS_S3TC_DXT5_RGBA: u32 = 33487; +pub const GL_VIEW_CLASS_RGTC1_RED: u32 = 33488; +pub const GL_VIEW_CLASS_RGTC2_RG: u32 = 33489; +pub const GL_VIEW_CLASS_BPTC_UNORM: u32 = 33490; +pub const GL_VIEW_CLASS_BPTC_FLOAT: u32 = 33491; +pub const GL_UNIFORM: u32 = 37601; +pub const GL_UNIFORM_BLOCK: u32 = 37602; +pub const GL_PROGRAM_INPUT: u32 = 37603; +pub const GL_PROGRAM_OUTPUT: u32 = 37604; +pub const GL_BUFFER_VARIABLE: u32 = 37605; +pub const GL_SHADER_STORAGE_BLOCK: u32 = 37606; +pub const GL_VERTEX_SUBROUTINE: u32 = 37608; +pub const GL_TESS_CONTROL_SUBROUTINE: u32 = 37609; +pub const GL_TESS_EVALUATION_SUBROUTINE: u32 = 37610; +pub const GL_GEOMETRY_SUBROUTINE: u32 = 37611; +pub const GL_FRAGMENT_SUBROUTINE: u32 = 37612; +pub const GL_COMPUTE_SUBROUTINE: u32 = 37613; +pub const GL_VERTEX_SUBROUTINE_UNIFORM: u32 = 37614; +pub const GL_TESS_CONTROL_SUBROUTINE_UNIFORM: u32 = 37615; +pub const GL_TESS_EVALUATION_SUBROUTINE_UNIFORM: u32 = 37616; +pub const GL_GEOMETRY_SUBROUTINE_UNIFORM: u32 = 37617; +pub const GL_FRAGMENT_SUBROUTINE_UNIFORM: u32 = 37618; +pub const GL_COMPUTE_SUBROUTINE_UNIFORM: u32 = 37619; +pub const GL_TRANSFORM_FEEDBACK_VARYING: u32 = 37620; +pub const GL_ACTIVE_RESOURCES: u32 = 37621; +pub const GL_MAX_NAME_LENGTH: u32 = 37622; +pub const GL_MAX_NUM_ACTIVE_VARIABLES: u32 = 37623; +pub const GL_MAX_NUM_COMPATIBLE_SUBROUTINES: u32 = 37624; +pub const GL_NAME_LENGTH: u32 = 37625; +pub const GL_TYPE: u32 = 37626; +pub const GL_ARRAY_SIZE: u32 = 37627; +pub const GL_OFFSET: u32 = 37628; +pub const GL_BLOCK_INDEX: u32 = 37629; +pub const GL_ARRAY_STRIDE: u32 = 37630; +pub const GL_MATRIX_STRIDE: u32 = 37631; +pub const GL_IS_ROW_MAJOR: u32 = 37632; +pub const GL_ATOMIC_COUNTER_BUFFER_INDEX: u32 = 37633; +pub const GL_BUFFER_BINDING: u32 = 37634; +pub const GL_BUFFER_DATA_SIZE: u32 = 37635; +pub const GL_NUM_ACTIVE_VARIABLES: u32 = 37636; +pub const GL_ACTIVE_VARIABLES: u32 = 37637; +pub const GL_REFERENCED_BY_VERTEX_SHADER: u32 = 37638; +pub const GL_REFERENCED_BY_TESS_CONTROL_SHADER: u32 = 37639; +pub const GL_REFERENCED_BY_TESS_EVALUATION_SHADER: u32 = 37640; +pub const GL_REFERENCED_BY_GEOMETRY_SHADER: u32 = 37641; +pub const GL_REFERENCED_BY_FRAGMENT_SHADER: u32 = 37642; +pub const GL_REFERENCED_BY_COMPUTE_SHADER: u32 = 37643; +pub const GL_TOP_LEVEL_ARRAY_SIZE: u32 = 37644; +pub const GL_TOP_LEVEL_ARRAY_STRIDE: u32 = 37645; +pub const GL_LOCATION: u32 = 37646; +pub const GL_LOCATION_INDEX: u32 = 37647; +pub const GL_IS_PER_PATCH: u32 = 37607; +pub const GL_SHADER_STORAGE_BUFFER: u32 = 37074; +pub const GL_SHADER_STORAGE_BUFFER_BINDING: u32 = 37075; +pub const GL_SHADER_STORAGE_BUFFER_START: u32 = 37076; +pub const GL_SHADER_STORAGE_BUFFER_SIZE: u32 = 37077; +pub const GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS: u32 = 37078; +pub const GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS: u32 = 37079; +pub const GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS: u32 = 37080; +pub const GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS: u32 = 37081; +pub const GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS: u32 = 37082; +pub const GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS: u32 = 37083; +pub const GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS: u32 = 37084; +pub const GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS: u32 = 37085; +pub const GL_MAX_SHADER_STORAGE_BLOCK_SIZE: u32 = 37086; +pub const GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT: u32 = 37087; +pub const GL_SHADER_STORAGE_BARRIER_BIT: u32 = 8192; +pub const GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES: u32 = 36665; +pub const GL_DEPTH_STENCIL_TEXTURE_MODE: u32 = 37098; +pub const GL_TEXTURE_BUFFER_OFFSET: u32 = 37277; +pub const GL_TEXTURE_BUFFER_SIZE: u32 = 37278; +pub const GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT: u32 = 37279; +pub const GL_TEXTURE_VIEW_MIN_LEVEL: u32 = 33499; +pub const GL_TEXTURE_VIEW_NUM_LEVELS: u32 = 33500; +pub const GL_TEXTURE_VIEW_MIN_LAYER: u32 = 33501; +pub const GL_TEXTURE_VIEW_NUM_LAYERS: u32 = 33502; +pub const GL_TEXTURE_IMMUTABLE_LEVELS: u32 = 33503; +pub const GL_VERTEX_ATTRIB_BINDING: u32 = 33492; +pub const GL_VERTEX_ATTRIB_RELATIVE_OFFSET: u32 = 33493; +pub const GL_VERTEX_BINDING_DIVISOR: u32 = 33494; +pub const GL_VERTEX_BINDING_OFFSET: u32 = 33495; +pub const GL_VERTEX_BINDING_STRIDE: u32 = 33496; +pub const GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET: u32 = 33497; +pub const GL_MAX_VERTEX_ATTRIB_BINDINGS: u32 = 33498; +pub const GL_VERTEX_BINDING_BUFFER: u32 = 36687; +pub const GL_DISPLAY_LIST: u32 = 33511; +pub const GL_VERSION_4_4: u32 = 1; +pub const GL_MAX_VERTEX_ATTRIB_STRIDE: u32 = 33509; +pub const GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED: u32 = 33313; +pub const GL_TEXTURE_BUFFER_BINDING: u32 = 35882; +pub const GL_MAP_PERSISTENT_BIT: u32 = 64; +pub const GL_MAP_COHERENT_BIT: u32 = 128; +pub const GL_DYNAMIC_STORAGE_BIT: u32 = 256; +pub const GL_CLIENT_STORAGE_BIT: u32 = 512; +pub const GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT: u32 = 16384; +pub const GL_BUFFER_IMMUTABLE_STORAGE: u32 = 33311; +pub const GL_BUFFER_STORAGE_FLAGS: u32 = 33312; +pub const GL_CLEAR_TEXTURE: u32 = 37733; +pub const GL_LOCATION_COMPONENT: u32 = 37706; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_INDEX: u32 = 37707; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE: u32 = 37708; +pub const GL_QUERY_BUFFER: u32 = 37266; +pub const GL_QUERY_BUFFER_BARRIER_BIT: u32 = 32768; +pub const GL_QUERY_BUFFER_BINDING: u32 = 37267; +pub const GL_QUERY_RESULT_NO_WAIT: u32 = 37268; +pub const GL_MIRROR_CLAMP_TO_EDGE: u32 = 34627; +pub const GL_VERSION_4_5: u32 = 1; +pub const GL_CONTEXT_LOST: u32 = 1287; +pub const GL_NEGATIVE_ONE_TO_ONE: u32 = 37726; +pub const GL_ZERO_TO_ONE: u32 = 37727; +pub const GL_CLIP_ORIGIN: u32 = 37724; +pub const GL_CLIP_DEPTH_MODE: u32 = 37725; +pub const GL_QUERY_WAIT_INVERTED: u32 = 36375; +pub const GL_QUERY_NO_WAIT_INVERTED: u32 = 36376; +pub const GL_QUERY_BY_REGION_WAIT_INVERTED: u32 = 36377; +pub const GL_QUERY_BY_REGION_NO_WAIT_INVERTED: u32 = 36378; +pub const GL_MAX_CULL_DISTANCES: u32 = 33529; +pub const GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES: u32 = 33530; +pub const GL_TEXTURE_TARGET: u32 = 4102; +pub const GL_QUERY_TARGET: u32 = 33514; +pub const GL_GUILTY_CONTEXT_RESET: u32 = 33363; +pub const GL_INNOCENT_CONTEXT_RESET: u32 = 33364; +pub const GL_UNKNOWN_CONTEXT_RESET: u32 = 33365; +pub const GL_RESET_NOTIFICATION_STRATEGY: u32 = 33366; +pub const GL_LOSE_CONTEXT_ON_RESET: u32 = 33362; +pub const GL_NO_RESET_NOTIFICATION: u32 = 33377; +pub const GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT: u32 = 4; +pub const GL_CONTEXT_RELEASE_BEHAVIOR: u32 = 33531; +pub const GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH: u32 = 33532; +pub const GL_VERSION_4_6: u32 = 1; +pub const GL_SHADER_BINARY_FORMAT_SPIR_V: u32 = 38225; +pub const GL_SPIR_V_BINARY: u32 = 38226; +pub const GL_PARAMETER_BUFFER: u32 = 33006; +pub const GL_PARAMETER_BUFFER_BINDING: u32 = 33007; +pub const GL_CONTEXT_FLAG_NO_ERROR_BIT: u32 = 8; +pub const GL_VERTICES_SUBMITTED: u32 = 33518; +pub const GL_PRIMITIVES_SUBMITTED: u32 = 33519; +pub const GL_VERTEX_SHADER_INVOCATIONS: u32 = 33520; +pub const GL_TESS_CONTROL_SHADER_PATCHES: u32 = 33521; +pub const GL_TESS_EVALUATION_SHADER_INVOCATIONS: u32 = 33522; +pub const GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED: u32 = 33523; +pub const GL_FRAGMENT_SHADER_INVOCATIONS: u32 = 33524; +pub const GL_COMPUTE_SHADER_INVOCATIONS: u32 = 33525; +pub const GL_CLIPPING_INPUT_PRIMITIVES: u32 = 33526; +pub const GL_CLIPPING_OUTPUT_PRIMITIVES: u32 = 33527; +pub const GL_POLYGON_OFFSET_CLAMP: u32 = 36379; +pub const GL_SPIR_V_EXTENSIONS: u32 = 38227; +pub const GL_NUM_SPIR_V_EXTENSIONS: u32 = 38228; +pub const GL_TEXTURE_MAX_ANISOTROPY: u32 = 34046; +pub const GL_MAX_TEXTURE_MAX_ANISOTROPY: u32 = 34047; +pub const GL_TRANSFORM_FEEDBACK_OVERFLOW: u32 = 33516; +pub const GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW: u32 = 33517; +pub const GL_ARB_ES2_compatibility: u32 = 1; +pub const GL_ARB_ES3_1_compatibility: u32 = 1; +pub const GL_ARB_ES3_2_compatibility: u32 = 1; +pub const GL_PRIMITIVE_BOUNDING_BOX_ARB: u32 = 37566; +pub const GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB: u32 = 37761; +pub const GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB: u32 = 37762; +pub const GL_ARB_ES3_compatibility: u32 = 1; +pub const GL_ARB_arrays_of_arrays: u32 = 1; +pub const GL_ARB_base_instance: u32 = 1; +pub const GL_ARB_bindless_texture: u32 = 1; +pub const GL_UNSIGNED_INT64_ARB: u32 = 5135; +pub const GL_ARB_blend_func_extended: u32 = 1; +pub const GL_ARB_buffer_storage: u32 = 1; +pub const GL_ARB_cl_event: u32 = 1; +pub const GL_SYNC_CL_EVENT_ARB: u32 = 33344; +pub const GL_SYNC_CL_EVENT_COMPLETE_ARB: u32 = 33345; +pub const GL_ARB_clear_buffer_object: u32 = 1; +pub const GL_ARB_clear_texture: u32 = 1; +pub const GL_ARB_clip_control: u32 = 1; +pub const GL_ARB_color_buffer_float: u32 = 1; +pub const GL_RGBA_FLOAT_MODE_ARB: u32 = 34848; +pub const GL_CLAMP_VERTEX_COLOR_ARB: u32 = 35098; +pub const GL_CLAMP_FRAGMENT_COLOR_ARB: u32 = 35099; +pub const GL_CLAMP_READ_COLOR_ARB: u32 = 35100; +pub const GL_FIXED_ONLY_ARB: u32 = 35101; +pub const GL_ARB_compatibility: u32 = 1; +pub const GL_ARB_compressed_texture_pixel_storage: u32 = 1; +pub const GL_ARB_compute_shader: u32 = 1; +pub const GL_ARB_compute_variable_group_size: u32 = 1; +pub const GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB: u32 = 37700; +pub const GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB: u32 = 37099; +pub const GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB: u32 = 37701; +pub const GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB: u32 = 37311; +pub const GL_ARB_conditional_render_inverted: u32 = 1; +pub const GL_ARB_conservative_depth: u32 = 1; +pub const GL_ARB_copy_buffer: u32 = 1; +pub const GL_ARB_copy_image: u32 = 1; +pub const GL_ARB_cull_distance: u32 = 1; +pub const GL_ARB_debug_output: u32 = 1; +pub const GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB: u32 = 33346; +pub const GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB: u32 = 33347; +pub const GL_DEBUG_CALLBACK_FUNCTION_ARB: u32 = 33348; +pub const GL_DEBUG_CALLBACK_USER_PARAM_ARB: u32 = 33349; +pub const GL_DEBUG_SOURCE_API_ARB: u32 = 33350; +pub const GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB: u32 = 33351; +pub const GL_DEBUG_SOURCE_SHADER_COMPILER_ARB: u32 = 33352; +pub const GL_DEBUG_SOURCE_THIRD_PARTY_ARB: u32 = 33353; +pub const GL_DEBUG_SOURCE_APPLICATION_ARB: u32 = 33354; +pub const GL_DEBUG_SOURCE_OTHER_ARB: u32 = 33355; +pub const GL_DEBUG_TYPE_ERROR_ARB: u32 = 33356; +pub const GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB: u32 = 33357; +pub const GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB: u32 = 33358; +pub const GL_DEBUG_TYPE_PORTABILITY_ARB: u32 = 33359; +pub const GL_DEBUG_TYPE_PERFORMANCE_ARB: u32 = 33360; +pub const GL_DEBUG_TYPE_OTHER_ARB: u32 = 33361; +pub const GL_MAX_DEBUG_MESSAGE_LENGTH_ARB: u32 = 37187; +pub const GL_MAX_DEBUG_LOGGED_MESSAGES_ARB: u32 = 37188; +pub const GL_DEBUG_LOGGED_MESSAGES_ARB: u32 = 37189; +pub const GL_DEBUG_SEVERITY_HIGH_ARB: u32 = 37190; +pub const GL_DEBUG_SEVERITY_MEDIUM_ARB: u32 = 37191; +pub const GL_DEBUG_SEVERITY_LOW_ARB: u32 = 37192; +pub const GL_ARB_depth_buffer_float: u32 = 1; +pub const GL_ARB_depth_clamp: u32 = 1; +pub const GL_ARB_depth_texture: u32 = 1; +pub const GL_DEPTH_COMPONENT16_ARB: u32 = 33189; +pub const GL_DEPTH_COMPONENT24_ARB: u32 = 33190; +pub const GL_DEPTH_COMPONENT32_ARB: u32 = 33191; +pub const GL_TEXTURE_DEPTH_SIZE_ARB: u32 = 34890; +pub const GL_DEPTH_TEXTURE_MODE_ARB: u32 = 34891; +pub const GL_ARB_derivative_control: u32 = 1; +pub const GL_ARB_direct_state_access: u32 = 1; +pub const GL_ARB_draw_buffers: u32 = 1; +pub const GL_MAX_DRAW_BUFFERS_ARB: u32 = 34852; +pub const GL_DRAW_BUFFER0_ARB: u32 = 34853; +pub const GL_DRAW_BUFFER1_ARB: u32 = 34854; +pub const GL_DRAW_BUFFER2_ARB: u32 = 34855; +pub const GL_DRAW_BUFFER3_ARB: u32 = 34856; +pub const GL_DRAW_BUFFER4_ARB: u32 = 34857; +pub const GL_DRAW_BUFFER5_ARB: u32 = 34858; +pub const GL_DRAW_BUFFER6_ARB: u32 = 34859; +pub const GL_DRAW_BUFFER7_ARB: u32 = 34860; +pub const GL_DRAW_BUFFER8_ARB: u32 = 34861; +pub const GL_DRAW_BUFFER9_ARB: u32 = 34862; +pub const GL_DRAW_BUFFER10_ARB: u32 = 34863; +pub const GL_DRAW_BUFFER11_ARB: u32 = 34864; +pub const GL_DRAW_BUFFER12_ARB: u32 = 34865; +pub const GL_DRAW_BUFFER13_ARB: u32 = 34866; +pub const GL_DRAW_BUFFER14_ARB: u32 = 34867; +pub const GL_DRAW_BUFFER15_ARB: u32 = 34868; +pub const GL_ARB_draw_buffers_blend: u32 = 1; +pub const GL_ARB_draw_elements_base_vertex: u32 = 1; +pub const GL_ARB_draw_indirect: u32 = 1; +pub const GL_ARB_draw_instanced: u32 = 1; +pub const GL_ARB_enhanced_layouts: u32 = 1; +pub const GL_ARB_explicit_attrib_location: u32 = 1; +pub const GL_ARB_explicit_uniform_location: u32 = 1; +pub const GL_ARB_fragment_coord_conventions: u32 = 1; +pub const GL_ARB_fragment_layer_viewport: u32 = 1; +pub const GL_ARB_fragment_program: u32 = 1; +pub const GL_FRAGMENT_PROGRAM_ARB: u32 = 34820; +pub const GL_PROGRAM_FORMAT_ASCII_ARB: u32 = 34933; +pub const GL_PROGRAM_LENGTH_ARB: u32 = 34343; +pub const GL_PROGRAM_FORMAT_ARB: u32 = 34934; +pub const GL_PROGRAM_BINDING_ARB: u32 = 34423; +pub const GL_PROGRAM_INSTRUCTIONS_ARB: u32 = 34976; +pub const GL_MAX_PROGRAM_INSTRUCTIONS_ARB: u32 = 34977; +pub const GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB: u32 = 34978; +pub const GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB: u32 = 34979; +pub const GL_PROGRAM_TEMPORARIES_ARB: u32 = 34980; +pub const GL_MAX_PROGRAM_TEMPORARIES_ARB: u32 = 34981; +pub const GL_PROGRAM_NATIVE_TEMPORARIES_ARB: u32 = 34982; +pub const GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB: u32 = 34983; +pub const GL_PROGRAM_PARAMETERS_ARB: u32 = 34984; +pub const GL_MAX_PROGRAM_PARAMETERS_ARB: u32 = 34985; +pub const GL_PROGRAM_NATIVE_PARAMETERS_ARB: u32 = 34986; +pub const GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB: u32 = 34987; +pub const GL_PROGRAM_ATTRIBS_ARB: u32 = 34988; +pub const GL_MAX_PROGRAM_ATTRIBS_ARB: u32 = 34989; +pub const GL_PROGRAM_NATIVE_ATTRIBS_ARB: u32 = 34990; +pub const GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB: u32 = 34991; +pub const GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB: u32 = 34996; +pub const GL_MAX_PROGRAM_ENV_PARAMETERS_ARB: u32 = 34997; +pub const GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB: u32 = 34998; +pub const GL_PROGRAM_ALU_INSTRUCTIONS_ARB: u32 = 34821; +pub const GL_PROGRAM_TEX_INSTRUCTIONS_ARB: u32 = 34822; +pub const GL_PROGRAM_TEX_INDIRECTIONS_ARB: u32 = 34823; +pub const GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: u32 = 34824; +pub const GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: u32 = 34825; +pub const GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: u32 = 34826; +pub const GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB: u32 = 34827; +pub const GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB: u32 = 34828; +pub const GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB: u32 = 34829; +pub const GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB: u32 = 34830; +pub const GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB: u32 = 34831; +pub const GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB: u32 = 34832; +pub const GL_PROGRAM_STRING_ARB: u32 = 34344; +pub const GL_PROGRAM_ERROR_POSITION_ARB: u32 = 34379; +pub const GL_CURRENT_MATRIX_ARB: u32 = 34369; +pub const GL_TRANSPOSE_CURRENT_MATRIX_ARB: u32 = 34999; +pub const GL_CURRENT_MATRIX_STACK_DEPTH_ARB: u32 = 34368; +pub const GL_MAX_PROGRAM_MATRICES_ARB: u32 = 34351; +pub const GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: u32 = 34350; +pub const GL_MAX_TEXTURE_COORDS_ARB: u32 = 34929; +pub const GL_MAX_TEXTURE_IMAGE_UNITS_ARB: u32 = 34930; +pub const GL_PROGRAM_ERROR_STRING_ARB: u32 = 34932; +pub const GL_MATRIX0_ARB: u32 = 35008; +pub const GL_MATRIX1_ARB: u32 = 35009; +pub const GL_MATRIX2_ARB: u32 = 35010; +pub const GL_MATRIX3_ARB: u32 = 35011; +pub const GL_MATRIX4_ARB: u32 = 35012; +pub const GL_MATRIX5_ARB: u32 = 35013; +pub const GL_MATRIX6_ARB: u32 = 35014; +pub const GL_MATRIX7_ARB: u32 = 35015; +pub const GL_MATRIX8_ARB: u32 = 35016; +pub const GL_MATRIX9_ARB: u32 = 35017; +pub const GL_MATRIX10_ARB: u32 = 35018; +pub const GL_MATRIX11_ARB: u32 = 35019; +pub const GL_MATRIX12_ARB: u32 = 35020; +pub const GL_MATRIX13_ARB: u32 = 35021; +pub const GL_MATRIX14_ARB: u32 = 35022; +pub const GL_MATRIX15_ARB: u32 = 35023; +pub const GL_MATRIX16_ARB: u32 = 35024; +pub const GL_MATRIX17_ARB: u32 = 35025; +pub const GL_MATRIX18_ARB: u32 = 35026; +pub const GL_MATRIX19_ARB: u32 = 35027; +pub const GL_MATRIX20_ARB: u32 = 35028; +pub const GL_MATRIX21_ARB: u32 = 35029; +pub const GL_MATRIX22_ARB: u32 = 35030; +pub const GL_MATRIX23_ARB: u32 = 35031; +pub const GL_MATRIX24_ARB: u32 = 35032; +pub const GL_MATRIX25_ARB: u32 = 35033; +pub const GL_MATRIX26_ARB: u32 = 35034; +pub const GL_MATRIX27_ARB: u32 = 35035; +pub const GL_MATRIX28_ARB: u32 = 35036; +pub const GL_MATRIX29_ARB: u32 = 35037; +pub const GL_MATRIX30_ARB: u32 = 35038; +pub const GL_MATRIX31_ARB: u32 = 35039; +pub const GL_ARB_fragment_program_shadow: u32 = 1; +pub const GL_ARB_fragment_shader: u32 = 1; +pub const GL_FRAGMENT_SHADER_ARB: u32 = 35632; +pub const GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: u32 = 35657; +pub const GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: u32 = 35723; +pub const GL_ARB_fragment_shader_interlock: u32 = 1; +pub const GL_ARB_framebuffer_no_attachments: u32 = 1; +pub const GL_ARB_framebuffer_object: u32 = 1; +pub const GL_ARB_framebuffer_sRGB: u32 = 1; +pub const GL_ARB_geometry_shader4: u32 = 1; +pub const GL_LINES_ADJACENCY_ARB: u32 = 10; +pub const GL_LINE_STRIP_ADJACENCY_ARB: u32 = 11; +pub const GL_TRIANGLES_ADJACENCY_ARB: u32 = 12; +pub const GL_TRIANGLE_STRIP_ADJACENCY_ARB: u32 = 13; +pub const GL_PROGRAM_POINT_SIZE_ARB: u32 = 34370; +pub const GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB: u32 = 35881; +pub const GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB: u32 = 36263; +pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB: u32 = 36264; +pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB: u32 = 36265; +pub const GL_GEOMETRY_SHADER_ARB: u32 = 36313; +pub const GL_GEOMETRY_VERTICES_OUT_ARB: u32 = 36314; +pub const GL_GEOMETRY_INPUT_TYPE_ARB: u32 = 36315; +pub const GL_GEOMETRY_OUTPUT_TYPE_ARB: u32 = 36316; +pub const GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB: u32 = 36317; +pub const GL_MAX_VERTEX_VARYING_COMPONENTS_ARB: u32 = 36318; +pub const GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB: u32 = 36319; +pub const GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB: u32 = 36320; +pub const GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB: u32 = 36321; +pub const GL_ARB_get_program_binary: u32 = 1; +pub const GL_ARB_get_texture_sub_image: u32 = 1; +pub const GL_ARB_gl_spirv: u32 = 1; +pub const GL_SHADER_BINARY_FORMAT_SPIR_V_ARB: u32 = 38225; +pub const GL_SPIR_V_BINARY_ARB: u32 = 38226; +pub const GL_ARB_gpu_shader5: u32 = 1; +pub const GL_ARB_gpu_shader_fp64: u32 = 1; +pub const GL_ARB_gpu_shader_int64: u32 = 1; +pub const GL_INT64_ARB: u32 = 5134; +pub const GL_INT64_VEC2_ARB: u32 = 36841; +pub const GL_INT64_VEC3_ARB: u32 = 36842; +pub const GL_INT64_VEC4_ARB: u32 = 36843; +pub const GL_UNSIGNED_INT64_VEC2_ARB: u32 = 36853; +pub const GL_UNSIGNED_INT64_VEC3_ARB: u32 = 36854; +pub const GL_UNSIGNED_INT64_VEC4_ARB: u32 = 36855; +pub const GL_ARB_half_float_pixel: u32 = 1; +pub const GL_HALF_FLOAT_ARB: u32 = 5131; +pub const GL_ARB_half_float_vertex: u32 = 1; +pub const GL_ARB_indirect_parameters: u32 = 1; +pub const GL_PARAMETER_BUFFER_ARB: u32 = 33006; +pub const GL_PARAMETER_BUFFER_BINDING_ARB: u32 = 33007; +pub const GL_ARB_instanced_arrays: u32 = 1; +pub const GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB: u32 = 35070; +pub const GL_ARB_internalformat_query: u32 = 1; +pub const GL_ARB_internalformat_query2: u32 = 1; +pub const GL_SRGB_DECODE_ARB: u32 = 33433; +pub const GL_VIEW_CLASS_EAC_R11: u32 = 37763; +pub const GL_VIEW_CLASS_EAC_RG11: u32 = 37764; +pub const GL_VIEW_CLASS_ETC2_RGB: u32 = 37765; +pub const GL_VIEW_CLASS_ETC2_RGBA: u32 = 37766; +pub const GL_VIEW_CLASS_ETC2_EAC_RGBA: u32 = 37767; +pub const GL_VIEW_CLASS_ASTC_4x4_RGBA: u32 = 37768; +pub const GL_VIEW_CLASS_ASTC_5x4_RGBA: u32 = 37769; +pub const GL_VIEW_CLASS_ASTC_5x5_RGBA: u32 = 37770; +pub const GL_VIEW_CLASS_ASTC_6x5_RGBA: u32 = 37771; +pub const GL_VIEW_CLASS_ASTC_6x6_RGBA: u32 = 37772; +pub const GL_VIEW_CLASS_ASTC_8x5_RGBA: u32 = 37773; +pub const GL_VIEW_CLASS_ASTC_8x6_RGBA: u32 = 37774; +pub const GL_VIEW_CLASS_ASTC_8x8_RGBA: u32 = 37775; +pub const GL_VIEW_CLASS_ASTC_10x5_RGBA: u32 = 37776; +pub const GL_VIEW_CLASS_ASTC_10x6_RGBA: u32 = 37777; +pub const GL_VIEW_CLASS_ASTC_10x8_RGBA: u32 = 37778; +pub const GL_VIEW_CLASS_ASTC_10x10_RGBA: u32 = 37779; +pub const GL_VIEW_CLASS_ASTC_12x10_RGBA: u32 = 37780; +pub const GL_VIEW_CLASS_ASTC_12x12_RGBA: u32 = 37781; +pub const GL_ARB_invalidate_subdata: u32 = 1; +pub const GL_ARB_map_buffer_alignment: u32 = 1; +pub const GL_ARB_map_buffer_range: u32 = 1; +pub const GL_ARB_matrix_palette: u32 = 1; +pub const GL_MATRIX_PALETTE_ARB: u32 = 34880; +pub const GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB: u32 = 34881; +pub const GL_MAX_PALETTE_MATRICES_ARB: u32 = 34882; +pub const GL_CURRENT_PALETTE_MATRIX_ARB: u32 = 34883; +pub const GL_MATRIX_INDEX_ARRAY_ARB: u32 = 34884; +pub const GL_CURRENT_MATRIX_INDEX_ARB: u32 = 34885; +pub const GL_MATRIX_INDEX_ARRAY_SIZE_ARB: u32 = 34886; +pub const GL_MATRIX_INDEX_ARRAY_TYPE_ARB: u32 = 34887; +pub const GL_MATRIX_INDEX_ARRAY_STRIDE_ARB: u32 = 34888; +pub const GL_MATRIX_INDEX_ARRAY_POINTER_ARB: u32 = 34889; +pub const GL_ARB_multi_bind: u32 = 1; +pub const GL_ARB_multi_draw_indirect: u32 = 1; +pub const GL_ARB_multisample: u32 = 1; +pub const GL_MULTISAMPLE_ARB: u32 = 32925; +pub const GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: u32 = 32926; +pub const GL_SAMPLE_ALPHA_TO_ONE_ARB: u32 = 32927; +pub const GL_SAMPLE_COVERAGE_ARB: u32 = 32928; +pub const GL_SAMPLE_BUFFERS_ARB: u32 = 32936; +pub const GL_SAMPLES_ARB: u32 = 32937; +pub const GL_SAMPLE_COVERAGE_VALUE_ARB: u32 = 32938; +pub const GL_SAMPLE_COVERAGE_INVERT_ARB: u32 = 32939; +pub const GL_MULTISAMPLE_BIT_ARB: u32 = 536870912; +pub const GL_ARB_occlusion_query: u32 = 1; +pub const GL_QUERY_COUNTER_BITS_ARB: u32 = 34916; +pub const GL_CURRENT_QUERY_ARB: u32 = 34917; +pub const GL_QUERY_RESULT_ARB: u32 = 34918; +pub const GL_QUERY_RESULT_AVAILABLE_ARB: u32 = 34919; +pub const GL_SAMPLES_PASSED_ARB: u32 = 35092; +pub const GL_ARB_occlusion_query2: u32 = 1; +pub const GL_ARB_parallel_shader_compile: u32 = 1; +pub const GL_MAX_SHADER_COMPILER_THREADS_ARB: u32 = 37296; +pub const GL_COMPLETION_STATUS_ARB: u32 = 37297; +pub const GL_ARB_pipeline_statistics_query: u32 = 1; +pub const GL_VERTICES_SUBMITTED_ARB: u32 = 33518; +pub const GL_PRIMITIVES_SUBMITTED_ARB: u32 = 33519; +pub const GL_VERTEX_SHADER_INVOCATIONS_ARB: u32 = 33520; +pub const GL_TESS_CONTROL_SHADER_PATCHES_ARB: u32 = 33521; +pub const GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB: u32 = 33522; +pub const GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB: u32 = 33523; +pub const GL_FRAGMENT_SHADER_INVOCATIONS_ARB: u32 = 33524; +pub const GL_COMPUTE_SHADER_INVOCATIONS_ARB: u32 = 33525; +pub const GL_CLIPPING_INPUT_PRIMITIVES_ARB: u32 = 33526; +pub const GL_CLIPPING_OUTPUT_PRIMITIVES_ARB: u32 = 33527; +pub const GL_ARB_pixel_buffer_object: u32 = 1; +pub const GL_PIXEL_PACK_BUFFER_ARB: u32 = 35051; +pub const GL_PIXEL_UNPACK_BUFFER_ARB: u32 = 35052; +pub const GL_PIXEL_PACK_BUFFER_BINDING_ARB: u32 = 35053; +pub const GL_PIXEL_UNPACK_BUFFER_BINDING_ARB: u32 = 35055; +pub const GL_ARB_point_parameters: u32 = 1; +pub const GL_POINT_SIZE_MIN_ARB: u32 = 33062; +pub const GL_POINT_SIZE_MAX_ARB: u32 = 33063; +pub const GL_POINT_FADE_THRESHOLD_SIZE_ARB: u32 = 33064; +pub const GL_POINT_DISTANCE_ATTENUATION_ARB: u32 = 33065; +pub const GL_ARB_point_sprite: u32 = 1; +pub const GL_POINT_SPRITE_ARB: u32 = 34913; +pub const GL_COORD_REPLACE_ARB: u32 = 34914; +pub const GL_ARB_polygon_offset_clamp: u32 = 1; +pub const GL_ARB_post_depth_coverage: u32 = 1; +pub const GL_ARB_program_interface_query: u32 = 1; +pub const GL_ARB_provoking_vertex: u32 = 1; +pub const GL_ARB_query_buffer_object: u32 = 1; +pub const GL_ARB_robust_buffer_access_behavior: u32 = 1; +pub const GL_ARB_robustness: u32 = 1; +pub const GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB: u32 = 4; +pub const GL_LOSE_CONTEXT_ON_RESET_ARB: u32 = 33362; +pub const GL_GUILTY_CONTEXT_RESET_ARB: u32 = 33363; +pub const GL_INNOCENT_CONTEXT_RESET_ARB: u32 = 33364; +pub const GL_UNKNOWN_CONTEXT_RESET_ARB: u32 = 33365; +pub const GL_RESET_NOTIFICATION_STRATEGY_ARB: u32 = 33366; +pub const GL_NO_RESET_NOTIFICATION_ARB: u32 = 33377; +pub const GL_ARB_robustness_isolation: u32 = 1; +pub const GL_ARB_sample_locations: u32 = 1; +pub const GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB: u32 = 37693; +pub const GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB: u32 = 37694; +pub const GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB: u32 = 37695; +pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB: u32 = 37696; +pub const GL_SAMPLE_LOCATION_ARB: u32 = 36432; +pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB: u32 = 37697; +pub const GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB: u32 = 37698; +pub const GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB: u32 = 37699; +pub const GL_ARB_sample_shading: u32 = 1; +pub const GL_SAMPLE_SHADING_ARB: u32 = 35894; +pub const GL_MIN_SAMPLE_SHADING_VALUE_ARB: u32 = 35895; +pub const GL_ARB_sampler_objects: u32 = 1; +pub const GL_ARB_seamless_cube_map: u32 = 1; +pub const GL_ARB_seamless_cubemap_per_texture: u32 = 1; +pub const GL_ARB_separate_shader_objects: u32 = 1; +pub const GL_ARB_shader_atomic_counter_ops: u32 = 1; +pub const GL_ARB_shader_atomic_counters: u32 = 1; +pub const GL_ARB_shader_ballot: u32 = 1; +pub const GL_ARB_shader_bit_encoding: u32 = 1; +pub const GL_ARB_shader_clock: u32 = 1; +pub const GL_ARB_shader_draw_parameters: u32 = 1; +pub const GL_ARB_shader_group_vote: u32 = 1; +pub const GL_ARB_shader_image_load_store: u32 = 1; +pub const GL_ARB_shader_image_size: u32 = 1; +pub const GL_ARB_shader_objects: u32 = 1; +pub const GL_PROGRAM_OBJECT_ARB: u32 = 35648; +pub const GL_SHADER_OBJECT_ARB: u32 = 35656; +pub const GL_OBJECT_TYPE_ARB: u32 = 35662; +pub const GL_OBJECT_SUBTYPE_ARB: u32 = 35663; +pub const GL_FLOAT_VEC2_ARB: u32 = 35664; +pub const GL_FLOAT_VEC3_ARB: u32 = 35665; +pub const GL_FLOAT_VEC4_ARB: u32 = 35666; +pub const GL_INT_VEC2_ARB: u32 = 35667; +pub const GL_INT_VEC3_ARB: u32 = 35668; +pub const GL_INT_VEC4_ARB: u32 = 35669; +pub const GL_BOOL_ARB: u32 = 35670; +pub const GL_BOOL_VEC2_ARB: u32 = 35671; +pub const GL_BOOL_VEC3_ARB: u32 = 35672; +pub const GL_BOOL_VEC4_ARB: u32 = 35673; +pub const GL_FLOAT_MAT2_ARB: u32 = 35674; +pub const GL_FLOAT_MAT3_ARB: u32 = 35675; +pub const GL_FLOAT_MAT4_ARB: u32 = 35676; +pub const GL_SAMPLER_1D_ARB: u32 = 35677; +pub const GL_SAMPLER_2D_ARB: u32 = 35678; +pub const GL_SAMPLER_3D_ARB: u32 = 35679; +pub const GL_SAMPLER_CUBE_ARB: u32 = 35680; +pub const GL_SAMPLER_1D_SHADOW_ARB: u32 = 35681; +pub const GL_SAMPLER_2D_SHADOW_ARB: u32 = 35682; +pub const GL_SAMPLER_2D_RECT_ARB: u32 = 35683; +pub const GL_SAMPLER_2D_RECT_SHADOW_ARB: u32 = 35684; +pub const GL_OBJECT_DELETE_STATUS_ARB: u32 = 35712; +pub const GL_OBJECT_COMPILE_STATUS_ARB: u32 = 35713; +pub const GL_OBJECT_LINK_STATUS_ARB: u32 = 35714; +pub const GL_OBJECT_VALIDATE_STATUS_ARB: u32 = 35715; +pub const GL_OBJECT_INFO_LOG_LENGTH_ARB: u32 = 35716; +pub const GL_OBJECT_ATTACHED_OBJECTS_ARB: u32 = 35717; +pub const GL_OBJECT_ACTIVE_UNIFORMS_ARB: u32 = 35718; +pub const GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB: u32 = 35719; +pub const GL_OBJECT_SHADER_SOURCE_LENGTH_ARB: u32 = 35720; +pub const GL_ARB_shader_precision: u32 = 1; +pub const GL_ARB_shader_stencil_export: u32 = 1; +pub const GL_ARB_shader_storage_buffer_object: u32 = 1; +pub const GL_ARB_shader_subroutine: u32 = 1; +pub const GL_ARB_shader_texture_image_samples: u32 = 1; +pub const GL_ARB_shader_texture_lod: u32 = 1; +pub const GL_ARB_shader_viewport_layer_array: u32 = 1; +pub const GL_ARB_shading_language_100: u32 = 1; +pub const GL_SHADING_LANGUAGE_VERSION_ARB: u32 = 35724; +pub const GL_ARB_shading_language_420pack: u32 = 1; +pub const GL_ARB_shading_language_include: u32 = 1; +pub const GL_SHADER_INCLUDE_ARB: u32 = 36270; +pub const GL_NAMED_STRING_LENGTH_ARB: u32 = 36329; +pub const GL_NAMED_STRING_TYPE_ARB: u32 = 36330; +pub const GL_ARB_shading_language_packing: u32 = 1; +pub const GL_ARB_shadow: u32 = 1; +pub const GL_TEXTURE_COMPARE_MODE_ARB: u32 = 34892; +pub const GL_TEXTURE_COMPARE_FUNC_ARB: u32 = 34893; +pub const GL_COMPARE_R_TO_TEXTURE_ARB: u32 = 34894; +pub const GL_ARB_shadow_ambient: u32 = 1; +pub const GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: u32 = 32959; +pub const GL_ARB_sparse_buffer: u32 = 1; +pub const GL_SPARSE_STORAGE_BIT_ARB: u32 = 1024; +pub const GL_SPARSE_BUFFER_PAGE_SIZE_ARB: u32 = 33528; +pub const GL_ARB_sparse_texture: u32 = 1; +pub const GL_TEXTURE_SPARSE_ARB: u32 = 37286; +pub const GL_VIRTUAL_PAGE_SIZE_INDEX_ARB: u32 = 37287; +pub const GL_NUM_SPARSE_LEVELS_ARB: u32 = 37290; +pub const GL_NUM_VIRTUAL_PAGE_SIZES_ARB: u32 = 37288; +pub const GL_VIRTUAL_PAGE_SIZE_X_ARB: u32 = 37269; +pub const GL_VIRTUAL_PAGE_SIZE_Y_ARB: u32 = 37270; +pub const GL_VIRTUAL_PAGE_SIZE_Z_ARB: u32 = 37271; +pub const GL_MAX_SPARSE_TEXTURE_SIZE_ARB: u32 = 37272; +pub const GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB: u32 = 37273; +pub const GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB: u32 = 37274; +pub const GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB: u32 = 37289; +pub const GL_ARB_sparse_texture2: u32 = 1; +pub const GL_ARB_sparse_texture_clamp: u32 = 1; +pub const GL_ARB_spirv_extensions: u32 = 1; +pub const GL_ARB_stencil_texturing: u32 = 1; +pub const GL_ARB_sync: u32 = 1; +pub const GL_ARB_tessellation_shader: u32 = 1; +pub const GL_ARB_texture_barrier: u32 = 1; +pub const GL_ARB_texture_border_clamp: u32 = 1; +pub const GL_CLAMP_TO_BORDER_ARB: u32 = 33069; +pub const GL_ARB_texture_buffer_object: u32 = 1; +pub const GL_TEXTURE_BUFFER_ARB: u32 = 35882; +pub const GL_MAX_TEXTURE_BUFFER_SIZE_ARB: u32 = 35883; +pub const GL_TEXTURE_BINDING_BUFFER_ARB: u32 = 35884; +pub const GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB: u32 = 35885; +pub const GL_TEXTURE_BUFFER_FORMAT_ARB: u32 = 35886; +pub const GL_ARB_texture_buffer_object_rgb32: u32 = 1; +pub const GL_ARB_texture_buffer_range: u32 = 1; +pub const GL_ARB_texture_compression: u32 = 1; +pub const GL_COMPRESSED_ALPHA_ARB: u32 = 34025; +pub const GL_COMPRESSED_LUMINANCE_ARB: u32 = 34026; +pub const GL_COMPRESSED_LUMINANCE_ALPHA_ARB: u32 = 34027; +pub const GL_COMPRESSED_INTENSITY_ARB: u32 = 34028; +pub const GL_COMPRESSED_RGB_ARB: u32 = 34029; +pub const GL_COMPRESSED_RGBA_ARB: u32 = 34030; +pub const GL_TEXTURE_COMPRESSION_HINT_ARB: u32 = 34031; +pub const GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB: u32 = 34464; +pub const GL_TEXTURE_COMPRESSED_ARB: u32 = 34465; +pub const GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: u32 = 34466; +pub const GL_COMPRESSED_TEXTURE_FORMATS_ARB: u32 = 34467; +pub const GL_ARB_texture_compression_bptc: u32 = 1; +pub const GL_COMPRESSED_RGBA_BPTC_UNORM_ARB: u32 = 36492; +pub const GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB: u32 = 36493; +pub const GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB: u32 = 36494; +pub const GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB: u32 = 36495; +pub const GL_ARB_texture_compression_rgtc: u32 = 1; +pub const GL_ARB_texture_cube_map: u32 = 1; +pub const GL_NORMAL_MAP_ARB: u32 = 34065; +pub const GL_REFLECTION_MAP_ARB: u32 = 34066; +pub const GL_TEXTURE_CUBE_MAP_ARB: u32 = 34067; +pub const GL_TEXTURE_BINDING_CUBE_MAP_ARB: u32 = 34068; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB: u32 = 34069; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB: u32 = 34070; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB: u32 = 34071; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: u32 = 34072; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: u32 = 34073; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: u32 = 34074; +pub const GL_PROXY_TEXTURE_CUBE_MAP_ARB: u32 = 34075; +pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: u32 = 34076; +pub const GL_ARB_texture_cube_map_array: u32 = 1; +pub const GL_TEXTURE_CUBE_MAP_ARRAY_ARB: u32 = 36873; +pub const GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB: u32 = 36874; +pub const GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB: u32 = 36875; +pub const GL_SAMPLER_CUBE_MAP_ARRAY_ARB: u32 = 36876; +pub const GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB: u32 = 36877; +pub const GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB: u32 = 36878; +pub const GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB: u32 = 36879; +pub const GL_ARB_texture_env_add: u32 = 1; +pub const GL_ARB_texture_env_combine: u32 = 1; +pub const GL_COMBINE_ARB: u32 = 34160; +pub const GL_COMBINE_RGB_ARB: u32 = 34161; +pub const GL_COMBINE_ALPHA_ARB: u32 = 34162; +pub const GL_SOURCE0_RGB_ARB: u32 = 34176; +pub const GL_SOURCE1_RGB_ARB: u32 = 34177; +pub const GL_SOURCE2_RGB_ARB: u32 = 34178; +pub const GL_SOURCE0_ALPHA_ARB: u32 = 34184; +pub const GL_SOURCE1_ALPHA_ARB: u32 = 34185; +pub const GL_SOURCE2_ALPHA_ARB: u32 = 34186; +pub const GL_OPERAND0_RGB_ARB: u32 = 34192; +pub const GL_OPERAND1_RGB_ARB: u32 = 34193; +pub const GL_OPERAND2_RGB_ARB: u32 = 34194; +pub const GL_OPERAND0_ALPHA_ARB: u32 = 34200; +pub const GL_OPERAND1_ALPHA_ARB: u32 = 34201; +pub const GL_OPERAND2_ALPHA_ARB: u32 = 34202; +pub const GL_RGB_SCALE_ARB: u32 = 34163; +pub const GL_ADD_SIGNED_ARB: u32 = 34164; +pub const GL_INTERPOLATE_ARB: u32 = 34165; +pub const GL_SUBTRACT_ARB: u32 = 34023; +pub const GL_CONSTANT_ARB: u32 = 34166; +pub const GL_PRIMARY_COLOR_ARB: u32 = 34167; +pub const GL_PREVIOUS_ARB: u32 = 34168; +pub const GL_ARB_texture_env_crossbar: u32 = 1; +pub const GL_ARB_texture_env_dot3: u32 = 1; +pub const GL_DOT3_RGB_ARB: u32 = 34478; +pub const GL_DOT3_RGBA_ARB: u32 = 34479; +pub const GL_ARB_texture_filter_anisotropic: u32 = 1; +pub const GL_ARB_texture_filter_minmax: u32 = 1; +pub const GL_TEXTURE_REDUCTION_MODE_ARB: u32 = 37734; +pub const GL_WEIGHTED_AVERAGE_ARB: u32 = 37735; +pub const GL_ARB_texture_float: u32 = 1; +pub const GL_TEXTURE_RED_TYPE_ARB: u32 = 35856; +pub const GL_TEXTURE_GREEN_TYPE_ARB: u32 = 35857; +pub const GL_TEXTURE_BLUE_TYPE_ARB: u32 = 35858; +pub const GL_TEXTURE_ALPHA_TYPE_ARB: u32 = 35859; +pub const GL_TEXTURE_LUMINANCE_TYPE_ARB: u32 = 35860; +pub const GL_TEXTURE_INTENSITY_TYPE_ARB: u32 = 35861; +pub const GL_TEXTURE_DEPTH_TYPE_ARB: u32 = 35862; +pub const GL_UNSIGNED_NORMALIZED_ARB: u32 = 35863; +pub const GL_RGBA32F_ARB: u32 = 34836; +pub const GL_RGB32F_ARB: u32 = 34837; +pub const GL_ALPHA32F_ARB: u32 = 34838; +pub const GL_INTENSITY32F_ARB: u32 = 34839; +pub const GL_LUMINANCE32F_ARB: u32 = 34840; +pub const GL_LUMINANCE_ALPHA32F_ARB: u32 = 34841; +pub const GL_RGBA16F_ARB: u32 = 34842; +pub const GL_RGB16F_ARB: u32 = 34843; +pub const GL_ALPHA16F_ARB: u32 = 34844; +pub const GL_INTENSITY16F_ARB: u32 = 34845; +pub const GL_LUMINANCE16F_ARB: u32 = 34846; +pub const GL_LUMINANCE_ALPHA16F_ARB: u32 = 34847; +pub const GL_ARB_texture_gather: u32 = 1; +pub const GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB: u32 = 36446; +pub const GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB: u32 = 36447; +pub const GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB: u32 = 36767; +pub const GL_ARB_texture_mirror_clamp_to_edge: u32 = 1; +pub const GL_ARB_texture_mirrored_repeat: u32 = 1; +pub const GL_MIRRORED_REPEAT_ARB: u32 = 33648; +pub const GL_ARB_texture_multisample: u32 = 1; +pub const GL_ARB_texture_non_power_of_two: u32 = 1; +pub const GL_ARB_texture_query_levels: u32 = 1; +pub const GL_ARB_texture_query_lod: u32 = 1; +pub const GL_ARB_texture_rectangle: u32 = 1; +pub const GL_TEXTURE_RECTANGLE_ARB: u32 = 34037; +pub const GL_TEXTURE_BINDING_RECTANGLE_ARB: u32 = 34038; +pub const GL_PROXY_TEXTURE_RECTANGLE_ARB: u32 = 34039; +pub const GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB: u32 = 34040; +pub const GL_ARB_texture_rg: u32 = 1; +pub const GL_ARB_texture_rgb10_a2ui: u32 = 1; +pub const GL_ARB_texture_stencil8: u32 = 1; +pub const GL_ARB_texture_storage: u32 = 1; +pub const GL_ARB_texture_storage_multisample: u32 = 1; +pub const GL_ARB_texture_swizzle: u32 = 1; +pub const GL_ARB_texture_view: u32 = 1; +pub const GL_ARB_timer_query: u32 = 1; +pub const GL_ARB_transform_feedback2: u32 = 1; +pub const GL_ARB_transform_feedback3: u32 = 1; +pub const GL_ARB_transform_feedback_instanced: u32 = 1; +pub const GL_ARB_transform_feedback_overflow_query: u32 = 1; +pub const GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB: u32 = 33516; +pub const GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB: u32 = 33517; +pub const GL_ARB_transpose_matrix: u32 = 1; +pub const GL_TRANSPOSE_MODELVIEW_MATRIX_ARB: u32 = 34019; +pub const GL_TRANSPOSE_PROJECTION_MATRIX_ARB: u32 = 34020; +pub const GL_TRANSPOSE_TEXTURE_MATRIX_ARB: u32 = 34021; +pub const GL_TRANSPOSE_COLOR_MATRIX_ARB: u32 = 34022; +pub const GL_ARB_uniform_buffer_object: u32 = 1; +pub const GL_ARB_vertex_array_bgra: u32 = 1; +pub const GL_ARB_vertex_array_object: u32 = 1; +pub const GL_ARB_vertex_attrib_64bit: u32 = 1; +pub const GL_ARB_vertex_attrib_binding: u32 = 1; +pub const GL_ARB_vertex_blend: u32 = 1; +pub const GL_MAX_VERTEX_UNITS_ARB: u32 = 34468; +pub const GL_ACTIVE_VERTEX_UNITS_ARB: u32 = 34469; +pub const GL_WEIGHT_SUM_UNITY_ARB: u32 = 34470; +pub const GL_VERTEX_BLEND_ARB: u32 = 34471; +pub const GL_CURRENT_WEIGHT_ARB: u32 = 34472; +pub const GL_WEIGHT_ARRAY_TYPE_ARB: u32 = 34473; +pub const GL_WEIGHT_ARRAY_STRIDE_ARB: u32 = 34474; +pub const GL_WEIGHT_ARRAY_SIZE_ARB: u32 = 34475; +pub const GL_WEIGHT_ARRAY_POINTER_ARB: u32 = 34476; +pub const GL_WEIGHT_ARRAY_ARB: u32 = 34477; +pub const GL_MODELVIEW0_ARB: u32 = 5888; +pub const GL_MODELVIEW1_ARB: u32 = 34058; +pub const GL_MODELVIEW2_ARB: u32 = 34594; +pub const GL_MODELVIEW3_ARB: u32 = 34595; +pub const GL_MODELVIEW4_ARB: u32 = 34596; +pub const GL_MODELVIEW5_ARB: u32 = 34597; +pub const GL_MODELVIEW6_ARB: u32 = 34598; +pub const GL_MODELVIEW7_ARB: u32 = 34599; +pub const GL_MODELVIEW8_ARB: u32 = 34600; +pub const GL_MODELVIEW9_ARB: u32 = 34601; +pub const GL_MODELVIEW10_ARB: u32 = 34602; +pub const GL_MODELVIEW11_ARB: u32 = 34603; +pub const GL_MODELVIEW12_ARB: u32 = 34604; +pub const GL_MODELVIEW13_ARB: u32 = 34605; +pub const GL_MODELVIEW14_ARB: u32 = 34606; +pub const GL_MODELVIEW15_ARB: u32 = 34607; +pub const GL_MODELVIEW16_ARB: u32 = 34608; +pub const GL_MODELVIEW17_ARB: u32 = 34609; +pub const GL_MODELVIEW18_ARB: u32 = 34610; +pub const GL_MODELVIEW19_ARB: u32 = 34611; +pub const GL_MODELVIEW20_ARB: u32 = 34612; +pub const GL_MODELVIEW21_ARB: u32 = 34613; +pub const GL_MODELVIEW22_ARB: u32 = 34614; +pub const GL_MODELVIEW23_ARB: u32 = 34615; +pub const GL_MODELVIEW24_ARB: u32 = 34616; +pub const GL_MODELVIEW25_ARB: u32 = 34617; +pub const GL_MODELVIEW26_ARB: u32 = 34618; +pub const GL_MODELVIEW27_ARB: u32 = 34619; +pub const GL_MODELVIEW28_ARB: u32 = 34620; +pub const GL_MODELVIEW29_ARB: u32 = 34621; +pub const GL_MODELVIEW30_ARB: u32 = 34622; +pub const GL_MODELVIEW31_ARB: u32 = 34623; +pub const GL_ARB_vertex_buffer_object: u32 = 1; +pub const GL_BUFFER_SIZE_ARB: u32 = 34660; +pub const GL_BUFFER_USAGE_ARB: u32 = 34661; +pub const GL_ARRAY_BUFFER_ARB: u32 = 34962; +pub const GL_ELEMENT_ARRAY_BUFFER_ARB: u32 = 34963; +pub const GL_ARRAY_BUFFER_BINDING_ARB: u32 = 34964; +pub const GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: u32 = 34965; +pub const GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: u32 = 34966; +pub const GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: u32 = 34967; +pub const GL_COLOR_ARRAY_BUFFER_BINDING_ARB: u32 = 34968; +pub const GL_INDEX_ARRAY_BUFFER_BINDING_ARB: u32 = 34969; +pub const GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: u32 = 34970; +pub const GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: u32 = 34971; +pub const GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: u32 = 34972; +pub const GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: u32 = 34973; +pub const GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: u32 = 34974; +pub const GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: u32 = 34975; +pub const GL_READ_ONLY_ARB: u32 = 35000; +pub const GL_WRITE_ONLY_ARB: u32 = 35001; +pub const GL_READ_WRITE_ARB: u32 = 35002; +pub const GL_BUFFER_ACCESS_ARB: u32 = 35003; +pub const GL_BUFFER_MAPPED_ARB: u32 = 35004; +pub const GL_BUFFER_MAP_POINTER_ARB: u32 = 35005; +pub const GL_STREAM_DRAW_ARB: u32 = 35040; +pub const GL_STREAM_READ_ARB: u32 = 35041; +pub const GL_STREAM_COPY_ARB: u32 = 35042; +pub const GL_STATIC_DRAW_ARB: u32 = 35044; +pub const GL_STATIC_READ_ARB: u32 = 35045; +pub const GL_STATIC_COPY_ARB: u32 = 35046; +pub const GL_DYNAMIC_DRAW_ARB: u32 = 35048; +pub const GL_DYNAMIC_READ_ARB: u32 = 35049; +pub const GL_DYNAMIC_COPY_ARB: u32 = 35050; +pub const GL_ARB_vertex_program: u32 = 1; +pub const GL_COLOR_SUM_ARB: u32 = 33880; +pub const GL_VERTEX_PROGRAM_ARB: u32 = 34336; +pub const GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB: u32 = 34338; +pub const GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB: u32 = 34339; +pub const GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB: u32 = 34340; +pub const GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB: u32 = 34341; +pub const GL_CURRENT_VERTEX_ATTRIB_ARB: u32 = 34342; +pub const GL_VERTEX_PROGRAM_POINT_SIZE_ARB: u32 = 34370; +pub const GL_VERTEX_PROGRAM_TWO_SIDE_ARB: u32 = 34371; +pub const GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB: u32 = 34373; +pub const GL_MAX_VERTEX_ATTRIBS_ARB: u32 = 34921; +pub const GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB: u32 = 34922; +pub const GL_PROGRAM_ADDRESS_REGISTERS_ARB: u32 = 34992; +pub const GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB: u32 = 34993; +pub const GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: u32 = 34994; +pub const GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB: u32 = 34995; +pub const GL_ARB_vertex_shader: u32 = 1; +pub const GL_VERTEX_SHADER_ARB: u32 = 35633; +pub const GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: u32 = 35658; +pub const GL_MAX_VARYING_FLOATS_ARB: u32 = 35659; +pub const GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: u32 = 35660; +pub const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: u32 = 35661; +pub const GL_OBJECT_ACTIVE_ATTRIBUTES_ARB: u32 = 35721; +pub const GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB: u32 = 35722; +pub const GL_ARB_vertex_type_10f_11f_11f_rev: u32 = 1; +pub const GL_ARB_vertex_type_2_10_10_10_rev: u32 = 1; +pub const GL_ARB_viewport_array: u32 = 1; +pub const GL_ARB_window_pos: u32 = 1; +pub const GL_KHR_blend_equation_advanced: u32 = 1; +pub const GL_MULTIPLY_KHR: u32 = 37524; +pub const GL_SCREEN_KHR: u32 = 37525; +pub const GL_OVERLAY_KHR: u32 = 37526; +pub const GL_DARKEN_KHR: u32 = 37527; +pub const GL_LIGHTEN_KHR: u32 = 37528; +pub const GL_COLORDODGE_KHR: u32 = 37529; +pub const GL_COLORBURN_KHR: u32 = 37530; +pub const GL_HARDLIGHT_KHR: u32 = 37531; +pub const GL_SOFTLIGHT_KHR: u32 = 37532; +pub const GL_DIFFERENCE_KHR: u32 = 37534; +pub const GL_EXCLUSION_KHR: u32 = 37536; +pub const GL_HSL_HUE_KHR: u32 = 37549; +pub const GL_HSL_SATURATION_KHR: u32 = 37550; +pub const GL_HSL_COLOR_KHR: u32 = 37551; +pub const GL_HSL_LUMINOSITY_KHR: u32 = 37552; +pub const GL_KHR_blend_equation_advanced_coherent: u32 = 1; +pub const GL_BLEND_ADVANCED_COHERENT_KHR: u32 = 37509; +pub const GL_KHR_context_flush_control: u32 = 1; +pub const GL_KHR_debug: u32 = 1; +pub const GL_KHR_no_error: u32 = 1; +pub const GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR: u32 = 8; +pub const GL_KHR_parallel_shader_compile: u32 = 1; +pub const GL_MAX_SHADER_COMPILER_THREADS_KHR: u32 = 37296; +pub const GL_COMPLETION_STATUS_KHR: u32 = 37297; +pub const GL_KHR_robust_buffer_access_behavior: u32 = 1; +pub const GL_KHR_robustness: u32 = 1; +pub const GL_CONTEXT_ROBUST_ACCESS: u32 = 37107; +pub const GL_KHR_shader_subgroup: u32 = 1; +pub const GL_SUBGROUP_SIZE_KHR: u32 = 38194; +pub const GL_SUBGROUP_SUPPORTED_STAGES_KHR: u32 = 38195; +pub const GL_SUBGROUP_SUPPORTED_FEATURES_KHR: u32 = 38196; +pub const GL_SUBGROUP_QUAD_ALL_STAGES_KHR: u32 = 38197; +pub const GL_SUBGROUP_FEATURE_BASIC_BIT_KHR: u32 = 1; +pub const GL_SUBGROUP_FEATURE_VOTE_BIT_KHR: u32 = 2; +pub const GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR: u32 = 4; +pub const GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR: u32 = 8; +pub const GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR: u32 = 16; +pub const GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR: u32 = 32; +pub const GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR: u32 = 64; +pub const GL_SUBGROUP_FEATURE_QUAD_BIT_KHR: u32 = 128; +pub const GL_KHR_texture_compression_astc_hdr: u32 = 1; +pub const GL_COMPRESSED_RGBA_ASTC_4x4_KHR: u32 = 37808; +pub const GL_COMPRESSED_RGBA_ASTC_5x4_KHR: u32 = 37809; +pub const GL_COMPRESSED_RGBA_ASTC_5x5_KHR: u32 = 37810; +pub const GL_COMPRESSED_RGBA_ASTC_6x5_KHR: u32 = 37811; +pub const GL_COMPRESSED_RGBA_ASTC_6x6_KHR: u32 = 37812; +pub const GL_COMPRESSED_RGBA_ASTC_8x5_KHR: u32 = 37813; +pub const GL_COMPRESSED_RGBA_ASTC_8x6_KHR: u32 = 37814; +pub const GL_COMPRESSED_RGBA_ASTC_8x8_KHR: u32 = 37815; +pub const GL_COMPRESSED_RGBA_ASTC_10x5_KHR: u32 = 37816; +pub const GL_COMPRESSED_RGBA_ASTC_10x6_KHR: u32 = 37817; +pub const GL_COMPRESSED_RGBA_ASTC_10x8_KHR: u32 = 37818; +pub const GL_COMPRESSED_RGBA_ASTC_10x10_KHR: u32 = 37819; +pub const GL_COMPRESSED_RGBA_ASTC_12x10_KHR: u32 = 37820; +pub const GL_COMPRESSED_RGBA_ASTC_12x12_KHR: u32 = 37821; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: u32 = 37840; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: u32 = 37841; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: u32 = 37842; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: u32 = 37843; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: u32 = 37844; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: u32 = 37845; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: u32 = 37846; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: u32 = 37847; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: u32 = 37848; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: u32 = 37849; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: u32 = 37850; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: u32 = 37851; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: u32 = 37852; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: u32 = 37853; +pub const GL_KHR_texture_compression_astc_ldr: u32 = 1; +pub const GL_KHR_texture_compression_astc_sliced_3d: u32 = 1; +pub const GL_OES_byte_coordinates: u32 = 1; +pub const GL_OES_compressed_paletted_texture: u32 = 1; +pub const GL_PALETTE4_RGB8_OES: u32 = 35728; +pub const GL_PALETTE4_RGBA8_OES: u32 = 35729; +pub const GL_PALETTE4_R5_G6_B5_OES: u32 = 35730; +pub const GL_PALETTE4_RGBA4_OES: u32 = 35731; +pub const GL_PALETTE4_RGB5_A1_OES: u32 = 35732; +pub const GL_PALETTE8_RGB8_OES: u32 = 35733; +pub const GL_PALETTE8_RGBA8_OES: u32 = 35734; +pub const GL_PALETTE8_R5_G6_B5_OES: u32 = 35735; +pub const GL_PALETTE8_RGBA4_OES: u32 = 35736; +pub const GL_PALETTE8_RGB5_A1_OES: u32 = 35737; +pub const GL_OES_fixed_point: u32 = 1; +pub const GL_FIXED_OES: u32 = 5132; +pub const GL_OES_query_matrix: u32 = 1; +pub const GL_OES_read_format: u32 = 1; +pub const GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: u32 = 35738; +pub const GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: u32 = 35739; +pub const GL_OES_single_precision: u32 = 1; +pub const GL_3DFX_multisample: u32 = 1; +pub const GL_MULTISAMPLE_3DFX: u32 = 34482; +pub const GL_SAMPLE_BUFFERS_3DFX: u32 = 34483; +pub const GL_SAMPLES_3DFX: u32 = 34484; +pub const GL_MULTISAMPLE_BIT_3DFX: u32 = 536870912; +pub const GL_3DFX_tbuffer: u32 = 1; +pub const GL_3DFX_texture_compression_FXT1: u32 = 1; +pub const GL_COMPRESSED_RGB_FXT1_3DFX: u32 = 34480; +pub const GL_COMPRESSED_RGBA_FXT1_3DFX: u32 = 34481; +pub const GL_AMD_blend_minmax_factor: u32 = 1; +pub const GL_FACTOR_MIN_AMD: u32 = 36892; +pub const GL_FACTOR_MAX_AMD: u32 = 36893; +pub const GL_AMD_conservative_depth: u32 = 1; +pub const GL_AMD_debug_output: u32 = 1; +pub const GL_MAX_DEBUG_MESSAGE_LENGTH_AMD: u32 = 37187; +pub const GL_MAX_DEBUG_LOGGED_MESSAGES_AMD: u32 = 37188; +pub const GL_DEBUG_LOGGED_MESSAGES_AMD: u32 = 37189; +pub const GL_DEBUG_SEVERITY_HIGH_AMD: u32 = 37190; +pub const GL_DEBUG_SEVERITY_MEDIUM_AMD: u32 = 37191; +pub const GL_DEBUG_SEVERITY_LOW_AMD: u32 = 37192; +pub const GL_DEBUG_CATEGORY_API_ERROR_AMD: u32 = 37193; +pub const GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD: u32 = 37194; +pub const GL_DEBUG_CATEGORY_DEPRECATION_AMD: u32 = 37195; +pub const GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD: u32 = 37196; +pub const GL_DEBUG_CATEGORY_PERFORMANCE_AMD: u32 = 37197; +pub const GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD: u32 = 37198; +pub const GL_DEBUG_CATEGORY_APPLICATION_AMD: u32 = 37199; +pub const GL_DEBUG_CATEGORY_OTHER_AMD: u32 = 37200; +pub const GL_AMD_depth_clamp_separate: u32 = 1; +pub const GL_DEPTH_CLAMP_NEAR_AMD: u32 = 36894; +pub const GL_DEPTH_CLAMP_FAR_AMD: u32 = 36895; +pub const GL_AMD_draw_buffers_blend: u32 = 1; +pub const GL_AMD_framebuffer_multisample_advanced: u32 = 1; +pub const GL_RENDERBUFFER_STORAGE_SAMPLES_AMD: u32 = 37298; +pub const GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD: u32 = 37299; +pub const GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD: u32 = 37300; +pub const GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD: u32 = 37301; +pub const GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD: u32 = 37302; +pub const GL_SUPPORTED_MULTISAMPLE_MODES_AMD: u32 = 37303; +pub const GL_AMD_framebuffer_sample_positions: u32 = 1; +pub const GL_SUBSAMPLE_DISTANCE_AMD: u32 = 34879; +pub const GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD: u32 = 37294; +pub const GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD: u32 = 37295; +pub const GL_ALL_PIXELS_AMD: u32 = 4294967295; +pub const GL_AMD_gcn_shader: u32 = 1; +pub const GL_AMD_gpu_shader_half_float: u32 = 1; +pub const GL_FLOAT16_NV: u32 = 36856; +pub const GL_FLOAT16_VEC2_NV: u32 = 36857; +pub const GL_FLOAT16_VEC3_NV: u32 = 36858; +pub const GL_FLOAT16_VEC4_NV: u32 = 36859; +pub const GL_FLOAT16_MAT2_AMD: u32 = 37317; +pub const GL_FLOAT16_MAT3_AMD: u32 = 37318; +pub const GL_FLOAT16_MAT4_AMD: u32 = 37319; +pub const GL_FLOAT16_MAT2x3_AMD: u32 = 37320; +pub const GL_FLOAT16_MAT2x4_AMD: u32 = 37321; +pub const GL_FLOAT16_MAT3x2_AMD: u32 = 37322; +pub const GL_FLOAT16_MAT3x4_AMD: u32 = 37323; +pub const GL_FLOAT16_MAT4x2_AMD: u32 = 37324; +pub const GL_FLOAT16_MAT4x3_AMD: u32 = 37325; +pub const GL_AMD_gpu_shader_int16: u32 = 1; +pub const GL_AMD_gpu_shader_int64: u32 = 1; +pub const GL_INT64_NV: u32 = 5134; +pub const GL_UNSIGNED_INT64_NV: u32 = 5135; +pub const GL_INT8_NV: u32 = 36832; +pub const GL_INT8_VEC2_NV: u32 = 36833; +pub const GL_INT8_VEC3_NV: u32 = 36834; +pub const GL_INT8_VEC4_NV: u32 = 36835; +pub const GL_INT16_NV: u32 = 36836; +pub const GL_INT16_VEC2_NV: u32 = 36837; +pub const GL_INT16_VEC3_NV: u32 = 36838; +pub const GL_INT16_VEC4_NV: u32 = 36839; +pub const GL_INT64_VEC2_NV: u32 = 36841; +pub const GL_INT64_VEC3_NV: u32 = 36842; +pub const GL_INT64_VEC4_NV: u32 = 36843; +pub const GL_UNSIGNED_INT8_NV: u32 = 36844; +pub const GL_UNSIGNED_INT8_VEC2_NV: u32 = 36845; +pub const GL_UNSIGNED_INT8_VEC3_NV: u32 = 36846; +pub const GL_UNSIGNED_INT8_VEC4_NV: u32 = 36847; +pub const GL_UNSIGNED_INT16_NV: u32 = 36848; +pub const GL_UNSIGNED_INT16_VEC2_NV: u32 = 36849; +pub const GL_UNSIGNED_INT16_VEC3_NV: u32 = 36850; +pub const GL_UNSIGNED_INT16_VEC4_NV: u32 = 36851; +pub const GL_UNSIGNED_INT64_VEC2_NV: u32 = 36853; +pub const GL_UNSIGNED_INT64_VEC3_NV: u32 = 36854; +pub const GL_UNSIGNED_INT64_VEC4_NV: u32 = 36855; +pub const GL_AMD_interleaved_elements: u32 = 1; +pub const GL_VERTEX_ELEMENT_SWIZZLE_AMD: u32 = 37284; +pub const GL_VERTEX_ID_SWIZZLE_AMD: u32 = 37285; +pub const GL_AMD_multi_draw_indirect: u32 = 1; +pub const GL_AMD_name_gen_delete: u32 = 1; +pub const GL_DATA_BUFFER_AMD: u32 = 37201; +pub const GL_PERFORMANCE_MONITOR_AMD: u32 = 37202; +pub const GL_QUERY_OBJECT_AMD: u32 = 37203; +pub const GL_VERTEX_ARRAY_OBJECT_AMD: u32 = 37204; +pub const GL_SAMPLER_OBJECT_AMD: u32 = 37205; +pub const GL_AMD_occlusion_query_event: u32 = 1; +pub const GL_OCCLUSION_QUERY_EVENT_MASK_AMD: u32 = 34639; +pub const GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD: u32 = 1; +pub const GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD: u32 = 2; +pub const GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD: u32 = 4; +pub const GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD: u32 = 8; +pub const GL_QUERY_ALL_EVENT_BITS_AMD: u32 = 4294967295; +pub const GL_AMD_performance_monitor: u32 = 1; +pub const GL_COUNTER_TYPE_AMD: u32 = 35776; +pub const GL_COUNTER_RANGE_AMD: u32 = 35777; +pub const GL_UNSIGNED_INT64_AMD: u32 = 35778; +pub const GL_PERCENTAGE_AMD: u32 = 35779; +pub const GL_PERFMON_RESULT_AVAILABLE_AMD: u32 = 35780; +pub const GL_PERFMON_RESULT_SIZE_AMD: u32 = 35781; +pub const GL_PERFMON_RESULT_AMD: u32 = 35782; +pub const GL_AMD_pinned_memory: u32 = 1; +pub const GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD: u32 = 37216; +pub const GL_AMD_query_buffer_object: u32 = 1; +pub const GL_QUERY_BUFFER_AMD: u32 = 37266; +pub const GL_QUERY_BUFFER_BINDING_AMD: u32 = 37267; +pub const GL_QUERY_RESULT_NO_WAIT_AMD: u32 = 37268; +pub const GL_AMD_sample_positions: u32 = 1; +pub const GL_AMD_seamless_cubemap_per_texture: u32 = 1; +pub const GL_AMD_shader_atomic_counter_ops: u32 = 1; +pub const GL_AMD_shader_ballot: u32 = 1; +pub const GL_AMD_shader_explicit_vertex_parameter: u32 = 1; +pub const GL_AMD_shader_gpu_shader_half_float_fetch: u32 = 1; +pub const GL_AMD_shader_image_load_store_lod: u32 = 1; +pub const GL_AMD_shader_stencil_export: u32 = 1; +pub const GL_AMD_shader_trinary_minmax: u32 = 1; +pub const GL_AMD_sparse_texture: u32 = 1; +pub const GL_VIRTUAL_PAGE_SIZE_X_AMD: u32 = 37269; +pub const GL_VIRTUAL_PAGE_SIZE_Y_AMD: u32 = 37270; +pub const GL_VIRTUAL_PAGE_SIZE_Z_AMD: u32 = 37271; +pub const GL_MAX_SPARSE_TEXTURE_SIZE_AMD: u32 = 37272; +pub const GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD: u32 = 37273; +pub const GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS: u32 = 37274; +pub const GL_MIN_SPARSE_LEVEL_AMD: u32 = 37275; +pub const GL_MIN_LOD_WARNING_AMD: u32 = 37276; +pub const GL_TEXTURE_STORAGE_SPARSE_BIT_AMD: u32 = 1; +pub const GL_AMD_stencil_operation_extended: u32 = 1; +pub const GL_SET_AMD: u32 = 34634; +pub const GL_REPLACE_VALUE_AMD: u32 = 34635; +pub const GL_STENCIL_OP_VALUE_AMD: u32 = 34636; +pub const GL_STENCIL_BACK_OP_VALUE_AMD: u32 = 34637; +pub const GL_AMD_texture_gather_bias_lod: u32 = 1; +pub const GL_AMD_texture_texture4: u32 = 1; +pub const GL_AMD_transform_feedback3_lines_triangles: u32 = 1; +pub const GL_AMD_transform_feedback4: u32 = 1; +pub const GL_STREAM_RASTERIZATION_AMD: u32 = 37280; +pub const GL_AMD_vertex_shader_layer: u32 = 1; +pub const GL_AMD_vertex_shader_tessellator: u32 = 1; +pub const GL_SAMPLER_BUFFER_AMD: u32 = 36865; +pub const GL_INT_SAMPLER_BUFFER_AMD: u32 = 36866; +pub const GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD: u32 = 36867; +pub const GL_TESSELLATION_MODE_AMD: u32 = 36868; +pub const GL_TESSELLATION_FACTOR_AMD: u32 = 36869; +pub const GL_DISCRETE_AMD: u32 = 36870; +pub const GL_CONTINUOUS_AMD: u32 = 36871; +pub const GL_AMD_vertex_shader_viewport_index: u32 = 1; +pub const GL_APPLE_aux_depth_stencil: u32 = 1; +pub const GL_AUX_DEPTH_STENCIL_APPLE: u32 = 35348; +pub const GL_APPLE_client_storage: u32 = 1; +pub const GL_UNPACK_CLIENT_STORAGE_APPLE: u32 = 34226; +pub const GL_APPLE_element_array: u32 = 1; +pub const GL_ELEMENT_ARRAY_APPLE: u32 = 35340; +pub const GL_ELEMENT_ARRAY_TYPE_APPLE: u32 = 35341; +pub const GL_ELEMENT_ARRAY_POINTER_APPLE: u32 = 35342; +pub const GL_APPLE_fence: u32 = 1; +pub const GL_DRAW_PIXELS_APPLE: u32 = 35338; +pub const GL_FENCE_APPLE: u32 = 35339; +pub const GL_APPLE_float_pixels: u32 = 1; +pub const GL_HALF_APPLE: u32 = 5131; +pub const GL_RGBA_FLOAT32_APPLE: u32 = 34836; +pub const GL_RGB_FLOAT32_APPLE: u32 = 34837; +pub const GL_ALPHA_FLOAT32_APPLE: u32 = 34838; +pub const GL_INTENSITY_FLOAT32_APPLE: u32 = 34839; +pub const GL_LUMINANCE_FLOAT32_APPLE: u32 = 34840; +pub const GL_LUMINANCE_ALPHA_FLOAT32_APPLE: u32 = 34841; +pub const GL_RGBA_FLOAT16_APPLE: u32 = 34842; +pub const GL_RGB_FLOAT16_APPLE: u32 = 34843; +pub const GL_ALPHA_FLOAT16_APPLE: u32 = 34844; +pub const GL_INTENSITY_FLOAT16_APPLE: u32 = 34845; +pub const GL_LUMINANCE_FLOAT16_APPLE: u32 = 34846; +pub const GL_LUMINANCE_ALPHA_FLOAT16_APPLE: u32 = 34847; +pub const GL_COLOR_FLOAT_APPLE: u32 = 35343; +pub const GL_APPLE_flush_buffer_range: u32 = 1; +pub const GL_BUFFER_SERIALIZED_MODIFY_APPLE: u32 = 35346; +pub const GL_BUFFER_FLUSHING_UNMAP_APPLE: u32 = 35347; +pub const GL_APPLE_object_purgeable: u32 = 1; +pub const GL_BUFFER_OBJECT_APPLE: u32 = 34227; +pub const GL_RELEASED_APPLE: u32 = 35353; +pub const GL_VOLATILE_APPLE: u32 = 35354; +pub const GL_RETAINED_APPLE: u32 = 35355; +pub const GL_UNDEFINED_APPLE: u32 = 35356; +pub const GL_PURGEABLE_APPLE: u32 = 35357; +pub const GL_APPLE_rgb_422: u32 = 1; +pub const GL_RGB_422_APPLE: u32 = 35359; +pub const GL_UNSIGNED_SHORT_8_8_APPLE: u32 = 34234; +pub const GL_UNSIGNED_SHORT_8_8_REV_APPLE: u32 = 34235; +pub const GL_RGB_RAW_422_APPLE: u32 = 35409; +pub const GL_APPLE_row_bytes: u32 = 1; +pub const GL_PACK_ROW_BYTES_APPLE: u32 = 35349; +pub const GL_UNPACK_ROW_BYTES_APPLE: u32 = 35350; +pub const GL_APPLE_specular_vector: u32 = 1; +pub const GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE: u32 = 34224; +pub const GL_APPLE_texture_range: u32 = 1; +pub const GL_TEXTURE_RANGE_LENGTH_APPLE: u32 = 34231; +pub const GL_TEXTURE_RANGE_POINTER_APPLE: u32 = 34232; +pub const GL_TEXTURE_STORAGE_HINT_APPLE: u32 = 34236; +pub const GL_STORAGE_PRIVATE_APPLE: u32 = 34237; +pub const GL_STORAGE_CACHED_APPLE: u32 = 34238; +pub const GL_STORAGE_SHARED_APPLE: u32 = 34239; +pub const GL_APPLE_transform_hint: u32 = 1; +pub const GL_TRANSFORM_HINT_APPLE: u32 = 34225; +pub const GL_APPLE_vertex_array_object: u32 = 1; +pub const GL_VERTEX_ARRAY_BINDING_APPLE: u32 = 34229; +pub const GL_APPLE_vertex_array_range: u32 = 1; +pub const GL_VERTEX_ARRAY_RANGE_APPLE: u32 = 34077; +pub const GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE: u32 = 34078; +pub const GL_VERTEX_ARRAY_STORAGE_HINT_APPLE: u32 = 34079; +pub const GL_VERTEX_ARRAY_RANGE_POINTER_APPLE: u32 = 34081; +pub const GL_STORAGE_CLIENT_APPLE: u32 = 34228; +pub const GL_APPLE_vertex_program_evaluators: u32 = 1; +pub const GL_VERTEX_ATTRIB_MAP1_APPLE: u32 = 35328; +pub const GL_VERTEX_ATTRIB_MAP2_APPLE: u32 = 35329; +pub const GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE: u32 = 35330; +pub const GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE: u32 = 35331; +pub const GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE: u32 = 35332; +pub const GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE: u32 = 35333; +pub const GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE: u32 = 35334; +pub const GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE: u32 = 35335; +pub const GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE: u32 = 35336; +pub const GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE: u32 = 35337; +pub const GL_APPLE_ycbcr_422: u32 = 1; +pub const GL_YCBCR_422_APPLE: u32 = 34233; +pub const GL_ATI_draw_buffers: u32 = 1; +pub const GL_MAX_DRAW_BUFFERS_ATI: u32 = 34852; +pub const GL_DRAW_BUFFER0_ATI: u32 = 34853; +pub const GL_DRAW_BUFFER1_ATI: u32 = 34854; +pub const GL_DRAW_BUFFER2_ATI: u32 = 34855; +pub const GL_DRAW_BUFFER3_ATI: u32 = 34856; +pub const GL_DRAW_BUFFER4_ATI: u32 = 34857; +pub const GL_DRAW_BUFFER5_ATI: u32 = 34858; +pub const GL_DRAW_BUFFER6_ATI: u32 = 34859; +pub const GL_DRAW_BUFFER7_ATI: u32 = 34860; +pub const GL_DRAW_BUFFER8_ATI: u32 = 34861; +pub const GL_DRAW_BUFFER9_ATI: u32 = 34862; +pub const GL_DRAW_BUFFER10_ATI: u32 = 34863; +pub const GL_DRAW_BUFFER11_ATI: u32 = 34864; +pub const GL_DRAW_BUFFER12_ATI: u32 = 34865; +pub const GL_DRAW_BUFFER13_ATI: u32 = 34866; +pub const GL_DRAW_BUFFER14_ATI: u32 = 34867; +pub const GL_DRAW_BUFFER15_ATI: u32 = 34868; +pub const GL_ATI_element_array: u32 = 1; +pub const GL_ELEMENT_ARRAY_ATI: u32 = 34664; +pub const GL_ELEMENT_ARRAY_TYPE_ATI: u32 = 34665; +pub const GL_ELEMENT_ARRAY_POINTER_ATI: u32 = 34666; +pub const GL_ATI_envmap_bumpmap: u32 = 1; +pub const GL_BUMP_ROT_MATRIX_ATI: u32 = 34677; +pub const GL_BUMP_ROT_MATRIX_SIZE_ATI: u32 = 34678; +pub const GL_BUMP_NUM_TEX_UNITS_ATI: u32 = 34679; +pub const GL_BUMP_TEX_UNITS_ATI: u32 = 34680; +pub const GL_DUDV_ATI: u32 = 34681; +pub const GL_DU8DV8_ATI: u32 = 34682; +pub const GL_BUMP_ENVMAP_ATI: u32 = 34683; +pub const GL_BUMP_TARGET_ATI: u32 = 34684; +pub const GL_ATI_fragment_shader: u32 = 1; +pub const GL_FRAGMENT_SHADER_ATI: u32 = 35104; +pub const GL_REG_0_ATI: u32 = 35105; +pub const GL_REG_1_ATI: u32 = 35106; +pub const GL_REG_2_ATI: u32 = 35107; +pub const GL_REG_3_ATI: u32 = 35108; +pub const GL_REG_4_ATI: u32 = 35109; +pub const GL_REG_5_ATI: u32 = 35110; +pub const GL_REG_6_ATI: u32 = 35111; +pub const GL_REG_7_ATI: u32 = 35112; +pub const GL_REG_8_ATI: u32 = 35113; +pub const GL_REG_9_ATI: u32 = 35114; +pub const GL_REG_10_ATI: u32 = 35115; +pub const GL_REG_11_ATI: u32 = 35116; +pub const GL_REG_12_ATI: u32 = 35117; +pub const GL_REG_13_ATI: u32 = 35118; +pub const GL_REG_14_ATI: u32 = 35119; +pub const GL_REG_15_ATI: u32 = 35120; +pub const GL_REG_16_ATI: u32 = 35121; +pub const GL_REG_17_ATI: u32 = 35122; +pub const GL_REG_18_ATI: u32 = 35123; +pub const GL_REG_19_ATI: u32 = 35124; +pub const GL_REG_20_ATI: u32 = 35125; +pub const GL_REG_21_ATI: u32 = 35126; +pub const GL_REG_22_ATI: u32 = 35127; +pub const GL_REG_23_ATI: u32 = 35128; +pub const GL_REG_24_ATI: u32 = 35129; +pub const GL_REG_25_ATI: u32 = 35130; +pub const GL_REG_26_ATI: u32 = 35131; +pub const GL_REG_27_ATI: u32 = 35132; +pub const GL_REG_28_ATI: u32 = 35133; +pub const GL_REG_29_ATI: u32 = 35134; +pub const GL_REG_30_ATI: u32 = 35135; +pub const GL_REG_31_ATI: u32 = 35136; +pub const GL_CON_0_ATI: u32 = 35137; +pub const GL_CON_1_ATI: u32 = 35138; +pub const GL_CON_2_ATI: u32 = 35139; +pub const GL_CON_3_ATI: u32 = 35140; +pub const GL_CON_4_ATI: u32 = 35141; +pub const GL_CON_5_ATI: u32 = 35142; +pub const GL_CON_6_ATI: u32 = 35143; +pub const GL_CON_7_ATI: u32 = 35144; +pub const GL_CON_8_ATI: u32 = 35145; +pub const GL_CON_9_ATI: u32 = 35146; +pub const GL_CON_10_ATI: u32 = 35147; +pub const GL_CON_11_ATI: u32 = 35148; +pub const GL_CON_12_ATI: u32 = 35149; +pub const GL_CON_13_ATI: u32 = 35150; +pub const GL_CON_14_ATI: u32 = 35151; +pub const GL_CON_15_ATI: u32 = 35152; +pub const GL_CON_16_ATI: u32 = 35153; +pub const GL_CON_17_ATI: u32 = 35154; +pub const GL_CON_18_ATI: u32 = 35155; +pub const GL_CON_19_ATI: u32 = 35156; +pub const GL_CON_20_ATI: u32 = 35157; +pub const GL_CON_21_ATI: u32 = 35158; +pub const GL_CON_22_ATI: u32 = 35159; +pub const GL_CON_23_ATI: u32 = 35160; +pub const GL_CON_24_ATI: u32 = 35161; +pub const GL_CON_25_ATI: u32 = 35162; +pub const GL_CON_26_ATI: u32 = 35163; +pub const GL_CON_27_ATI: u32 = 35164; +pub const GL_CON_28_ATI: u32 = 35165; +pub const GL_CON_29_ATI: u32 = 35166; +pub const GL_CON_30_ATI: u32 = 35167; +pub const GL_CON_31_ATI: u32 = 35168; +pub const GL_MOV_ATI: u32 = 35169; +pub const GL_ADD_ATI: u32 = 35171; +pub const GL_MUL_ATI: u32 = 35172; +pub const GL_SUB_ATI: u32 = 35173; +pub const GL_DOT3_ATI: u32 = 35174; +pub const GL_DOT4_ATI: u32 = 35175; +pub const GL_MAD_ATI: u32 = 35176; +pub const GL_LERP_ATI: u32 = 35177; +pub const GL_CND_ATI: u32 = 35178; +pub const GL_CND0_ATI: u32 = 35179; +pub const GL_DOT2_ADD_ATI: u32 = 35180; +pub const GL_SECONDARY_INTERPOLATOR_ATI: u32 = 35181; +pub const GL_NUM_FRAGMENT_REGISTERS_ATI: u32 = 35182; +pub const GL_NUM_FRAGMENT_CONSTANTS_ATI: u32 = 35183; +pub const GL_NUM_PASSES_ATI: u32 = 35184; +pub const GL_NUM_INSTRUCTIONS_PER_PASS_ATI: u32 = 35185; +pub const GL_NUM_INSTRUCTIONS_TOTAL_ATI: u32 = 35186; +pub const GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: u32 = 35187; +pub const GL_NUM_LOOPBACK_COMPONENTS_ATI: u32 = 35188; +pub const GL_COLOR_ALPHA_PAIRING_ATI: u32 = 35189; +pub const GL_SWIZZLE_STR_ATI: u32 = 35190; +pub const GL_SWIZZLE_STQ_ATI: u32 = 35191; +pub const GL_SWIZZLE_STR_DR_ATI: u32 = 35192; +pub const GL_SWIZZLE_STQ_DQ_ATI: u32 = 35193; +pub const GL_SWIZZLE_STRQ_ATI: u32 = 35194; +pub const GL_SWIZZLE_STRQ_DQ_ATI: u32 = 35195; +pub const GL_RED_BIT_ATI: u32 = 1; +pub const GL_GREEN_BIT_ATI: u32 = 2; +pub const GL_BLUE_BIT_ATI: u32 = 4; +pub const GL_2X_BIT_ATI: u32 = 1; +pub const GL_4X_BIT_ATI: u32 = 2; +pub const GL_8X_BIT_ATI: u32 = 4; +pub const GL_HALF_BIT_ATI: u32 = 8; +pub const GL_QUARTER_BIT_ATI: u32 = 16; +pub const GL_EIGHTH_BIT_ATI: u32 = 32; +pub const GL_SATURATE_BIT_ATI: u32 = 64; +pub const GL_COMP_BIT_ATI: u32 = 2; +pub const GL_NEGATE_BIT_ATI: u32 = 4; +pub const GL_BIAS_BIT_ATI: u32 = 8; +pub const GL_ATI_map_object_buffer: u32 = 1; +pub const GL_ATI_meminfo: u32 = 1; +pub const GL_VBO_FREE_MEMORY_ATI: u32 = 34811; +pub const GL_TEXTURE_FREE_MEMORY_ATI: u32 = 34812; +pub const GL_RENDERBUFFER_FREE_MEMORY_ATI: u32 = 34813; +pub const GL_ATI_pixel_format_float: u32 = 1; +pub const GL_RGBA_FLOAT_MODE_ATI: u32 = 34848; +pub const GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI: u32 = 34869; +pub const GL_ATI_pn_triangles: u32 = 1; +pub const GL_PN_TRIANGLES_ATI: u32 = 34800; +pub const GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI: u32 = 34801; +pub const GL_PN_TRIANGLES_POINT_MODE_ATI: u32 = 34802; +pub const GL_PN_TRIANGLES_NORMAL_MODE_ATI: u32 = 34803; +pub const GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI: u32 = 34804; +pub const GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI: u32 = 34805; +pub const GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI: u32 = 34806; +pub const GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI: u32 = 34807; +pub const GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI: u32 = 34808; +pub const GL_ATI_separate_stencil: u32 = 1; +pub const GL_STENCIL_BACK_FUNC_ATI: u32 = 34816; +pub const GL_STENCIL_BACK_FAIL_ATI: u32 = 34817; +pub const GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI: u32 = 34818; +pub const GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI: u32 = 34819; +pub const GL_ATI_text_fragment_shader: u32 = 1; +pub const GL_TEXT_FRAGMENT_SHADER_ATI: u32 = 33280; +pub const GL_ATI_texture_env_combine3: u32 = 1; +pub const GL_MODULATE_ADD_ATI: u32 = 34628; +pub const GL_MODULATE_SIGNED_ADD_ATI: u32 = 34629; +pub const GL_MODULATE_SUBTRACT_ATI: u32 = 34630; +pub const GL_ATI_texture_float: u32 = 1; +pub const GL_RGBA_FLOAT32_ATI: u32 = 34836; +pub const GL_RGB_FLOAT32_ATI: u32 = 34837; +pub const GL_ALPHA_FLOAT32_ATI: u32 = 34838; +pub const GL_INTENSITY_FLOAT32_ATI: u32 = 34839; +pub const GL_LUMINANCE_FLOAT32_ATI: u32 = 34840; +pub const GL_LUMINANCE_ALPHA_FLOAT32_ATI: u32 = 34841; +pub const GL_RGBA_FLOAT16_ATI: u32 = 34842; +pub const GL_RGB_FLOAT16_ATI: u32 = 34843; +pub const GL_ALPHA_FLOAT16_ATI: u32 = 34844; +pub const GL_INTENSITY_FLOAT16_ATI: u32 = 34845; +pub const GL_LUMINANCE_FLOAT16_ATI: u32 = 34846; +pub const GL_LUMINANCE_ALPHA_FLOAT16_ATI: u32 = 34847; +pub const GL_ATI_texture_mirror_once: u32 = 1; +pub const GL_MIRROR_CLAMP_ATI: u32 = 34626; +pub const GL_MIRROR_CLAMP_TO_EDGE_ATI: u32 = 34627; +pub const GL_ATI_vertex_array_object: u32 = 1; +pub const GL_STATIC_ATI: u32 = 34656; +pub const GL_DYNAMIC_ATI: u32 = 34657; +pub const GL_PRESERVE_ATI: u32 = 34658; +pub const GL_DISCARD_ATI: u32 = 34659; +pub const GL_OBJECT_BUFFER_SIZE_ATI: u32 = 34660; +pub const GL_OBJECT_BUFFER_USAGE_ATI: u32 = 34661; +pub const GL_ARRAY_OBJECT_BUFFER_ATI: u32 = 34662; +pub const GL_ARRAY_OBJECT_OFFSET_ATI: u32 = 34663; +pub const GL_ATI_vertex_attrib_array_object: u32 = 1; +pub const GL_ATI_vertex_streams: u32 = 1; +pub const GL_MAX_VERTEX_STREAMS_ATI: u32 = 34667; +pub const GL_VERTEX_STREAM0_ATI: u32 = 34668; +pub const GL_VERTEX_STREAM1_ATI: u32 = 34669; +pub const GL_VERTEX_STREAM2_ATI: u32 = 34670; +pub const GL_VERTEX_STREAM3_ATI: u32 = 34671; +pub const GL_VERTEX_STREAM4_ATI: u32 = 34672; +pub const GL_VERTEX_STREAM5_ATI: u32 = 34673; +pub const GL_VERTEX_STREAM6_ATI: u32 = 34674; +pub const GL_VERTEX_STREAM7_ATI: u32 = 34675; +pub const GL_VERTEX_SOURCE_ATI: u32 = 34676; +pub const GL_EXT_422_pixels: u32 = 1; +pub const GL_422_EXT: u32 = 32972; +pub const GL_422_REV_EXT: u32 = 32973; +pub const GL_422_AVERAGE_EXT: u32 = 32974; +pub const GL_422_REV_AVERAGE_EXT: u32 = 32975; +pub const GL_EXT_EGL_image_storage: u32 = 1; +pub const GL_EXT_abgr: u32 = 1; +pub const GL_ABGR_EXT: u32 = 32768; +pub const GL_EXT_bgra: u32 = 1; +pub const GL_BGR_EXT: u32 = 32992; +pub const GL_BGRA_EXT: u32 = 32993; +pub const GL_EXT_bindable_uniform: u32 = 1; +pub const GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT: u32 = 36322; +pub const GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT: u32 = 36323; +pub const GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT: u32 = 36324; +pub const GL_MAX_BINDABLE_UNIFORM_SIZE_EXT: u32 = 36333; +pub const GL_UNIFORM_BUFFER_EXT: u32 = 36334; +pub const GL_UNIFORM_BUFFER_BINDING_EXT: u32 = 36335; +pub const GL_EXT_blend_color: u32 = 1; +pub const GL_CONSTANT_COLOR_EXT: u32 = 32769; +pub const GL_ONE_MINUS_CONSTANT_COLOR_EXT: u32 = 32770; +pub const GL_CONSTANT_ALPHA_EXT: u32 = 32771; +pub const GL_ONE_MINUS_CONSTANT_ALPHA_EXT: u32 = 32772; +pub const GL_BLEND_COLOR_EXT: u32 = 32773; +pub const GL_EXT_blend_equation_separate: u32 = 1; +pub const GL_BLEND_EQUATION_RGB_EXT: u32 = 32777; +pub const GL_BLEND_EQUATION_ALPHA_EXT: u32 = 34877; +pub const GL_EXT_blend_func_separate: u32 = 1; +pub const GL_BLEND_DST_RGB_EXT: u32 = 32968; +pub const GL_BLEND_SRC_RGB_EXT: u32 = 32969; +pub const GL_BLEND_DST_ALPHA_EXT: u32 = 32970; +pub const GL_BLEND_SRC_ALPHA_EXT: u32 = 32971; +pub const GL_EXT_blend_logic_op: u32 = 1; +pub const GL_EXT_blend_minmax: u32 = 1; +pub const GL_MIN_EXT: u32 = 32775; +pub const GL_MAX_EXT: u32 = 32776; +pub const GL_FUNC_ADD_EXT: u32 = 32774; +pub const GL_BLEND_EQUATION_EXT: u32 = 32777; +pub const GL_EXT_blend_subtract: u32 = 1; +pub const GL_FUNC_SUBTRACT_EXT: u32 = 32778; +pub const GL_FUNC_REVERSE_SUBTRACT_EXT: u32 = 32779; +pub const GL_EXT_clip_volume_hint: u32 = 1; +pub const GL_CLIP_VOLUME_CLIPPING_HINT_EXT: u32 = 33008; +pub const GL_EXT_cmyka: u32 = 1; +pub const GL_CMYK_EXT: u32 = 32780; +pub const GL_CMYKA_EXT: u32 = 32781; +pub const GL_PACK_CMYK_HINT_EXT: u32 = 32782; +pub const GL_UNPACK_CMYK_HINT_EXT: u32 = 32783; +pub const GL_EXT_color_subtable: u32 = 1; +pub const GL_EXT_compiled_vertex_array: u32 = 1; +pub const GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: u32 = 33192; +pub const GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: u32 = 33193; +pub const GL_EXT_convolution: u32 = 1; +pub const GL_CONVOLUTION_1D_EXT: u32 = 32784; +pub const GL_CONVOLUTION_2D_EXT: u32 = 32785; +pub const GL_SEPARABLE_2D_EXT: u32 = 32786; +pub const GL_CONVOLUTION_BORDER_MODE_EXT: u32 = 32787; +pub const GL_CONVOLUTION_FILTER_SCALE_EXT: u32 = 32788; +pub const GL_CONVOLUTION_FILTER_BIAS_EXT: u32 = 32789; +pub const GL_REDUCE_EXT: u32 = 32790; +pub const GL_CONVOLUTION_FORMAT_EXT: u32 = 32791; +pub const GL_CONVOLUTION_WIDTH_EXT: u32 = 32792; +pub const GL_CONVOLUTION_HEIGHT_EXT: u32 = 32793; +pub const GL_MAX_CONVOLUTION_WIDTH_EXT: u32 = 32794; +pub const GL_MAX_CONVOLUTION_HEIGHT_EXT: u32 = 32795; +pub const GL_POST_CONVOLUTION_RED_SCALE_EXT: u32 = 32796; +pub const GL_POST_CONVOLUTION_GREEN_SCALE_EXT: u32 = 32797; +pub const GL_POST_CONVOLUTION_BLUE_SCALE_EXT: u32 = 32798; +pub const GL_POST_CONVOLUTION_ALPHA_SCALE_EXT: u32 = 32799; +pub const GL_POST_CONVOLUTION_RED_BIAS_EXT: u32 = 32800; +pub const GL_POST_CONVOLUTION_GREEN_BIAS_EXT: u32 = 32801; +pub const GL_POST_CONVOLUTION_BLUE_BIAS_EXT: u32 = 32802; +pub const GL_POST_CONVOLUTION_ALPHA_BIAS_EXT: u32 = 32803; +pub const GL_EXT_coordinate_frame: u32 = 1; +pub const GL_TANGENT_ARRAY_EXT: u32 = 33849; +pub const GL_BINORMAL_ARRAY_EXT: u32 = 33850; +pub const GL_CURRENT_TANGENT_EXT: u32 = 33851; +pub const GL_CURRENT_BINORMAL_EXT: u32 = 33852; +pub const GL_TANGENT_ARRAY_TYPE_EXT: u32 = 33854; +pub const GL_TANGENT_ARRAY_STRIDE_EXT: u32 = 33855; +pub const GL_BINORMAL_ARRAY_TYPE_EXT: u32 = 33856; +pub const GL_BINORMAL_ARRAY_STRIDE_EXT: u32 = 33857; +pub const GL_TANGENT_ARRAY_POINTER_EXT: u32 = 33858; +pub const GL_BINORMAL_ARRAY_POINTER_EXT: u32 = 33859; +pub const GL_MAP1_TANGENT_EXT: u32 = 33860; +pub const GL_MAP2_TANGENT_EXT: u32 = 33861; +pub const GL_MAP1_BINORMAL_EXT: u32 = 33862; +pub const GL_MAP2_BINORMAL_EXT: u32 = 33863; +pub const GL_EXT_copy_texture: u32 = 1; +pub const GL_EXT_cull_vertex: u32 = 1; +pub const GL_CULL_VERTEX_EXT: u32 = 33194; +pub const GL_CULL_VERTEX_EYE_POSITION_EXT: u32 = 33195; +pub const GL_CULL_VERTEX_OBJECT_POSITION_EXT: u32 = 33196; +pub const GL_EXT_debug_label: u32 = 1; +pub const GL_PROGRAM_PIPELINE_OBJECT_EXT: u32 = 35407; +pub const GL_PROGRAM_OBJECT_EXT: u32 = 35648; +pub const GL_SHADER_OBJECT_EXT: u32 = 35656; +pub const GL_BUFFER_OBJECT_EXT: u32 = 37201; +pub const GL_QUERY_OBJECT_EXT: u32 = 37203; +pub const GL_VERTEX_ARRAY_OBJECT_EXT: u32 = 37204; +pub const GL_EXT_debug_marker: u32 = 1; +pub const GL_EXT_depth_bounds_test: u32 = 1; +pub const GL_DEPTH_BOUNDS_TEST_EXT: u32 = 34960; +pub const GL_DEPTH_BOUNDS_EXT: u32 = 34961; +pub const GL_EXT_direct_state_access: u32 = 1; +pub const GL_PROGRAM_MATRIX_EXT: u32 = 36397; +pub const GL_TRANSPOSE_PROGRAM_MATRIX_EXT: u32 = 36398; +pub const GL_PROGRAM_MATRIX_STACK_DEPTH_EXT: u32 = 36399; +pub const GL_EXT_draw_buffers2: u32 = 1; +pub const GL_EXT_draw_instanced: u32 = 1; +pub const GL_EXT_draw_range_elements: u32 = 1; +pub const GL_MAX_ELEMENTS_VERTICES_EXT: u32 = 33000; +pub const GL_MAX_ELEMENTS_INDICES_EXT: u32 = 33001; +pub const GL_EXT_external_buffer: u32 = 1; +pub const GL_EXT_fog_coord: u32 = 1; +pub const GL_FOG_COORDINATE_SOURCE_EXT: u32 = 33872; +pub const GL_FOG_COORDINATE_EXT: u32 = 33873; +pub const GL_FRAGMENT_DEPTH_EXT: u32 = 33874; +pub const GL_CURRENT_FOG_COORDINATE_EXT: u32 = 33875; +pub const GL_FOG_COORDINATE_ARRAY_TYPE_EXT: u32 = 33876; +pub const GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: u32 = 33877; +pub const GL_FOG_COORDINATE_ARRAY_POINTER_EXT: u32 = 33878; +pub const GL_FOG_COORDINATE_ARRAY_EXT: u32 = 33879; +pub const GL_EXT_framebuffer_blit: u32 = 1; +pub const GL_READ_FRAMEBUFFER_EXT: u32 = 36008; +pub const GL_DRAW_FRAMEBUFFER_EXT: u32 = 36009; +pub const GL_DRAW_FRAMEBUFFER_BINDING_EXT: u32 = 36006; +pub const GL_READ_FRAMEBUFFER_BINDING_EXT: u32 = 36010; +pub const GL_EXT_framebuffer_multisample: u32 = 1; +pub const GL_RENDERBUFFER_SAMPLES_EXT: u32 = 36011; +pub const GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT: u32 = 36182; +pub const GL_MAX_SAMPLES_EXT: u32 = 36183; +pub const GL_EXT_framebuffer_multisample_blit_scaled: u32 = 1; +pub const GL_SCALED_RESOLVE_FASTEST_EXT: u32 = 37050; +pub const GL_SCALED_RESOLVE_NICEST_EXT: u32 = 37051; +pub const GL_EXT_framebuffer_object: u32 = 1; +pub const GL_INVALID_FRAMEBUFFER_OPERATION_EXT: u32 = 1286; +pub const GL_MAX_RENDERBUFFER_SIZE_EXT: u32 = 34024; +pub const GL_FRAMEBUFFER_BINDING_EXT: u32 = 36006; +pub const GL_RENDERBUFFER_BINDING_EXT: u32 = 36007; +pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: u32 = 36048; +pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: u32 = 36049; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT: u32 = 36050; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT: u32 = 36051; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: u32 = 36052; +pub const GL_FRAMEBUFFER_COMPLETE_EXT: u32 = 36053; +pub const GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: u32 = 36054; +pub const GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: u32 = 36055; +pub const GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: u32 = 36057; +pub const GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: u32 = 36058; +pub const GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: u32 = 36059; +pub const GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: u32 = 36060; +pub const GL_FRAMEBUFFER_UNSUPPORTED_EXT: u32 = 36061; +pub const GL_MAX_COLOR_ATTACHMENTS_EXT: u32 = 36063; +pub const GL_COLOR_ATTACHMENT0_EXT: u32 = 36064; +pub const GL_COLOR_ATTACHMENT1_EXT: u32 = 36065; +pub const GL_COLOR_ATTACHMENT2_EXT: u32 = 36066; +pub const GL_COLOR_ATTACHMENT3_EXT: u32 = 36067; +pub const GL_COLOR_ATTACHMENT4_EXT: u32 = 36068; +pub const GL_COLOR_ATTACHMENT5_EXT: u32 = 36069; +pub const GL_COLOR_ATTACHMENT6_EXT: u32 = 36070; +pub const GL_COLOR_ATTACHMENT7_EXT: u32 = 36071; +pub const GL_COLOR_ATTACHMENT8_EXT: u32 = 36072; +pub const GL_COLOR_ATTACHMENT9_EXT: u32 = 36073; +pub const GL_COLOR_ATTACHMENT10_EXT: u32 = 36074; +pub const GL_COLOR_ATTACHMENT11_EXT: u32 = 36075; +pub const GL_COLOR_ATTACHMENT12_EXT: u32 = 36076; +pub const GL_COLOR_ATTACHMENT13_EXT: u32 = 36077; +pub const GL_COLOR_ATTACHMENT14_EXT: u32 = 36078; +pub const GL_COLOR_ATTACHMENT15_EXT: u32 = 36079; +pub const GL_DEPTH_ATTACHMENT_EXT: u32 = 36096; +pub const GL_STENCIL_ATTACHMENT_EXT: u32 = 36128; +pub const GL_FRAMEBUFFER_EXT: u32 = 36160; +pub const GL_RENDERBUFFER_EXT: u32 = 36161; +pub const GL_RENDERBUFFER_WIDTH_EXT: u32 = 36162; +pub const GL_RENDERBUFFER_HEIGHT_EXT: u32 = 36163; +pub const GL_RENDERBUFFER_INTERNAL_FORMAT_EXT: u32 = 36164; +pub const GL_STENCIL_INDEX1_EXT: u32 = 36166; +pub const GL_STENCIL_INDEX4_EXT: u32 = 36167; +pub const GL_STENCIL_INDEX8_EXT: u32 = 36168; +pub const GL_STENCIL_INDEX16_EXT: u32 = 36169; +pub const GL_RENDERBUFFER_RED_SIZE_EXT: u32 = 36176; +pub const GL_RENDERBUFFER_GREEN_SIZE_EXT: u32 = 36177; +pub const GL_RENDERBUFFER_BLUE_SIZE_EXT: u32 = 36178; +pub const GL_RENDERBUFFER_ALPHA_SIZE_EXT: u32 = 36179; +pub const GL_RENDERBUFFER_DEPTH_SIZE_EXT: u32 = 36180; +pub const GL_RENDERBUFFER_STENCIL_SIZE_EXT: u32 = 36181; +pub const GL_EXT_framebuffer_sRGB: u32 = 1; +pub const GL_FRAMEBUFFER_SRGB_EXT: u32 = 36281; +pub const GL_FRAMEBUFFER_SRGB_CAPABLE_EXT: u32 = 36282; +pub const GL_EXT_geometry_shader4: u32 = 1; +pub const GL_GEOMETRY_SHADER_EXT: u32 = 36313; +pub const GL_GEOMETRY_VERTICES_OUT_EXT: u32 = 36314; +pub const GL_GEOMETRY_INPUT_TYPE_EXT: u32 = 36315; +pub const GL_GEOMETRY_OUTPUT_TYPE_EXT: u32 = 36316; +pub const GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT: u32 = 35881; +pub const GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT: u32 = 36317; +pub const GL_MAX_VERTEX_VARYING_COMPONENTS_EXT: u32 = 36318; +pub const GL_MAX_VARYING_COMPONENTS_EXT: u32 = 35659; +pub const GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT: u32 = 36319; +pub const GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT: u32 = 36320; +pub const GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT: u32 = 36321; +pub const GL_LINES_ADJACENCY_EXT: u32 = 10; +pub const GL_LINE_STRIP_ADJACENCY_EXT: u32 = 11; +pub const GL_TRIANGLES_ADJACENCY_EXT: u32 = 12; +pub const GL_TRIANGLE_STRIP_ADJACENCY_EXT: u32 = 13; +pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT: u32 = 36264; +pub const GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT: u32 = 36265; +pub const GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT: u32 = 36263; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT: u32 = 36052; +pub const GL_PROGRAM_POINT_SIZE_EXT: u32 = 34370; +pub const GL_EXT_gpu_program_parameters: u32 = 1; +pub const GL_EXT_gpu_shader4: u32 = 1; +pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT: u32 = 35069; +pub const GL_SAMPLER_1D_ARRAY_EXT: u32 = 36288; +pub const GL_SAMPLER_2D_ARRAY_EXT: u32 = 36289; +pub const GL_SAMPLER_BUFFER_EXT: u32 = 36290; +pub const GL_SAMPLER_1D_ARRAY_SHADOW_EXT: u32 = 36291; +pub const GL_SAMPLER_2D_ARRAY_SHADOW_EXT: u32 = 36292; +pub const GL_SAMPLER_CUBE_SHADOW_EXT: u32 = 36293; +pub const GL_UNSIGNED_INT_VEC2_EXT: u32 = 36294; +pub const GL_UNSIGNED_INT_VEC3_EXT: u32 = 36295; +pub const GL_UNSIGNED_INT_VEC4_EXT: u32 = 36296; +pub const GL_INT_SAMPLER_1D_EXT: u32 = 36297; +pub const GL_INT_SAMPLER_2D_EXT: u32 = 36298; +pub const GL_INT_SAMPLER_3D_EXT: u32 = 36299; +pub const GL_INT_SAMPLER_CUBE_EXT: u32 = 36300; +pub const GL_INT_SAMPLER_2D_RECT_EXT: u32 = 36301; +pub const GL_INT_SAMPLER_1D_ARRAY_EXT: u32 = 36302; +pub const GL_INT_SAMPLER_2D_ARRAY_EXT: u32 = 36303; +pub const GL_INT_SAMPLER_BUFFER_EXT: u32 = 36304; +pub const GL_UNSIGNED_INT_SAMPLER_1D_EXT: u32 = 36305; +pub const GL_UNSIGNED_INT_SAMPLER_2D_EXT: u32 = 36306; +pub const GL_UNSIGNED_INT_SAMPLER_3D_EXT: u32 = 36307; +pub const GL_UNSIGNED_INT_SAMPLER_CUBE_EXT: u32 = 36308; +pub const GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT: u32 = 36309; +pub const GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT: u32 = 36310; +pub const GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT: u32 = 36311; +pub const GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT: u32 = 36312; +pub const GL_MIN_PROGRAM_TEXEL_OFFSET_EXT: u32 = 35076; +pub const GL_MAX_PROGRAM_TEXEL_OFFSET_EXT: u32 = 35077; +pub const GL_EXT_histogram: u32 = 1; +pub const GL_HISTOGRAM_EXT: u32 = 32804; +pub const GL_PROXY_HISTOGRAM_EXT: u32 = 32805; +pub const GL_HISTOGRAM_WIDTH_EXT: u32 = 32806; +pub const GL_HISTOGRAM_FORMAT_EXT: u32 = 32807; +pub const GL_HISTOGRAM_RED_SIZE_EXT: u32 = 32808; +pub const GL_HISTOGRAM_GREEN_SIZE_EXT: u32 = 32809; +pub const GL_HISTOGRAM_BLUE_SIZE_EXT: u32 = 32810; +pub const GL_HISTOGRAM_ALPHA_SIZE_EXT: u32 = 32811; +pub const GL_HISTOGRAM_LUMINANCE_SIZE_EXT: u32 = 32812; +pub const GL_HISTOGRAM_SINK_EXT: u32 = 32813; +pub const GL_MINMAX_EXT: u32 = 32814; +pub const GL_MINMAX_FORMAT_EXT: u32 = 32815; +pub const GL_MINMAX_SINK_EXT: u32 = 32816; +pub const GL_TABLE_TOO_LARGE_EXT: u32 = 32817; +pub const GL_EXT_index_array_formats: u32 = 1; +pub const GL_IUI_V2F_EXT: u32 = 33197; +pub const GL_IUI_V3F_EXT: u32 = 33198; +pub const GL_IUI_N3F_V2F_EXT: u32 = 33199; +pub const GL_IUI_N3F_V3F_EXT: u32 = 33200; +pub const GL_T2F_IUI_V2F_EXT: u32 = 33201; +pub const GL_T2F_IUI_V3F_EXT: u32 = 33202; +pub const GL_T2F_IUI_N3F_V2F_EXT: u32 = 33203; +pub const GL_T2F_IUI_N3F_V3F_EXT: u32 = 33204; +pub const GL_EXT_index_func: u32 = 1; +pub const GL_INDEX_TEST_EXT: u32 = 33205; +pub const GL_INDEX_TEST_FUNC_EXT: u32 = 33206; +pub const GL_INDEX_TEST_REF_EXT: u32 = 33207; +pub const GL_EXT_index_material: u32 = 1; +pub const GL_INDEX_MATERIAL_EXT: u32 = 33208; +pub const GL_INDEX_MATERIAL_PARAMETER_EXT: u32 = 33209; +pub const GL_INDEX_MATERIAL_FACE_EXT: u32 = 33210; +pub const GL_EXT_index_texture: u32 = 1; +pub const GL_EXT_light_texture: u32 = 1; +pub const GL_FRAGMENT_MATERIAL_EXT: u32 = 33609; +pub const GL_FRAGMENT_NORMAL_EXT: u32 = 33610; +pub const GL_FRAGMENT_COLOR_EXT: u32 = 33612; +pub const GL_ATTENUATION_EXT: u32 = 33613; +pub const GL_SHADOW_ATTENUATION_EXT: u32 = 33614; +pub const GL_TEXTURE_APPLICATION_MODE_EXT: u32 = 33615; +pub const GL_TEXTURE_LIGHT_EXT: u32 = 33616; +pub const GL_TEXTURE_MATERIAL_FACE_EXT: u32 = 33617; +pub const GL_TEXTURE_MATERIAL_PARAMETER_EXT: u32 = 33618; +pub const GL_EXT_memory_object: u32 = 1; +pub const GL_TEXTURE_TILING_EXT: u32 = 38272; +pub const GL_DEDICATED_MEMORY_OBJECT_EXT: u32 = 38273; +pub const GL_PROTECTED_MEMORY_OBJECT_EXT: u32 = 38299; +pub const GL_NUM_TILING_TYPES_EXT: u32 = 38274; +pub const GL_TILING_TYPES_EXT: u32 = 38275; +pub const GL_OPTIMAL_TILING_EXT: u32 = 38276; +pub const GL_LINEAR_TILING_EXT: u32 = 38277; +pub const GL_NUM_DEVICE_UUIDS_EXT: u32 = 38294; +pub const GL_DEVICE_UUID_EXT: u32 = 38295; +pub const GL_DRIVER_UUID_EXT: u32 = 38296; +pub const GL_UUID_SIZE_EXT: u32 = 16; +pub const GL_EXT_memory_object_fd: u32 = 1; +pub const GL_HANDLE_TYPE_OPAQUE_FD_EXT: u32 = 38278; +pub const GL_EXT_memory_object_win32: u32 = 1; +pub const GL_HANDLE_TYPE_OPAQUE_WIN32_EXT: u32 = 38279; +pub const GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT: u32 = 38280; +pub const GL_DEVICE_LUID_EXT: u32 = 38297; +pub const GL_DEVICE_NODE_MASK_EXT: u32 = 38298; +pub const GL_LUID_SIZE_EXT: u32 = 8; +pub const GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT: u32 = 38281; +pub const GL_HANDLE_TYPE_D3D12_RESOURCE_EXT: u32 = 38282; +pub const GL_HANDLE_TYPE_D3D11_IMAGE_EXT: u32 = 38283; +pub const GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT: u32 = 38284; +pub const GL_EXT_misc_attribute: u32 = 1; +pub const GL_EXT_multi_draw_arrays: u32 = 1; +pub const GL_EXT_multisample: u32 = 1; +pub const GL_MULTISAMPLE_EXT: u32 = 32925; +pub const GL_SAMPLE_ALPHA_TO_MASK_EXT: u32 = 32926; +pub const GL_SAMPLE_ALPHA_TO_ONE_EXT: u32 = 32927; +pub const GL_SAMPLE_MASK_EXT: u32 = 32928; +pub const GL_1PASS_EXT: u32 = 32929; +pub const GL_2PASS_0_EXT: u32 = 32930; +pub const GL_2PASS_1_EXT: u32 = 32931; +pub const GL_4PASS_0_EXT: u32 = 32932; +pub const GL_4PASS_1_EXT: u32 = 32933; +pub const GL_4PASS_2_EXT: u32 = 32934; +pub const GL_4PASS_3_EXT: u32 = 32935; +pub const GL_SAMPLE_BUFFERS_EXT: u32 = 32936; +pub const GL_SAMPLES_EXT: u32 = 32937; +pub const GL_SAMPLE_MASK_VALUE_EXT: u32 = 32938; +pub const GL_SAMPLE_MASK_INVERT_EXT: u32 = 32939; +pub const GL_SAMPLE_PATTERN_EXT: u32 = 32940; +pub const GL_MULTISAMPLE_BIT_EXT: u32 = 536870912; +pub const GL_EXT_multiview_tessellation_geometry_shader: u32 = 1; +pub const GL_EXT_multiview_texture_multisample: u32 = 1; +pub const GL_EXT_multiview_timer_query: u32 = 1; +pub const GL_EXT_packed_depth_stencil: u32 = 1; +pub const GL_DEPTH_STENCIL_EXT: u32 = 34041; +pub const GL_UNSIGNED_INT_24_8_EXT: u32 = 34042; +pub const GL_DEPTH24_STENCIL8_EXT: u32 = 35056; +pub const GL_TEXTURE_STENCIL_SIZE_EXT: u32 = 35057; +pub const GL_EXT_packed_float: u32 = 1; +pub const GL_R11F_G11F_B10F_EXT: u32 = 35898; +pub const GL_UNSIGNED_INT_10F_11F_11F_REV_EXT: u32 = 35899; +pub const GL_RGBA_SIGNED_COMPONENTS_EXT: u32 = 35900; +pub const GL_EXT_packed_pixels: u32 = 1; +pub const GL_UNSIGNED_BYTE_3_3_2_EXT: u32 = 32818; +pub const GL_UNSIGNED_SHORT_4_4_4_4_EXT: u32 = 32819; +pub const GL_UNSIGNED_SHORT_5_5_5_1_EXT: u32 = 32820; +pub const GL_UNSIGNED_INT_8_8_8_8_EXT: u32 = 32821; +pub const GL_UNSIGNED_INT_10_10_10_2_EXT: u32 = 32822; +pub const GL_EXT_paletted_texture: u32 = 1; +pub const GL_COLOR_INDEX1_EXT: u32 = 32994; +pub const GL_COLOR_INDEX2_EXT: u32 = 32995; +pub const GL_COLOR_INDEX4_EXT: u32 = 32996; +pub const GL_COLOR_INDEX8_EXT: u32 = 32997; +pub const GL_COLOR_INDEX12_EXT: u32 = 32998; +pub const GL_COLOR_INDEX16_EXT: u32 = 32999; +pub const GL_TEXTURE_INDEX_SIZE_EXT: u32 = 33005; +pub const GL_EXT_pixel_buffer_object: u32 = 1; +pub const GL_PIXEL_PACK_BUFFER_EXT: u32 = 35051; +pub const GL_PIXEL_UNPACK_BUFFER_EXT: u32 = 35052; +pub const GL_PIXEL_PACK_BUFFER_BINDING_EXT: u32 = 35053; +pub const GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: u32 = 35055; +pub const GL_EXT_pixel_transform: u32 = 1; +pub const GL_PIXEL_TRANSFORM_2D_EXT: u32 = 33584; +pub const GL_PIXEL_MAG_FILTER_EXT: u32 = 33585; +pub const GL_PIXEL_MIN_FILTER_EXT: u32 = 33586; +pub const GL_PIXEL_CUBIC_WEIGHT_EXT: u32 = 33587; +pub const GL_CUBIC_EXT: u32 = 33588; +pub const GL_AVERAGE_EXT: u32 = 33589; +pub const GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT: u32 = 33590; +pub const GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT: u32 = 33591; +pub const GL_PIXEL_TRANSFORM_2D_MATRIX_EXT: u32 = 33592; +pub const GL_EXT_pixel_transform_color_table: u32 = 1; +pub const GL_EXT_point_parameters: u32 = 1; +pub const GL_POINT_SIZE_MIN_EXT: u32 = 33062; +pub const GL_POINT_SIZE_MAX_EXT: u32 = 33063; +pub const GL_POINT_FADE_THRESHOLD_SIZE_EXT: u32 = 33064; +pub const GL_DISTANCE_ATTENUATION_EXT: u32 = 33065; +pub const GL_EXT_polygon_offset: u32 = 1; +pub const GL_POLYGON_OFFSET_EXT: u32 = 32823; +pub const GL_POLYGON_OFFSET_FACTOR_EXT: u32 = 32824; +pub const GL_POLYGON_OFFSET_BIAS_EXT: u32 = 32825; +pub const GL_EXT_polygon_offset_clamp: u32 = 1; +pub const GL_POLYGON_OFFSET_CLAMP_EXT: u32 = 36379; +pub const GL_EXT_post_depth_coverage: u32 = 1; +pub const GL_EXT_provoking_vertex: u32 = 1; +pub const GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT: u32 = 36428; +pub const GL_FIRST_VERTEX_CONVENTION_EXT: u32 = 36429; +pub const GL_LAST_VERTEX_CONVENTION_EXT: u32 = 36430; +pub const GL_PROVOKING_VERTEX_EXT: u32 = 36431; +pub const GL_EXT_raster_multisample: u32 = 1; +pub const GL_RASTER_MULTISAMPLE_EXT: u32 = 37671; +pub const GL_RASTER_SAMPLES_EXT: u32 = 37672; +pub const GL_MAX_RASTER_SAMPLES_EXT: u32 = 37673; +pub const GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT: u32 = 37674; +pub const GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT: u32 = 37675; +pub const GL_EFFECTIVE_RASTER_SAMPLES_EXT: u32 = 37676; +pub const GL_EXT_rescale_normal: u32 = 1; +pub const GL_RESCALE_NORMAL_EXT: u32 = 32826; +pub const GL_EXT_secondary_color: u32 = 1; +pub const GL_COLOR_SUM_EXT: u32 = 33880; +pub const GL_CURRENT_SECONDARY_COLOR_EXT: u32 = 33881; +pub const GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: u32 = 33882; +pub const GL_SECONDARY_COLOR_ARRAY_TYPE_EXT: u32 = 33883; +pub const GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: u32 = 33884; +pub const GL_SECONDARY_COLOR_ARRAY_POINTER_EXT: u32 = 33885; +pub const GL_SECONDARY_COLOR_ARRAY_EXT: u32 = 33886; +pub const GL_EXT_semaphore: u32 = 1; +pub const GL_LAYOUT_GENERAL_EXT: u32 = 38285; +pub const GL_LAYOUT_COLOR_ATTACHMENT_EXT: u32 = 38286; +pub const GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT: u32 = 38287; +pub const GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT: u32 = 38288; +pub const GL_LAYOUT_SHADER_READ_ONLY_EXT: u32 = 38289; +pub const GL_LAYOUT_TRANSFER_SRC_EXT: u32 = 38290; +pub const GL_LAYOUT_TRANSFER_DST_EXT: u32 = 38291; +pub const GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT: u32 = 38192; +pub const GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT: u32 = 38193; +pub const GL_EXT_semaphore_fd: u32 = 1; +pub const GL_EXT_semaphore_win32: u32 = 1; +pub const GL_HANDLE_TYPE_D3D12_FENCE_EXT: u32 = 38292; +pub const GL_D3D12_FENCE_VALUE_EXT: u32 = 38293; +pub const GL_EXT_separate_shader_objects: u32 = 1; +pub const GL_ACTIVE_PROGRAM_EXT: u32 = 35725; +pub const GL_EXT_separate_specular_color: u32 = 1; +pub const GL_LIGHT_MODEL_COLOR_CONTROL_EXT: u32 = 33272; +pub const GL_SINGLE_COLOR_EXT: u32 = 33273; +pub const GL_SEPARATE_SPECULAR_COLOR_EXT: u32 = 33274; +pub const GL_EXT_shader_framebuffer_fetch: u32 = 1; +pub const GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT: u32 = 35410; +pub const GL_EXT_shader_framebuffer_fetch_non_coherent: u32 = 1; +pub const GL_EXT_shader_image_load_formatted: u32 = 1; +pub const GL_EXT_shader_image_load_store: u32 = 1; +pub const GL_MAX_IMAGE_UNITS_EXT: u32 = 36664; +pub const GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT: u32 = 36665; +pub const GL_IMAGE_BINDING_NAME_EXT: u32 = 36666; +pub const GL_IMAGE_BINDING_LEVEL_EXT: u32 = 36667; +pub const GL_IMAGE_BINDING_LAYERED_EXT: u32 = 36668; +pub const GL_IMAGE_BINDING_LAYER_EXT: u32 = 36669; +pub const GL_IMAGE_BINDING_ACCESS_EXT: u32 = 36670; +pub const GL_IMAGE_1D_EXT: u32 = 36940; +pub const GL_IMAGE_2D_EXT: u32 = 36941; +pub const GL_IMAGE_3D_EXT: u32 = 36942; +pub const GL_IMAGE_2D_RECT_EXT: u32 = 36943; +pub const GL_IMAGE_CUBE_EXT: u32 = 36944; +pub const GL_IMAGE_BUFFER_EXT: u32 = 36945; +pub const GL_IMAGE_1D_ARRAY_EXT: u32 = 36946; +pub const GL_IMAGE_2D_ARRAY_EXT: u32 = 36947; +pub const GL_IMAGE_CUBE_MAP_ARRAY_EXT: u32 = 36948; +pub const GL_IMAGE_2D_MULTISAMPLE_EXT: u32 = 36949; +pub const GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT: u32 = 36950; +pub const GL_INT_IMAGE_1D_EXT: u32 = 36951; +pub const GL_INT_IMAGE_2D_EXT: u32 = 36952; +pub const GL_INT_IMAGE_3D_EXT: u32 = 36953; +pub const GL_INT_IMAGE_2D_RECT_EXT: u32 = 36954; +pub const GL_INT_IMAGE_CUBE_EXT: u32 = 36955; +pub const GL_INT_IMAGE_BUFFER_EXT: u32 = 36956; +pub const GL_INT_IMAGE_1D_ARRAY_EXT: u32 = 36957; +pub const GL_INT_IMAGE_2D_ARRAY_EXT: u32 = 36958; +pub const GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT: u32 = 36959; +pub const GL_INT_IMAGE_2D_MULTISAMPLE_EXT: u32 = 36960; +pub const GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT: u32 = 36961; +pub const GL_UNSIGNED_INT_IMAGE_1D_EXT: u32 = 36962; +pub const GL_UNSIGNED_INT_IMAGE_2D_EXT: u32 = 36963; +pub const GL_UNSIGNED_INT_IMAGE_3D_EXT: u32 = 36964; +pub const GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT: u32 = 36965; +pub const GL_UNSIGNED_INT_IMAGE_CUBE_EXT: u32 = 36966; +pub const GL_UNSIGNED_INT_IMAGE_BUFFER_EXT: u32 = 36967; +pub const GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT: u32 = 36968; +pub const GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT: u32 = 36969; +pub const GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT: u32 = 36970; +pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT: u32 = 36971; +pub const GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT: u32 = 36972; +pub const GL_MAX_IMAGE_SAMPLES_EXT: u32 = 36973; +pub const GL_IMAGE_BINDING_FORMAT_EXT: u32 = 36974; +pub const GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT: u32 = 1; +pub const GL_ELEMENT_ARRAY_BARRIER_BIT_EXT: u32 = 2; +pub const GL_UNIFORM_BARRIER_BIT_EXT: u32 = 4; +pub const GL_TEXTURE_FETCH_BARRIER_BIT_EXT: u32 = 8; +pub const GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT: u32 = 32; +pub const GL_COMMAND_BARRIER_BIT_EXT: u32 = 64; +pub const GL_PIXEL_BUFFER_BARRIER_BIT_EXT: u32 = 128; +pub const GL_TEXTURE_UPDATE_BARRIER_BIT_EXT: u32 = 256; +pub const GL_BUFFER_UPDATE_BARRIER_BIT_EXT: u32 = 512; +pub const GL_FRAMEBUFFER_BARRIER_BIT_EXT: u32 = 1024; +pub const GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT: u32 = 2048; +pub const GL_ATOMIC_COUNTER_BARRIER_BIT_EXT: u32 = 4096; +pub const GL_ALL_BARRIER_BITS_EXT: u32 = 4294967295; +pub const GL_EXT_shader_integer_mix: u32 = 1; +pub const GL_EXT_shadow_funcs: u32 = 1; +pub const GL_EXT_shared_texture_palette: u32 = 1; +pub const GL_SHARED_TEXTURE_PALETTE_EXT: u32 = 33275; +pub const GL_EXT_sparse_texture2: u32 = 1; +pub const GL_EXT_stencil_clear_tag: u32 = 1; +pub const GL_STENCIL_TAG_BITS_EXT: u32 = 35058; +pub const GL_STENCIL_CLEAR_TAG_VALUE_EXT: u32 = 35059; +pub const GL_EXT_stencil_two_side: u32 = 1; +pub const GL_STENCIL_TEST_TWO_SIDE_EXT: u32 = 35088; +pub const GL_ACTIVE_STENCIL_FACE_EXT: u32 = 35089; +pub const GL_EXT_stencil_wrap: u32 = 1; +pub const GL_INCR_WRAP_EXT: u32 = 34055; +pub const GL_DECR_WRAP_EXT: u32 = 34056; +pub const GL_EXT_subtexture: u32 = 1; +pub const GL_EXT_texture: u32 = 1; +pub const GL_ALPHA4_EXT: u32 = 32827; +pub const GL_ALPHA8_EXT: u32 = 32828; +pub const GL_ALPHA12_EXT: u32 = 32829; +pub const GL_ALPHA16_EXT: u32 = 32830; +pub const GL_LUMINANCE4_EXT: u32 = 32831; +pub const GL_LUMINANCE8_EXT: u32 = 32832; +pub const GL_LUMINANCE12_EXT: u32 = 32833; +pub const GL_LUMINANCE16_EXT: u32 = 32834; +pub const GL_LUMINANCE4_ALPHA4_EXT: u32 = 32835; +pub const GL_LUMINANCE6_ALPHA2_EXT: u32 = 32836; +pub const GL_LUMINANCE8_ALPHA8_EXT: u32 = 32837; +pub const GL_LUMINANCE12_ALPHA4_EXT: u32 = 32838; +pub const GL_LUMINANCE12_ALPHA12_EXT: u32 = 32839; +pub const GL_LUMINANCE16_ALPHA16_EXT: u32 = 32840; +pub const GL_INTENSITY_EXT: u32 = 32841; +pub const GL_INTENSITY4_EXT: u32 = 32842; +pub const GL_INTENSITY8_EXT: u32 = 32843; +pub const GL_INTENSITY12_EXT: u32 = 32844; +pub const GL_INTENSITY16_EXT: u32 = 32845; +pub const GL_RGB2_EXT: u32 = 32846; +pub const GL_RGB4_EXT: u32 = 32847; +pub const GL_RGB5_EXT: u32 = 32848; +pub const GL_RGB8_EXT: u32 = 32849; +pub const GL_RGB10_EXT: u32 = 32850; +pub const GL_RGB12_EXT: u32 = 32851; +pub const GL_RGB16_EXT: u32 = 32852; +pub const GL_RGBA2_EXT: u32 = 32853; +pub const GL_RGBA4_EXT: u32 = 32854; +pub const GL_RGB5_A1_EXT: u32 = 32855; +pub const GL_RGBA8_EXT: u32 = 32856; +pub const GL_RGB10_A2_EXT: u32 = 32857; +pub const GL_RGBA12_EXT: u32 = 32858; +pub const GL_RGBA16_EXT: u32 = 32859; +pub const GL_TEXTURE_RED_SIZE_EXT: u32 = 32860; +pub const GL_TEXTURE_GREEN_SIZE_EXT: u32 = 32861; +pub const GL_TEXTURE_BLUE_SIZE_EXT: u32 = 32862; +pub const GL_TEXTURE_ALPHA_SIZE_EXT: u32 = 32863; +pub const GL_TEXTURE_LUMINANCE_SIZE_EXT: u32 = 32864; +pub const GL_TEXTURE_INTENSITY_SIZE_EXT: u32 = 32865; +pub const GL_REPLACE_EXT: u32 = 32866; +pub const GL_PROXY_TEXTURE_1D_EXT: u32 = 32867; +pub const GL_PROXY_TEXTURE_2D_EXT: u32 = 32868; +pub const GL_TEXTURE_TOO_LARGE_EXT: u32 = 32869; +pub const GL_EXT_texture3D: u32 = 1; +pub const GL_PACK_SKIP_IMAGES_EXT: u32 = 32875; +pub const GL_PACK_IMAGE_HEIGHT_EXT: u32 = 32876; +pub const GL_UNPACK_SKIP_IMAGES_EXT: u32 = 32877; +pub const GL_UNPACK_IMAGE_HEIGHT_EXT: u32 = 32878; +pub const GL_TEXTURE_3D_EXT: u32 = 32879; +pub const GL_PROXY_TEXTURE_3D_EXT: u32 = 32880; +pub const GL_TEXTURE_DEPTH_EXT: u32 = 32881; +pub const GL_TEXTURE_WRAP_R_EXT: u32 = 32882; +pub const GL_MAX_3D_TEXTURE_SIZE_EXT: u32 = 32883; +pub const GL_EXT_texture_array: u32 = 1; +pub const GL_TEXTURE_1D_ARRAY_EXT: u32 = 35864; +pub const GL_PROXY_TEXTURE_1D_ARRAY_EXT: u32 = 35865; +pub const GL_TEXTURE_2D_ARRAY_EXT: u32 = 35866; +pub const GL_PROXY_TEXTURE_2D_ARRAY_EXT: u32 = 35867; +pub const GL_TEXTURE_BINDING_1D_ARRAY_EXT: u32 = 35868; +pub const GL_TEXTURE_BINDING_2D_ARRAY_EXT: u32 = 35869; +pub const GL_MAX_ARRAY_TEXTURE_LAYERS_EXT: u32 = 35071; +pub const GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT: u32 = 34894; +pub const GL_EXT_texture_buffer_object: u32 = 1; +pub const GL_TEXTURE_BUFFER_EXT: u32 = 35882; +pub const GL_MAX_TEXTURE_BUFFER_SIZE_EXT: u32 = 35883; +pub const GL_TEXTURE_BINDING_BUFFER_EXT: u32 = 35884; +pub const GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT: u32 = 35885; +pub const GL_TEXTURE_BUFFER_FORMAT_EXT: u32 = 35886; +pub const GL_EXT_texture_compression_latc: u32 = 1; +pub const GL_COMPRESSED_LUMINANCE_LATC1_EXT: u32 = 35952; +pub const GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT: u32 = 35953; +pub const GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: u32 = 35954; +pub const GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: u32 = 35955; +pub const GL_EXT_texture_compression_rgtc: u32 = 1; +pub const GL_COMPRESSED_RED_RGTC1_EXT: u32 = 36283; +pub const GL_COMPRESSED_SIGNED_RED_RGTC1_EXT: u32 = 36284; +pub const GL_COMPRESSED_RED_GREEN_RGTC2_EXT: u32 = 36285; +pub const GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: u32 = 36286; +pub const GL_EXT_texture_compression_s3tc: u32 = 1; +pub const GL_COMPRESSED_RGB_S3TC_DXT1_EXT: u32 = 33776; +pub const GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: u32 = 33777; +pub const GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: u32 = 33778; +pub const GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: u32 = 33779; +pub const GL_EXT_texture_cube_map: u32 = 1; +pub const GL_NORMAL_MAP_EXT: u32 = 34065; +pub const GL_REFLECTION_MAP_EXT: u32 = 34066; +pub const GL_TEXTURE_CUBE_MAP_EXT: u32 = 34067; +pub const GL_TEXTURE_BINDING_CUBE_MAP_EXT: u32 = 34068; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT: u32 = 34069; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT: u32 = 34070; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT: u32 = 34071; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT: u32 = 34072; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT: u32 = 34073; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT: u32 = 34074; +pub const GL_PROXY_TEXTURE_CUBE_MAP_EXT: u32 = 34075; +pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT: u32 = 34076; +pub const GL_EXT_texture_env_add: u32 = 1; +pub const GL_EXT_texture_env_combine: u32 = 1; +pub const GL_COMBINE_EXT: u32 = 34160; +pub const GL_COMBINE_RGB_EXT: u32 = 34161; +pub const GL_COMBINE_ALPHA_EXT: u32 = 34162; +pub const GL_RGB_SCALE_EXT: u32 = 34163; +pub const GL_ADD_SIGNED_EXT: u32 = 34164; +pub const GL_INTERPOLATE_EXT: u32 = 34165; +pub const GL_CONSTANT_EXT: u32 = 34166; +pub const GL_PRIMARY_COLOR_EXT: u32 = 34167; +pub const GL_PREVIOUS_EXT: u32 = 34168; +pub const GL_SOURCE0_RGB_EXT: u32 = 34176; +pub const GL_SOURCE1_RGB_EXT: u32 = 34177; +pub const GL_SOURCE2_RGB_EXT: u32 = 34178; +pub const GL_SOURCE0_ALPHA_EXT: u32 = 34184; +pub const GL_SOURCE1_ALPHA_EXT: u32 = 34185; +pub const GL_SOURCE2_ALPHA_EXT: u32 = 34186; +pub const GL_OPERAND0_RGB_EXT: u32 = 34192; +pub const GL_OPERAND1_RGB_EXT: u32 = 34193; +pub const GL_OPERAND2_RGB_EXT: u32 = 34194; +pub const GL_OPERAND0_ALPHA_EXT: u32 = 34200; +pub const GL_OPERAND1_ALPHA_EXT: u32 = 34201; +pub const GL_OPERAND2_ALPHA_EXT: u32 = 34202; +pub const GL_EXT_texture_env_dot3: u32 = 1; +pub const GL_DOT3_RGB_EXT: u32 = 34624; +pub const GL_DOT3_RGBA_EXT: u32 = 34625; +pub const GL_EXT_texture_filter_anisotropic: u32 = 1; +pub const GL_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 34046; +pub const GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 34047; +pub const GL_EXT_texture_filter_minmax: u32 = 1; +pub const GL_TEXTURE_REDUCTION_MODE_EXT: u32 = 37734; +pub const GL_WEIGHTED_AVERAGE_EXT: u32 = 37735; +pub const GL_EXT_texture_integer: u32 = 1; +pub const GL_RGBA32UI_EXT: u32 = 36208; +pub const GL_RGB32UI_EXT: u32 = 36209; +pub const GL_ALPHA32UI_EXT: u32 = 36210; +pub const GL_INTENSITY32UI_EXT: u32 = 36211; +pub const GL_LUMINANCE32UI_EXT: u32 = 36212; +pub const GL_LUMINANCE_ALPHA32UI_EXT: u32 = 36213; +pub const GL_RGBA16UI_EXT: u32 = 36214; +pub const GL_RGB16UI_EXT: u32 = 36215; +pub const GL_ALPHA16UI_EXT: u32 = 36216; +pub const GL_INTENSITY16UI_EXT: u32 = 36217; +pub const GL_LUMINANCE16UI_EXT: u32 = 36218; +pub const GL_LUMINANCE_ALPHA16UI_EXT: u32 = 36219; +pub const GL_RGBA8UI_EXT: u32 = 36220; +pub const GL_RGB8UI_EXT: u32 = 36221; +pub const GL_ALPHA8UI_EXT: u32 = 36222; +pub const GL_INTENSITY8UI_EXT: u32 = 36223; +pub const GL_LUMINANCE8UI_EXT: u32 = 36224; +pub const GL_LUMINANCE_ALPHA8UI_EXT: u32 = 36225; +pub const GL_RGBA32I_EXT: u32 = 36226; +pub const GL_RGB32I_EXT: u32 = 36227; +pub const GL_ALPHA32I_EXT: u32 = 36228; +pub const GL_INTENSITY32I_EXT: u32 = 36229; +pub const GL_LUMINANCE32I_EXT: u32 = 36230; +pub const GL_LUMINANCE_ALPHA32I_EXT: u32 = 36231; +pub const GL_RGBA16I_EXT: u32 = 36232; +pub const GL_RGB16I_EXT: u32 = 36233; +pub const GL_ALPHA16I_EXT: u32 = 36234; +pub const GL_INTENSITY16I_EXT: u32 = 36235; +pub const GL_LUMINANCE16I_EXT: u32 = 36236; +pub const GL_LUMINANCE_ALPHA16I_EXT: u32 = 36237; +pub const GL_RGBA8I_EXT: u32 = 36238; +pub const GL_RGB8I_EXT: u32 = 36239; +pub const GL_ALPHA8I_EXT: u32 = 36240; +pub const GL_INTENSITY8I_EXT: u32 = 36241; +pub const GL_LUMINANCE8I_EXT: u32 = 36242; +pub const GL_LUMINANCE_ALPHA8I_EXT: u32 = 36243; +pub const GL_RED_INTEGER_EXT: u32 = 36244; +pub const GL_GREEN_INTEGER_EXT: u32 = 36245; +pub const GL_BLUE_INTEGER_EXT: u32 = 36246; +pub const GL_ALPHA_INTEGER_EXT: u32 = 36247; +pub const GL_RGB_INTEGER_EXT: u32 = 36248; +pub const GL_RGBA_INTEGER_EXT: u32 = 36249; +pub const GL_BGR_INTEGER_EXT: u32 = 36250; +pub const GL_BGRA_INTEGER_EXT: u32 = 36251; +pub const GL_LUMINANCE_INTEGER_EXT: u32 = 36252; +pub const GL_LUMINANCE_ALPHA_INTEGER_EXT: u32 = 36253; +pub const GL_RGBA_INTEGER_MODE_EXT: u32 = 36254; +pub const GL_EXT_texture_lod_bias: u32 = 1; +pub const GL_MAX_TEXTURE_LOD_BIAS_EXT: u32 = 34045; +pub const GL_TEXTURE_FILTER_CONTROL_EXT: u32 = 34048; +pub const GL_TEXTURE_LOD_BIAS_EXT: u32 = 34049; +pub const GL_EXT_texture_mirror_clamp: u32 = 1; +pub const GL_MIRROR_CLAMP_EXT: u32 = 34626; +pub const GL_MIRROR_CLAMP_TO_EDGE_EXT: u32 = 34627; +pub const GL_MIRROR_CLAMP_TO_BORDER_EXT: u32 = 35090; +pub const GL_EXT_texture_object: u32 = 1; +pub const GL_TEXTURE_PRIORITY_EXT: u32 = 32870; +pub const GL_TEXTURE_RESIDENT_EXT: u32 = 32871; +pub const GL_TEXTURE_1D_BINDING_EXT: u32 = 32872; +pub const GL_TEXTURE_2D_BINDING_EXT: u32 = 32873; +pub const GL_TEXTURE_3D_BINDING_EXT: u32 = 32874; +pub const GL_EXT_texture_perturb_normal: u32 = 1; +pub const GL_PERTURB_EXT: u32 = 34222; +pub const GL_TEXTURE_NORMAL_EXT: u32 = 34223; +pub const GL_EXT_texture_sRGB: u32 = 1; +pub const GL_SRGB_EXT: u32 = 35904; +pub const GL_SRGB8_EXT: u32 = 35905; +pub const GL_SRGB_ALPHA_EXT: u32 = 35906; +pub const GL_SRGB8_ALPHA8_EXT: u32 = 35907; +pub const GL_SLUMINANCE_ALPHA_EXT: u32 = 35908; +pub const GL_SLUMINANCE8_ALPHA8_EXT: u32 = 35909; +pub const GL_SLUMINANCE_EXT: u32 = 35910; +pub const GL_SLUMINANCE8_EXT: u32 = 35911; +pub const GL_COMPRESSED_SRGB_EXT: u32 = 35912; +pub const GL_COMPRESSED_SRGB_ALPHA_EXT: u32 = 35913; +pub const GL_COMPRESSED_SLUMINANCE_EXT: u32 = 35914; +pub const GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: u32 = 35915; +pub const GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: u32 = 35916; +pub const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: u32 = 35917; +pub const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: u32 = 35918; +pub const GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: u32 = 35919; +pub const GL_EXT_texture_sRGB_R8: u32 = 1; +pub const GL_SR8_EXT: u32 = 36797; +pub const GL_EXT_texture_sRGB_decode: u32 = 1; +pub const GL_TEXTURE_SRGB_DECODE_EXT: u32 = 35400; +pub const GL_DECODE_EXT: u32 = 35401; +pub const GL_SKIP_DECODE_EXT: u32 = 35402; +pub const GL_EXT_texture_shadow_lod: u32 = 1; +pub const GL_EXT_texture_shared_exponent: u32 = 1; +pub const GL_RGB9_E5_EXT: u32 = 35901; +pub const GL_UNSIGNED_INT_5_9_9_9_REV_EXT: u32 = 35902; +pub const GL_TEXTURE_SHARED_SIZE_EXT: u32 = 35903; +pub const GL_EXT_texture_snorm: u32 = 1; +pub const GL_ALPHA_SNORM: u32 = 36880; +pub const GL_LUMINANCE_SNORM: u32 = 36881; +pub const GL_LUMINANCE_ALPHA_SNORM: u32 = 36882; +pub const GL_INTENSITY_SNORM: u32 = 36883; +pub const GL_ALPHA8_SNORM: u32 = 36884; +pub const GL_LUMINANCE8_SNORM: u32 = 36885; +pub const GL_LUMINANCE8_ALPHA8_SNORM: u32 = 36886; +pub const GL_INTENSITY8_SNORM: u32 = 36887; +pub const GL_ALPHA16_SNORM: u32 = 36888; +pub const GL_LUMINANCE16_SNORM: u32 = 36889; +pub const GL_LUMINANCE16_ALPHA16_SNORM: u32 = 36890; +pub const GL_INTENSITY16_SNORM: u32 = 36891; +pub const GL_RED_SNORM: u32 = 36752; +pub const GL_RG_SNORM: u32 = 36753; +pub const GL_RGB_SNORM: u32 = 36754; +pub const GL_RGBA_SNORM: u32 = 36755; +pub const GL_EXT_texture_swizzle: u32 = 1; +pub const GL_TEXTURE_SWIZZLE_R_EXT: u32 = 36418; +pub const GL_TEXTURE_SWIZZLE_G_EXT: u32 = 36419; +pub const GL_TEXTURE_SWIZZLE_B_EXT: u32 = 36420; +pub const GL_TEXTURE_SWIZZLE_A_EXT: u32 = 36421; +pub const GL_TEXTURE_SWIZZLE_RGBA_EXT: u32 = 36422; +pub const GL_EXT_timer_query: u32 = 1; +pub const GL_TIME_ELAPSED_EXT: u32 = 35007; +pub const GL_EXT_transform_feedback: u32 = 1; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_EXT: u32 = 35982; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT: u32 = 35972; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT: u32 = 35973; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT: u32 = 35983; +pub const GL_INTERLEAVED_ATTRIBS_EXT: u32 = 35980; +pub const GL_SEPARATE_ATTRIBS_EXT: u32 = 35981; +pub const GL_PRIMITIVES_GENERATED_EXT: u32 = 35975; +pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT: u32 = 35976; +pub const GL_RASTERIZER_DISCARD_EXT: u32 = 35977; +pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT: u32 = 35978; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT: u32 = 35979; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT: u32 = 35968; +pub const GL_TRANSFORM_FEEDBACK_VARYINGS_EXT: u32 = 35971; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT: u32 = 35967; +pub const GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT: u32 = 35958; +pub const GL_EXT_vertex_array: u32 = 1; +pub const GL_VERTEX_ARRAY_EXT: u32 = 32884; +pub const GL_NORMAL_ARRAY_EXT: u32 = 32885; +pub const GL_COLOR_ARRAY_EXT: u32 = 32886; +pub const GL_INDEX_ARRAY_EXT: u32 = 32887; +pub const GL_TEXTURE_COORD_ARRAY_EXT: u32 = 32888; +pub const GL_EDGE_FLAG_ARRAY_EXT: u32 = 32889; +pub const GL_VERTEX_ARRAY_SIZE_EXT: u32 = 32890; +pub const GL_VERTEX_ARRAY_TYPE_EXT: u32 = 32891; +pub const GL_VERTEX_ARRAY_STRIDE_EXT: u32 = 32892; +pub const GL_VERTEX_ARRAY_COUNT_EXT: u32 = 32893; +pub const GL_NORMAL_ARRAY_TYPE_EXT: u32 = 32894; +pub const GL_NORMAL_ARRAY_STRIDE_EXT: u32 = 32895; +pub const GL_NORMAL_ARRAY_COUNT_EXT: u32 = 32896; +pub const GL_COLOR_ARRAY_SIZE_EXT: u32 = 32897; +pub const GL_COLOR_ARRAY_TYPE_EXT: u32 = 32898; +pub const GL_COLOR_ARRAY_STRIDE_EXT: u32 = 32899; +pub const GL_COLOR_ARRAY_COUNT_EXT: u32 = 32900; +pub const GL_INDEX_ARRAY_TYPE_EXT: u32 = 32901; +pub const GL_INDEX_ARRAY_STRIDE_EXT: u32 = 32902; +pub const GL_INDEX_ARRAY_COUNT_EXT: u32 = 32903; +pub const GL_TEXTURE_COORD_ARRAY_SIZE_EXT: u32 = 32904; +pub const GL_TEXTURE_COORD_ARRAY_TYPE_EXT: u32 = 32905; +pub const GL_TEXTURE_COORD_ARRAY_STRIDE_EXT: u32 = 32906; +pub const GL_TEXTURE_COORD_ARRAY_COUNT_EXT: u32 = 32907; +pub const GL_EDGE_FLAG_ARRAY_STRIDE_EXT: u32 = 32908; +pub const GL_EDGE_FLAG_ARRAY_COUNT_EXT: u32 = 32909; +pub const GL_VERTEX_ARRAY_POINTER_EXT: u32 = 32910; +pub const GL_NORMAL_ARRAY_POINTER_EXT: u32 = 32911; +pub const GL_COLOR_ARRAY_POINTER_EXT: u32 = 32912; +pub const GL_INDEX_ARRAY_POINTER_EXT: u32 = 32913; +pub const GL_TEXTURE_COORD_ARRAY_POINTER_EXT: u32 = 32914; +pub const GL_EDGE_FLAG_ARRAY_POINTER_EXT: u32 = 32915; +pub const GL_EXT_vertex_array_bgra: u32 = 1; +pub const GL_EXT_vertex_attrib_64bit: u32 = 1; +pub const GL_DOUBLE_VEC2_EXT: u32 = 36860; +pub const GL_DOUBLE_VEC3_EXT: u32 = 36861; +pub const GL_DOUBLE_VEC4_EXT: u32 = 36862; +pub const GL_DOUBLE_MAT2_EXT: u32 = 36678; +pub const GL_DOUBLE_MAT3_EXT: u32 = 36679; +pub const GL_DOUBLE_MAT4_EXT: u32 = 36680; +pub const GL_DOUBLE_MAT2x3_EXT: u32 = 36681; +pub const GL_DOUBLE_MAT2x4_EXT: u32 = 36682; +pub const GL_DOUBLE_MAT3x2_EXT: u32 = 36683; +pub const GL_DOUBLE_MAT3x4_EXT: u32 = 36684; +pub const GL_DOUBLE_MAT4x2_EXT: u32 = 36685; +pub const GL_DOUBLE_MAT4x3_EXT: u32 = 36686; +pub const GL_EXT_vertex_shader: u32 = 1; +pub const GL_VERTEX_SHADER_EXT: u32 = 34688; +pub const GL_VERTEX_SHADER_BINDING_EXT: u32 = 34689; +pub const GL_OP_INDEX_EXT: u32 = 34690; +pub const GL_OP_NEGATE_EXT: u32 = 34691; +pub const GL_OP_DOT3_EXT: u32 = 34692; +pub const GL_OP_DOT4_EXT: u32 = 34693; +pub const GL_OP_MUL_EXT: u32 = 34694; +pub const GL_OP_ADD_EXT: u32 = 34695; +pub const GL_OP_MADD_EXT: u32 = 34696; +pub const GL_OP_FRAC_EXT: u32 = 34697; +pub const GL_OP_MAX_EXT: u32 = 34698; +pub const GL_OP_MIN_EXT: u32 = 34699; +pub const GL_OP_SET_GE_EXT: u32 = 34700; +pub const GL_OP_SET_LT_EXT: u32 = 34701; +pub const GL_OP_CLAMP_EXT: u32 = 34702; +pub const GL_OP_FLOOR_EXT: u32 = 34703; +pub const GL_OP_ROUND_EXT: u32 = 34704; +pub const GL_OP_EXP_BASE_2_EXT: u32 = 34705; +pub const GL_OP_LOG_BASE_2_EXT: u32 = 34706; +pub const GL_OP_POWER_EXT: u32 = 34707; +pub const GL_OP_RECIP_EXT: u32 = 34708; +pub const GL_OP_RECIP_SQRT_EXT: u32 = 34709; +pub const GL_OP_SUB_EXT: u32 = 34710; +pub const GL_OP_CROSS_PRODUCT_EXT: u32 = 34711; +pub const GL_OP_MULTIPLY_MATRIX_EXT: u32 = 34712; +pub const GL_OP_MOV_EXT: u32 = 34713; +pub const GL_OUTPUT_VERTEX_EXT: u32 = 34714; +pub const GL_OUTPUT_COLOR0_EXT: u32 = 34715; +pub const GL_OUTPUT_COLOR1_EXT: u32 = 34716; +pub const GL_OUTPUT_TEXTURE_COORD0_EXT: u32 = 34717; +pub const GL_OUTPUT_TEXTURE_COORD1_EXT: u32 = 34718; +pub const GL_OUTPUT_TEXTURE_COORD2_EXT: u32 = 34719; +pub const GL_OUTPUT_TEXTURE_COORD3_EXT: u32 = 34720; +pub const GL_OUTPUT_TEXTURE_COORD4_EXT: u32 = 34721; +pub const GL_OUTPUT_TEXTURE_COORD5_EXT: u32 = 34722; +pub const GL_OUTPUT_TEXTURE_COORD6_EXT: u32 = 34723; +pub const GL_OUTPUT_TEXTURE_COORD7_EXT: u32 = 34724; +pub const GL_OUTPUT_TEXTURE_COORD8_EXT: u32 = 34725; +pub const GL_OUTPUT_TEXTURE_COORD9_EXT: u32 = 34726; +pub const GL_OUTPUT_TEXTURE_COORD10_EXT: u32 = 34727; +pub const GL_OUTPUT_TEXTURE_COORD11_EXT: u32 = 34728; +pub const GL_OUTPUT_TEXTURE_COORD12_EXT: u32 = 34729; +pub const GL_OUTPUT_TEXTURE_COORD13_EXT: u32 = 34730; +pub const GL_OUTPUT_TEXTURE_COORD14_EXT: u32 = 34731; +pub const GL_OUTPUT_TEXTURE_COORD15_EXT: u32 = 34732; +pub const GL_OUTPUT_TEXTURE_COORD16_EXT: u32 = 34733; +pub const GL_OUTPUT_TEXTURE_COORD17_EXT: u32 = 34734; +pub const GL_OUTPUT_TEXTURE_COORD18_EXT: u32 = 34735; +pub const GL_OUTPUT_TEXTURE_COORD19_EXT: u32 = 34736; +pub const GL_OUTPUT_TEXTURE_COORD20_EXT: u32 = 34737; +pub const GL_OUTPUT_TEXTURE_COORD21_EXT: u32 = 34738; +pub const GL_OUTPUT_TEXTURE_COORD22_EXT: u32 = 34739; +pub const GL_OUTPUT_TEXTURE_COORD23_EXT: u32 = 34740; +pub const GL_OUTPUT_TEXTURE_COORD24_EXT: u32 = 34741; +pub const GL_OUTPUT_TEXTURE_COORD25_EXT: u32 = 34742; +pub const GL_OUTPUT_TEXTURE_COORD26_EXT: u32 = 34743; +pub const GL_OUTPUT_TEXTURE_COORD27_EXT: u32 = 34744; +pub const GL_OUTPUT_TEXTURE_COORD28_EXT: u32 = 34745; +pub const GL_OUTPUT_TEXTURE_COORD29_EXT: u32 = 34746; +pub const GL_OUTPUT_TEXTURE_COORD30_EXT: u32 = 34747; +pub const GL_OUTPUT_TEXTURE_COORD31_EXT: u32 = 34748; +pub const GL_OUTPUT_FOG_EXT: u32 = 34749; +pub const GL_SCALAR_EXT: u32 = 34750; +pub const GL_VECTOR_EXT: u32 = 34751; +pub const GL_MATRIX_EXT: u32 = 34752; +pub const GL_VARIANT_EXT: u32 = 34753; +pub const GL_INVARIANT_EXT: u32 = 34754; +pub const GL_LOCAL_CONSTANT_EXT: u32 = 34755; +pub const GL_LOCAL_EXT: u32 = 34756; +pub const GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT: u32 = 34757; +pub const GL_MAX_VERTEX_SHADER_VARIANTS_EXT: u32 = 34758; +pub const GL_MAX_VERTEX_SHADER_INVARIANTS_EXT: u32 = 34759; +pub const GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT: u32 = 34760; +pub const GL_MAX_VERTEX_SHADER_LOCALS_EXT: u32 = 34761; +pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT: u32 = 34762; +pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT: u32 = 34763; +pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT: u32 = 34764; +pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT: u32 = 34765; +pub const GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT: u32 = 34766; +pub const GL_VERTEX_SHADER_INSTRUCTIONS_EXT: u32 = 34767; +pub const GL_VERTEX_SHADER_VARIANTS_EXT: u32 = 34768; +pub const GL_VERTEX_SHADER_INVARIANTS_EXT: u32 = 34769; +pub const GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT: u32 = 34770; +pub const GL_VERTEX_SHADER_LOCALS_EXT: u32 = 34771; +pub const GL_VERTEX_SHADER_OPTIMIZED_EXT: u32 = 34772; +pub const GL_X_EXT: u32 = 34773; +pub const GL_Y_EXT: u32 = 34774; +pub const GL_Z_EXT: u32 = 34775; +pub const GL_W_EXT: u32 = 34776; +pub const GL_NEGATIVE_X_EXT: u32 = 34777; +pub const GL_NEGATIVE_Y_EXT: u32 = 34778; +pub const GL_NEGATIVE_Z_EXT: u32 = 34779; +pub const GL_NEGATIVE_W_EXT: u32 = 34780; +pub const GL_ZERO_EXT: u32 = 34781; +pub const GL_ONE_EXT: u32 = 34782; +pub const GL_NEGATIVE_ONE_EXT: u32 = 34783; +pub const GL_NORMALIZED_RANGE_EXT: u32 = 34784; +pub const GL_FULL_RANGE_EXT: u32 = 34785; +pub const GL_CURRENT_VERTEX_EXT: u32 = 34786; +pub const GL_MVP_MATRIX_EXT: u32 = 34787; +pub const GL_VARIANT_VALUE_EXT: u32 = 34788; +pub const GL_VARIANT_DATATYPE_EXT: u32 = 34789; +pub const GL_VARIANT_ARRAY_STRIDE_EXT: u32 = 34790; +pub const GL_VARIANT_ARRAY_TYPE_EXT: u32 = 34791; +pub const GL_VARIANT_ARRAY_EXT: u32 = 34792; +pub const GL_VARIANT_ARRAY_POINTER_EXT: u32 = 34793; +pub const GL_INVARIANT_VALUE_EXT: u32 = 34794; +pub const GL_INVARIANT_DATATYPE_EXT: u32 = 34795; +pub const GL_LOCAL_CONSTANT_VALUE_EXT: u32 = 34796; +pub const GL_LOCAL_CONSTANT_DATATYPE_EXT: u32 = 34797; +pub const GL_EXT_vertex_weighting: u32 = 1; +pub const GL_MODELVIEW0_STACK_DEPTH_EXT: u32 = 2979; +pub const GL_MODELVIEW1_STACK_DEPTH_EXT: u32 = 34050; +pub const GL_MODELVIEW0_MATRIX_EXT: u32 = 2982; +pub const GL_MODELVIEW1_MATRIX_EXT: u32 = 34054; +pub const GL_VERTEX_WEIGHTING_EXT: u32 = 34057; +pub const GL_MODELVIEW0_EXT: u32 = 5888; +pub const GL_MODELVIEW1_EXT: u32 = 34058; +pub const GL_CURRENT_VERTEX_WEIGHT_EXT: u32 = 34059; +pub const GL_VERTEX_WEIGHT_ARRAY_EXT: u32 = 34060; +pub const GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT: u32 = 34061; +pub const GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT: u32 = 34062; +pub const GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT: u32 = 34063; +pub const GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT: u32 = 34064; +pub const GL_EXT_win32_keyed_mutex: u32 = 1; +pub const GL_EXT_window_rectangles: u32 = 1; +pub const GL_INCLUSIVE_EXT: u32 = 36624; +pub const GL_EXCLUSIVE_EXT: u32 = 36625; +pub const GL_WINDOW_RECTANGLE_EXT: u32 = 36626; +pub const GL_WINDOW_RECTANGLE_MODE_EXT: u32 = 36627; +pub const GL_MAX_WINDOW_RECTANGLES_EXT: u32 = 36628; +pub const GL_NUM_WINDOW_RECTANGLES_EXT: u32 = 36629; +pub const GL_EXT_x11_sync_object: u32 = 1; +pub const GL_SYNC_X11_FENCE_EXT: u32 = 37089; +pub const GL_GREMEDY_frame_terminator: u32 = 1; +pub const GL_GREMEDY_string_marker: u32 = 1; +pub const GL_HP_convolution_border_modes: u32 = 1; +pub const GL_IGNORE_BORDER_HP: u32 = 33104; +pub const GL_CONSTANT_BORDER_HP: u32 = 33105; +pub const GL_REPLICATE_BORDER_HP: u32 = 33107; +pub const GL_CONVOLUTION_BORDER_COLOR_HP: u32 = 33108; +pub const GL_HP_image_transform: u32 = 1; +pub const GL_IMAGE_SCALE_X_HP: u32 = 33109; +pub const GL_IMAGE_SCALE_Y_HP: u32 = 33110; +pub const GL_IMAGE_TRANSLATE_X_HP: u32 = 33111; +pub const GL_IMAGE_TRANSLATE_Y_HP: u32 = 33112; +pub const GL_IMAGE_ROTATE_ANGLE_HP: u32 = 33113; +pub const GL_IMAGE_ROTATE_ORIGIN_X_HP: u32 = 33114; +pub const GL_IMAGE_ROTATE_ORIGIN_Y_HP: u32 = 33115; +pub const GL_IMAGE_MAG_FILTER_HP: u32 = 33116; +pub const GL_IMAGE_MIN_FILTER_HP: u32 = 33117; +pub const GL_IMAGE_CUBIC_WEIGHT_HP: u32 = 33118; +pub const GL_CUBIC_HP: u32 = 33119; +pub const GL_AVERAGE_HP: u32 = 33120; +pub const GL_IMAGE_TRANSFORM_2D_HP: u32 = 33121; +pub const GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP: u32 = 33122; +pub const GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP: u32 = 33123; +pub const GL_HP_occlusion_test: u32 = 1; +pub const GL_OCCLUSION_TEST_HP: u32 = 33125; +pub const GL_OCCLUSION_TEST_RESULT_HP: u32 = 33126; +pub const GL_HP_texture_lighting: u32 = 1; +pub const GL_TEXTURE_LIGHTING_MODE_HP: u32 = 33127; +pub const GL_TEXTURE_POST_SPECULAR_HP: u32 = 33128; +pub const GL_TEXTURE_PRE_SPECULAR_HP: u32 = 33129; +pub const GL_IBM_cull_vertex: u32 = 1; +pub const GL_CULL_VERTEX_IBM: u32 = 103050; +pub const GL_IBM_multimode_draw_arrays: u32 = 1; +pub const GL_IBM_rasterpos_clip: u32 = 1; +pub const GL_RASTER_POSITION_UNCLIPPED_IBM: u32 = 103010; +pub const GL_IBM_static_data: u32 = 1; +pub const GL_ALL_STATIC_DATA_IBM: u32 = 103060; +pub const GL_STATIC_VERTEX_ARRAY_IBM: u32 = 103061; +pub const GL_IBM_texture_mirrored_repeat: u32 = 1; +pub const GL_MIRRORED_REPEAT_IBM: u32 = 33648; +pub const GL_IBM_vertex_array_lists: u32 = 1; +pub const GL_VERTEX_ARRAY_LIST_IBM: u32 = 103070; +pub const GL_NORMAL_ARRAY_LIST_IBM: u32 = 103071; +pub const GL_COLOR_ARRAY_LIST_IBM: u32 = 103072; +pub const GL_INDEX_ARRAY_LIST_IBM: u32 = 103073; +pub const GL_TEXTURE_COORD_ARRAY_LIST_IBM: u32 = 103074; +pub const GL_EDGE_FLAG_ARRAY_LIST_IBM: u32 = 103075; +pub const GL_FOG_COORDINATE_ARRAY_LIST_IBM: u32 = 103076; +pub const GL_SECONDARY_COLOR_ARRAY_LIST_IBM: u32 = 103077; +pub const GL_VERTEX_ARRAY_LIST_STRIDE_IBM: u32 = 103080; +pub const GL_NORMAL_ARRAY_LIST_STRIDE_IBM: u32 = 103081; +pub const GL_COLOR_ARRAY_LIST_STRIDE_IBM: u32 = 103082; +pub const GL_INDEX_ARRAY_LIST_STRIDE_IBM: u32 = 103083; +pub const GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM: u32 = 103084; +pub const GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM: u32 = 103085; +pub const GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM: u32 = 103086; +pub const GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM: u32 = 103087; +pub const GL_INGR_blend_func_separate: u32 = 1; +pub const GL_INGR_color_clamp: u32 = 1; +pub const GL_RED_MIN_CLAMP_INGR: u32 = 34144; +pub const GL_GREEN_MIN_CLAMP_INGR: u32 = 34145; +pub const GL_BLUE_MIN_CLAMP_INGR: u32 = 34146; +pub const GL_ALPHA_MIN_CLAMP_INGR: u32 = 34147; +pub const GL_RED_MAX_CLAMP_INGR: u32 = 34148; +pub const GL_GREEN_MAX_CLAMP_INGR: u32 = 34149; +pub const GL_BLUE_MAX_CLAMP_INGR: u32 = 34150; +pub const GL_ALPHA_MAX_CLAMP_INGR: u32 = 34151; +pub const GL_INGR_interlace_read: u32 = 1; +pub const GL_INTERLACE_READ_INGR: u32 = 34152; +pub const GL_INTEL_blackhole_render: u32 = 1; +pub const GL_BLACKHOLE_RENDER_INTEL: u32 = 33788; +pub const GL_INTEL_conservative_rasterization: u32 = 1; +pub const GL_CONSERVATIVE_RASTERIZATION_INTEL: u32 = 33790; +pub const GL_INTEL_fragment_shader_ordering: u32 = 1; +pub const GL_INTEL_framebuffer_CMAA: u32 = 1; +pub const GL_INTEL_map_texture: u32 = 1; +pub const GL_TEXTURE_MEMORY_LAYOUT_INTEL: u32 = 33791; +pub const GL_LAYOUT_DEFAULT_INTEL: u32 = 0; +pub const GL_LAYOUT_LINEAR_INTEL: u32 = 1; +pub const GL_LAYOUT_LINEAR_CPU_CACHED_INTEL: u32 = 2; +pub const GL_INTEL_parallel_arrays: u32 = 1; +pub const GL_PARALLEL_ARRAYS_INTEL: u32 = 33780; +pub const GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL: u32 = 33781; +pub const GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL: u32 = 33782; +pub const GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL: u32 = 33783; +pub const GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL: u32 = 33784; +pub const GL_INTEL_performance_query: u32 = 1; +pub const GL_PERFQUERY_SINGLE_CONTEXT_INTEL: u32 = 0; +pub const GL_PERFQUERY_GLOBAL_CONTEXT_INTEL: u32 = 1; +pub const GL_PERFQUERY_WAIT_INTEL: u32 = 33787; +pub const GL_PERFQUERY_FLUSH_INTEL: u32 = 33786; +pub const GL_PERFQUERY_DONOT_FLUSH_INTEL: u32 = 33785; +pub const GL_PERFQUERY_COUNTER_EVENT_INTEL: u32 = 38128; +pub const GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL: u32 = 38129; +pub const GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL: u32 = 38130; +pub const GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL: u32 = 38131; +pub const GL_PERFQUERY_COUNTER_RAW_INTEL: u32 = 38132; +pub const GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL: u32 = 38133; +pub const GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL: u32 = 38136; +pub const GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL: u32 = 38137; +pub const GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL: u32 = 38138; +pub const GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL: u32 = 38139; +pub const GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL: u32 = 38140; +pub const GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL: u32 = 38141; +pub const GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL: u32 = 38142; +pub const GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL: u32 = 38143; +pub const GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL: u32 = 38144; +pub const GL_MESAX_texture_stack: u32 = 1; +pub const GL_TEXTURE_1D_STACK_MESAX: u32 = 34649; +pub const GL_TEXTURE_2D_STACK_MESAX: u32 = 34650; +pub const GL_PROXY_TEXTURE_1D_STACK_MESAX: u32 = 34651; +pub const GL_PROXY_TEXTURE_2D_STACK_MESAX: u32 = 34652; +pub const GL_TEXTURE_1D_STACK_BINDING_MESAX: u32 = 34653; +pub const GL_TEXTURE_2D_STACK_BINDING_MESAX: u32 = 34654; +pub const GL_MESA_framebuffer_flip_y: u32 = 1; +pub const GL_FRAMEBUFFER_FLIP_Y_MESA: u32 = 35771; +pub const GL_MESA_pack_invert: u32 = 1; +pub const GL_PACK_INVERT_MESA: u32 = 34648; +pub const GL_MESA_program_binary_formats: u32 = 1; +pub const GL_PROGRAM_BINARY_FORMAT_MESA: u32 = 34655; +pub const GL_MESA_resize_buffers: u32 = 1; +pub const GL_MESA_shader_integer_functions: u32 = 1; +pub const GL_MESA_tile_raster_order: u32 = 1; +pub const GL_TILE_RASTER_ORDER_FIXED_MESA: u32 = 35768; +pub const GL_TILE_RASTER_ORDER_INCREASING_X_MESA: u32 = 35769; +pub const GL_TILE_RASTER_ORDER_INCREASING_Y_MESA: u32 = 35770; +pub const GL_MESA_window_pos: u32 = 1; +pub const GL_MESA_ycbcr_texture: u32 = 1; +pub const GL_UNSIGNED_SHORT_8_8_MESA: u32 = 34234; +pub const GL_UNSIGNED_SHORT_8_8_REV_MESA: u32 = 34235; +pub const GL_YCBCR_MESA: u32 = 34647; +pub const GL_NVX_blend_equation_advanced_multi_draw_buffers: u32 = 1; +pub const GL_NVX_conditional_render: u32 = 1; +pub const GL_NVX_gpu_memory_info: u32 = 1; +pub const GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: u32 = 36935; +pub const GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: u32 = 36936; +pub const GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX: u32 = 36937; +pub const GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX: u32 = 36938; +pub const GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX: u32 = 36939; +pub const GL_NVX_gpu_multicast2: u32 = 1; +pub const GL_UPLOAD_GPU_MASK_NVX: u32 = 38218; +pub const GL_NVX_linked_gpu_multicast: u32 = 1; +pub const GL_LGPU_SEPARATE_STORAGE_BIT_NVX: u32 = 2048; +pub const GL_MAX_LGPU_GPUS_NVX: u32 = 37562; +pub const GL_NVX_progress_fence: u32 = 1; +pub const GL_NV_alpha_to_coverage_dither_control: u32 = 1; +pub const GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV: u32 = 37709; +pub const GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV: u32 = 37710; +pub const GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV: u32 = 37711; +pub const GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV: u32 = 37567; +pub const GL_NV_bindless_multi_draw_indirect: u32 = 1; +pub const GL_NV_bindless_multi_draw_indirect_count: u32 = 1; +pub const GL_NV_bindless_texture: u32 = 1; +pub const GL_NV_blend_equation_advanced: u32 = 1; +pub const GL_BLEND_OVERLAP_NV: u32 = 37505; +pub const GL_BLEND_PREMULTIPLIED_SRC_NV: u32 = 37504; +pub const GL_BLUE_NV: u32 = 6405; +pub const GL_COLORBURN_NV: u32 = 37530; +pub const GL_COLORDODGE_NV: u32 = 37529; +pub const GL_CONJOINT_NV: u32 = 37508; +pub const GL_CONTRAST_NV: u32 = 37537; +pub const GL_DARKEN_NV: u32 = 37527; +pub const GL_DIFFERENCE_NV: u32 = 37534; +pub const GL_DISJOINT_NV: u32 = 37507; +pub const GL_DST_ATOP_NV: u32 = 37519; +pub const GL_DST_IN_NV: u32 = 37515; +pub const GL_DST_NV: u32 = 37511; +pub const GL_DST_OUT_NV: u32 = 37517; +pub const GL_DST_OVER_NV: u32 = 37513; +pub const GL_EXCLUSION_NV: u32 = 37536; +pub const GL_GREEN_NV: u32 = 6404; +pub const GL_HARDLIGHT_NV: u32 = 37531; +pub const GL_HARDMIX_NV: u32 = 37545; +pub const GL_HSL_COLOR_NV: u32 = 37551; +pub const GL_HSL_HUE_NV: u32 = 37549; +pub const GL_HSL_LUMINOSITY_NV: u32 = 37552; +pub const GL_HSL_SATURATION_NV: u32 = 37550; +pub const GL_INVERT_OVG_NV: u32 = 37556; +pub const GL_INVERT_RGB_NV: u32 = 37539; +pub const GL_LIGHTEN_NV: u32 = 37528; +pub const GL_LINEARBURN_NV: u32 = 37541; +pub const GL_LINEARDODGE_NV: u32 = 37540; +pub const GL_LINEARLIGHT_NV: u32 = 37543; +pub const GL_MINUS_CLAMPED_NV: u32 = 37555; +pub const GL_MINUS_NV: u32 = 37535; +pub const GL_MULTIPLY_NV: u32 = 37524; +pub const GL_OVERLAY_NV: u32 = 37526; +pub const GL_PINLIGHT_NV: u32 = 37544; +pub const GL_PLUS_CLAMPED_ALPHA_NV: u32 = 37554; +pub const GL_PLUS_CLAMPED_NV: u32 = 37553; +pub const GL_PLUS_DARKER_NV: u32 = 37522; +pub const GL_PLUS_NV: u32 = 37521; +pub const GL_RED_NV: u32 = 6403; +pub const GL_SCREEN_NV: u32 = 37525; +pub const GL_SOFTLIGHT_NV: u32 = 37532; +pub const GL_SRC_ATOP_NV: u32 = 37518; +pub const GL_SRC_IN_NV: u32 = 37514; +pub const GL_SRC_NV: u32 = 37510; +pub const GL_SRC_OUT_NV: u32 = 37516; +pub const GL_SRC_OVER_NV: u32 = 37512; +pub const GL_UNCORRELATED_NV: u32 = 37506; +pub const GL_VIVIDLIGHT_NV: u32 = 37542; +pub const GL_XOR_NV: u32 = 5382; +pub const GL_NV_blend_equation_advanced_coherent: u32 = 1; +pub const GL_BLEND_ADVANCED_COHERENT_NV: u32 = 37509; +pub const GL_NV_blend_minmax_factor: u32 = 1; +pub const GL_NV_blend_square: u32 = 1; +pub const GL_NV_clip_space_w_scaling: u32 = 1; +pub const GL_VIEWPORT_POSITION_W_SCALE_NV: u32 = 37756; +pub const GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV: u32 = 37757; +pub const GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV: u32 = 37758; +pub const GL_NV_command_list: u32 = 1; +pub const GL_TERMINATE_SEQUENCE_COMMAND_NV: u32 = 0; +pub const GL_NOP_COMMAND_NV: u32 = 1; +pub const GL_DRAW_ELEMENTS_COMMAND_NV: u32 = 2; +pub const GL_DRAW_ARRAYS_COMMAND_NV: u32 = 3; +pub const GL_DRAW_ELEMENTS_STRIP_COMMAND_NV: u32 = 4; +pub const GL_DRAW_ARRAYS_STRIP_COMMAND_NV: u32 = 5; +pub const GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV: u32 = 6; +pub const GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV: u32 = 7; +pub const GL_ELEMENT_ADDRESS_COMMAND_NV: u32 = 8; +pub const GL_ATTRIBUTE_ADDRESS_COMMAND_NV: u32 = 9; +pub const GL_UNIFORM_ADDRESS_COMMAND_NV: u32 = 10; +pub const GL_BLEND_COLOR_COMMAND_NV: u32 = 11; +pub const GL_STENCIL_REF_COMMAND_NV: u32 = 12; +pub const GL_LINE_WIDTH_COMMAND_NV: u32 = 13; +pub const GL_POLYGON_OFFSET_COMMAND_NV: u32 = 14; +pub const GL_ALPHA_REF_COMMAND_NV: u32 = 15; +pub const GL_VIEWPORT_COMMAND_NV: u32 = 16; +pub const GL_SCISSOR_COMMAND_NV: u32 = 17; +pub const GL_FRONT_FACE_COMMAND_NV: u32 = 18; +pub const GL_NV_compute_program5: u32 = 1; +pub const GL_COMPUTE_PROGRAM_NV: u32 = 37115; +pub const GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV: u32 = 37116; +pub const GL_NV_compute_shader_derivatives: u32 = 1; +pub const GL_NV_conditional_render: u32 = 1; +pub const GL_QUERY_WAIT_NV: u32 = 36371; +pub const GL_QUERY_NO_WAIT_NV: u32 = 36372; +pub const GL_QUERY_BY_REGION_WAIT_NV: u32 = 36373; +pub const GL_QUERY_BY_REGION_NO_WAIT_NV: u32 = 36374; +pub const GL_NV_conservative_raster: u32 = 1; +pub const GL_CONSERVATIVE_RASTERIZATION_NV: u32 = 37702; +pub const GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV: u32 = 37703; +pub const GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV: u32 = 37704; +pub const GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV: u32 = 37705; +pub const GL_NV_conservative_raster_dilate: u32 = 1; +pub const GL_CONSERVATIVE_RASTER_DILATE_NV: u32 = 37753; +pub const GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV: u32 = 37754; +pub const GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV: u32 = 37755; +pub const GL_NV_conservative_raster_pre_snap: u32 = 1; +pub const GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV: u32 = 38224; +pub const GL_NV_conservative_raster_pre_snap_triangles: u32 = 1; +pub const GL_CONSERVATIVE_RASTER_MODE_NV: u32 = 38221; +pub const GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV: u32 = 38222; +pub const GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV: u32 = 38223; +pub const GL_NV_conservative_raster_underestimation: u32 = 1; +pub const GL_NV_copy_depth_to_color: u32 = 1; +pub const GL_DEPTH_STENCIL_TO_RGBA_NV: u32 = 34926; +pub const GL_DEPTH_STENCIL_TO_BGRA_NV: u32 = 34927; +pub const GL_NV_copy_image: u32 = 1; +pub const GL_NV_deep_texture3D: u32 = 1; +pub const GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV: u32 = 37072; +pub const GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV: u32 = 37073; +pub const GL_NV_depth_buffer_float: u32 = 1; +pub const GL_DEPTH_COMPONENT32F_NV: u32 = 36267; +pub const GL_DEPTH32F_STENCIL8_NV: u32 = 36268; +pub const GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV: u32 = 36269; +pub const GL_DEPTH_BUFFER_FLOAT_MODE_NV: u32 = 36271; +pub const GL_NV_depth_clamp: u32 = 1; +pub const GL_DEPTH_CLAMP_NV: u32 = 34383; +pub const GL_NV_draw_texture: u32 = 1; +pub const GL_NV_draw_vulkan_image: u32 = 1; +pub const GL_NV_evaluators: u32 = 1; +pub const GL_EVAL_2D_NV: u32 = 34496; +pub const GL_EVAL_TRIANGULAR_2D_NV: u32 = 34497; +pub const GL_MAP_TESSELLATION_NV: u32 = 34498; +pub const GL_MAP_ATTRIB_U_ORDER_NV: u32 = 34499; +pub const GL_MAP_ATTRIB_V_ORDER_NV: u32 = 34500; +pub const GL_EVAL_FRACTIONAL_TESSELLATION_NV: u32 = 34501; +pub const GL_EVAL_VERTEX_ATTRIB0_NV: u32 = 34502; +pub const GL_EVAL_VERTEX_ATTRIB1_NV: u32 = 34503; +pub const GL_EVAL_VERTEX_ATTRIB2_NV: u32 = 34504; +pub const GL_EVAL_VERTEX_ATTRIB3_NV: u32 = 34505; +pub const GL_EVAL_VERTEX_ATTRIB4_NV: u32 = 34506; +pub const GL_EVAL_VERTEX_ATTRIB5_NV: u32 = 34507; +pub const GL_EVAL_VERTEX_ATTRIB6_NV: u32 = 34508; +pub const GL_EVAL_VERTEX_ATTRIB7_NV: u32 = 34509; +pub const GL_EVAL_VERTEX_ATTRIB8_NV: u32 = 34510; +pub const GL_EVAL_VERTEX_ATTRIB9_NV: u32 = 34511; +pub const GL_EVAL_VERTEX_ATTRIB10_NV: u32 = 34512; +pub const GL_EVAL_VERTEX_ATTRIB11_NV: u32 = 34513; +pub const GL_EVAL_VERTEX_ATTRIB12_NV: u32 = 34514; +pub const GL_EVAL_VERTEX_ATTRIB13_NV: u32 = 34515; +pub const GL_EVAL_VERTEX_ATTRIB14_NV: u32 = 34516; +pub const GL_EVAL_VERTEX_ATTRIB15_NV: u32 = 34517; +pub const GL_MAX_MAP_TESSELLATION_NV: u32 = 34518; +pub const GL_MAX_RATIONAL_EVAL_ORDER_NV: u32 = 34519; +pub const GL_NV_explicit_multisample: u32 = 1; +pub const GL_SAMPLE_POSITION_NV: u32 = 36432; +pub const GL_SAMPLE_MASK_NV: u32 = 36433; +pub const GL_SAMPLE_MASK_VALUE_NV: u32 = 36434; +pub const GL_TEXTURE_BINDING_RENDERBUFFER_NV: u32 = 36435; +pub const GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV: u32 = 36436; +pub const GL_TEXTURE_RENDERBUFFER_NV: u32 = 36437; +pub const GL_SAMPLER_RENDERBUFFER_NV: u32 = 36438; +pub const GL_INT_SAMPLER_RENDERBUFFER_NV: u32 = 36439; +pub const GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV: u32 = 36440; +pub const GL_MAX_SAMPLE_MASK_WORDS_NV: u32 = 36441; +pub const GL_NV_fence: u32 = 1; +pub const GL_ALL_COMPLETED_NV: u32 = 34034; +pub const GL_FENCE_STATUS_NV: u32 = 34035; +pub const GL_FENCE_CONDITION_NV: u32 = 34036; +pub const GL_NV_fill_rectangle: u32 = 1; +pub const GL_FILL_RECTANGLE_NV: u32 = 37692; +pub const GL_NV_float_buffer: u32 = 1; +pub const GL_FLOAT_R_NV: u32 = 34944; +pub const GL_FLOAT_RG_NV: u32 = 34945; +pub const GL_FLOAT_RGB_NV: u32 = 34946; +pub const GL_FLOAT_RGBA_NV: u32 = 34947; +pub const GL_FLOAT_R16_NV: u32 = 34948; +pub const GL_FLOAT_R32_NV: u32 = 34949; +pub const GL_FLOAT_RG16_NV: u32 = 34950; +pub const GL_FLOAT_RG32_NV: u32 = 34951; +pub const GL_FLOAT_RGB16_NV: u32 = 34952; +pub const GL_FLOAT_RGB32_NV: u32 = 34953; +pub const GL_FLOAT_RGBA16_NV: u32 = 34954; +pub const GL_FLOAT_RGBA32_NV: u32 = 34955; +pub const GL_TEXTURE_FLOAT_COMPONENTS_NV: u32 = 34956; +pub const GL_FLOAT_CLEAR_COLOR_VALUE_NV: u32 = 34957; +pub const GL_FLOAT_RGBA_MODE_NV: u32 = 34958; +pub const GL_NV_fog_distance: u32 = 1; +pub const GL_FOG_DISTANCE_MODE_NV: u32 = 34138; +pub const GL_EYE_RADIAL_NV: u32 = 34139; +pub const GL_EYE_PLANE_ABSOLUTE_NV: u32 = 34140; +pub const GL_NV_fragment_coverage_to_color: u32 = 1; +pub const GL_FRAGMENT_COVERAGE_TO_COLOR_NV: u32 = 37597; +pub const GL_FRAGMENT_COVERAGE_COLOR_NV: u32 = 37598; +pub const GL_NV_fragment_program: u32 = 1; +pub const GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: u32 = 34920; +pub const GL_FRAGMENT_PROGRAM_NV: u32 = 34928; +pub const GL_MAX_TEXTURE_COORDS_NV: u32 = 34929; +pub const GL_MAX_TEXTURE_IMAGE_UNITS_NV: u32 = 34930; +pub const GL_FRAGMENT_PROGRAM_BINDING_NV: u32 = 34931; +pub const GL_PROGRAM_ERROR_STRING_NV: u32 = 34932; +pub const GL_NV_fragment_program2: u32 = 1; +pub const GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV: u32 = 35060; +pub const GL_MAX_PROGRAM_CALL_DEPTH_NV: u32 = 35061; +pub const GL_MAX_PROGRAM_IF_DEPTH_NV: u32 = 35062; +pub const GL_MAX_PROGRAM_LOOP_DEPTH_NV: u32 = 35063; +pub const GL_MAX_PROGRAM_LOOP_COUNT_NV: u32 = 35064; +pub const GL_NV_fragment_program4: u32 = 1; +pub const GL_NV_fragment_program_option: u32 = 1; +pub const GL_NV_fragment_shader_barycentric: u32 = 1; +pub const GL_NV_fragment_shader_interlock: u32 = 1; +pub const GL_NV_framebuffer_mixed_samples: u32 = 1; +pub const GL_COVERAGE_MODULATION_TABLE_NV: u32 = 37681; +pub const GL_COLOR_SAMPLES_NV: u32 = 36384; +pub const GL_DEPTH_SAMPLES_NV: u32 = 37677; +pub const GL_STENCIL_SAMPLES_NV: u32 = 37678; +pub const GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV: u32 = 37679; +pub const GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV: u32 = 37680; +pub const GL_COVERAGE_MODULATION_NV: u32 = 37682; +pub const GL_COVERAGE_MODULATION_TABLE_SIZE_NV: u32 = 37683; +pub const GL_NV_framebuffer_multisample_coverage: u32 = 1; +pub const GL_RENDERBUFFER_COVERAGE_SAMPLES_NV: u32 = 36011; +pub const GL_RENDERBUFFER_COLOR_SAMPLES_NV: u32 = 36368; +pub const GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV: u32 = 36369; +pub const GL_MULTISAMPLE_COVERAGE_MODES_NV: u32 = 36370; +pub const GL_NV_geometry_program4: u32 = 1; +pub const GL_GEOMETRY_PROGRAM_NV: u32 = 35878; +pub const GL_MAX_PROGRAM_OUTPUT_VERTICES_NV: u32 = 35879; +pub const GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV: u32 = 35880; +pub const GL_NV_geometry_shader4: u32 = 1; +pub const GL_NV_geometry_shader_passthrough: u32 = 1; +pub const GL_NV_gpu_multicast: u32 = 1; +pub const GL_PER_GPU_STORAGE_BIT_NV: u32 = 2048; +pub const GL_MULTICAST_GPUS_NV: u32 = 37562; +pub const GL_RENDER_GPU_MASK_NV: u32 = 38232; +pub const GL_PER_GPU_STORAGE_NV: u32 = 38216; +pub const GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV: u32 = 38217; +pub const GL_NV_gpu_program4: u32 = 1; +pub const GL_MIN_PROGRAM_TEXEL_OFFSET_NV: u32 = 35076; +pub const GL_MAX_PROGRAM_TEXEL_OFFSET_NV: u32 = 35077; +pub const GL_PROGRAM_ATTRIB_COMPONENTS_NV: u32 = 35078; +pub const GL_PROGRAM_RESULT_COMPONENTS_NV: u32 = 35079; +pub const GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV: u32 = 35080; +pub const GL_MAX_PROGRAM_RESULT_COMPONENTS_NV: u32 = 35081; +pub const GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV: u32 = 36261; +pub const GL_MAX_PROGRAM_GENERIC_RESULTS_NV: u32 = 36262; +pub const GL_NV_gpu_program5: u32 = 1; +pub const GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV: u32 = 36442; +pub const GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV: u32 = 36443; +pub const GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV: u32 = 36444; +pub const GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV: u32 = 36445; +pub const GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV: u32 = 36446; +pub const GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV: u32 = 36447; +pub const GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV: u32 = 36676; +pub const GL_MAX_PROGRAM_SUBROUTINE_NUM_NV: u32 = 36677; +pub const GL_NV_gpu_program5_mem_extended: u32 = 1; +pub const GL_NV_gpu_shader5: u32 = 1; +pub const GL_NV_half_float: u32 = 1; +pub const GL_HALF_FLOAT_NV: u32 = 5131; +pub const GL_NV_internalformat_sample_query: u32 = 1; +pub const GL_MULTISAMPLES_NV: u32 = 37745; +pub const GL_SUPERSAMPLE_SCALE_X_NV: u32 = 37746; +pub const GL_SUPERSAMPLE_SCALE_Y_NV: u32 = 37747; +pub const GL_CONFORMANT_NV: u32 = 37748; +pub const GL_NV_light_max_exponent: u32 = 1; +pub const GL_MAX_SHININESS_NV: u32 = 34052; +pub const GL_MAX_SPOT_EXPONENT_NV: u32 = 34053; +pub const GL_NV_memory_attachment: u32 = 1; +pub const GL_ATTACHED_MEMORY_OBJECT_NV: u32 = 38308; +pub const GL_ATTACHED_MEMORY_OFFSET_NV: u32 = 38309; +pub const GL_MEMORY_ATTACHABLE_ALIGNMENT_NV: u32 = 38310; +pub const GL_MEMORY_ATTACHABLE_SIZE_NV: u32 = 38311; +pub const GL_MEMORY_ATTACHABLE_NV: u32 = 38312; +pub const GL_DETACHED_MEMORY_INCARNATION_NV: u32 = 38313; +pub const GL_DETACHED_TEXTURES_NV: u32 = 38314; +pub const GL_DETACHED_BUFFERS_NV: u32 = 38315; +pub const GL_MAX_DETACHED_TEXTURES_NV: u32 = 38316; +pub const GL_MAX_DETACHED_BUFFERS_NV: u32 = 38317; +pub const GL_NV_mesh_shader: u32 = 1; +pub const GL_MESH_SHADER_NV: u32 = 38233; +pub const GL_TASK_SHADER_NV: u32 = 38234; +pub const GL_MAX_MESH_UNIFORM_BLOCKS_NV: u32 = 36448; +pub const GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV: u32 = 36449; +pub const GL_MAX_MESH_IMAGE_UNIFORMS_NV: u32 = 36450; +pub const GL_MAX_MESH_UNIFORM_COMPONENTS_NV: u32 = 36451; +pub const GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV: u32 = 36452; +pub const GL_MAX_MESH_ATOMIC_COUNTERS_NV: u32 = 36453; +pub const GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV: u32 = 36454; +pub const GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV: u32 = 36455; +pub const GL_MAX_TASK_UNIFORM_BLOCKS_NV: u32 = 36456; +pub const GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV: u32 = 36457; +pub const GL_MAX_TASK_IMAGE_UNIFORMS_NV: u32 = 36458; +pub const GL_MAX_TASK_UNIFORM_COMPONENTS_NV: u32 = 36459; +pub const GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV: u32 = 36460; +pub const GL_MAX_TASK_ATOMIC_COUNTERS_NV: u32 = 36461; +pub const GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV: u32 = 36462; +pub const GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV: u32 = 36463; +pub const GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV: u32 = 38306; +pub const GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV: u32 = 38307; +pub const GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV: u32 = 38198; +pub const GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV: u32 = 38199; +pub const GL_MAX_MESH_OUTPUT_VERTICES_NV: u32 = 38200; +pub const GL_MAX_MESH_OUTPUT_PRIMITIVES_NV: u32 = 38201; +pub const GL_MAX_TASK_OUTPUT_COUNT_NV: u32 = 38202; +pub const GL_MAX_DRAW_MESH_TASKS_COUNT_NV: u32 = 38205; +pub const GL_MAX_MESH_VIEWS_NV: u32 = 38231; +pub const GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV: u32 = 37599; +pub const GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV: u32 = 38211; +pub const GL_MAX_MESH_WORK_GROUP_SIZE_NV: u32 = 38203; +pub const GL_MAX_TASK_WORK_GROUP_SIZE_NV: u32 = 38204; +pub const GL_MESH_WORK_GROUP_SIZE_NV: u32 = 38206; +pub const GL_TASK_WORK_GROUP_SIZE_NV: u32 = 38207; +pub const GL_MESH_VERTICES_OUT_NV: u32 = 38265; +pub const GL_MESH_PRIMITIVES_OUT_NV: u32 = 38266; +pub const GL_MESH_OUTPUT_TYPE_NV: u32 = 38267; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV: u32 = 38300; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV: u32 = 38301; +pub const GL_REFERENCED_BY_MESH_SHADER_NV: u32 = 38304; +pub const GL_REFERENCED_BY_TASK_SHADER_NV: u32 = 38305; +pub const GL_MESH_SHADER_BIT_NV: u32 = 64; +pub const GL_TASK_SHADER_BIT_NV: u32 = 128; +pub const GL_MESH_SUBROUTINE_NV: u32 = 38268; +pub const GL_TASK_SUBROUTINE_NV: u32 = 38269; +pub const GL_MESH_SUBROUTINE_UNIFORM_NV: u32 = 38270; +pub const GL_TASK_SUBROUTINE_UNIFORM_NV: u32 = 38271; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV: u32 = 38302; +pub const GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV: u32 = 38303; +pub const GL_NV_multisample_coverage: u32 = 1; +pub const GL_NV_multisample_filter_hint: u32 = 1; +pub const GL_MULTISAMPLE_FILTER_HINT_NV: u32 = 34100; +pub const GL_NV_occlusion_query: u32 = 1; +pub const GL_PIXEL_COUNTER_BITS_NV: u32 = 34916; +pub const GL_CURRENT_OCCLUSION_QUERY_ID_NV: u32 = 34917; +pub const GL_PIXEL_COUNT_NV: u32 = 34918; +pub const GL_PIXEL_COUNT_AVAILABLE_NV: u32 = 34919; +pub const GL_NV_packed_depth_stencil: u32 = 1; +pub const GL_DEPTH_STENCIL_NV: u32 = 34041; +pub const GL_UNSIGNED_INT_24_8_NV: u32 = 34042; +pub const GL_NV_parameter_buffer_object: u32 = 1; +pub const GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV: u32 = 36256; +pub const GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV: u32 = 36257; +pub const GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV: u32 = 36258; +pub const GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV: u32 = 36259; +pub const GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV: u32 = 36260; +pub const GL_NV_parameter_buffer_object2: u32 = 1; +pub const GL_NV_path_rendering: u32 = 1; +pub const GL_PATH_FORMAT_SVG_NV: u32 = 36976; +pub const GL_PATH_FORMAT_PS_NV: u32 = 36977; +pub const GL_STANDARD_FONT_NAME_NV: u32 = 36978; +pub const GL_SYSTEM_FONT_NAME_NV: u32 = 36979; +pub const GL_FILE_NAME_NV: u32 = 36980; +pub const GL_PATH_STROKE_WIDTH_NV: u32 = 36981; +pub const GL_PATH_END_CAPS_NV: u32 = 36982; +pub const GL_PATH_INITIAL_END_CAP_NV: u32 = 36983; +pub const GL_PATH_TERMINAL_END_CAP_NV: u32 = 36984; +pub const GL_PATH_JOIN_STYLE_NV: u32 = 36985; +pub const GL_PATH_MITER_LIMIT_NV: u32 = 36986; +pub const GL_PATH_DASH_CAPS_NV: u32 = 36987; +pub const GL_PATH_INITIAL_DASH_CAP_NV: u32 = 36988; +pub const GL_PATH_TERMINAL_DASH_CAP_NV: u32 = 36989; +pub const GL_PATH_DASH_OFFSET_NV: u32 = 36990; +pub const GL_PATH_CLIENT_LENGTH_NV: u32 = 36991; +pub const GL_PATH_FILL_MODE_NV: u32 = 36992; +pub const GL_PATH_FILL_MASK_NV: u32 = 36993; +pub const GL_PATH_FILL_COVER_MODE_NV: u32 = 36994; +pub const GL_PATH_STROKE_COVER_MODE_NV: u32 = 36995; +pub const GL_PATH_STROKE_MASK_NV: u32 = 36996; +pub const GL_COUNT_UP_NV: u32 = 37000; +pub const GL_COUNT_DOWN_NV: u32 = 37001; +pub const GL_PATH_OBJECT_BOUNDING_BOX_NV: u32 = 37002; +pub const GL_CONVEX_HULL_NV: u32 = 37003; +pub const GL_BOUNDING_BOX_NV: u32 = 37005; +pub const GL_TRANSLATE_X_NV: u32 = 37006; +pub const GL_TRANSLATE_Y_NV: u32 = 37007; +pub const GL_TRANSLATE_2D_NV: u32 = 37008; +pub const GL_TRANSLATE_3D_NV: u32 = 37009; +pub const GL_AFFINE_2D_NV: u32 = 37010; +pub const GL_AFFINE_3D_NV: u32 = 37012; +pub const GL_TRANSPOSE_AFFINE_2D_NV: u32 = 37014; +pub const GL_TRANSPOSE_AFFINE_3D_NV: u32 = 37016; +pub const GL_UTF8_NV: u32 = 37018; +pub const GL_UTF16_NV: u32 = 37019; +pub const GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV: u32 = 37020; +pub const GL_PATH_COMMAND_COUNT_NV: u32 = 37021; +pub const GL_PATH_COORD_COUNT_NV: u32 = 37022; +pub const GL_PATH_DASH_ARRAY_COUNT_NV: u32 = 37023; +pub const GL_PATH_COMPUTED_LENGTH_NV: u32 = 37024; +pub const GL_PATH_FILL_BOUNDING_BOX_NV: u32 = 37025; +pub const GL_PATH_STROKE_BOUNDING_BOX_NV: u32 = 37026; +pub const GL_SQUARE_NV: u32 = 37027; +pub const GL_ROUND_NV: u32 = 37028; +pub const GL_TRIANGULAR_NV: u32 = 37029; +pub const GL_BEVEL_NV: u32 = 37030; +pub const GL_MITER_REVERT_NV: u32 = 37031; +pub const GL_MITER_TRUNCATE_NV: u32 = 37032; +pub const GL_SKIP_MISSING_GLYPH_NV: u32 = 37033; +pub const GL_USE_MISSING_GLYPH_NV: u32 = 37034; +pub const GL_PATH_ERROR_POSITION_NV: u32 = 37035; +pub const GL_ACCUM_ADJACENT_PAIRS_NV: u32 = 37037; +pub const GL_ADJACENT_PAIRS_NV: u32 = 37038; +pub const GL_FIRST_TO_REST_NV: u32 = 37039; +pub const GL_PATH_GEN_MODE_NV: u32 = 37040; +pub const GL_PATH_GEN_COEFF_NV: u32 = 37041; +pub const GL_PATH_GEN_COMPONENTS_NV: u32 = 37043; +pub const GL_PATH_STENCIL_FUNC_NV: u32 = 37047; +pub const GL_PATH_STENCIL_REF_NV: u32 = 37048; +pub const GL_PATH_STENCIL_VALUE_MASK_NV: u32 = 37049; +pub const GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV: u32 = 37053; +pub const GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV: u32 = 37054; +pub const GL_PATH_COVER_DEPTH_FUNC_NV: u32 = 37055; +pub const GL_PATH_DASH_OFFSET_RESET_NV: u32 = 37044; +pub const GL_MOVE_TO_RESETS_NV: u32 = 37045; +pub const GL_MOVE_TO_CONTINUES_NV: u32 = 37046; +pub const GL_CLOSE_PATH_NV: u32 = 0; +pub const GL_MOVE_TO_NV: u32 = 2; +pub const GL_RELATIVE_MOVE_TO_NV: u32 = 3; +pub const GL_LINE_TO_NV: u32 = 4; +pub const GL_RELATIVE_LINE_TO_NV: u32 = 5; +pub const GL_HORIZONTAL_LINE_TO_NV: u32 = 6; +pub const GL_RELATIVE_HORIZONTAL_LINE_TO_NV: u32 = 7; +pub const GL_VERTICAL_LINE_TO_NV: u32 = 8; +pub const GL_RELATIVE_VERTICAL_LINE_TO_NV: u32 = 9; +pub const GL_QUADRATIC_CURVE_TO_NV: u32 = 10; +pub const GL_RELATIVE_QUADRATIC_CURVE_TO_NV: u32 = 11; +pub const GL_CUBIC_CURVE_TO_NV: u32 = 12; +pub const GL_RELATIVE_CUBIC_CURVE_TO_NV: u32 = 13; +pub const GL_SMOOTH_QUADRATIC_CURVE_TO_NV: u32 = 14; +pub const GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV: u32 = 15; +pub const GL_SMOOTH_CUBIC_CURVE_TO_NV: u32 = 16; +pub const GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV: u32 = 17; +pub const GL_SMALL_CCW_ARC_TO_NV: u32 = 18; +pub const GL_RELATIVE_SMALL_CCW_ARC_TO_NV: u32 = 19; +pub const GL_SMALL_CW_ARC_TO_NV: u32 = 20; +pub const GL_RELATIVE_SMALL_CW_ARC_TO_NV: u32 = 21; +pub const GL_LARGE_CCW_ARC_TO_NV: u32 = 22; +pub const GL_RELATIVE_LARGE_CCW_ARC_TO_NV: u32 = 23; +pub const GL_LARGE_CW_ARC_TO_NV: u32 = 24; +pub const GL_RELATIVE_LARGE_CW_ARC_TO_NV: u32 = 25; +pub const GL_RESTART_PATH_NV: u32 = 240; +pub const GL_DUP_FIRST_CUBIC_CURVE_TO_NV: u32 = 242; +pub const GL_DUP_LAST_CUBIC_CURVE_TO_NV: u32 = 244; +pub const GL_RECT_NV: u32 = 246; +pub const GL_CIRCULAR_CCW_ARC_TO_NV: u32 = 248; +pub const GL_CIRCULAR_CW_ARC_TO_NV: u32 = 250; +pub const GL_CIRCULAR_TANGENT_ARC_TO_NV: u32 = 252; +pub const GL_ARC_TO_NV: u32 = 254; +pub const GL_RELATIVE_ARC_TO_NV: u32 = 255; +pub const GL_BOLD_BIT_NV: u32 = 1; +pub const GL_ITALIC_BIT_NV: u32 = 2; +pub const GL_GLYPH_WIDTH_BIT_NV: u32 = 1; +pub const GL_GLYPH_HEIGHT_BIT_NV: u32 = 2; +pub const GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV: u32 = 4; +pub const GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV: u32 = 8; +pub const GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV: u32 = 16; +pub const GL_GLYPH_VERTICAL_BEARING_X_BIT_NV: u32 = 32; +pub const GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV: u32 = 64; +pub const GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV: u32 = 128; +pub const GL_GLYPH_HAS_KERNING_BIT_NV: u32 = 256; +pub const GL_FONT_X_MIN_BOUNDS_BIT_NV: u32 = 65536; +pub const GL_FONT_Y_MIN_BOUNDS_BIT_NV: u32 = 131072; +pub const GL_FONT_X_MAX_BOUNDS_BIT_NV: u32 = 262144; +pub const GL_FONT_Y_MAX_BOUNDS_BIT_NV: u32 = 524288; +pub const GL_FONT_UNITS_PER_EM_BIT_NV: u32 = 1048576; +pub const GL_FONT_ASCENDER_BIT_NV: u32 = 2097152; +pub const GL_FONT_DESCENDER_BIT_NV: u32 = 4194304; +pub const GL_FONT_HEIGHT_BIT_NV: u32 = 8388608; +pub const GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV: u32 = 16777216; +pub const GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV: u32 = 33554432; +pub const GL_FONT_UNDERLINE_POSITION_BIT_NV: u32 = 67108864; +pub const GL_FONT_UNDERLINE_THICKNESS_BIT_NV: u32 = 134217728; +pub const GL_FONT_HAS_KERNING_BIT_NV: u32 = 268435456; +pub const GL_ROUNDED_RECT_NV: u32 = 232; +pub const GL_RELATIVE_ROUNDED_RECT_NV: u32 = 233; +pub const GL_ROUNDED_RECT2_NV: u32 = 234; +pub const GL_RELATIVE_ROUNDED_RECT2_NV: u32 = 235; +pub const GL_ROUNDED_RECT4_NV: u32 = 236; +pub const GL_RELATIVE_ROUNDED_RECT4_NV: u32 = 237; +pub const GL_ROUNDED_RECT8_NV: u32 = 238; +pub const GL_RELATIVE_ROUNDED_RECT8_NV: u32 = 239; +pub const GL_RELATIVE_RECT_NV: u32 = 247; +pub const GL_FONT_GLYPHS_AVAILABLE_NV: u32 = 37736; +pub const GL_FONT_TARGET_UNAVAILABLE_NV: u32 = 37737; +pub const GL_FONT_UNAVAILABLE_NV: u32 = 37738; +pub const GL_FONT_UNINTELLIGIBLE_NV: u32 = 37739; +pub const GL_CONIC_CURVE_TO_NV: u32 = 26; +pub const GL_RELATIVE_CONIC_CURVE_TO_NV: u32 = 27; +pub const GL_FONT_NUM_GLYPH_INDICES_BIT_NV: u32 = 536870912; +pub const GL_STANDARD_FONT_FORMAT_NV: u32 = 37740; +pub const GL_2_BYTES_NV: u32 = 5127; +pub const GL_3_BYTES_NV: u32 = 5128; +pub const GL_4_BYTES_NV: u32 = 5129; +pub const GL_EYE_LINEAR_NV: u32 = 9216; +pub const GL_OBJECT_LINEAR_NV: u32 = 9217; +pub const GL_CONSTANT_NV: u32 = 34166; +pub const GL_PATH_FOG_GEN_MODE_NV: u32 = 37036; +pub const GL_PRIMARY_COLOR_NV: u32 = 34092; +pub const GL_SECONDARY_COLOR_NV: u32 = 34093; +pub const GL_PATH_GEN_COLOR_FORMAT_NV: u32 = 37042; +pub const GL_PATH_PROJECTION_NV: u32 = 5889; +pub const GL_PATH_MODELVIEW_NV: u32 = 5888; +pub const GL_PATH_MODELVIEW_STACK_DEPTH_NV: u32 = 2979; +pub const GL_PATH_MODELVIEW_MATRIX_NV: u32 = 2982; +pub const GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV: u32 = 3382; +pub const GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV: u32 = 34019; +pub const GL_PATH_PROJECTION_STACK_DEPTH_NV: u32 = 2980; +pub const GL_PATH_PROJECTION_MATRIX_NV: u32 = 2983; +pub const GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV: u32 = 3384; +pub const GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV: u32 = 34020; +pub const GL_FRAGMENT_INPUT_NV: u32 = 37741; +pub const GL_NV_path_rendering_shared_edge: u32 = 1; +pub const GL_SHARED_EDGE_NV: u32 = 192; +pub const GL_NV_pixel_data_range: u32 = 1; +pub const GL_WRITE_PIXEL_DATA_RANGE_NV: u32 = 34936; +pub const GL_READ_PIXEL_DATA_RANGE_NV: u32 = 34937; +pub const GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV: u32 = 34938; +pub const GL_READ_PIXEL_DATA_RANGE_LENGTH_NV: u32 = 34939; +pub const GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV: u32 = 34940; +pub const GL_READ_PIXEL_DATA_RANGE_POINTER_NV: u32 = 34941; +pub const GL_NV_point_sprite: u32 = 1; +pub const GL_POINT_SPRITE_NV: u32 = 34913; +pub const GL_COORD_REPLACE_NV: u32 = 34914; +pub const GL_POINT_SPRITE_R_MODE_NV: u32 = 34915; +pub const GL_NV_present_video: u32 = 1; +pub const GL_FRAME_NV: u32 = 36390; +pub const GL_FIELDS_NV: u32 = 36391; +pub const GL_CURRENT_TIME_NV: u32 = 36392; +pub const GL_NUM_FILL_STREAMS_NV: u32 = 36393; +pub const GL_PRESENT_TIME_NV: u32 = 36394; +pub const GL_PRESENT_DURATION_NV: u32 = 36395; +pub const GL_NV_primitive_restart: u32 = 1; +pub const GL_PRIMITIVE_RESTART_NV: u32 = 34136; +pub const GL_PRIMITIVE_RESTART_INDEX_NV: u32 = 34137; +pub const GL_NV_query_resource: u32 = 1; +pub const GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV: u32 = 38208; +pub const GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV: u32 = 38210; +pub const GL_QUERY_RESOURCE_SYS_RESERVED_NV: u32 = 38212; +pub const GL_QUERY_RESOURCE_TEXTURE_NV: u32 = 38213; +pub const GL_QUERY_RESOURCE_RENDERBUFFER_NV: u32 = 38214; +pub const GL_QUERY_RESOURCE_BUFFEROBJECT_NV: u32 = 38215; +pub const GL_NV_query_resource_tag: u32 = 1; +pub const GL_NV_register_combiners: u32 = 1; +pub const GL_REGISTER_COMBINERS_NV: u32 = 34082; +pub const GL_VARIABLE_A_NV: u32 = 34083; +pub const GL_VARIABLE_B_NV: u32 = 34084; +pub const GL_VARIABLE_C_NV: u32 = 34085; +pub const GL_VARIABLE_D_NV: u32 = 34086; +pub const GL_VARIABLE_E_NV: u32 = 34087; +pub const GL_VARIABLE_F_NV: u32 = 34088; +pub const GL_VARIABLE_G_NV: u32 = 34089; +pub const GL_CONSTANT_COLOR0_NV: u32 = 34090; +pub const GL_CONSTANT_COLOR1_NV: u32 = 34091; +pub const GL_SPARE0_NV: u32 = 34094; +pub const GL_SPARE1_NV: u32 = 34095; +pub const GL_DISCARD_NV: u32 = 34096; +pub const GL_E_TIMES_F_NV: u32 = 34097; +pub const GL_SPARE0_PLUS_SECONDARY_COLOR_NV: u32 = 34098; +pub const GL_UNSIGNED_IDENTITY_NV: u32 = 34102; +pub const GL_UNSIGNED_INVERT_NV: u32 = 34103; +pub const GL_EXPAND_NORMAL_NV: u32 = 34104; +pub const GL_EXPAND_NEGATE_NV: u32 = 34105; +pub const GL_HALF_BIAS_NORMAL_NV: u32 = 34106; +pub const GL_HALF_BIAS_NEGATE_NV: u32 = 34107; +pub const GL_SIGNED_IDENTITY_NV: u32 = 34108; +pub const GL_SIGNED_NEGATE_NV: u32 = 34109; +pub const GL_SCALE_BY_TWO_NV: u32 = 34110; +pub const GL_SCALE_BY_FOUR_NV: u32 = 34111; +pub const GL_SCALE_BY_ONE_HALF_NV: u32 = 34112; +pub const GL_BIAS_BY_NEGATIVE_ONE_HALF_NV: u32 = 34113; +pub const GL_COMBINER_INPUT_NV: u32 = 34114; +pub const GL_COMBINER_MAPPING_NV: u32 = 34115; +pub const GL_COMBINER_COMPONENT_USAGE_NV: u32 = 34116; +pub const GL_COMBINER_AB_DOT_PRODUCT_NV: u32 = 34117; +pub const GL_COMBINER_CD_DOT_PRODUCT_NV: u32 = 34118; +pub const GL_COMBINER_MUX_SUM_NV: u32 = 34119; +pub const GL_COMBINER_SCALE_NV: u32 = 34120; +pub const GL_COMBINER_BIAS_NV: u32 = 34121; +pub const GL_COMBINER_AB_OUTPUT_NV: u32 = 34122; +pub const GL_COMBINER_CD_OUTPUT_NV: u32 = 34123; +pub const GL_COMBINER_SUM_OUTPUT_NV: u32 = 34124; +pub const GL_MAX_GENERAL_COMBINERS_NV: u32 = 34125; +pub const GL_NUM_GENERAL_COMBINERS_NV: u32 = 34126; +pub const GL_COLOR_SUM_CLAMP_NV: u32 = 34127; +pub const GL_COMBINER0_NV: u32 = 34128; +pub const GL_COMBINER1_NV: u32 = 34129; +pub const GL_COMBINER2_NV: u32 = 34130; +pub const GL_COMBINER3_NV: u32 = 34131; +pub const GL_COMBINER4_NV: u32 = 34132; +pub const GL_COMBINER5_NV: u32 = 34133; +pub const GL_COMBINER6_NV: u32 = 34134; +pub const GL_COMBINER7_NV: u32 = 34135; +pub const GL_NV_register_combiners2: u32 = 1; +pub const GL_PER_STAGE_CONSTANTS_NV: u32 = 34101; +pub const GL_NV_representative_fragment_test: u32 = 1; +pub const GL_REPRESENTATIVE_FRAGMENT_TEST_NV: u32 = 37759; +pub const GL_NV_robustness_video_memory_purge: u32 = 1; +pub const GL_PURGED_CONTEXT_RESET_NV: u32 = 37563; +pub const GL_NV_sample_locations: u32 = 1; +pub const GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV: u32 = 37693; +pub const GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV: u32 = 37694; +pub const GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV: u32 = 37695; +pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV: u32 = 37696; +pub const GL_SAMPLE_LOCATION_NV: u32 = 36432; +pub const GL_PROGRAMMABLE_SAMPLE_LOCATION_NV: u32 = 37697; +pub const GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV: u32 = 37698; +pub const GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV: u32 = 37699; +pub const GL_NV_sample_mask_override_coverage: u32 = 1; +pub const GL_NV_scissor_exclusive: u32 = 1; +pub const GL_SCISSOR_TEST_EXCLUSIVE_NV: u32 = 38229; +pub const GL_SCISSOR_BOX_EXCLUSIVE_NV: u32 = 38230; +pub const GL_NV_shader_atomic_counters: u32 = 1; +pub const GL_NV_shader_atomic_float: u32 = 1; +pub const GL_NV_shader_atomic_float64: u32 = 1; +pub const GL_NV_shader_atomic_fp16_vector: u32 = 1; +pub const GL_NV_shader_atomic_int64: u32 = 1; +pub const GL_NV_shader_buffer_load: u32 = 1; +pub const GL_BUFFER_GPU_ADDRESS_NV: u32 = 36637; +pub const GL_GPU_ADDRESS_NV: u32 = 36660; +pub const GL_MAX_SHADER_BUFFER_ADDRESS_NV: u32 = 36661; +pub const GL_NV_shader_buffer_store: u32 = 1; +pub const GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV: u32 = 16; +pub const GL_NV_shader_storage_buffer_object: u32 = 1; +pub const GL_NV_shader_subgroup_partitioned: u32 = 1; +pub const GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV: u32 = 256; +pub const GL_NV_shader_texture_footprint: u32 = 1; +pub const GL_NV_shader_thread_group: u32 = 1; +pub const GL_WARP_SIZE_NV: u32 = 37689; +pub const GL_WARPS_PER_SM_NV: u32 = 37690; +pub const GL_SM_COUNT_NV: u32 = 37691; +pub const GL_NV_shader_thread_shuffle: u32 = 1; +pub const GL_NV_shading_rate_image: u32 = 1; +pub const GL_SHADING_RATE_IMAGE_NV: u32 = 38243; +pub const GL_SHADING_RATE_NO_INVOCATIONS_NV: u32 = 38244; +pub const GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV: u32 = 38245; +pub const GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV: u32 = 38246; +pub const GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV: u32 = 38247; +pub const GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV: u32 = 38248; +pub const GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV: u32 = 38249; +pub const GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV: u32 = 38250; +pub const GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV: u32 = 38251; +pub const GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV: u32 = 38252; +pub const GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV: u32 = 38253; +pub const GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV: u32 = 38254; +pub const GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV: u32 = 38255; +pub const GL_SHADING_RATE_IMAGE_BINDING_NV: u32 = 38235; +pub const GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV: u32 = 38236; +pub const GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV: u32 = 38237; +pub const GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV: u32 = 38238; +pub const GL_MAX_COARSE_FRAGMENT_SAMPLES_NV: u32 = 38239; +pub const GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV: u32 = 38318; +pub const GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV: u32 = 38319; +pub const GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV: u32 = 38320; +pub const GL_NV_stereo_view_rendering: u32 = 1; +pub const GL_NV_tessellation_program5: u32 = 1; +pub const GL_MAX_PROGRAM_PATCH_ATTRIBS_NV: u32 = 34520; +pub const GL_TESS_CONTROL_PROGRAM_NV: u32 = 35102; +pub const GL_TESS_EVALUATION_PROGRAM_NV: u32 = 35103; +pub const GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV: u32 = 35956; +pub const GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV: u32 = 35957; +pub const GL_NV_texgen_emboss: u32 = 1; +pub const GL_EMBOSS_LIGHT_NV: u32 = 34141; +pub const GL_EMBOSS_CONSTANT_NV: u32 = 34142; +pub const GL_EMBOSS_MAP_NV: u32 = 34143; +pub const GL_NV_texgen_reflection: u32 = 1; +pub const GL_NORMAL_MAP_NV: u32 = 34065; +pub const GL_REFLECTION_MAP_NV: u32 = 34066; +pub const GL_NV_texture_barrier: u32 = 1; +pub const GL_NV_texture_compression_vtc: u32 = 1; +pub const GL_NV_texture_env_combine4: u32 = 1; +pub const GL_COMBINE4_NV: u32 = 34051; +pub const GL_SOURCE3_RGB_NV: u32 = 34179; +pub const GL_SOURCE3_ALPHA_NV: u32 = 34187; +pub const GL_OPERAND3_RGB_NV: u32 = 34195; +pub const GL_OPERAND3_ALPHA_NV: u32 = 34203; +pub const GL_NV_texture_expand_normal: u32 = 1; +pub const GL_TEXTURE_UNSIGNED_REMAP_MODE_NV: u32 = 34959; +pub const GL_NV_texture_multisample: u32 = 1; +pub const GL_TEXTURE_COVERAGE_SAMPLES_NV: u32 = 36933; +pub const GL_TEXTURE_COLOR_SAMPLES_NV: u32 = 36934; +pub const GL_NV_texture_rectangle: u32 = 1; +pub const GL_TEXTURE_RECTANGLE_NV: u32 = 34037; +pub const GL_TEXTURE_BINDING_RECTANGLE_NV: u32 = 34038; +pub const GL_PROXY_TEXTURE_RECTANGLE_NV: u32 = 34039; +pub const GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: u32 = 34040; +pub const GL_NV_texture_rectangle_compressed: u32 = 1; +pub const GL_NV_texture_shader: u32 = 1; +pub const GL_OFFSET_TEXTURE_RECTANGLE_NV: u32 = 34380; +pub const GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV: u32 = 34381; +pub const GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV: u32 = 34382; +pub const GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV: u32 = 34521; +pub const GL_UNSIGNED_INT_S8_S8_8_8_NV: u32 = 34522; +pub const GL_UNSIGNED_INT_8_8_S8_S8_REV_NV: u32 = 34523; +pub const GL_DSDT_MAG_INTENSITY_NV: u32 = 34524; +pub const GL_SHADER_CONSISTENT_NV: u32 = 34525; +pub const GL_TEXTURE_SHADER_NV: u32 = 34526; +pub const GL_SHADER_OPERATION_NV: u32 = 34527; +pub const GL_CULL_MODES_NV: u32 = 34528; +pub const GL_OFFSET_TEXTURE_MATRIX_NV: u32 = 34529; +pub const GL_OFFSET_TEXTURE_SCALE_NV: u32 = 34530; +pub const GL_OFFSET_TEXTURE_BIAS_NV: u32 = 34531; +pub const GL_OFFSET_TEXTURE_2D_MATRIX_NV: u32 = 34529; +pub const GL_OFFSET_TEXTURE_2D_SCALE_NV: u32 = 34530; +pub const GL_OFFSET_TEXTURE_2D_BIAS_NV: u32 = 34531; +pub const GL_PREVIOUS_TEXTURE_INPUT_NV: u32 = 34532; +pub const GL_CONST_EYE_NV: u32 = 34533; +pub const GL_PASS_THROUGH_NV: u32 = 34534; +pub const GL_CULL_FRAGMENT_NV: u32 = 34535; +pub const GL_OFFSET_TEXTURE_2D_NV: u32 = 34536; +pub const GL_DEPENDENT_AR_TEXTURE_2D_NV: u32 = 34537; +pub const GL_DEPENDENT_GB_TEXTURE_2D_NV: u32 = 34538; +pub const GL_DOT_PRODUCT_NV: u32 = 34540; +pub const GL_DOT_PRODUCT_DEPTH_REPLACE_NV: u32 = 34541; +pub const GL_DOT_PRODUCT_TEXTURE_2D_NV: u32 = 34542; +pub const GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV: u32 = 34544; +pub const GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV: u32 = 34545; +pub const GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV: u32 = 34546; +pub const GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV: u32 = 34547; +pub const GL_HILO_NV: u32 = 34548; +pub const GL_DSDT_NV: u32 = 34549; +pub const GL_DSDT_MAG_NV: u32 = 34550; +pub const GL_DSDT_MAG_VIB_NV: u32 = 34551; +pub const GL_HILO16_NV: u32 = 34552; +pub const GL_SIGNED_HILO_NV: u32 = 34553; +pub const GL_SIGNED_HILO16_NV: u32 = 34554; +pub const GL_SIGNED_RGBA_NV: u32 = 34555; +pub const GL_SIGNED_RGBA8_NV: u32 = 34556; +pub const GL_SIGNED_RGB_NV: u32 = 34558; +pub const GL_SIGNED_RGB8_NV: u32 = 34559; +pub const GL_SIGNED_LUMINANCE_NV: u32 = 34561; +pub const GL_SIGNED_LUMINANCE8_NV: u32 = 34562; +pub const GL_SIGNED_LUMINANCE_ALPHA_NV: u32 = 34563; +pub const GL_SIGNED_LUMINANCE8_ALPHA8_NV: u32 = 34564; +pub const GL_SIGNED_ALPHA_NV: u32 = 34565; +pub const GL_SIGNED_ALPHA8_NV: u32 = 34566; +pub const GL_SIGNED_INTENSITY_NV: u32 = 34567; +pub const GL_SIGNED_INTENSITY8_NV: u32 = 34568; +pub const GL_DSDT8_NV: u32 = 34569; +pub const GL_DSDT8_MAG8_NV: u32 = 34570; +pub const GL_DSDT8_MAG8_INTENSITY8_NV: u32 = 34571; +pub const GL_SIGNED_RGB_UNSIGNED_ALPHA_NV: u32 = 34572; +pub const GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV: u32 = 34573; +pub const GL_HI_SCALE_NV: u32 = 34574; +pub const GL_LO_SCALE_NV: u32 = 34575; +pub const GL_DS_SCALE_NV: u32 = 34576; +pub const GL_DT_SCALE_NV: u32 = 34577; +pub const GL_MAGNITUDE_SCALE_NV: u32 = 34578; +pub const GL_VIBRANCE_SCALE_NV: u32 = 34579; +pub const GL_HI_BIAS_NV: u32 = 34580; +pub const GL_LO_BIAS_NV: u32 = 34581; +pub const GL_DS_BIAS_NV: u32 = 34582; +pub const GL_DT_BIAS_NV: u32 = 34583; +pub const GL_MAGNITUDE_BIAS_NV: u32 = 34584; +pub const GL_VIBRANCE_BIAS_NV: u32 = 34585; +pub const GL_TEXTURE_BORDER_VALUES_NV: u32 = 34586; +pub const GL_TEXTURE_HI_SIZE_NV: u32 = 34587; +pub const GL_TEXTURE_LO_SIZE_NV: u32 = 34588; +pub const GL_TEXTURE_DS_SIZE_NV: u32 = 34589; +pub const GL_TEXTURE_DT_SIZE_NV: u32 = 34590; +pub const GL_TEXTURE_MAG_SIZE_NV: u32 = 34591; +pub const GL_NV_texture_shader2: u32 = 1; +pub const GL_DOT_PRODUCT_TEXTURE_3D_NV: u32 = 34543; +pub const GL_NV_texture_shader3: u32 = 1; +pub const GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV: u32 = 34896; +pub const GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV: u32 = 34897; +pub const GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV: u32 = 34898; +pub const GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV: u32 = 34899; +pub const GL_OFFSET_HILO_TEXTURE_2D_NV: u32 = 34900; +pub const GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV: u32 = 34901; +pub const GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV: u32 = 34902; +pub const GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV: u32 = 34903; +pub const GL_DEPENDENT_HILO_TEXTURE_2D_NV: u32 = 34904; +pub const GL_DEPENDENT_RGB_TEXTURE_3D_NV: u32 = 34905; +pub const GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV: u32 = 34906; +pub const GL_DOT_PRODUCT_PASS_THROUGH_NV: u32 = 34907; +pub const GL_DOT_PRODUCT_TEXTURE_1D_NV: u32 = 34908; +pub const GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV: u32 = 34909; +pub const GL_HILO8_NV: u32 = 34910; +pub const GL_SIGNED_HILO8_NV: u32 = 34911; +pub const GL_FORCE_BLUE_TO_ONE_NV: u32 = 34912; +pub const GL_NV_transform_feedback: u32 = 1; +pub const GL_BACK_PRIMARY_COLOR_NV: u32 = 35959; +pub const GL_BACK_SECONDARY_COLOR_NV: u32 = 35960; +pub const GL_TEXTURE_COORD_NV: u32 = 35961; +pub const GL_CLIP_DISTANCE_NV: u32 = 35962; +pub const GL_VERTEX_ID_NV: u32 = 35963; +pub const GL_PRIMITIVE_ID_NV: u32 = 35964; +pub const GL_GENERIC_ATTRIB_NV: u32 = 35965; +pub const GL_TRANSFORM_FEEDBACK_ATTRIBS_NV: u32 = 35966; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV: u32 = 35967; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV: u32 = 35968; +pub const GL_ACTIVE_VARYINGS_NV: u32 = 35969; +pub const GL_ACTIVE_VARYING_MAX_LENGTH_NV: u32 = 35970; +pub const GL_TRANSFORM_FEEDBACK_VARYINGS_NV: u32 = 35971; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_START_NV: u32 = 35972; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV: u32 = 35973; +pub const GL_TRANSFORM_FEEDBACK_RECORD_NV: u32 = 35974; +pub const GL_PRIMITIVES_GENERATED_NV: u32 = 35975; +pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV: u32 = 35976; +pub const GL_RASTERIZER_DISCARD_NV: u32 = 35977; +pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV: u32 = 35978; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV: u32 = 35979; +pub const GL_INTERLEAVED_ATTRIBS_NV: u32 = 35980; +pub const GL_SEPARATE_ATTRIBS_NV: u32 = 35981; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_NV: u32 = 35982; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV: u32 = 35983; +pub const GL_LAYER_NV: u32 = 36266; +pub const GL_NEXT_BUFFER_NV: i32 = -2; +pub const GL_SKIP_COMPONENTS4_NV: i32 = -3; +pub const GL_SKIP_COMPONENTS3_NV: i32 = -4; +pub const GL_SKIP_COMPONENTS2_NV: i32 = -5; +pub const GL_SKIP_COMPONENTS1_NV: i32 = -6; +pub const GL_NV_transform_feedback2: u32 = 1; +pub const GL_TRANSFORM_FEEDBACK_NV: u32 = 36386; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV: u32 = 36387; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV: u32 = 36388; +pub const GL_TRANSFORM_FEEDBACK_BINDING_NV: u32 = 36389; +pub const GL_NV_uniform_buffer_unified_memory: u32 = 1; +pub const GL_UNIFORM_BUFFER_UNIFIED_NV: u32 = 37742; +pub const GL_UNIFORM_BUFFER_ADDRESS_NV: u32 = 37743; +pub const GL_UNIFORM_BUFFER_LENGTH_NV: u32 = 37744; +pub const GL_NV_vdpau_interop: u32 = 1; +pub const GL_SURFACE_STATE_NV: u32 = 34539; +pub const GL_SURFACE_REGISTERED_NV: u32 = 34557; +pub const GL_SURFACE_MAPPED_NV: u32 = 34560; +pub const GL_WRITE_DISCARD_NV: u32 = 35006; +pub const GL_NV_vdpau_interop2: u32 = 1; +pub const GL_NV_vertex_array_range: u32 = 1; +pub const GL_VERTEX_ARRAY_RANGE_NV: u32 = 34077; +pub const GL_VERTEX_ARRAY_RANGE_LENGTH_NV: u32 = 34078; +pub const GL_VERTEX_ARRAY_RANGE_VALID_NV: u32 = 34079; +pub const GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV: u32 = 34080; +pub const GL_VERTEX_ARRAY_RANGE_POINTER_NV: u32 = 34081; +pub const GL_NV_vertex_array_range2: u32 = 1; +pub const GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV: u32 = 34099; +pub const GL_NV_vertex_attrib_integer_64bit: u32 = 1; +pub const GL_NV_vertex_buffer_unified_memory: u32 = 1; +pub const GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV: u32 = 36638; +pub const GL_ELEMENT_ARRAY_UNIFIED_NV: u32 = 36639; +pub const GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV: u32 = 36640; +pub const GL_VERTEX_ARRAY_ADDRESS_NV: u32 = 36641; +pub const GL_NORMAL_ARRAY_ADDRESS_NV: u32 = 36642; +pub const GL_COLOR_ARRAY_ADDRESS_NV: u32 = 36643; +pub const GL_INDEX_ARRAY_ADDRESS_NV: u32 = 36644; +pub const GL_TEXTURE_COORD_ARRAY_ADDRESS_NV: u32 = 36645; +pub const GL_EDGE_FLAG_ARRAY_ADDRESS_NV: u32 = 36646; +pub const GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV: u32 = 36647; +pub const GL_FOG_COORD_ARRAY_ADDRESS_NV: u32 = 36648; +pub const GL_ELEMENT_ARRAY_ADDRESS_NV: u32 = 36649; +pub const GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV: u32 = 36650; +pub const GL_VERTEX_ARRAY_LENGTH_NV: u32 = 36651; +pub const GL_NORMAL_ARRAY_LENGTH_NV: u32 = 36652; +pub const GL_COLOR_ARRAY_LENGTH_NV: u32 = 36653; +pub const GL_INDEX_ARRAY_LENGTH_NV: u32 = 36654; +pub const GL_TEXTURE_COORD_ARRAY_LENGTH_NV: u32 = 36655; +pub const GL_EDGE_FLAG_ARRAY_LENGTH_NV: u32 = 36656; +pub const GL_SECONDARY_COLOR_ARRAY_LENGTH_NV: u32 = 36657; +pub const GL_FOG_COORD_ARRAY_LENGTH_NV: u32 = 36658; +pub const GL_ELEMENT_ARRAY_LENGTH_NV: u32 = 36659; +pub const GL_DRAW_INDIRECT_UNIFIED_NV: u32 = 36672; +pub const GL_DRAW_INDIRECT_ADDRESS_NV: u32 = 36673; +pub const GL_DRAW_INDIRECT_LENGTH_NV: u32 = 36674; +pub const GL_NV_vertex_program: u32 = 1; +pub const GL_VERTEX_PROGRAM_NV: u32 = 34336; +pub const GL_VERTEX_STATE_PROGRAM_NV: u32 = 34337; +pub const GL_ATTRIB_ARRAY_SIZE_NV: u32 = 34339; +pub const GL_ATTRIB_ARRAY_STRIDE_NV: u32 = 34340; +pub const GL_ATTRIB_ARRAY_TYPE_NV: u32 = 34341; +pub const GL_CURRENT_ATTRIB_NV: u32 = 34342; +pub const GL_PROGRAM_LENGTH_NV: u32 = 34343; +pub const GL_PROGRAM_STRING_NV: u32 = 34344; +pub const GL_MODELVIEW_PROJECTION_NV: u32 = 34345; +pub const GL_IDENTITY_NV: u32 = 34346; +pub const GL_INVERSE_NV: u32 = 34347; +pub const GL_TRANSPOSE_NV: u32 = 34348; +pub const GL_INVERSE_TRANSPOSE_NV: u32 = 34349; +pub const GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV: u32 = 34350; +pub const GL_MAX_TRACK_MATRICES_NV: u32 = 34351; +pub const GL_MATRIX0_NV: u32 = 34352; +pub const GL_MATRIX1_NV: u32 = 34353; +pub const GL_MATRIX2_NV: u32 = 34354; +pub const GL_MATRIX3_NV: u32 = 34355; +pub const GL_MATRIX4_NV: u32 = 34356; +pub const GL_MATRIX5_NV: u32 = 34357; +pub const GL_MATRIX6_NV: u32 = 34358; +pub const GL_MATRIX7_NV: u32 = 34359; +pub const GL_CURRENT_MATRIX_STACK_DEPTH_NV: u32 = 34368; +pub const GL_CURRENT_MATRIX_NV: u32 = 34369; +pub const GL_VERTEX_PROGRAM_POINT_SIZE_NV: u32 = 34370; +pub const GL_VERTEX_PROGRAM_TWO_SIDE_NV: u32 = 34371; +pub const GL_PROGRAM_PARAMETER_NV: u32 = 34372; +pub const GL_ATTRIB_ARRAY_POINTER_NV: u32 = 34373; +pub const GL_PROGRAM_TARGET_NV: u32 = 34374; +pub const GL_PROGRAM_RESIDENT_NV: u32 = 34375; +pub const GL_TRACK_MATRIX_NV: u32 = 34376; +pub const GL_TRACK_MATRIX_TRANSFORM_NV: u32 = 34377; +pub const GL_VERTEX_PROGRAM_BINDING_NV: u32 = 34378; +pub const GL_PROGRAM_ERROR_POSITION_NV: u32 = 34379; +pub const GL_VERTEX_ATTRIB_ARRAY0_NV: u32 = 34384; +pub const GL_VERTEX_ATTRIB_ARRAY1_NV: u32 = 34385; +pub const GL_VERTEX_ATTRIB_ARRAY2_NV: u32 = 34386; +pub const GL_VERTEX_ATTRIB_ARRAY3_NV: u32 = 34387; +pub const GL_VERTEX_ATTRIB_ARRAY4_NV: u32 = 34388; +pub const GL_VERTEX_ATTRIB_ARRAY5_NV: u32 = 34389; +pub const GL_VERTEX_ATTRIB_ARRAY6_NV: u32 = 34390; +pub const GL_VERTEX_ATTRIB_ARRAY7_NV: u32 = 34391; +pub const GL_VERTEX_ATTRIB_ARRAY8_NV: u32 = 34392; +pub const GL_VERTEX_ATTRIB_ARRAY9_NV: u32 = 34393; +pub const GL_VERTEX_ATTRIB_ARRAY10_NV: u32 = 34394; +pub const GL_VERTEX_ATTRIB_ARRAY11_NV: u32 = 34395; +pub const GL_VERTEX_ATTRIB_ARRAY12_NV: u32 = 34396; +pub const GL_VERTEX_ATTRIB_ARRAY13_NV: u32 = 34397; +pub const GL_VERTEX_ATTRIB_ARRAY14_NV: u32 = 34398; +pub const GL_VERTEX_ATTRIB_ARRAY15_NV: u32 = 34399; +pub const GL_MAP1_VERTEX_ATTRIB0_4_NV: u32 = 34400; +pub const GL_MAP1_VERTEX_ATTRIB1_4_NV: u32 = 34401; +pub const GL_MAP1_VERTEX_ATTRIB2_4_NV: u32 = 34402; +pub const GL_MAP1_VERTEX_ATTRIB3_4_NV: u32 = 34403; +pub const GL_MAP1_VERTEX_ATTRIB4_4_NV: u32 = 34404; +pub const GL_MAP1_VERTEX_ATTRIB5_4_NV: u32 = 34405; +pub const GL_MAP1_VERTEX_ATTRIB6_4_NV: u32 = 34406; +pub const GL_MAP1_VERTEX_ATTRIB7_4_NV: u32 = 34407; +pub const GL_MAP1_VERTEX_ATTRIB8_4_NV: u32 = 34408; +pub const GL_MAP1_VERTEX_ATTRIB9_4_NV: u32 = 34409; +pub const GL_MAP1_VERTEX_ATTRIB10_4_NV: u32 = 34410; +pub const GL_MAP1_VERTEX_ATTRIB11_4_NV: u32 = 34411; +pub const GL_MAP1_VERTEX_ATTRIB12_4_NV: u32 = 34412; +pub const GL_MAP1_VERTEX_ATTRIB13_4_NV: u32 = 34413; +pub const GL_MAP1_VERTEX_ATTRIB14_4_NV: u32 = 34414; +pub const GL_MAP1_VERTEX_ATTRIB15_4_NV: u32 = 34415; +pub const GL_MAP2_VERTEX_ATTRIB0_4_NV: u32 = 34416; +pub const GL_MAP2_VERTEX_ATTRIB1_4_NV: u32 = 34417; +pub const GL_MAP2_VERTEX_ATTRIB2_4_NV: u32 = 34418; +pub const GL_MAP2_VERTEX_ATTRIB3_4_NV: u32 = 34419; +pub const GL_MAP2_VERTEX_ATTRIB4_4_NV: u32 = 34420; +pub const GL_MAP2_VERTEX_ATTRIB5_4_NV: u32 = 34421; +pub const GL_MAP2_VERTEX_ATTRIB6_4_NV: u32 = 34422; +pub const GL_MAP2_VERTEX_ATTRIB7_4_NV: u32 = 34423; +pub const GL_MAP2_VERTEX_ATTRIB8_4_NV: u32 = 34424; +pub const GL_MAP2_VERTEX_ATTRIB9_4_NV: u32 = 34425; +pub const GL_MAP2_VERTEX_ATTRIB10_4_NV: u32 = 34426; +pub const GL_MAP2_VERTEX_ATTRIB11_4_NV: u32 = 34427; +pub const GL_MAP2_VERTEX_ATTRIB12_4_NV: u32 = 34428; +pub const GL_MAP2_VERTEX_ATTRIB13_4_NV: u32 = 34429; +pub const GL_MAP2_VERTEX_ATTRIB14_4_NV: u32 = 34430; +pub const GL_MAP2_VERTEX_ATTRIB15_4_NV: u32 = 34431; +pub const GL_NV_vertex_program1_1: u32 = 1; +pub const GL_NV_vertex_program2: u32 = 1; +pub const GL_NV_vertex_program2_option: u32 = 1; +pub const GL_NV_vertex_program3: u32 = 1; +pub const GL_NV_vertex_program4: u32 = 1; +pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV: u32 = 35069; +pub const GL_NV_video_capture: u32 = 1; +pub const GL_VIDEO_BUFFER_NV: u32 = 36896; +pub const GL_VIDEO_BUFFER_BINDING_NV: u32 = 36897; +pub const GL_FIELD_UPPER_NV: u32 = 36898; +pub const GL_FIELD_LOWER_NV: u32 = 36899; +pub const GL_NUM_VIDEO_CAPTURE_STREAMS_NV: u32 = 36900; +pub const GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV: u32 = 36901; +pub const GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV: u32 = 36902; +pub const GL_LAST_VIDEO_CAPTURE_STATUS_NV: u32 = 36903; +pub const GL_VIDEO_BUFFER_PITCH_NV: u32 = 36904; +pub const GL_VIDEO_COLOR_CONVERSION_MATRIX_NV: u32 = 36905; +pub const GL_VIDEO_COLOR_CONVERSION_MAX_NV: u32 = 36906; +pub const GL_VIDEO_COLOR_CONVERSION_MIN_NV: u32 = 36907; +pub const GL_VIDEO_COLOR_CONVERSION_OFFSET_NV: u32 = 36908; +pub const GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV: u32 = 36909; +pub const GL_PARTIAL_SUCCESS_NV: u32 = 36910; +pub const GL_SUCCESS_NV: u32 = 36911; +pub const GL_FAILURE_NV: u32 = 36912; +pub const GL_YCBYCR8_422_NV: u32 = 36913; +pub const GL_YCBAYCR8A_4224_NV: u32 = 36914; +pub const GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV: u32 = 36915; +pub const GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV: u32 = 36916; +pub const GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV: u32 = 36917; +pub const GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV: u32 = 36918; +pub const GL_Z4Y12Z4CB12Z4CR12_444_NV: u32 = 36919; +pub const GL_VIDEO_CAPTURE_FRAME_WIDTH_NV: u32 = 36920; +pub const GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV: u32 = 36921; +pub const GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV: u32 = 36922; +pub const GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV: u32 = 36923; +pub const GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV: u32 = 36924; +pub const GL_NV_viewport_array2: u32 = 1; +pub const GL_NV_viewport_swizzle: u32 = 1; +pub const GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV: u32 = 37712; +pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV: u32 = 37713; +pub const GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV: u32 = 37714; +pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV: u32 = 37715; +pub const GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV: u32 = 37716; +pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV: u32 = 37717; +pub const GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV: u32 = 37718; +pub const GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV: u32 = 37719; +pub const GL_VIEWPORT_SWIZZLE_X_NV: u32 = 37720; +pub const GL_VIEWPORT_SWIZZLE_Y_NV: u32 = 37721; +pub const GL_VIEWPORT_SWIZZLE_Z_NV: u32 = 37722; +pub const GL_VIEWPORT_SWIZZLE_W_NV: u32 = 37723; +pub const GL_OML_interlace: u32 = 1; +pub const GL_INTERLACE_OML: u32 = 35200; +pub const GL_INTERLACE_READ_OML: u32 = 35201; +pub const GL_OML_resample: u32 = 1; +pub const GL_PACK_RESAMPLE_OML: u32 = 35204; +pub const GL_UNPACK_RESAMPLE_OML: u32 = 35205; +pub const GL_RESAMPLE_REPLICATE_OML: u32 = 35206; +pub const GL_RESAMPLE_ZERO_FILL_OML: u32 = 35207; +pub const GL_RESAMPLE_AVERAGE_OML: u32 = 35208; +pub const GL_RESAMPLE_DECIMATE_OML: u32 = 35209; +pub const GL_OML_subsample: u32 = 1; +pub const GL_FORMAT_SUBSAMPLE_24_24_OML: u32 = 35202; +pub const GL_FORMAT_SUBSAMPLE_244_244_OML: u32 = 35203; +pub const GL_OVR_multiview: u32 = 1; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR: u32 = 38448; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR: u32 = 38450; +pub const GL_MAX_VIEWS_OVR: u32 = 38449; +pub const GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: u32 = 38451; +pub const GL_OVR_multiview2: u32 = 1; +pub const GL_PGI_misc_hints: u32 = 1; +pub const GL_PREFER_DOUBLEBUFFER_HINT_PGI: u32 = 107000; +pub const GL_CONSERVE_MEMORY_HINT_PGI: u32 = 107005; +pub const GL_RECLAIM_MEMORY_HINT_PGI: u32 = 107006; +pub const GL_NATIVE_GRAPHICS_HANDLE_PGI: u32 = 107010; +pub const GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI: u32 = 107011; +pub const GL_NATIVE_GRAPHICS_END_HINT_PGI: u32 = 107012; +pub const GL_ALWAYS_FAST_HINT_PGI: u32 = 107020; +pub const GL_ALWAYS_SOFT_HINT_PGI: u32 = 107021; +pub const GL_ALLOW_DRAW_OBJ_HINT_PGI: u32 = 107022; +pub const GL_ALLOW_DRAW_WIN_HINT_PGI: u32 = 107023; +pub const GL_ALLOW_DRAW_FRG_HINT_PGI: u32 = 107024; +pub const GL_ALLOW_DRAW_MEM_HINT_PGI: u32 = 107025; +pub const GL_STRICT_DEPTHFUNC_HINT_PGI: u32 = 107030; +pub const GL_STRICT_LIGHTING_HINT_PGI: u32 = 107031; +pub const GL_STRICT_SCISSOR_HINT_PGI: u32 = 107032; +pub const GL_FULL_STIPPLE_HINT_PGI: u32 = 107033; +pub const GL_CLIP_NEAR_HINT_PGI: u32 = 107040; +pub const GL_CLIP_FAR_HINT_PGI: u32 = 107041; +pub const GL_WIDE_LINE_HINT_PGI: u32 = 107042; +pub const GL_BACK_NORMALS_HINT_PGI: u32 = 107043; +pub const GL_PGI_vertex_hints: u32 = 1; +pub const GL_VERTEX_DATA_HINT_PGI: u32 = 107050; +pub const GL_VERTEX_CONSISTENT_HINT_PGI: u32 = 107051; +pub const GL_MATERIAL_SIDE_HINT_PGI: u32 = 107052; +pub const GL_MAX_VERTEX_HINT_PGI: u32 = 107053; +pub const GL_COLOR3_BIT_PGI: u32 = 65536; +pub const GL_COLOR4_BIT_PGI: u32 = 131072; +pub const GL_EDGEFLAG_BIT_PGI: u32 = 262144; +pub const GL_INDEX_BIT_PGI: u32 = 524288; +pub const GL_MAT_AMBIENT_BIT_PGI: u32 = 1048576; +pub const GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI: u32 = 2097152; +pub const GL_MAT_DIFFUSE_BIT_PGI: u32 = 4194304; +pub const GL_MAT_EMISSION_BIT_PGI: u32 = 8388608; +pub const GL_MAT_COLOR_INDEXES_BIT_PGI: u32 = 16777216; +pub const GL_MAT_SHININESS_BIT_PGI: u32 = 33554432; +pub const GL_MAT_SPECULAR_BIT_PGI: u32 = 67108864; +pub const GL_NORMAL_BIT_PGI: u32 = 134217728; +pub const GL_TEXCOORD1_BIT_PGI: u32 = 268435456; +pub const GL_TEXCOORD2_BIT_PGI: u32 = 536870912; +pub const GL_TEXCOORD3_BIT_PGI: u32 = 1073741824; +pub const GL_TEXCOORD4_BIT_PGI: u32 = 2147483648; +pub const GL_VERTEX23_BIT_PGI: u32 = 4; +pub const GL_VERTEX4_BIT_PGI: u32 = 8; +pub const GL_REND_screen_coordinates: u32 = 1; +pub const GL_SCREEN_COORDINATES_REND: u32 = 33936; +pub const GL_INVERTED_SCREEN_W_REND: u32 = 33937; +pub const GL_S3_s3tc: u32 = 1; +pub const GL_RGB_S3TC: u32 = 33696; +pub const GL_RGB4_S3TC: u32 = 33697; +pub const GL_RGBA_S3TC: u32 = 33698; +pub const GL_RGBA4_S3TC: u32 = 33699; +pub const GL_RGBA_DXT5_S3TC: u32 = 33700; +pub const GL_RGBA4_DXT5_S3TC: u32 = 33701; +pub const GL_SGIS_detail_texture: u32 = 1; +pub const GL_DETAIL_TEXTURE_2D_SGIS: u32 = 32917; +pub const GL_DETAIL_TEXTURE_2D_BINDING_SGIS: u32 = 32918; +pub const GL_LINEAR_DETAIL_SGIS: u32 = 32919; +pub const GL_LINEAR_DETAIL_ALPHA_SGIS: u32 = 32920; +pub const GL_LINEAR_DETAIL_COLOR_SGIS: u32 = 32921; +pub const GL_DETAIL_TEXTURE_LEVEL_SGIS: u32 = 32922; +pub const GL_DETAIL_TEXTURE_MODE_SGIS: u32 = 32923; +pub const GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS: u32 = 32924; +pub const GL_SGIS_fog_function: u32 = 1; +pub const GL_FOG_FUNC_SGIS: u32 = 33066; +pub const GL_FOG_FUNC_POINTS_SGIS: u32 = 33067; +pub const GL_MAX_FOG_FUNC_POINTS_SGIS: u32 = 33068; +pub const GL_SGIS_generate_mipmap: u32 = 1; +pub const GL_GENERATE_MIPMAP_SGIS: u32 = 33169; +pub const GL_GENERATE_MIPMAP_HINT_SGIS: u32 = 33170; +pub const GL_SGIS_multisample: u32 = 1; +pub const GL_MULTISAMPLE_SGIS: u32 = 32925; +pub const GL_SAMPLE_ALPHA_TO_MASK_SGIS: u32 = 32926; +pub const GL_SAMPLE_ALPHA_TO_ONE_SGIS: u32 = 32927; +pub const GL_SAMPLE_MASK_SGIS: u32 = 32928; +pub const GL_1PASS_SGIS: u32 = 32929; +pub const GL_2PASS_0_SGIS: u32 = 32930; +pub const GL_2PASS_1_SGIS: u32 = 32931; +pub const GL_4PASS_0_SGIS: u32 = 32932; +pub const GL_4PASS_1_SGIS: u32 = 32933; +pub const GL_4PASS_2_SGIS: u32 = 32934; +pub const GL_4PASS_3_SGIS: u32 = 32935; +pub const GL_SAMPLE_BUFFERS_SGIS: u32 = 32936; +pub const GL_SAMPLES_SGIS: u32 = 32937; +pub const GL_SAMPLE_MASK_VALUE_SGIS: u32 = 32938; +pub const GL_SAMPLE_MASK_INVERT_SGIS: u32 = 32939; +pub const GL_SAMPLE_PATTERN_SGIS: u32 = 32940; +pub const GL_SGIS_pixel_texture: u32 = 1; +pub const GL_PIXEL_TEXTURE_SGIS: u32 = 33619; +pub const GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS: u32 = 33620; +pub const GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS: u32 = 33621; +pub const GL_PIXEL_GROUP_COLOR_SGIS: u32 = 33622; +pub const GL_SGIS_point_line_texgen: u32 = 1; +pub const GL_EYE_DISTANCE_TO_POINT_SGIS: u32 = 33264; +pub const GL_OBJECT_DISTANCE_TO_POINT_SGIS: u32 = 33265; +pub const GL_EYE_DISTANCE_TO_LINE_SGIS: u32 = 33266; +pub const GL_OBJECT_DISTANCE_TO_LINE_SGIS: u32 = 33267; +pub const GL_EYE_POINT_SGIS: u32 = 33268; +pub const GL_OBJECT_POINT_SGIS: u32 = 33269; +pub const GL_EYE_LINE_SGIS: u32 = 33270; +pub const GL_OBJECT_LINE_SGIS: u32 = 33271; +pub const GL_SGIS_point_parameters: u32 = 1; +pub const GL_POINT_SIZE_MIN_SGIS: u32 = 33062; +pub const GL_POINT_SIZE_MAX_SGIS: u32 = 33063; +pub const GL_POINT_FADE_THRESHOLD_SIZE_SGIS: u32 = 33064; +pub const GL_DISTANCE_ATTENUATION_SGIS: u32 = 33065; +pub const GL_SGIS_sharpen_texture: u32 = 1; +pub const GL_LINEAR_SHARPEN_SGIS: u32 = 32941; +pub const GL_LINEAR_SHARPEN_ALPHA_SGIS: u32 = 32942; +pub const GL_LINEAR_SHARPEN_COLOR_SGIS: u32 = 32943; +pub const GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS: u32 = 32944; +pub const GL_SGIS_texture4D: u32 = 1; +pub const GL_PACK_SKIP_VOLUMES_SGIS: u32 = 33072; +pub const GL_PACK_IMAGE_DEPTH_SGIS: u32 = 33073; +pub const GL_UNPACK_SKIP_VOLUMES_SGIS: u32 = 33074; +pub const GL_UNPACK_IMAGE_DEPTH_SGIS: u32 = 33075; +pub const GL_TEXTURE_4D_SGIS: u32 = 33076; +pub const GL_PROXY_TEXTURE_4D_SGIS: u32 = 33077; +pub const GL_TEXTURE_4DSIZE_SGIS: u32 = 33078; +pub const GL_TEXTURE_WRAP_Q_SGIS: u32 = 33079; +pub const GL_MAX_4D_TEXTURE_SIZE_SGIS: u32 = 33080; +pub const GL_TEXTURE_4D_BINDING_SGIS: u32 = 33103; +pub const GL_SGIS_texture_border_clamp: u32 = 1; +pub const GL_CLAMP_TO_BORDER_SGIS: u32 = 33069; +pub const GL_SGIS_texture_color_mask: u32 = 1; +pub const GL_TEXTURE_COLOR_WRITEMASK_SGIS: u32 = 33263; +pub const GL_SGIS_texture_edge_clamp: u32 = 1; +pub const GL_CLAMP_TO_EDGE_SGIS: u32 = 33071; +pub const GL_SGIS_texture_filter4: u32 = 1; +pub const GL_FILTER4_SGIS: u32 = 33094; +pub const GL_TEXTURE_FILTER4_SIZE_SGIS: u32 = 33095; +pub const GL_SGIS_texture_lod: u32 = 1; +pub const GL_TEXTURE_MIN_LOD_SGIS: u32 = 33082; +pub const GL_TEXTURE_MAX_LOD_SGIS: u32 = 33083; +pub const GL_TEXTURE_BASE_LEVEL_SGIS: u32 = 33084; +pub const GL_TEXTURE_MAX_LEVEL_SGIS: u32 = 33085; +pub const GL_SGIS_texture_select: u32 = 1; +pub const GL_DUAL_ALPHA4_SGIS: u32 = 33040; +pub const GL_DUAL_ALPHA8_SGIS: u32 = 33041; +pub const GL_DUAL_ALPHA12_SGIS: u32 = 33042; +pub const GL_DUAL_ALPHA16_SGIS: u32 = 33043; +pub const GL_DUAL_LUMINANCE4_SGIS: u32 = 33044; +pub const GL_DUAL_LUMINANCE8_SGIS: u32 = 33045; +pub const GL_DUAL_LUMINANCE12_SGIS: u32 = 33046; +pub const GL_DUAL_LUMINANCE16_SGIS: u32 = 33047; +pub const GL_DUAL_INTENSITY4_SGIS: u32 = 33048; +pub const GL_DUAL_INTENSITY8_SGIS: u32 = 33049; +pub const GL_DUAL_INTENSITY12_SGIS: u32 = 33050; +pub const GL_DUAL_INTENSITY16_SGIS: u32 = 33051; +pub const GL_DUAL_LUMINANCE_ALPHA4_SGIS: u32 = 33052; +pub const GL_DUAL_LUMINANCE_ALPHA8_SGIS: u32 = 33053; +pub const GL_QUAD_ALPHA4_SGIS: u32 = 33054; +pub const GL_QUAD_ALPHA8_SGIS: u32 = 33055; +pub const GL_QUAD_LUMINANCE4_SGIS: u32 = 33056; +pub const GL_QUAD_LUMINANCE8_SGIS: u32 = 33057; +pub const GL_QUAD_INTENSITY4_SGIS: u32 = 33058; +pub const GL_QUAD_INTENSITY8_SGIS: u32 = 33059; +pub const GL_DUAL_TEXTURE_SELECT_SGIS: u32 = 33060; +pub const GL_QUAD_TEXTURE_SELECT_SGIS: u32 = 33061; +pub const GL_SGIX_async: u32 = 1; +pub const GL_ASYNC_MARKER_SGIX: u32 = 33577; +pub const GL_SGIX_async_histogram: u32 = 1; +pub const GL_ASYNC_HISTOGRAM_SGIX: u32 = 33580; +pub const GL_MAX_ASYNC_HISTOGRAM_SGIX: u32 = 33581; +pub const GL_SGIX_async_pixel: u32 = 1; +pub const GL_ASYNC_TEX_IMAGE_SGIX: u32 = 33628; +pub const GL_ASYNC_DRAW_PIXELS_SGIX: u32 = 33629; +pub const GL_ASYNC_READ_PIXELS_SGIX: u32 = 33630; +pub const GL_MAX_ASYNC_TEX_IMAGE_SGIX: u32 = 33631; +pub const GL_MAX_ASYNC_DRAW_PIXELS_SGIX: u32 = 33632; +pub const GL_MAX_ASYNC_READ_PIXELS_SGIX: u32 = 33633; +pub const GL_SGIX_blend_alpha_minmax: u32 = 1; +pub const GL_ALPHA_MIN_SGIX: u32 = 33568; +pub const GL_ALPHA_MAX_SGIX: u32 = 33569; +pub const GL_SGIX_calligraphic_fragment: u32 = 1; +pub const GL_CALLIGRAPHIC_FRAGMENT_SGIX: u32 = 33155; +pub const GL_SGIX_clipmap: u32 = 1; +pub const GL_LINEAR_CLIPMAP_LINEAR_SGIX: u32 = 33136; +pub const GL_TEXTURE_CLIPMAP_CENTER_SGIX: u32 = 33137; +pub const GL_TEXTURE_CLIPMAP_FRAME_SGIX: u32 = 33138; +pub const GL_TEXTURE_CLIPMAP_OFFSET_SGIX: u32 = 33139; +pub const GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX: u32 = 33140; +pub const GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX: u32 = 33141; +pub const GL_TEXTURE_CLIPMAP_DEPTH_SGIX: u32 = 33142; +pub const GL_MAX_CLIPMAP_DEPTH_SGIX: u32 = 33143; +pub const GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX: u32 = 33144; +pub const GL_NEAREST_CLIPMAP_NEAREST_SGIX: u32 = 33869; +pub const GL_NEAREST_CLIPMAP_LINEAR_SGIX: u32 = 33870; +pub const GL_LINEAR_CLIPMAP_NEAREST_SGIX: u32 = 33871; +pub const GL_SGIX_convolution_accuracy: u32 = 1; +pub const GL_CONVOLUTION_HINT_SGIX: u32 = 33558; +pub const GL_SGIX_depth_pass_instrument: u32 = 1; +pub const GL_SGIX_depth_texture: u32 = 1; +pub const GL_DEPTH_COMPONENT16_SGIX: u32 = 33189; +pub const GL_DEPTH_COMPONENT24_SGIX: u32 = 33190; +pub const GL_DEPTH_COMPONENT32_SGIX: u32 = 33191; +pub const GL_SGIX_flush_raster: u32 = 1; +pub const GL_SGIX_fog_offset: u32 = 1; +pub const GL_FOG_OFFSET_SGIX: u32 = 33176; +pub const GL_FOG_OFFSET_VALUE_SGIX: u32 = 33177; +pub const GL_SGIX_fragment_lighting: u32 = 1; +pub const GL_FRAGMENT_LIGHTING_SGIX: u32 = 33792; +pub const GL_FRAGMENT_COLOR_MATERIAL_SGIX: u32 = 33793; +pub const GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX: u32 = 33794; +pub const GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX: u32 = 33795; +pub const GL_MAX_FRAGMENT_LIGHTS_SGIX: u32 = 33796; +pub const GL_MAX_ACTIVE_LIGHTS_SGIX: u32 = 33797; +pub const GL_CURRENT_RASTER_NORMAL_SGIX: u32 = 33798; +pub const GL_LIGHT_ENV_MODE_SGIX: u32 = 33799; +pub const GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX: u32 = 33800; +pub const GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX: u32 = 33801; +pub const GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX: u32 = 33802; +pub const GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX: u32 = 33803; +pub const GL_FRAGMENT_LIGHT0_SGIX: u32 = 33804; +pub const GL_FRAGMENT_LIGHT1_SGIX: u32 = 33805; +pub const GL_FRAGMENT_LIGHT2_SGIX: u32 = 33806; +pub const GL_FRAGMENT_LIGHT3_SGIX: u32 = 33807; +pub const GL_FRAGMENT_LIGHT4_SGIX: u32 = 33808; +pub const GL_FRAGMENT_LIGHT5_SGIX: u32 = 33809; +pub const GL_FRAGMENT_LIGHT6_SGIX: u32 = 33810; +pub const GL_FRAGMENT_LIGHT7_SGIX: u32 = 33811; +pub const GL_SGIX_framezoom: u32 = 1; +pub const GL_FRAMEZOOM_SGIX: u32 = 33163; +pub const GL_FRAMEZOOM_FACTOR_SGIX: u32 = 33164; +pub const GL_MAX_FRAMEZOOM_FACTOR_SGIX: u32 = 33165; +pub const GL_SGIX_igloo_interface: u32 = 1; +pub const GL_SGIX_instruments: u32 = 1; +pub const GL_INSTRUMENT_BUFFER_POINTER_SGIX: u32 = 33152; +pub const GL_INSTRUMENT_MEASUREMENTS_SGIX: u32 = 33153; +pub const GL_SGIX_interlace: u32 = 1; +pub const GL_INTERLACE_SGIX: u32 = 32916; +pub const GL_SGIX_ir_instrument1: u32 = 1; +pub const GL_IR_INSTRUMENT1_SGIX: u32 = 33151; +pub const GL_SGIX_list_priority: u32 = 1; +pub const GL_LIST_PRIORITY_SGIX: u32 = 33154; +pub const GL_SGIX_pixel_texture: u32 = 1; +pub const GL_PIXEL_TEX_GEN_SGIX: u32 = 33081; +pub const GL_PIXEL_TEX_GEN_MODE_SGIX: u32 = 33579; +pub const GL_SGIX_pixel_tiles: u32 = 1; +pub const GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX: u32 = 33086; +pub const GL_PIXEL_TILE_CACHE_INCREMENT_SGIX: u32 = 33087; +pub const GL_PIXEL_TILE_WIDTH_SGIX: u32 = 33088; +pub const GL_PIXEL_TILE_HEIGHT_SGIX: u32 = 33089; +pub const GL_PIXEL_TILE_GRID_WIDTH_SGIX: u32 = 33090; +pub const GL_PIXEL_TILE_GRID_HEIGHT_SGIX: u32 = 33091; +pub const GL_PIXEL_TILE_GRID_DEPTH_SGIX: u32 = 33092; +pub const GL_PIXEL_TILE_CACHE_SIZE_SGIX: u32 = 33093; +pub const GL_SGIX_polynomial_ffd: u32 = 1; +pub const GL_TEXTURE_DEFORMATION_BIT_SGIX: u32 = 1; +pub const GL_GEOMETRY_DEFORMATION_BIT_SGIX: u32 = 2; +pub const GL_GEOMETRY_DEFORMATION_SGIX: u32 = 33172; +pub const GL_TEXTURE_DEFORMATION_SGIX: u32 = 33173; +pub const GL_DEFORMATIONS_MASK_SGIX: u32 = 33174; +pub const GL_MAX_DEFORMATION_ORDER_SGIX: u32 = 33175; +pub const GL_SGIX_reference_plane: u32 = 1; +pub const GL_REFERENCE_PLANE_SGIX: u32 = 33149; +pub const GL_REFERENCE_PLANE_EQUATION_SGIX: u32 = 33150; +pub const GL_SGIX_resample: u32 = 1; +pub const GL_PACK_RESAMPLE_SGIX: u32 = 33838; +pub const GL_UNPACK_RESAMPLE_SGIX: u32 = 33839; +pub const GL_RESAMPLE_REPLICATE_SGIX: u32 = 33843; +pub const GL_RESAMPLE_ZERO_FILL_SGIX: u32 = 33844; +pub const GL_RESAMPLE_DECIMATE_SGIX: u32 = 33840; +pub const GL_SGIX_scalebias_hint: u32 = 1; +pub const GL_SCALEBIAS_HINT_SGIX: u32 = 33570; +pub const GL_SGIX_shadow: u32 = 1; +pub const GL_TEXTURE_COMPARE_SGIX: u32 = 33178; +pub const GL_TEXTURE_COMPARE_OPERATOR_SGIX: u32 = 33179; +pub const GL_TEXTURE_LEQUAL_R_SGIX: u32 = 33180; +pub const GL_TEXTURE_GEQUAL_R_SGIX: u32 = 33181; +pub const GL_SGIX_shadow_ambient: u32 = 1; +pub const GL_SHADOW_AMBIENT_SGIX: u32 = 32959; +pub const GL_SGIX_sprite: u32 = 1; +pub const GL_SPRITE_SGIX: u32 = 33096; +pub const GL_SPRITE_MODE_SGIX: u32 = 33097; +pub const GL_SPRITE_AXIS_SGIX: u32 = 33098; +pub const GL_SPRITE_TRANSLATION_SGIX: u32 = 33099; +pub const GL_SPRITE_AXIAL_SGIX: u32 = 33100; +pub const GL_SPRITE_OBJECT_ALIGNED_SGIX: u32 = 33101; +pub const GL_SPRITE_EYE_ALIGNED_SGIX: u32 = 33102; +pub const GL_SGIX_subsample: u32 = 1; +pub const GL_PACK_SUBSAMPLE_RATE_SGIX: u32 = 34208; +pub const GL_UNPACK_SUBSAMPLE_RATE_SGIX: u32 = 34209; +pub const GL_PIXEL_SUBSAMPLE_4444_SGIX: u32 = 34210; +pub const GL_PIXEL_SUBSAMPLE_2424_SGIX: u32 = 34211; +pub const GL_PIXEL_SUBSAMPLE_4242_SGIX: u32 = 34212; +pub const GL_SGIX_tag_sample_buffer: u32 = 1; +pub const GL_SGIX_texture_add_env: u32 = 1; +pub const GL_TEXTURE_ENV_BIAS_SGIX: u32 = 32958; +pub const GL_SGIX_texture_coordinate_clamp: u32 = 1; +pub const GL_TEXTURE_MAX_CLAMP_S_SGIX: u32 = 33641; +pub const GL_TEXTURE_MAX_CLAMP_T_SGIX: u32 = 33642; +pub const GL_TEXTURE_MAX_CLAMP_R_SGIX: u32 = 33643; +pub const GL_SGIX_texture_lod_bias: u32 = 1; +pub const GL_TEXTURE_LOD_BIAS_S_SGIX: u32 = 33166; +pub const GL_TEXTURE_LOD_BIAS_T_SGIX: u32 = 33167; +pub const GL_TEXTURE_LOD_BIAS_R_SGIX: u32 = 33168; +pub const GL_SGIX_texture_multi_buffer: u32 = 1; +pub const GL_TEXTURE_MULTI_BUFFER_HINT_SGIX: u32 = 33070; +pub const GL_SGIX_texture_scale_bias: u32 = 1; +pub const GL_POST_TEXTURE_FILTER_BIAS_SGIX: u32 = 33145; +pub const GL_POST_TEXTURE_FILTER_SCALE_SGIX: u32 = 33146; +pub const GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX: u32 = 33147; +pub const GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX: u32 = 33148; +pub const GL_SGIX_vertex_preclip: u32 = 1; +pub const GL_VERTEX_PRECLIP_SGIX: u32 = 33774; +pub const GL_VERTEX_PRECLIP_HINT_SGIX: u32 = 33775; +pub const GL_SGIX_ycrcb: u32 = 1; +pub const GL_YCRCB_422_SGIX: u32 = 33211; +pub const GL_YCRCB_444_SGIX: u32 = 33212; +pub const GL_SGIX_ycrcb_subsample: u32 = 1; +pub const GL_SGIX_ycrcba: u32 = 1; +pub const GL_YCRCB_SGIX: u32 = 33560; +pub const GL_YCRCBA_SGIX: u32 = 33561; +pub const GL_SGI_color_matrix: u32 = 1; +pub const GL_COLOR_MATRIX_SGI: u32 = 32945; +pub const GL_COLOR_MATRIX_STACK_DEPTH_SGI: u32 = 32946; +pub const GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: u32 = 32947; +pub const GL_POST_COLOR_MATRIX_RED_SCALE_SGI: u32 = 32948; +pub const GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI: u32 = 32949; +pub const GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI: u32 = 32950; +pub const GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI: u32 = 32951; +pub const GL_POST_COLOR_MATRIX_RED_BIAS_SGI: u32 = 32952; +pub const GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI: u32 = 32953; +pub const GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI: u32 = 32954; +pub const GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI: u32 = 32955; +pub const GL_SGI_color_table: u32 = 1; +pub const GL_COLOR_TABLE_SGI: u32 = 32976; +pub const GL_POST_CONVOLUTION_COLOR_TABLE_SGI: u32 = 32977; +pub const GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI: u32 = 32978; +pub const GL_PROXY_COLOR_TABLE_SGI: u32 = 32979; +pub const GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI: u32 = 32980; +pub const GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI: u32 = 32981; +pub const GL_COLOR_TABLE_SCALE_SGI: u32 = 32982; +pub const GL_COLOR_TABLE_BIAS_SGI: u32 = 32983; +pub const GL_COLOR_TABLE_FORMAT_SGI: u32 = 32984; +pub const GL_COLOR_TABLE_WIDTH_SGI: u32 = 32985; +pub const GL_COLOR_TABLE_RED_SIZE_SGI: u32 = 32986; +pub const GL_COLOR_TABLE_GREEN_SIZE_SGI: u32 = 32987; +pub const GL_COLOR_TABLE_BLUE_SIZE_SGI: u32 = 32988; +pub const GL_COLOR_TABLE_ALPHA_SIZE_SGI: u32 = 32989; +pub const GL_COLOR_TABLE_LUMINANCE_SIZE_SGI: u32 = 32990; +pub const GL_COLOR_TABLE_INTENSITY_SIZE_SGI: u32 = 32991; +pub const GL_SGI_texture_color_table: u32 = 1; +pub const GL_TEXTURE_COLOR_TABLE_SGI: u32 = 32956; +pub const GL_PROXY_TEXTURE_COLOR_TABLE_SGI: u32 = 32957; +pub const GL_SUNX_constant_data: u32 = 1; +pub const GL_UNPACK_CONSTANT_DATA_SUNX: u32 = 33237; +pub const GL_TEXTURE_CONSTANT_DATA_SUNX: u32 = 33238; +pub const GL_SUN_convolution_border_modes: u32 = 1; +pub const GL_WRAP_BORDER_SUN: u32 = 33236; +pub const GL_SUN_global_alpha: u32 = 1; +pub const GL_GLOBAL_ALPHA_SUN: u32 = 33241; +pub const GL_GLOBAL_ALPHA_FACTOR_SUN: u32 = 33242; +pub const GL_SUN_mesh_array: u32 = 1; +pub const GL_QUAD_MESH_SUN: u32 = 34324; +pub const GL_TRIANGLE_MESH_SUN: u32 = 34325; +pub const GL_SUN_slice_accum: u32 = 1; +pub const GL_SLICE_ACCUM_SUN: u32 = 34252; +pub const GL_SUN_triangle_list: u32 = 1; +pub const GL_RESTART_SUN: u32 = 1; +pub const GL_REPLACE_MIDDLE_SUN: u32 = 2; +pub const GL_REPLACE_OLDEST_SUN: u32 = 3; +pub const GL_TRIANGLE_LIST_SUN: u32 = 33239; +pub const GL_REPLACEMENT_CODE_SUN: u32 = 33240; +pub const GL_REPLACEMENT_CODE_ARRAY_SUN: u32 = 34240; +pub const GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN: u32 = 34241; +pub const GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN: u32 = 34242; +pub const GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN: u32 = 34243; +pub const GL_R1UI_V3F_SUN: u32 = 34244; +pub const GL_R1UI_C4UB_V3F_SUN: u32 = 34245; +pub const GL_R1UI_C3F_V3F_SUN: u32 = 34246; +pub const GL_R1UI_N3F_V3F_SUN: u32 = 34247; +pub const GL_R1UI_C4F_N3F_V3F_SUN: u32 = 34248; +pub const GL_R1UI_T2F_V3F_SUN: u32 = 34249; +pub const GL_R1UI_T2F_N3F_V3F_SUN: u32 = 34250; +pub const GL_R1UI_T2F_C4F_N3F_V3F_SUN: u32 = 34251; +pub const GL_SUN_vertex: u32 = 1; +pub const GL_WIN_phong_shading: u32 = 1; +pub const GL_PHONG_WIN: u32 = 33002; +pub const GL_PHONG_HINT_WIN: u32 = 33003; +pub const GL_WIN_specular_fog: u32 = 1; +pub const GL_FOG_SPECULAR_TEXTURE_WIN: u32 = 33004; +pub const GL_MESA_packed_depth_stencil: u32 = 1; +pub const GL_DEPTH_STENCIL_MESA: u32 = 34640; +pub const GL_UNSIGNED_INT_24_8_MESA: u32 = 34641; +pub const GL_UNSIGNED_INT_8_24_REV_MESA: u32 = 34642; +pub const GL_UNSIGNED_SHORT_15_1_MESA: u32 = 34643; +pub const GL_UNSIGNED_SHORT_1_15_REV_MESA: u32 = 34644; +pub const GL_ATI_blend_equation_separate: u32 = 1; +pub const GL_ALPHA_BLEND_EQUATION_ATI: u32 = 34877; +pub const GL_OES_EGL_image: u32 = 1; +pub const _DLFCN_H: u32 = 1; +pub const RTLD_LAZY: u32 = 1; +pub const RTLD_NOW: u32 = 2; +pub const RTLD_BINDING_MASK: u32 = 3; +pub const RTLD_NOLOAD: u32 = 4; +pub const RTLD_DEEPBIND: u32 = 8; +pub const RTLD_GLOBAL: u32 = 256; +pub const RTLD_LOCAL: u32 = 0; +pub const RTLD_NODELETE: u32 = 4096; +pub const _LIBC_LIMITS_H_: u32 = 1; +pub const MB_LEN_MAX: u32 = 16; +pub const _BITS_POSIX1_LIM_H: u32 = 1; +pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; +pub const _POSIX_AIO_MAX: u32 = 1; +pub const _POSIX_ARG_MAX: u32 = 4096; +pub const _POSIX_CHILD_MAX: u32 = 25; +pub const _POSIX_DELAYTIMER_MAX: u32 = 32; +pub const _POSIX_HOST_NAME_MAX: u32 = 255; +pub const _POSIX_LINK_MAX: u32 = 8; +pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; +pub const _POSIX_MAX_CANON: u32 = 255; +pub const _POSIX_MAX_INPUT: u32 = 255; +pub const _POSIX_MQ_OPEN_MAX: u32 = 8; +pub const _POSIX_MQ_PRIO_MAX: u32 = 32; +pub const _POSIX_NAME_MAX: u32 = 14; +pub const _POSIX_NGROUPS_MAX: u32 = 8; +pub const _POSIX_OPEN_MAX: u32 = 20; +pub const _POSIX_PATH_MAX: u32 = 256; +pub const _POSIX_PIPE_BUF: u32 = 512; +pub const _POSIX_RE_DUP_MAX: u32 = 255; +pub const _POSIX_RTSIG_MAX: u32 = 8; +pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; +pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; +pub const _POSIX_SIGQUEUE_MAX: u32 = 32; +pub const _POSIX_SSIZE_MAX: u32 = 32767; +pub const _POSIX_STREAM_MAX: u32 = 8; +pub const _POSIX_SYMLINK_MAX: u32 = 255; +pub const _POSIX_SYMLOOP_MAX: u32 = 8; +pub const _POSIX_TIMER_MAX: u32 = 32; +pub const _POSIX_TTY_NAME_MAX: u32 = 9; +pub const _POSIX_TZNAME_MAX: u32 = 6; +pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; +pub const NR_OPEN: u32 = 1024; +pub const NGROUPS_MAX: u32 = 65536; +pub const ARG_MAX: u32 = 131072; +pub const LINK_MAX: u32 = 127; +pub const MAX_CANON: u32 = 255; +pub const MAX_INPUT: u32 = 255; +pub const NAME_MAX: u32 = 255; +pub const PATH_MAX: u32 = 4096; +pub const PIPE_BUF: u32 = 4096; +pub const XATTR_NAME_MAX: u32 = 255; +pub const XATTR_SIZE_MAX: u32 = 65536; +pub const XATTR_LIST_MAX: u32 = 65536; +pub const RTSIG_MAX: u32 = 32; +pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; +pub const PTHREAD_KEYS_MAX: u32 = 1024; +pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; +pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; +pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; +pub const AIO_PRIO_DELTA_MAX: u32 = 20; +pub const PTHREAD_STACK_MIN: u32 = 16384; +pub const DELAYTIMER_MAX: u32 = 2147483647; +pub const TTY_NAME_MAX: u32 = 32; +pub const LOGIN_NAME_MAX: u32 = 256; +pub const HOST_NAME_MAX: u32 = 64; +pub const MQ_PRIO_MAX: u32 = 32768; +pub const SEM_VALUE_MAX: u32 = 2147483647; +pub const _BITS_POSIX2_LIM_H: u32 = 1; +pub const _POSIX2_BC_BASE_MAX: u32 = 99; +pub const _POSIX2_BC_DIM_MAX: u32 = 2048; +pub const _POSIX2_BC_SCALE_MAX: u32 = 99; +pub const _POSIX2_BC_STRING_MAX: u32 = 1000; +pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; +pub const _POSIX2_EXPR_NEST_MAX: u32 = 32; +pub const _POSIX2_LINE_MAX: u32 = 2048; +pub const _POSIX2_RE_DUP_MAX: u32 = 255; +pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14; +pub const BC_BASE_MAX: u32 = 99; +pub const BC_DIM_MAX: u32 = 2048; +pub const BC_SCALE_MAX: u32 = 99; +pub const BC_STRING_MAX: u32 = 1000; +pub const COLL_WEIGHTS_MAX: u32 = 255; +pub const EXPR_NEST_MAX: u32 = 32; +pub const LINE_MAX: u32 = 2048; +pub const CHARCLASS_NAME_MAX: u32 = 2048; +pub const RE_DUP_MAX: u32 = 32767; +pub const GLX_VENDOR: u32 = 1; +pub const GLX_RGBA_BIT: u32 = 1; +pub const GLX_WINDOW_BIT: u32 = 1; +pub const GLX_DRAWABLE_TYPE: u32 = 32784; +pub const GLX_RENDER_TYPE: u32 = 32785; +pub const GLX_RGBA_TYPE: u32 = 32788; +pub const GLX_DOUBLEBUFFER: u32 = 5; +pub const GLX_STEREO: u32 = 6; +pub const GLX_AUX_BUFFERS: u32 = 7; +pub const GLX_RED_SIZE: u32 = 8; +pub const GLX_GREEN_SIZE: u32 = 9; +pub const GLX_BLUE_SIZE: u32 = 10; +pub const GLX_ALPHA_SIZE: u32 = 11; +pub const GLX_DEPTH_SIZE: u32 = 12; +pub const GLX_STENCIL_SIZE: u32 = 13; +pub const GLX_ACCUM_RED_SIZE: u32 = 14; +pub const GLX_ACCUM_GREEN_SIZE: u32 = 15; +pub const GLX_ACCUM_BLUE_SIZE: u32 = 16; +pub const GLX_ACCUM_ALPHA_SIZE: u32 = 17; +pub const GLX_SAMPLES: u32 = 100001; +pub const GLX_VISUAL_ID: u32 = 32779; +pub const GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB: u32 = 8370; +pub const GLX_CONTEXT_DEBUG_BIT_ARB: u32 = 1; +pub const GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: u32 = 2; +pub const GLX_CONTEXT_CORE_PROFILE_BIT_ARB: u32 = 1; +pub const GLX_CONTEXT_PROFILE_MASK_ARB: u32 = 37158; +pub const GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB: u32 = 2; +pub const GLX_CONTEXT_MAJOR_VERSION_ARB: u32 = 8337; +pub const GLX_CONTEXT_MINOR_VERSION_ARB: u32 = 8338; +pub const GLX_CONTEXT_FLAGS_ARB: u32 = 8340; +pub const GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB: u32 = 4; +pub const GLX_LOSE_CONTEXT_ON_RESET_ARB: u32 = 33362; +pub const GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB: u32 = 33366; +pub const GLX_NO_RESET_NOTIFICATION_ARB: u32 = 33377; +pub const GLX_CONTEXT_RELEASE_BEHAVIOR_ARB: u32 = 8343; +pub const GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB: u32 = 0; +pub const GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB: u32 = 8344; +pub type __u_char = ::std::os::raw::c_uchar; +pub type __u_short = ::std::os::raw::c_ushort; +pub type __u_int = ::std::os::raw::c_uint; +pub type __u_long = ::std::os::raw::c_ulong; +pub type __int8_t = ::std::os::raw::c_schar; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __int16_t = ::std::os::raw::c_short; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __int64_t = ::std::os::raw::c_long; +pub type __uint64_t = ::std::os::raw::c_ulong; +pub type __int_least8_t = __int8_t; +pub type __uint_least8_t = __uint8_t; +pub type __int_least16_t = __int16_t; +pub type __uint_least16_t = __uint16_t; +pub type __int_least32_t = __int32_t; +pub type __uint_least32_t = __uint32_t; +pub type __int_least64_t = __int64_t; +pub type __uint_least64_t = __uint64_t; +pub type __quad_t = ::std::os::raw::c_long; +pub type __u_quad_t = ::std::os::raw::c_ulong; +pub type __intmax_t = ::std::os::raw::c_long; +pub type __uintmax_t = ::std::os::raw::c_ulong; +pub type __dev_t = ::std::os::raw::c_ulong; +pub type __uid_t = ::std::os::raw::c_uint; +pub type __gid_t = ::std::os::raw::c_uint; +pub type __ino_t = ::std::os::raw::c_ulong; +pub type __ino64_t = ::std::os::raw::c_ulong; +pub type __mode_t = ::std::os::raw::c_uint; +pub type __nlink_t = ::std::os::raw::c_ulong; +pub type __off_t = ::std::os::raw::c_long; +pub type __off64_t = ::std::os::raw::c_long; +pub type __pid_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __fsid_t { + pub __val: [::std::os::raw::c_int; 2usize], +} +pub type __clock_t = ::std::os::raw::c_long; +pub type __rlim_t = ::std::os::raw::c_ulong; +pub type __rlim64_t = ::std::os::raw::c_ulong; +pub type __id_t = ::std::os::raw::c_uint; +pub type __time_t = ::std::os::raw::c_long; +pub type __useconds_t = ::std::os::raw::c_uint; +pub type __suseconds_t = ::std::os::raw::c_long; +pub type __daddr_t = ::std::os::raw::c_int; +pub type __key_t = ::std::os::raw::c_int; +pub type __clockid_t = ::std::os::raw::c_int; +pub type __timer_t = *mut ::std::os::raw::c_void; +pub type __blksize_t = ::std::os::raw::c_long; +pub type __blkcnt_t = ::std::os::raw::c_long; +pub type __blkcnt64_t = ::std::os::raw::c_long; +pub type __fsblkcnt_t = ::std::os::raw::c_ulong; +pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt_t = ::std::os::raw::c_ulong; +pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; +pub type __fsword_t = ::std::os::raw::c_long; +pub type __ssize_t = ::std::os::raw::c_long; +pub type __syscall_slong_t = ::std::os::raw::c_long; +pub type __syscall_ulong_t = ::std::os::raw::c_ulong; +pub type __loff_t = __off64_t; +pub type __caddr_t = *mut ::std::os::raw::c_char; +pub type __intptr_t = ::std::os::raw::c_long; +pub type __socklen_t = ::std::os::raw::c_uint; +pub type __sig_atomic_t = ::std::os::raw::c_int; +pub type int_least8_t = __int_least8_t; +pub type int_least16_t = __int_least16_t; +pub type int_least32_t = __int_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least8_t = __uint_least8_t; +pub type uint_least16_t = __uint_least16_t; +pub type uint_least32_t = __uint_least32_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type int_fast16_t = ::std::os::raw::c_long; +pub type int_fast32_t = ::std::os::raw::c_long; +pub type int_fast64_t = ::std::os::raw::c_long; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type uint_fast16_t = ::std::os::raw::c_ulong; +pub type uint_fast32_t = ::std::os::raw::c_ulong; +pub type uint_fast64_t = ::std::os::raw::c_ulong; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +pub const SAPP_MAX_TOUCHPOINTS: _bindgen_ty_1 = 8; +pub const SAPP_MAX_MOUSEBUTTONS: _bindgen_ty_1 = 3; +pub const SAPP_MAX_KEYCODES: _bindgen_ty_1 = 512; +pub type _bindgen_ty_1 = u32; +pub const sapp_event_type_SAPP_EVENTTYPE_INVALID: sapp_event_type = 0; +pub const sapp_event_type_SAPP_EVENTTYPE_KEY_DOWN: sapp_event_type = 1; +pub const sapp_event_type_SAPP_EVENTTYPE_KEY_UP: sapp_event_type = 2; +pub const sapp_event_type_SAPP_EVENTTYPE_CHAR: sapp_event_type = 3; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_DOWN: sapp_event_type = 4; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_UP: sapp_event_type = 5; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_SCROLL: sapp_event_type = 6; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_MOVE: sapp_event_type = 7; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_ENTER: sapp_event_type = 8; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_LEAVE: sapp_event_type = 9; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_BEGAN: sapp_event_type = 10; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_MOVED: sapp_event_type = 11; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_ENDED: sapp_event_type = 12; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_CANCELLED: sapp_event_type = 13; +pub const sapp_event_type_SAPP_EVENTTYPE_RESIZED: sapp_event_type = 14; +pub const sapp_event_type_SAPP_EVENTTYPE_ICONIFIED: sapp_event_type = 15; +pub const sapp_event_type_SAPP_EVENTTYPE_RESTORED: sapp_event_type = 16; +pub const sapp_event_type_SAPP_EVENTTYPE_SUSPENDED: sapp_event_type = 17; +pub const sapp_event_type_SAPP_EVENTTYPE_RESUMED: sapp_event_type = 18; +pub const sapp_event_type_SAPP_EVENTTYPE_UPDATE_CURSOR: sapp_event_type = 19; +pub const sapp_event_type_SAPP_EVENTTYPE_QUIT_REQUESTED: sapp_event_type = 20; +pub const sapp_event_type__SAPP_EVENTTYPE_NUM: sapp_event_type = 21; +pub const sapp_event_type__SAPP_EVENTTYPE_FORCE_U32: sapp_event_type = 2147483647; +pub type sapp_event_type = u32; +pub const sapp_keycode_SAPP_KEYCODE_INVALID: sapp_keycode = 0; +pub const sapp_keycode_SAPP_KEYCODE_SPACE: sapp_keycode = 32; +pub const sapp_keycode_SAPP_KEYCODE_APOSTROPHE: sapp_keycode = 39; +pub const sapp_keycode_SAPP_KEYCODE_COMMA: sapp_keycode = 44; +pub const sapp_keycode_SAPP_KEYCODE_MINUS: sapp_keycode = 45; +pub const sapp_keycode_SAPP_KEYCODE_PERIOD: sapp_keycode = 46; +pub const sapp_keycode_SAPP_KEYCODE_SLASH: sapp_keycode = 47; +pub const sapp_keycode_SAPP_KEYCODE_0: sapp_keycode = 48; +pub const sapp_keycode_SAPP_KEYCODE_1: sapp_keycode = 49; +pub const sapp_keycode_SAPP_KEYCODE_2: sapp_keycode = 50; +pub const sapp_keycode_SAPP_KEYCODE_3: sapp_keycode = 51; +pub const sapp_keycode_SAPP_KEYCODE_4: sapp_keycode = 52; +pub const sapp_keycode_SAPP_KEYCODE_5: sapp_keycode = 53; +pub const sapp_keycode_SAPP_KEYCODE_6: sapp_keycode = 54; +pub const sapp_keycode_SAPP_KEYCODE_7: sapp_keycode = 55; +pub const sapp_keycode_SAPP_KEYCODE_8: sapp_keycode = 56; +pub const sapp_keycode_SAPP_KEYCODE_9: sapp_keycode = 57; +pub const sapp_keycode_SAPP_KEYCODE_SEMICOLON: sapp_keycode = 59; +pub const sapp_keycode_SAPP_KEYCODE_EQUAL: sapp_keycode = 61; +pub const sapp_keycode_SAPP_KEYCODE_A: sapp_keycode = 65; +pub const sapp_keycode_SAPP_KEYCODE_B: sapp_keycode = 66; +pub const sapp_keycode_SAPP_KEYCODE_C: sapp_keycode = 67; +pub const sapp_keycode_SAPP_KEYCODE_D: sapp_keycode = 68; +pub const sapp_keycode_SAPP_KEYCODE_E: sapp_keycode = 69; +pub const sapp_keycode_SAPP_KEYCODE_F: sapp_keycode = 70; +pub const sapp_keycode_SAPP_KEYCODE_G: sapp_keycode = 71; +pub const sapp_keycode_SAPP_KEYCODE_H: sapp_keycode = 72; +pub const sapp_keycode_SAPP_KEYCODE_I: sapp_keycode = 73; +pub const sapp_keycode_SAPP_KEYCODE_J: sapp_keycode = 74; +pub const sapp_keycode_SAPP_KEYCODE_K: sapp_keycode = 75; +pub const sapp_keycode_SAPP_KEYCODE_L: sapp_keycode = 76; +pub const sapp_keycode_SAPP_KEYCODE_M: sapp_keycode = 77; +pub const sapp_keycode_SAPP_KEYCODE_N: sapp_keycode = 78; +pub const sapp_keycode_SAPP_KEYCODE_O: sapp_keycode = 79; +pub const sapp_keycode_SAPP_KEYCODE_P: sapp_keycode = 80; +pub const sapp_keycode_SAPP_KEYCODE_Q: sapp_keycode = 81; +pub const sapp_keycode_SAPP_KEYCODE_R: sapp_keycode = 82; +pub const sapp_keycode_SAPP_KEYCODE_S: sapp_keycode = 83; +pub const sapp_keycode_SAPP_KEYCODE_T: sapp_keycode = 84; +pub const sapp_keycode_SAPP_KEYCODE_U: sapp_keycode = 85; +pub const sapp_keycode_SAPP_KEYCODE_V: sapp_keycode = 86; +pub const sapp_keycode_SAPP_KEYCODE_W: sapp_keycode = 87; +pub const sapp_keycode_SAPP_KEYCODE_X: sapp_keycode = 88; +pub const sapp_keycode_SAPP_KEYCODE_Y: sapp_keycode = 89; +pub const sapp_keycode_SAPP_KEYCODE_Z: sapp_keycode = 90; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_BRACKET: sapp_keycode = 91; +pub const sapp_keycode_SAPP_KEYCODE_BACKSLASH: sapp_keycode = 92; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_BRACKET: sapp_keycode = 93; +pub const sapp_keycode_SAPP_KEYCODE_GRAVE_ACCENT: sapp_keycode = 96; +pub const sapp_keycode_SAPP_KEYCODE_WORLD_1: sapp_keycode = 161; +pub const sapp_keycode_SAPP_KEYCODE_WORLD_2: sapp_keycode = 162; +pub const sapp_keycode_SAPP_KEYCODE_ESCAPE: sapp_keycode = 256; +pub const sapp_keycode_SAPP_KEYCODE_ENTER: sapp_keycode = 257; +pub const sapp_keycode_SAPP_KEYCODE_TAB: sapp_keycode = 258; +pub const sapp_keycode_SAPP_KEYCODE_BACKSPACE: sapp_keycode = 259; +pub const sapp_keycode_SAPP_KEYCODE_INSERT: sapp_keycode = 260; +pub const sapp_keycode_SAPP_KEYCODE_DELETE: sapp_keycode = 261; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT: sapp_keycode = 262; +pub const sapp_keycode_SAPP_KEYCODE_LEFT: sapp_keycode = 263; +pub const sapp_keycode_SAPP_KEYCODE_DOWN: sapp_keycode = 264; +pub const sapp_keycode_SAPP_KEYCODE_UP: sapp_keycode = 265; +pub const sapp_keycode_SAPP_KEYCODE_PAGE_UP: sapp_keycode = 266; +pub const sapp_keycode_SAPP_KEYCODE_PAGE_DOWN: sapp_keycode = 267; +pub const sapp_keycode_SAPP_KEYCODE_HOME: sapp_keycode = 268; +pub const sapp_keycode_SAPP_KEYCODE_END: sapp_keycode = 269; +pub const sapp_keycode_SAPP_KEYCODE_CAPS_LOCK: sapp_keycode = 280; +pub const sapp_keycode_SAPP_KEYCODE_SCROLL_LOCK: sapp_keycode = 281; +pub const sapp_keycode_SAPP_KEYCODE_NUM_LOCK: sapp_keycode = 282; +pub const sapp_keycode_SAPP_KEYCODE_PRINT_SCREEN: sapp_keycode = 283; +pub const sapp_keycode_SAPP_KEYCODE_PAUSE: sapp_keycode = 284; +pub const sapp_keycode_SAPP_KEYCODE_F1: sapp_keycode = 290; +pub const sapp_keycode_SAPP_KEYCODE_F2: sapp_keycode = 291; +pub const sapp_keycode_SAPP_KEYCODE_F3: sapp_keycode = 292; +pub const sapp_keycode_SAPP_KEYCODE_F4: sapp_keycode = 293; +pub const sapp_keycode_SAPP_KEYCODE_F5: sapp_keycode = 294; +pub const sapp_keycode_SAPP_KEYCODE_F6: sapp_keycode = 295; +pub const sapp_keycode_SAPP_KEYCODE_F7: sapp_keycode = 296; +pub const sapp_keycode_SAPP_KEYCODE_F8: sapp_keycode = 297; +pub const sapp_keycode_SAPP_KEYCODE_F9: sapp_keycode = 298; +pub const sapp_keycode_SAPP_KEYCODE_F10: sapp_keycode = 299; +pub const sapp_keycode_SAPP_KEYCODE_F11: sapp_keycode = 300; +pub const sapp_keycode_SAPP_KEYCODE_F12: sapp_keycode = 301; +pub const sapp_keycode_SAPP_KEYCODE_F13: sapp_keycode = 302; +pub const sapp_keycode_SAPP_KEYCODE_F14: sapp_keycode = 303; +pub const sapp_keycode_SAPP_KEYCODE_F15: sapp_keycode = 304; +pub const sapp_keycode_SAPP_KEYCODE_F16: sapp_keycode = 305; +pub const sapp_keycode_SAPP_KEYCODE_F17: sapp_keycode = 306; +pub const sapp_keycode_SAPP_KEYCODE_F18: sapp_keycode = 307; +pub const sapp_keycode_SAPP_KEYCODE_F19: sapp_keycode = 308; +pub const sapp_keycode_SAPP_KEYCODE_F20: sapp_keycode = 309; +pub const sapp_keycode_SAPP_KEYCODE_F21: sapp_keycode = 310; +pub const sapp_keycode_SAPP_KEYCODE_F22: sapp_keycode = 311; +pub const sapp_keycode_SAPP_KEYCODE_F23: sapp_keycode = 312; +pub const sapp_keycode_SAPP_KEYCODE_F24: sapp_keycode = 313; +pub const sapp_keycode_SAPP_KEYCODE_F25: sapp_keycode = 314; +pub const sapp_keycode_SAPP_KEYCODE_KP_0: sapp_keycode = 320; +pub const sapp_keycode_SAPP_KEYCODE_KP_1: sapp_keycode = 321; +pub const sapp_keycode_SAPP_KEYCODE_KP_2: sapp_keycode = 322; +pub const sapp_keycode_SAPP_KEYCODE_KP_3: sapp_keycode = 323; +pub const sapp_keycode_SAPP_KEYCODE_KP_4: sapp_keycode = 324; +pub const sapp_keycode_SAPP_KEYCODE_KP_5: sapp_keycode = 325; +pub const sapp_keycode_SAPP_KEYCODE_KP_6: sapp_keycode = 326; +pub const sapp_keycode_SAPP_KEYCODE_KP_7: sapp_keycode = 327; +pub const sapp_keycode_SAPP_KEYCODE_KP_8: sapp_keycode = 328; +pub const sapp_keycode_SAPP_KEYCODE_KP_9: sapp_keycode = 329; +pub const sapp_keycode_SAPP_KEYCODE_KP_DECIMAL: sapp_keycode = 330; +pub const sapp_keycode_SAPP_KEYCODE_KP_DIVIDE: sapp_keycode = 331; +pub const sapp_keycode_SAPP_KEYCODE_KP_MULTIPLY: sapp_keycode = 332; +pub const sapp_keycode_SAPP_KEYCODE_KP_SUBTRACT: sapp_keycode = 333; +pub const sapp_keycode_SAPP_KEYCODE_KP_ADD: sapp_keycode = 334; +pub const sapp_keycode_SAPP_KEYCODE_KP_ENTER: sapp_keycode = 335; +pub const sapp_keycode_SAPP_KEYCODE_KP_EQUAL: sapp_keycode = 336; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_SHIFT: sapp_keycode = 340; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_CONTROL: sapp_keycode = 341; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_ALT: sapp_keycode = 342; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_SUPER: sapp_keycode = 343; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_SHIFT: sapp_keycode = 344; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_CONTROL: sapp_keycode = 345; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_ALT: sapp_keycode = 346; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_SUPER: sapp_keycode = 347; +pub const sapp_keycode_SAPP_KEYCODE_MENU: sapp_keycode = 348; +pub type sapp_keycode = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_touchpoint { + pub identifier: usize, + pub pos_x: f32, + pub pos_y: f32, + pub changed: bool, +} +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_INVALID: sapp_mousebutton = -1; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_LEFT: sapp_mousebutton = 0; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_RIGHT: sapp_mousebutton = 1; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_MIDDLE: sapp_mousebutton = 2; +pub type sapp_mousebutton = i32; +pub const SAPP_MODIFIER_SHIFT: _bindgen_ty_2 = 1; +pub const SAPP_MODIFIER_CTRL: _bindgen_ty_2 = 2; +pub const SAPP_MODIFIER_ALT: _bindgen_ty_2 = 4; +pub const SAPP_MODIFIER_SUPER: _bindgen_ty_2 = 8; +pub type _bindgen_ty_2 = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_event { + pub frame_count: u64, + pub type_: sapp_event_type, + pub key_code: sapp_keycode, + pub char_code: u32, + pub key_repeat: bool, + pub modifiers: u32, + pub mouse_button: sapp_mousebutton, + pub mouse_x: f32, + pub mouse_y: f32, + pub scroll_x: f32, + pub scroll_y: f32, + pub num_touches: ::std::os::raw::c_int, + pub touches: [sapp_touchpoint; 8usize], + pub window_width: ::std::os::raw::c_int, + pub window_height: ::std::os::raw::c_int, + pub framebuffer_width: ::std::os::raw::c_int, + pub framebuffer_height: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_desc { + pub init_cb: ::std::option::Option, + pub frame_cb: ::std::option::Option, + pub cleanup_cb: ::std::option::Option, + pub event_cb: ::std::option::Option, + pub fail_cb: ::std::option::Option, + pub user_data: *mut ::std::os::raw::c_void, + pub init_userdata_cb: + ::std::option::Option, + pub frame_userdata_cb: + ::std::option::Option, + pub cleanup_userdata_cb: + ::std::option::Option, + pub event_userdata_cb: ::std::option::Option< + unsafe extern "C" fn(arg1: *const sapp_event, arg2: *mut ::std::os::raw::c_void), + >, + pub fail_userdata_cb: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_void, + ), + >, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub sample_count: ::std::os::raw::c_int, + pub swap_interval: ::std::os::raw::c_int, + pub high_dpi: bool, + pub fullscreen: bool, + pub alpha: bool, + pub window_title: *const ::std::os::raw::c_char, + pub user_cursor: bool, + pub html5_canvas_name: *const ::std::os::raw::c_char, + pub html5_canvas_resize: bool, + pub html5_preserve_drawing_buffer: bool, + pub html5_premultiplied_alpha: bool, + pub html5_ask_leave_site: bool, + pub ios_keyboard_resizes_canvas: bool, + pub gl_force_gles2: bool, +} +extern "C" { + pub fn sokol_main( + argc: ::std::os::raw::c_int, + argv: *mut *mut ::std::os::raw::c_char, + ) -> sapp_desc; +} +extern "C" { + pub fn sapp_isvalid() -> bool; +} +extern "C" { + pub fn sapp_width() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sapp_height() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sapp_high_dpi() -> bool; +} +extern "C" { + pub fn sapp_dpi_scale() -> f32; +} +extern "C" { + pub fn sapp_show_keyboard(visible: bool); +} +extern "C" { + pub fn sapp_keyboard_shown() -> bool; +} +extern "C" { + pub fn sapp_show_mouse(visible: bool); +} +extern "C" { + pub fn sapp_mouse_shown() -> bool; +} +extern "C" { + pub fn sapp_userdata() -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_query_desc() -> sapp_desc; +} +extern "C" { + pub fn sapp_request_quit(); +} +extern "C" { + pub fn sapp_cancel_quit(); +} +extern "C" { + pub fn sapp_quit(); +} +extern "C" { + pub fn sapp_frame_count() -> u64; +} +extern "C" { + pub fn sapp_run(desc: *const sapp_desc) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sapp_gles2() -> bool; +} +extern "C" { + pub fn sapp_html5_ask_leave_site(ask: bool); +} +extern "C" { + pub fn sapp_metal_get_device() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_metal_get_renderpass_descriptor() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_metal_get_drawable() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_macos_get_window() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_ios_get_window() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_device() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_device_context() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_render_target_view() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_depth_stencil_view() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_win32_get_hwnd() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_android_get_native_activity() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn memcpy( + __dest: *mut ::std::os::raw::c_void, + __src: *const ::std::os::raw::c_void, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memmove( + __dest: *mut ::std::os::raw::c_void, + __src: *const ::std::os::raw::c_void, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memccpy( + __dest: *mut ::std::os::raw::c_void, + __src: *const ::std::os::raw::c_void, + __c: ::std::os::raw::c_int, + __n: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memset( + __s: *mut ::std::os::raw::c_void, + __c: ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memcmp( + __s1: *const ::std::os::raw::c_void, + __s2: *const ::std::os::raw::c_void, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn memchr( + __s: *const ::std::os::raw::c_void, + __c: ::std::os::raw::c_int, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn strcpy( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strncpy( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcat( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strncat( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcmp( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strncmp( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcoll( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strxfrm( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_ulong; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __locale_struct { + pub __locales: [*mut __locale_data; 13usize], + pub __ctype_b: *const ::std::os::raw::c_ushort, + pub __ctype_tolower: *const ::std::os::raw::c_int, + pub __ctype_toupper: *const ::std::os::raw::c_int, + pub __names: [*const ::std::os::raw::c_char; 13usize], +} +pub type __locale_t = *mut __locale_struct; +pub type locale_t = __locale_t; +extern "C" { + pub fn strcoll_l( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + __l: locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strxfrm_l( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: usize, + __l: locale_t, + ) -> usize; +} +extern "C" { + pub fn strdup(__s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strndup( + __string: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strchr( + __s: *const ::std::os::raw::c_char, + __c: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strrchr( + __s: *const ::std::os::raw::c_char, + __c: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcspn( + __s: *const ::std::os::raw::c_char, + __reject: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn strspn( + __s: *const ::std::os::raw::c_char, + __accept: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn strpbrk( + __s: *const ::std::os::raw::c_char, + __accept: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strstr( + __haystack: *const ::std::os::raw::c_char, + __needle: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strtok( + __s: *mut ::std::os::raw::c_char, + __delim: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn __strtok_r( + __s: *mut ::std::os::raw::c_char, + __delim: *const ::std::os::raw::c_char, + __save_ptr: *mut *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strtok_r( + __s: *mut ::std::os::raw::c_char, + __delim: *const ::std::os::raw::c_char, + __save_ptr: *mut *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strlen(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn strnlen(__string: *const ::std::os::raw::c_char, __maxlen: usize) -> usize; +} +extern "C" { + pub fn strerror(__errnum: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}__xpg_strerror_r"] + pub fn strerror_r( + __errnum: ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __buflen: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strerror_l( + __errnum: ::std::os::raw::c_int, + __l: locale_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn bcmp( + __s1: *const ::std::os::raw::c_void, + __s2: *const ::std::os::raw::c_void, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn bcopy( + __src: *const ::std::os::raw::c_void, + __dest: *mut ::std::os::raw::c_void, + __n: usize, + ); +} +extern "C" { + pub fn bzero(__s: *mut ::std::os::raw::c_void, __n: ::std::os::raw::c_ulong); +} +extern "C" { + pub fn index( + __s: *const ::std::os::raw::c_char, + __c: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn rindex( + __s: *const ::std::os::raw::c_char, + __c: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ffs(__i: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ffsl(__l: ::std::os::raw::c_long) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ffsll(__ll: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcasecmp( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strncasecmp( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcasecmp_l( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + __loc: locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strncasecmp_l( + __s1: *const ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + __n: usize, + __loc: locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn explicit_bzero(__s: *mut ::std::os::raw::c_void, __n: usize); +} +extern "C" { + pub fn strsep( + __stringp: *mut *mut ::std::os::raw::c_char, + __delim: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strsignal(__sig: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn __stpcpy( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn stpcpy( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn __stpncpy( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn stpncpy( + __dest: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn __assert_fail( + __assertion: *const ::std::os::raw::c_char, + __file: *const ::std::os::raw::c_char, + __line: ::std::os::raw::c_uint, + __function: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn __assert_perror_fail( + __errnum: ::std::os::raw::c_int, + __file: *const ::std::os::raw::c_char, + __line: ::std::os::raw::c_uint, + __function: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn __assert( + __assertion: *const ::std::os::raw::c_char, + __file: *const ::std::os::raw::c_char, + __line: ::std::os::raw::c_int, + ); +} +pub type wchar_t = ::std::os::raw::c_int; +pub type _Float32 = f32; +pub type _Float64 = f64; +pub type _Float32x = f64; +pub type _Float64x = u128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct div_t { + pub quot: ::std::os::raw::c_int, + pub rem: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ldiv_t { + pub quot: ::std::os::raw::c_long, + pub rem: ::std::os::raw::c_long, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct lldiv_t { + pub quot: ::std::os::raw::c_longlong, + pub rem: ::std::os::raw::c_longlong, +} +extern "C" { + pub fn __ctype_get_mb_cur_max() -> usize; +} +extern "C" { + pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; +} +extern "C" { + pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtod( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> f64; +} +extern "C" { + pub fn strtof( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn strtold( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + ) -> u128; +} +extern "C" { + pub fn strtol( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn strtoul( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn strtoq( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtouq( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn strtoll( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtoull( + __nptr: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; +} +pub type u_char = __u_char; +pub type u_short = __u_short; +pub type u_int = __u_int; +pub type u_long = __u_long; +pub type quad_t = __quad_t; +pub type u_quad_t = __u_quad_t; +pub type fsid_t = __fsid_t; +pub type loff_t = __loff_t; +pub type ino_t = __ino_t; +pub type dev_t = __dev_t; +pub type gid_t = __gid_t; +pub type mode_t = __mode_t; +pub type nlink_t = __nlink_t; +pub type uid_t = __uid_t; +pub type off_t = __off_t; +pub type pid_t = __pid_t; +pub type id_t = __id_t; +pub type daddr_t = __daddr_t; +pub type caddr_t = __caddr_t; +pub type key_t = __key_t; +pub type clock_t = __clock_t; +pub type clockid_t = __clockid_t; +pub type time_t = __time_t; +pub type timer_t = __timer_t; +pub type ulong = ::std::os::raw::c_ulong; +pub type ushort = ::std::os::raw::c_ushort; +pub type uint = ::std::os::raw::c_uint; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; +pub type register_t = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sigset_t { + pub __val: [::std::os::raw::c_ulong; 16usize], +} +pub type sigset_t = __sigset_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: __time_t, + pub tv_usec: __suseconds_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timespec { + pub tv_sec: __time_t, + pub tv_nsec: __syscall_slong_t, +} +pub type suseconds_t = __suseconds_t; +pub type __fd_mask = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fd_set { + pub __fds_bits: [__fd_mask; 16usize], +} +pub type fd_mask = __fd_mask; +extern "C" { + pub fn select( + __nfds: ::std::os::raw::c_int, + __readfds: *mut fd_set, + __writefds: *mut fd_set, + __exceptfds: *mut fd_set, + __timeout: *mut timeval, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn pselect( + __nfds: ::std::os::raw::c_int, + __readfds: *mut fd_set, + __writefds: *mut fd_set, + __exceptfds: *mut fd_set, + __timeout: *const timespec, + __sigmask: *const __sigset_t, + ) -> ::std::os::raw::c_int; +} +pub type blksize_t = __blksize_t; +pub type blkcnt_t = __blkcnt_t; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_rwlock_arch_t { + pub __readers: ::std::os::raw::c_uint, + pub __writers: ::std::os::raw::c_uint, + pub __wrphase_futex: ::std::os::raw::c_uint, + pub __writers_futex: ::std::os::raw::c_uint, + pub __pad3: ::std::os::raw::c_uint, + pub __pad4: ::std::os::raw::c_uint, + pub __cur_writer: ::std::os::raw::c_int, + pub __shared: ::std::os::raw::c_int, + pub __rwelision: ::std::os::raw::c_schar, + pub __pad1: [::std::os::raw::c_uchar; 7usize], + pub __pad2: ::std::os::raw::c_ulong, + pub __flags: ::std::os::raw::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_internal_list { + pub __prev: *mut __pthread_internal_list, + pub __next: *mut __pthread_internal_list, +} +pub type __pthread_list_t = __pthread_internal_list; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_mutex_s { + pub __lock: ::std::os::raw::c_int, + pub __count: ::std::os::raw::c_uint, + pub __owner: ::std::os::raw::c_int, + pub __nusers: ::std::os::raw::c_uint, + pub __kind: ::std::os::raw::c_int, + pub __spins: ::std::os::raw::c_short, + pub __elision: ::std::os::raw::c_short, + pub __list: __pthread_list_t, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __pthread_cond_s { + pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1, + pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2, + pub __g_refs: [::std::os::raw::c_uint; 2usize], + pub __g_size: [::std::os::raw::c_uint; 2usize], + pub __g1_orig_size: ::std::os::raw::c_uint, + pub __wrefs: ::std::os::raw::c_uint, + pub __g_signals: [::std::os::raw::c_uint; 2usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __pthread_cond_s__bindgen_ty_1 { + pub __wseq: ::std::os::raw::c_ulonglong, + pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 { + pub __low: ::std::os::raw::c_uint, + pub __high: ::std::os::raw::c_uint, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __pthread_cond_s__bindgen_ty_2 { + pub __g1_start: ::std::os::raw::c_ulonglong, + pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 { + pub __low: ::std::os::raw::c_uint, + pub __high: ::std::os::raw::c_uint, +} +pub type pthread_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutexattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_condattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, + _bindgen_union_align: u32, +} +pub type pthread_key_t = ::std::os::raw::c_uint; +pub type pthread_once_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_attr_t { + pub __size: [::std::os::raw::c_char; 56usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 7usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutex_t { + pub __data: __pthread_mutex_s, + pub __size: [::std::os::raw::c_char; 40usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 5usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_cond_t { + pub __data: __pthread_cond_s, + pub __size: [::std::os::raw::c_char; 48usize], + pub __align: ::std::os::raw::c_longlong, + _bindgen_union_align: [u64; 6usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_rwlock_t { + pub __data: __pthread_rwlock_arch_t, + pub __size: [::std::os::raw::c_char; 56usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 7usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_rwlockattr_t { + pub __size: [::std::os::raw::c_char; 8usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: u64, +} +pub type pthread_spinlock_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_barrier_t { + pub __size: [::std::os::raw::c_char; 32usize], + pub __align: ::std::os::raw::c_long, + _bindgen_union_align: [u64; 4usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_barrierattr_t { + pub __size: [::std::os::raw::c_char; 4usize], + pub __align: ::std::os::raw::c_int, + _bindgen_union_align: u32, +} +extern "C" { + pub fn random() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn srandom(__seed: ::std::os::raw::c_uint); +} +extern "C" { + pub fn initstate( + __seed: ::std::os::raw::c_uint, + __statebuf: *mut ::std::os::raw::c_char, + __statelen: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn setstate(__statebuf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct random_data { + pub fptr: *mut i32, + pub rptr: *mut i32, + pub state: *mut i32, + pub rand_type: ::std::os::raw::c_int, + pub rand_deg: ::std::os::raw::c_int, + pub rand_sep: ::std::os::raw::c_int, + pub end_ptr: *mut i32, +} +extern "C" { + pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srandom_r( + __seed: ::std::os::raw::c_uint, + __buf: *mut random_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn initstate_r( + __seed: ::std::os::raw::c_uint, + __statebuf: *mut ::std::os::raw::c_char, + __statelen: usize, + __buf: *mut random_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setstate_r( + __statebuf: *mut ::std::os::raw::c_char, + __buf: *mut random_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rand() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srand(__seed: ::std::os::raw::c_uint); +} +extern "C" { + pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn drand48() -> f64; +} +extern "C" { + pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; +} +extern "C" { + pub fn lrand48() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn mrand48() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn srand48(__seedval: ::std::os::raw::c_long); +} +extern "C" { + pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct drand48_data { + pub __x: [::std::os::raw::c_ushort; 3usize], + pub __old_x: [::std::os::raw::c_ushort; 3usize], + pub __c: ::std::os::raw::c_ushort, + pub __init: ::std::os::raw::c_ushort, + pub __a: ::std::os::raw::c_ulonglong, +} +extern "C" { + pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn erand48_r( + __xsubi: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + __result: *mut f64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lrand48_r( + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nrand48_r( + __xsubi: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mrand48_r( + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn jrand48_r( + __xsubi: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + __result: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srand48_r( + __seedval: ::std::os::raw::c_long, + __buffer: *mut drand48_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn seed48_r( + __seed16v: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lcong48_r( + __param: *mut ::std::os::raw::c_ushort, + __buffer: *mut drand48_data, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn calloc( + __nmemb: ::std::os::raw::c_ulong, + __size: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn realloc( + __ptr: *mut ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn reallocarray( + __ptr: *mut ::std::os::raw::c_void, + __nmemb: usize, + __size: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn free(__ptr: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn alloca(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn valloc(__size: usize) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn posix_memalign( + __memptr: *mut *mut ::std::os::raw::c_void, + __alignment: usize, + __size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn abort(); +} +extern "C" { + pub fn atexit(__func: ::std::option::Option) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn at_quick_exit( + __func: ::std::option::Option, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn on_exit( + __func: ::std::option::Option< + unsafe extern "C" fn( + __status: ::std::os::raw::c_int, + __arg: *mut ::std::os::raw::c_void, + ), + >, + __arg: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn exit(__status: ::std::os::raw::c_int); +} +extern "C" { + pub fn quick_exit(__status: ::std::os::raw::c_int); +} +extern "C" { + pub fn _Exit(__status: ::std::os::raw::c_int); +} +extern "C" { + pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setenv( + __name: *const ::std::os::raw::c_char, + __value: *const ::std::os::raw::c_char, + __replace: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clearenv() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mkstemps( + __template: *mut ::std::os::raw::c_char, + __suffixlen: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn realpath( + __name: *const ::std::os::raw::c_char, + __resolved: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +pub type __compar_fn_t = ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn bsearch( + __key: *const ::std::os::raw::c_void, + __base: *const ::std::os::raw::c_void, + __nmemb: usize, + __size: usize, + __compar: __compar_fn_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn qsort( + __base: *mut ::std::os::raw::c_void, + __nmemb: usize, + __size: usize, + __compar: __compar_fn_t, + ); +} +extern "C" { + pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int) -> div_t; +} +extern "C" { + pub fn ldiv(__numer: ::std::os::raw::c_long, __denom: ::std::os::raw::c_long) -> ldiv_t; +} +extern "C" { + pub fn lldiv( + __numer: ::std::os::raw::c_longlong, + __denom: ::std::os::raw::c_longlong, + ) -> lldiv_t; +} +extern "C" { + pub fn ecvt( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fcvt( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn gcvt( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn qecvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn qfcvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn qgcvt( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ecvt_r( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fcvt_r( + __value: f64, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn qecvt_r( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn qfcvt_r( + __value: u128, + __ndigit: ::std::os::raw::c_int, + __decpt: *mut ::std::os::raw::c_int, + __sign: *mut ::std::os::raw::c_int, + __buf: *mut ::std::os::raw::c_char, + __len: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbtowc( + __pwc: *mut wchar_t, + __s: *const ::std::os::raw::c_char, + __n: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> usize; +} +extern "C" { + pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t, __n: usize) -> usize; +} +extern "C" { + pub fn rpmatch(__response: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getsubopt( + __optionp: *mut *mut ::std::os::raw::c_char, + __tokens: *const *mut ::std::os::raw::c_char, + __valuep: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getloadavg(__loadavg: *mut f64, __nelem: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __mbstate_t { + pub __count: ::std::os::raw::c_int, + pub __value: __mbstate_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union __mbstate_t__bindgen_ty_1 { + pub __wch: ::std::os::raw::c_uint, + pub __wchb: [::std::os::raw::c_char; 4usize], + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _G_fpos_t { + pub __pos: __off_t, + pub __state: __mbstate_t, +} +pub type __fpos_t = _G_fpos_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _G_fpos64_t { + pub __pos: __off64_t, + pub __state: __mbstate_t, +} +pub type __fpos64_t = _G_fpos64_t; +pub type __FILE = _IO_FILE; +pub type FILE = _IO_FILE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_marker { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_codecvt { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_wide_data { + _unused: [u8; 0], +} +pub type _IO_lock_t = ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_FILE { + pub _flags: ::std::os::raw::c_int, + pub _IO_read_ptr: *mut ::std::os::raw::c_char, + pub _IO_read_end: *mut ::std::os::raw::c_char, + pub _IO_read_base: *mut ::std::os::raw::c_char, + pub _IO_write_base: *mut ::std::os::raw::c_char, + pub _IO_write_ptr: *mut ::std::os::raw::c_char, + pub _IO_write_end: *mut ::std::os::raw::c_char, + pub _IO_buf_base: *mut ::std::os::raw::c_char, + pub _IO_buf_end: *mut ::std::os::raw::c_char, + pub _IO_save_base: *mut ::std::os::raw::c_char, + pub _IO_backup_base: *mut ::std::os::raw::c_char, + pub _IO_save_end: *mut ::std::os::raw::c_char, + pub _markers: *mut _IO_marker, + pub _chain: *mut _IO_FILE, + pub _fileno: ::std::os::raw::c_int, + pub _flags2: ::std::os::raw::c_int, + pub _old_offset: __off_t, + pub _cur_column: ::std::os::raw::c_ushort, + pub _vtable_offset: ::std::os::raw::c_schar, + pub _shortbuf: [::std::os::raw::c_char; 1usize], + pub _lock: *mut _IO_lock_t, + pub _offset: __off64_t, + pub _codecvt: *mut _IO_codecvt, + pub _wide_data: *mut _IO_wide_data, + pub _freeres_list: *mut _IO_FILE, + pub _freeres_buf: *mut ::std::os::raw::c_void, + pub __pad5: usize, + pub _mode: ::std::os::raw::c_int, + pub _unused2: [::std::os::raw::c_char; 20usize], +} +pub type fpos_t = __fpos_t; +extern "C" { + pub static mut stdin: *mut FILE; +} +extern "C" { + pub static mut stdout: *mut FILE; +} +extern "C" { + pub static mut stderr: *mut FILE; +} +extern "C" { + pub fn remove(__filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rename( + __old: *const ::std::os::raw::c_char, + __new: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn renameat( + __oldfd: ::std::os::raw::c_int, + __old: *const ::std::os::raw::c_char, + __newfd: ::std::os::raw::c_int, + __new: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tmpfile() -> *mut FILE; +} +extern "C" { + pub fn tmpnam(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn tmpnam_r(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn tempnam( + __dir: *const ::std::os::raw::c_char, + __pfx: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fclose(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fflush(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fflush_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fopen( + __filename: *const ::std::os::raw::c_char, + __modes: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn freopen( + __filename: *const ::std::os::raw::c_char, + __modes: *const ::std::os::raw::c_char, + __stream: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn fdopen(__fd: ::std::os::raw::c_int, __modes: *const ::std::os::raw::c_char) + -> *mut FILE; +} +extern "C" { + pub fn fmemopen( + __s: *mut ::std::os::raw::c_void, + __len: usize, + __modes: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn open_memstream( + __bufloc: *mut *mut ::std::os::raw::c_char, + __sizeloc: *mut usize, + ) -> *mut FILE; +} +extern "C" { + pub fn setbuf(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn setvbuf( + __stream: *mut FILE, + __buf: *mut ::std::os::raw::c_char, + __modes: ::std::os::raw::c_int, + __n: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setbuffer(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char, __size: usize); +} +extern "C" { + pub fn setlinebuf(__stream: *mut FILE); +} +extern "C" { + pub fn fprintf( + __stream: *mut FILE, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn printf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sprintf( + __s: *mut ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfprintf( + __s: *mut FILE, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vprintf( + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsprintf( + __s: *mut ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn snprintf( + __s: *mut ::std::os::raw::c_char, + __maxlen: ::std::os::raw::c_ulong, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsnprintf( + __s: *mut ::std::os::raw::c_char, + __maxlen: ::std::os::raw::c_ulong, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vdprintf( + __fd: ::std::os::raw::c_int, + __fmt: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn dprintf( + __fd: ::std::os::raw::c_int, + __fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fscanf( + __stream: *mut FILE, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn scanf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sscanf( + __s: *const ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_fscanf"] + pub fn fscanf1( + __stream: *mut FILE, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_scanf"] + pub fn scanf1(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_sscanf"] + pub fn sscanf1( + __s: *const ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfscanf( + __s: *mut FILE, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vscanf( + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsscanf( + __s: *const ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_vfscanf"] + pub fn vfscanf1( + __s: *mut FILE, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_vscanf"] + pub fn vscanf1( + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}__isoc99_vsscanf"] + pub fn vsscanf1( + __s: *const ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + __arg: *mut __va_list_tag, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetc(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getc(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getchar_unlocked() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putchar(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putchar_unlocked(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getw(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putw(__w: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgets( + __s: *mut ::std::os::raw::c_char, + __n: ::std::os::raw::c_int, + __stream: *mut FILE, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn __getdelim( + __lineptr: *mut *mut ::std::os::raw::c_char, + __n: *mut usize, + __delimiter: ::std::os::raw::c_int, + __stream: *mut FILE, + ) -> __ssize_t; +} +extern "C" { + pub fn getdelim( + __lineptr: *mut *mut ::std::os::raw::c_char, + __n: *mut usize, + __delimiter: ::std::os::raw::c_int, + __stream: *mut FILE, + ) -> __ssize_t; +} +extern "C" { + pub fn getline( + __lineptr: *mut *mut ::std::os::raw::c_char, + __n: *mut usize, + __stream: *mut FILE, + ) -> __ssize_t; +} +extern "C" { + pub fn fputs(__s: *const ::std::os::raw::c_char, __stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ungetc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fread( + __ptr: *mut ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + __n: ::std::os::raw::c_ulong, + __stream: *mut FILE, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn fwrite( + __ptr: *const ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + __n: ::std::os::raw::c_ulong, + __s: *mut FILE, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn fread_unlocked( + __ptr: *mut ::std::os::raw::c_void, + __size: usize, + __n: usize, + __stream: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn fwrite_unlocked( + __ptr: *const ::std::os::raw::c_void, + __size: usize, + __n: usize, + __stream: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn fseek( + __stream: *mut FILE, + __off: ::std::os::raw::c_long, + __whence: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftell(__stream: *mut FILE) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn rewind(__stream: *mut FILE); +} +extern "C" { + pub fn fseeko( + __stream: *mut FILE, + __off: __off_t, + __whence: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftello(__stream: *mut FILE) -> __off_t; +} +extern "C" { + pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clearerr(__stream: *mut FILE); +} +extern "C" { + pub fn feof(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ferror(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn clearerr_unlocked(__stream: *mut FILE); +} +extern "C" { + pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ferror_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn perror(__s: *const ::std::os::raw::c_char); +} +extern "C" { + pub static mut sys_nerr: ::std::os::raw::c_int; +} +extern "C" { + pub static mut sys_errlist: [*const ::std::os::raw::c_char; 0usize]; +} +extern "C" { + pub fn fileno(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fileno_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn popen( + __command: *const ::std::os::raw::c_char, + __modes: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn pclose(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ctermid(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn flockfile(__stream: *mut FILE); +} +extern "C" { + pub fn ftrylockfile(__stream: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn funlockfile(__stream: *mut FILE); +} +extern "C" { + pub fn __uflow(arg1: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __overflow(arg1: *mut FILE, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +pub const _SAPP_MAX_TITLE_LENGTH: _bindgen_ty_3 = 128; +pub type _bindgen_ty_3 = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _sapp_state { + pub valid: bool, + pub window_width: ::std::os::raw::c_int, + pub window_height: ::std::os::raw::c_int, + pub framebuffer_width: ::std::os::raw::c_int, + pub framebuffer_height: ::std::os::raw::c_int, + pub sample_count: ::std::os::raw::c_int, + pub swap_interval: ::std::os::raw::c_int, + pub dpi_scale: f32, + pub gles2_fallback: bool, + pub first_frame: bool, + pub init_called: bool, + pub cleanup_called: bool, + pub quit_requested: bool, + pub quit_ordered: bool, + pub html5_canvas_name: *const ::std::os::raw::c_char, + pub html5_ask_leave_site: bool, + pub window_title: [::std::os::raw::c_char; 128usize], + pub window_title_wide: [wchar_t; 128usize], + pub frame_count: u64, + pub mouse_x: f32, + pub mouse_y: f32, + pub win32_mouse_tracked: bool, + pub onscreen_keyboard_shown: bool, + pub event: sapp_event, + pub desc: sapp_desc, + pub keycodes: [sapp_keycode; 512usize], +} +extern "C" { + pub static mut _sapp: _sapp_state; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _sapp_gl_fbconfig { + pub red_bits: ::std::os::raw::c_int, + pub green_bits: ::std::os::raw::c_int, + pub blue_bits: ::std::os::raw::c_int, + pub alpha_bits: ::std::os::raw::c_int, + pub depth_bits: ::std::os::raw::c_int, + pub stencil_bits: ::std::os::raw::c_int, + pub samples: ::std::os::raw::c_int, + pub doublebuffer: bool, + pub handle: usize, +} +pub type XID = ::std::os::raw::c_ulong; +pub type Mask = ::std::os::raw::c_ulong; +pub type Atom = ::std::os::raw::c_ulong; +pub type VisualID = ::std::os::raw::c_ulong; +pub type Time = ::std::os::raw::c_ulong; +pub type Window = XID; +pub type Drawable = XID; +pub type Font = XID; +pub type Pixmap = XID; +pub type Cursor = XID; +pub type Colormap = XID; +pub type GContext = XID; +pub type KeySym = XID; +pub type KeyCode = ::std::os::raw::c_uchar; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, + pub __bindgen_padding_0: u64, + pub __clang_max_align_nonce2: u128, +} +extern "C" { + pub fn _Xmblen( + str: *mut ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +pub type XPointer = *mut ::std::os::raw::c_char; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XExtData { + pub number: ::std::os::raw::c_int, + pub next: *mut _XExtData, + pub free_private: ::std::option::Option< + unsafe extern "C" fn(extension: *mut _XExtData) -> ::std::os::raw::c_int, + >, + pub private_data: XPointer, +} +pub type XExtData = _XExtData; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XExtCodes { + pub extension: ::std::os::raw::c_int, + pub major_opcode: ::std::os::raw::c_int, + pub first_event: ::std::os::raw::c_int, + pub first_error: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XPixmapFormatValues { + pub depth: ::std::os::raw::c_int, + pub bits_per_pixel: ::std::os::raw::c_int, + pub scanline_pad: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XGCValues { + pub function: ::std::os::raw::c_int, + pub plane_mask: ::std::os::raw::c_ulong, + pub foreground: ::std::os::raw::c_ulong, + pub background: ::std::os::raw::c_ulong, + pub line_width: ::std::os::raw::c_int, + pub line_style: ::std::os::raw::c_int, + pub cap_style: ::std::os::raw::c_int, + pub join_style: ::std::os::raw::c_int, + pub fill_style: ::std::os::raw::c_int, + pub fill_rule: ::std::os::raw::c_int, + pub arc_mode: ::std::os::raw::c_int, + pub tile: Pixmap, + pub stipple: Pixmap, + pub ts_x_origin: ::std::os::raw::c_int, + pub ts_y_origin: ::std::os::raw::c_int, + pub font: Font, + pub subwindow_mode: ::std::os::raw::c_int, + pub graphics_exposures: ::std::os::raw::c_int, + pub clip_x_origin: ::std::os::raw::c_int, + pub clip_y_origin: ::std::os::raw::c_int, + pub clip_mask: Pixmap, + pub dash_offset: ::std::os::raw::c_int, + pub dashes: ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XGC { + _unused: [u8; 0], +} +pub type GC = *mut _XGC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Visual { + pub ext_data: *mut XExtData, + pub visualid: VisualID, + pub class: ::std::os::raw::c_int, + pub red_mask: ::std::os::raw::c_ulong, + pub green_mask: ::std::os::raw::c_ulong, + pub blue_mask: ::std::os::raw::c_ulong, + pub bits_per_rgb: ::std::os::raw::c_int, + pub map_entries: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Depth { + pub depth: ::std::os::raw::c_int, + pub nvisuals: ::std::os::raw::c_int, + pub visuals: *mut Visual, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XDisplay { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Screen { + pub ext_data: *mut XExtData, + pub display: *mut _XDisplay, + pub root: Window, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub mwidth: ::std::os::raw::c_int, + pub mheight: ::std::os::raw::c_int, + pub ndepths: ::std::os::raw::c_int, + pub depths: *mut Depth, + pub root_depth: ::std::os::raw::c_int, + pub root_visual: *mut Visual, + pub default_gc: GC, + pub cmap: Colormap, + pub white_pixel: ::std::os::raw::c_ulong, + pub black_pixel: ::std::os::raw::c_ulong, + pub max_maps: ::std::os::raw::c_int, + pub min_maps: ::std::os::raw::c_int, + pub backing_store: ::std::os::raw::c_int, + pub save_unders: ::std::os::raw::c_int, + pub root_input_mask: ::std::os::raw::c_long, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ScreenFormat { + pub ext_data: *mut XExtData, + pub depth: ::std::os::raw::c_int, + pub bits_per_pixel: ::std::os::raw::c_int, + pub scanline_pad: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSetWindowAttributes { + pub background_pixmap: Pixmap, + pub background_pixel: ::std::os::raw::c_ulong, + pub border_pixmap: Pixmap, + pub border_pixel: ::std::os::raw::c_ulong, + pub bit_gravity: ::std::os::raw::c_int, + pub win_gravity: ::std::os::raw::c_int, + pub backing_store: ::std::os::raw::c_int, + pub backing_planes: ::std::os::raw::c_ulong, + pub backing_pixel: ::std::os::raw::c_ulong, + pub save_under: ::std::os::raw::c_int, + pub event_mask: ::std::os::raw::c_long, + pub do_not_propagate_mask: ::std::os::raw::c_long, + pub override_redirect: ::std::os::raw::c_int, + pub colormap: Colormap, + pub cursor: Cursor, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XWindowAttributes { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub border_width: ::std::os::raw::c_int, + pub depth: ::std::os::raw::c_int, + pub visual: *mut Visual, + pub root: Window, + pub class: ::std::os::raw::c_int, + pub bit_gravity: ::std::os::raw::c_int, + pub win_gravity: ::std::os::raw::c_int, + pub backing_store: ::std::os::raw::c_int, + pub backing_planes: ::std::os::raw::c_ulong, + pub backing_pixel: ::std::os::raw::c_ulong, + pub save_under: ::std::os::raw::c_int, + pub colormap: Colormap, + pub map_installed: ::std::os::raw::c_int, + pub map_state: ::std::os::raw::c_int, + pub all_event_masks: ::std::os::raw::c_long, + pub your_event_mask: ::std::os::raw::c_long, + pub do_not_propagate_mask: ::std::os::raw::c_long, + pub override_redirect: ::std::os::raw::c_int, + pub screen: *mut Screen, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XHostAddress { + pub family: ::std::os::raw::c_int, + pub length: ::std::os::raw::c_int, + pub address: *mut ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XServerInterpretedAddress { + pub typelength: ::std::os::raw::c_int, + pub valuelength: ::std::os::raw::c_int, + pub type_: *mut ::std::os::raw::c_char, + pub value: *mut ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XImage { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub xoffset: ::std::os::raw::c_int, + pub format: ::std::os::raw::c_int, + pub data: *mut ::std::os::raw::c_char, + pub byte_order: ::std::os::raw::c_int, + pub bitmap_unit: ::std::os::raw::c_int, + pub bitmap_bit_order: ::std::os::raw::c_int, + pub bitmap_pad: ::std::os::raw::c_int, + pub depth: ::std::os::raw::c_int, + pub bytes_per_line: ::std::os::raw::c_int, + pub bits_per_pixel: ::std::os::raw::c_int, + pub red_mask: ::std::os::raw::c_ulong, + pub green_mask: ::std::os::raw::c_ulong, + pub blue_mask: ::std::os::raw::c_ulong, + pub obdata: XPointer, + pub f: _XImage_funcs, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XImage_funcs { + pub create_image: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut _XDisplay, + arg2: *mut Visual, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_char, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_uint, + arg9: ::std::os::raw::c_int, + arg10: ::std::os::raw::c_int, + ) -> *mut _XImage, + >, + pub destroy_image: + ::std::option::Option ::std::os::raw::c_int>, + pub get_pixel: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut _XImage, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong, + >, + pub put_pixel: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut _XImage, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int, + >, + pub sub_image: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut _XImage, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> *mut _XImage, + >, + pub add_pixel: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut _XImage, + arg2: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int, + >, +} +pub type XImage = _XImage; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XWindowChanges { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub border_width: ::std::os::raw::c_int, + pub sibling: Window, + pub stack_mode: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XColor { + pub pixel: ::std::os::raw::c_ulong, + pub red: ::std::os::raw::c_ushort, + pub green: ::std::os::raw::c_ushort, + pub blue: ::std::os::raw::c_ushort, + pub flags: ::std::os::raw::c_char, + pub pad: ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSegment { + pub x1: ::std::os::raw::c_short, + pub y1: ::std::os::raw::c_short, + pub x2: ::std::os::raw::c_short, + pub y2: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XPoint { + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRectangle { + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, + pub width: ::std::os::raw::c_ushort, + pub height: ::std::os::raw::c_ushort, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XArc { + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, + pub width: ::std::os::raw::c_ushort, + pub height: ::std::os::raw::c_ushort, + pub angle1: ::std::os::raw::c_short, + pub angle2: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XKeyboardControl { + pub key_click_percent: ::std::os::raw::c_int, + pub bell_percent: ::std::os::raw::c_int, + pub bell_pitch: ::std::os::raw::c_int, + pub bell_duration: ::std::os::raw::c_int, + pub led: ::std::os::raw::c_int, + pub led_mode: ::std::os::raw::c_int, + pub key: ::std::os::raw::c_int, + pub auto_repeat_mode: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XKeyboardState { + pub key_click_percent: ::std::os::raw::c_int, + pub bell_percent: ::std::os::raw::c_int, + pub bell_pitch: ::std::os::raw::c_uint, + pub bell_duration: ::std::os::raw::c_uint, + pub led_mask: ::std::os::raw::c_ulong, + pub global_auto_repeat: ::std::os::raw::c_int, + pub auto_repeats: [::std::os::raw::c_char; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XTimeCoord { + pub time: Time, + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XModifierKeymap { + pub max_keypermod: ::std::os::raw::c_int, + pub modifiermap: *mut KeyCode, +} +pub type Display = _XDisplay; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XPrivate { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XrmHashBucketRec { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _bindgen_ty_4 { + pub ext_data: *mut XExtData, + pub private1: *mut _XPrivate, + pub fd: ::std::os::raw::c_int, + pub private2: ::std::os::raw::c_int, + pub proto_major_version: ::std::os::raw::c_int, + pub proto_minor_version: ::std::os::raw::c_int, + pub vendor: *mut ::std::os::raw::c_char, + pub private3: XID, + pub private4: XID, + pub private5: XID, + pub private6: ::std::os::raw::c_int, + pub resource_alloc: ::std::option::Option XID>, + pub byte_order: ::std::os::raw::c_int, + pub bitmap_unit: ::std::os::raw::c_int, + pub bitmap_pad: ::std::os::raw::c_int, + pub bitmap_bit_order: ::std::os::raw::c_int, + pub nformats: ::std::os::raw::c_int, + pub pixmap_format: *mut ScreenFormat, + pub private8: ::std::os::raw::c_int, + pub release: ::std::os::raw::c_int, + pub private9: *mut _XPrivate, + pub private10: *mut _XPrivate, + pub qlen: ::std::os::raw::c_int, + pub last_request_read: ::std::os::raw::c_ulong, + pub request: ::std::os::raw::c_ulong, + pub private11: XPointer, + pub private12: XPointer, + pub private13: XPointer, + pub private14: XPointer, + pub max_request_size: ::std::os::raw::c_uint, + pub db: *mut _XrmHashBucketRec, + pub private15: + ::std::option::Option ::std::os::raw::c_int>, + pub display_name: *mut ::std::os::raw::c_char, + pub default_screen: ::std::os::raw::c_int, + pub nscreens: ::std::os::raw::c_int, + pub screens: *mut Screen, + pub motion_buffer: ::std::os::raw::c_ulong, + pub private16: ::std::os::raw::c_ulong, + pub min_keycode: ::std::os::raw::c_int, + pub max_keycode: ::std::os::raw::c_int, + pub private17: XPointer, + pub private18: XPointer, + pub private19: ::std::os::raw::c_int, + pub xdefaults: *mut ::std::os::raw::c_char, +} +pub type _XPrivDisplay = *mut _bindgen_ty_4; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XKeyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub root: Window, + pub subwindow: Window, + pub time: Time, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub x_root: ::std::os::raw::c_int, + pub y_root: ::std::os::raw::c_int, + pub state: ::std::os::raw::c_uint, + pub keycode: ::std::os::raw::c_uint, + pub same_screen: ::std::os::raw::c_int, +} +pub type XKeyPressedEvent = XKeyEvent; +pub type XKeyReleasedEvent = XKeyEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XButtonEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub root: Window, + pub subwindow: Window, + pub time: Time, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub x_root: ::std::os::raw::c_int, + pub y_root: ::std::os::raw::c_int, + pub state: ::std::os::raw::c_uint, + pub button: ::std::os::raw::c_uint, + pub same_screen: ::std::os::raw::c_int, +} +pub type XButtonPressedEvent = XButtonEvent; +pub type XButtonReleasedEvent = XButtonEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XMotionEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub root: Window, + pub subwindow: Window, + pub time: Time, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub x_root: ::std::os::raw::c_int, + pub y_root: ::std::os::raw::c_int, + pub state: ::std::os::raw::c_uint, + pub is_hint: ::std::os::raw::c_char, + pub same_screen: ::std::os::raw::c_int, +} +pub type XPointerMovedEvent = XMotionEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XCrossingEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub root: Window, + pub subwindow: Window, + pub time: Time, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub x_root: ::std::os::raw::c_int, + pub y_root: ::std::os::raw::c_int, + pub mode: ::std::os::raw::c_int, + pub detail: ::std::os::raw::c_int, + pub same_screen: ::std::os::raw::c_int, + pub focus: ::std::os::raw::c_int, + pub state: ::std::os::raw::c_uint, +} +pub type XEnterWindowEvent = XCrossingEvent; +pub type XLeaveWindowEvent = XCrossingEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XFocusChangeEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub mode: ::std::os::raw::c_int, + pub detail: ::std::os::raw::c_int, +} +pub type XFocusInEvent = XFocusChangeEvent; +pub type XFocusOutEvent = XFocusChangeEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XKeymapEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub key_vector: [::std::os::raw::c_char; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XExposeEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub count: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XGraphicsExposeEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub drawable: Drawable, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub count: ::std::os::raw::c_int, + pub major_code: ::std::os::raw::c_int, + pub minor_code: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XNoExposeEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub drawable: Drawable, + pub major_code: ::std::os::raw::c_int, + pub minor_code: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XVisibilityEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub state: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XCreateWindowEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub parent: Window, + pub window: Window, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub border_width: ::std::os::raw::c_int, + pub override_redirect: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XDestroyWindowEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XUnmapEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, + pub from_configure: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XMapEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, + pub override_redirect: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XMapRequestEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub parent: Window, + pub window: Window, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XReparentEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, + pub parent: Window, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub override_redirect: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XConfigureEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub border_width: ::std::os::raw::c_int, + pub above: Window, + pub override_redirect: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XGravityEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XResizeRequestEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XConfigureRequestEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub parent: Window, + pub window: Window, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub border_width: ::std::os::raw::c_int, + pub above: Window, + pub detail: ::std::os::raw::c_int, + pub value_mask: ::std::os::raw::c_ulong, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XCirculateEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub event: Window, + pub window: Window, + pub place: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XCirculateRequestEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub parent: Window, + pub window: Window, + pub place: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XPropertyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub atom: Atom, + pub time: Time, + pub state: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSelectionClearEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub selection: Atom, + pub time: Time, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSelectionRequestEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub owner: Window, + pub requestor: Window, + pub selection: Atom, + pub target: Atom, + pub property: Atom, + pub time: Time, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSelectionEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub requestor: Window, + pub selection: Atom, + pub target: Atom, + pub property: Atom, + pub time: Time, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XColormapEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub colormap: Colormap, + pub new: ::std::os::raw::c_int, + pub state: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct XClientMessageEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub message_type: Atom, + pub format: ::std::os::raw::c_int, + pub data: XClientMessageEvent__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union XClientMessageEvent__bindgen_ty_1 { + pub b: [::std::os::raw::c_char; 20usize], + pub s: [::std::os::raw::c_short; 10usize], + pub l: [::std::os::raw::c_long; 5usize], + _bindgen_union_align: [u64; 5usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XMappingEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub request: ::std::os::raw::c_int, + pub first_keycode: ::std::os::raw::c_int, + pub count: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XErrorEvent { + pub type_: ::std::os::raw::c_int, + pub display: *mut Display, + pub resourceid: XID, + pub serial: ::std::os::raw::c_ulong, + pub error_code: ::std::os::raw::c_uchar, + pub request_code: ::std::os::raw::c_uchar, + pub minor_code: ::std::os::raw::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XAnyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XGenericEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub extension: ::std::os::raw::c_int, + pub evtype: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XGenericEventCookie { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub extension: ::std::os::raw::c_int, + pub evtype: ::std::os::raw::c_int, + pub cookie: ::std::os::raw::c_uint, + pub data: *mut ::std::os::raw::c_void, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _XEvent { + pub type_: ::std::os::raw::c_int, + pub xany: XAnyEvent, + pub xkey: XKeyEvent, + pub xbutton: XButtonEvent, + pub xmotion: XMotionEvent, + pub xcrossing: XCrossingEvent, + pub xfocus: XFocusChangeEvent, + pub xexpose: XExposeEvent, + pub xgraphicsexpose: XGraphicsExposeEvent, + pub xnoexpose: XNoExposeEvent, + pub xvisibility: XVisibilityEvent, + pub xcreatewindow: XCreateWindowEvent, + pub xdestroywindow: XDestroyWindowEvent, + pub xunmap: XUnmapEvent, + pub xmap: XMapEvent, + pub xmaprequest: XMapRequestEvent, + pub xreparent: XReparentEvent, + pub xconfigure: XConfigureEvent, + pub xgravity: XGravityEvent, + pub xresizerequest: XResizeRequestEvent, + pub xconfigurerequest: XConfigureRequestEvent, + pub xcirculate: XCirculateEvent, + pub xcirculaterequest: XCirculateRequestEvent, + pub xproperty: XPropertyEvent, + pub xselectionclear: XSelectionClearEvent, + pub xselectionrequest: XSelectionRequestEvent, + pub xselection: XSelectionEvent, + pub xcolormap: XColormapEvent, + pub xclient: XClientMessageEvent, + pub xmapping: XMappingEvent, + pub xerror: XErrorEvent, + pub xkeymap: XKeymapEvent, + pub xgeneric: XGenericEvent, + pub xcookie: XGenericEventCookie, + pub pad: [::std::os::raw::c_long; 24usize], + _bindgen_union_align: [u64; 24usize], +} +pub type XEvent = _XEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XCharStruct { + pub lbearing: ::std::os::raw::c_short, + pub rbearing: ::std::os::raw::c_short, + pub width: ::std::os::raw::c_short, + pub ascent: ::std::os::raw::c_short, + pub descent: ::std::os::raw::c_short, + pub attributes: ::std::os::raw::c_ushort, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XFontProp { + pub name: Atom, + pub card32: ::std::os::raw::c_ulong, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XFontStruct { + pub ext_data: *mut XExtData, + pub fid: Font, + pub direction: ::std::os::raw::c_uint, + pub min_char_or_byte2: ::std::os::raw::c_uint, + pub max_char_or_byte2: ::std::os::raw::c_uint, + pub min_byte1: ::std::os::raw::c_uint, + pub max_byte1: ::std::os::raw::c_uint, + pub all_chars_exist: ::std::os::raw::c_int, + pub default_char: ::std::os::raw::c_uint, + pub n_properties: ::std::os::raw::c_int, + pub properties: *mut XFontProp, + pub min_bounds: XCharStruct, + pub max_bounds: XCharStruct, + pub per_char: *mut XCharStruct, + pub ascent: ::std::os::raw::c_int, + pub descent: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XTextItem { + pub chars: *mut ::std::os::raw::c_char, + pub nchars: ::std::os::raw::c_int, + pub delta: ::std::os::raw::c_int, + pub font: Font, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XChar2b { + pub byte1: ::std::os::raw::c_uchar, + pub byte2: ::std::os::raw::c_uchar, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XTextItem16 { + pub chars: *mut XChar2b, + pub nchars: ::std::os::raw::c_int, + pub delta: ::std::os::raw::c_int, + pub font: Font, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union XEDataObject { + pub display: *mut Display, + pub gc: GC, + pub visual: *mut Visual, + pub screen: *mut Screen, + pub pixmap_format: *mut ScreenFormat, + pub font: *mut XFontStruct, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XFontSetExtents { + pub max_ink_extent: XRectangle, + pub max_logical_extent: XRectangle, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XOM { + _unused: [u8; 0], +} +pub type XOM = *mut _XOM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XOC { + _unused: [u8; 0], +} +pub type XOC = *mut _XOC; +pub type XFontSet = *mut _XOC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XmbTextItem { + pub chars: *mut ::std::os::raw::c_char, + pub nchars: ::std::os::raw::c_int, + pub delta: ::std::os::raw::c_int, + pub font_set: XFontSet, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XwcTextItem { + pub chars: *mut wchar_t, + pub nchars: ::std::os::raw::c_int, + pub delta: ::std::os::raw::c_int, + pub font_set: XFontSet, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XOMCharSetList { + pub charset_count: ::std::os::raw::c_int, + pub charset_list: *mut *mut ::std::os::raw::c_char, +} +pub const XOrientation_XOMOrientation_LTR_TTB: XOrientation = 0; +pub const XOrientation_XOMOrientation_RTL_TTB: XOrientation = 1; +pub const XOrientation_XOMOrientation_TTB_LTR: XOrientation = 2; +pub const XOrientation_XOMOrientation_TTB_RTL: XOrientation = 3; +pub const XOrientation_XOMOrientation_Context: XOrientation = 4; +pub type XOrientation = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XOMOrientation { + pub num_orientation: ::std::os::raw::c_int, + pub orientation: *mut XOrientation, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XOMFontInfo { + pub num_font: ::std::os::raw::c_int, + pub font_struct_list: *mut *mut XFontStruct, + pub font_name_list: *mut *mut ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIM { + _unused: [u8; 0], +} +pub type XIM = *mut _XIM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIC { + _unused: [u8; 0], +} +pub type XIC = *mut _XIC; +pub type XIMProc = + ::std::option::Option; +pub type XICProc = ::std::option::Option< + unsafe extern "C" fn(arg1: XIC, arg2: XPointer, arg3: XPointer) -> ::std::os::raw::c_int, +>; +pub type XIDProc = + ::std::option::Option; +pub type XIMStyle = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XIMStyles { + pub count_styles: ::std::os::raw::c_ushort, + pub supported_styles: *mut XIMStyle, +} +pub type XVaNestedList = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XIMCallback { + pub client_data: XPointer, + pub callback: XIMProc, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XICCallback { + pub client_data: XPointer, + pub callback: XICProc, +} +pub type XIMFeedback = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _XIMText { + pub length: ::std::os::raw::c_ushort, + pub feedback: *mut XIMFeedback, + pub encoding_is_wchar: ::std::os::raw::c_int, + pub string: _XIMText__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _XIMText__bindgen_ty_1 { + pub multi_byte: *mut ::std::os::raw::c_char, + pub wide_char: *mut wchar_t, + _bindgen_union_align: u64, +} +pub type XIMText = _XIMText; +pub type XIMPreeditState = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIMPreeditStateNotifyCallbackStruct { + pub state: XIMPreeditState, +} +pub type XIMPreeditStateNotifyCallbackStruct = _XIMPreeditStateNotifyCallbackStruct; +pub type XIMResetState = ::std::os::raw::c_ulong; +pub type XIMStringConversionFeedback = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _XIMStringConversionText { + pub length: ::std::os::raw::c_ushort, + pub feedback: *mut XIMStringConversionFeedback, + pub encoding_is_wchar: ::std::os::raw::c_int, + pub string: _XIMStringConversionText__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _XIMStringConversionText__bindgen_ty_1 { + pub mbs: *mut ::std::os::raw::c_char, + pub wcs: *mut wchar_t, + _bindgen_union_align: u64, +} +pub type XIMStringConversionText = _XIMStringConversionText; +pub type XIMStringConversionPosition = ::std::os::raw::c_ushort; +pub type XIMStringConversionType = ::std::os::raw::c_ushort; +pub type XIMStringConversionOperation = ::std::os::raw::c_ushort; +pub const XIMCaretDirection_XIMForwardChar: XIMCaretDirection = 0; +pub const XIMCaretDirection_XIMBackwardChar: XIMCaretDirection = 1; +pub const XIMCaretDirection_XIMForwardWord: XIMCaretDirection = 2; +pub const XIMCaretDirection_XIMBackwardWord: XIMCaretDirection = 3; +pub const XIMCaretDirection_XIMCaretUp: XIMCaretDirection = 4; +pub const XIMCaretDirection_XIMCaretDown: XIMCaretDirection = 5; +pub const XIMCaretDirection_XIMNextLine: XIMCaretDirection = 6; +pub const XIMCaretDirection_XIMPreviousLine: XIMCaretDirection = 7; +pub const XIMCaretDirection_XIMLineStart: XIMCaretDirection = 8; +pub const XIMCaretDirection_XIMLineEnd: XIMCaretDirection = 9; +pub const XIMCaretDirection_XIMAbsolutePosition: XIMCaretDirection = 10; +pub const XIMCaretDirection_XIMDontChange: XIMCaretDirection = 11; +pub type XIMCaretDirection = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIMStringConversionCallbackStruct { + pub position: XIMStringConversionPosition, + pub direction: XIMCaretDirection, + pub operation: XIMStringConversionOperation, + pub factor: ::std::os::raw::c_ushort, + pub text: *mut XIMStringConversionText, +} +pub type XIMStringConversionCallbackStruct = _XIMStringConversionCallbackStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIMPreeditDrawCallbackStruct { + pub caret: ::std::os::raw::c_int, + pub chg_first: ::std::os::raw::c_int, + pub chg_length: ::std::os::raw::c_int, + pub text: *mut XIMText, +} +pub type XIMPreeditDrawCallbackStruct = _XIMPreeditDrawCallbackStruct; +pub const XIMCaretStyle_XIMIsInvisible: XIMCaretStyle = 0; +pub const XIMCaretStyle_XIMIsPrimary: XIMCaretStyle = 1; +pub const XIMCaretStyle_XIMIsSecondary: XIMCaretStyle = 2; +pub type XIMCaretStyle = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIMPreeditCaretCallbackStruct { + pub position: ::std::os::raw::c_int, + pub direction: XIMCaretDirection, + pub style: XIMCaretStyle, +} +pub type XIMPreeditCaretCallbackStruct = _XIMPreeditCaretCallbackStruct; +pub const XIMStatusDataType_XIMTextType: XIMStatusDataType = 0; +pub const XIMStatusDataType_XIMBitmapType: XIMStatusDataType = 1; +pub type XIMStatusDataType = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _XIMStatusDrawCallbackStruct { + pub type_: XIMStatusDataType, + pub data: _XIMStatusDrawCallbackStruct__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _XIMStatusDrawCallbackStruct__bindgen_ty_1 { + pub text: *mut XIMText, + pub bitmap: Pixmap, + _bindgen_union_align: u64, +} +pub type XIMStatusDrawCallbackStruct = _XIMStatusDrawCallbackStruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIMHotKeyTrigger { + pub keysym: KeySym, + pub modifier: ::std::os::raw::c_int, + pub modifier_mask: ::std::os::raw::c_int, +} +pub type XIMHotKeyTrigger = _XIMHotKeyTrigger; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIMHotKeyTriggers { + pub num_hot_key: ::std::os::raw::c_int, + pub key: *mut XIMHotKeyTrigger, +} +pub type XIMHotKeyTriggers = _XIMHotKeyTriggers; +pub type XIMHotKeyState = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XIMValuesList { + pub count_values: ::std::os::raw::c_ushort, + pub supported_values: *mut *mut ::std::os::raw::c_char, +} +extern "C" { + pub static mut _Xdebug: ::std::os::raw::c_int; +} +extern "C" { + pub fn XLoadQueryFont( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + ) -> *mut XFontStruct; +} +extern "C" { + pub fn XQueryFont(arg1: *mut Display, arg2: XID) -> *mut XFontStruct; +} +extern "C" { + pub fn XGetMotionEvents( + arg1: *mut Display, + arg2: Window, + arg3: Time, + arg4: Time, + arg5: *mut ::std::os::raw::c_int, + ) -> *mut XTimeCoord; +} +extern "C" { + pub fn XDeleteModifiermapEntry( + arg1: *mut XModifierKeymap, + arg2: KeyCode, + arg3: ::std::os::raw::c_int, + ) -> *mut XModifierKeymap; +} +extern "C" { + pub fn XGetModifierMapping(arg1: *mut Display) -> *mut XModifierKeymap; +} +extern "C" { + pub fn XInsertModifiermapEntry( + arg1: *mut XModifierKeymap, + arg2: KeyCode, + arg3: ::std::os::raw::c_int, + ) -> *mut XModifierKeymap; +} +extern "C" { + pub fn XNewModifiermap(arg1: ::std::os::raw::c_int) -> *mut XModifierKeymap; +} +extern "C" { + pub fn XCreateImage( + arg1: *mut Display, + arg2: *mut Visual, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_char, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_uint, + arg9: ::std::os::raw::c_int, + arg10: ::std::os::raw::c_int, + ) -> *mut XImage; +} +extern "C" { + pub fn XInitImage(arg1: *mut XImage) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetImage( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_ulong, + arg8: ::std::os::raw::c_int, + ) -> *mut XImage; +} +extern "C" { + pub fn XGetSubImage( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_ulong, + arg8: ::std::os::raw::c_int, + arg9: *mut XImage, + arg10: ::std::os::raw::c_int, + arg11: ::std::os::raw::c_int, + ) -> *mut XImage; +} +extern "C" { + pub fn XOpenDisplay(arg1: *const ::std::os::raw::c_char) -> *mut Display; +} +extern "C" { + pub fn XrmInitialize(); +} +extern "C" { + pub fn XFetchBytes( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XFetchBuffer( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XGetAtomName(arg1: *mut Display, arg2: Atom) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XGetAtomNames( + arg1: *mut Display, + arg2: *mut Atom, + arg3: ::std::os::raw::c_int, + arg4: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetDefault( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XDisplayName(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XKeysymToString(arg1: KeySym) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XSynchronize( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >; +} +extern "C" { + pub fn XSetAfterFunction( + arg1: *mut Display, + arg2: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut Display) -> ::std::os::raw::c_int, + >, + ) -> ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut Display) -> ::std::os::raw::c_int, + >, + ) -> ::std::os::raw::c_int, + >; +} +extern "C" { + pub fn XInternAtom( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> Atom; +} +extern "C" { + pub fn XInternAtoms( + arg1: *mut Display, + arg2: *mut *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *mut Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCopyColormapAndFree(arg1: *mut Display, arg2: Colormap) -> Colormap; +} +extern "C" { + pub fn XCreateColormap( + arg1: *mut Display, + arg2: Window, + arg3: *mut Visual, + arg4: ::std::os::raw::c_int, + ) -> Colormap; +} +extern "C" { + pub fn XCreatePixmapCursor( + arg1: *mut Display, + arg2: Pixmap, + arg3: Pixmap, + arg4: *mut XColor, + arg5: *mut XColor, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + ) -> Cursor; +} +extern "C" { + pub fn XCreateGlyphCursor( + arg1: *mut Display, + arg2: Font, + arg3: Font, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: *const XColor, + arg7: *const XColor, + ) -> Cursor; +} +extern "C" { + pub fn XCreateFontCursor(arg1: *mut Display, arg2: ::std::os::raw::c_uint) -> Cursor; +} +extern "C" { + pub fn XLoadFont(arg1: *mut Display, arg2: *const ::std::os::raw::c_char) -> Font; +} +extern "C" { + pub fn XCreateGC( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_ulong, + arg4: *mut XGCValues, + ) -> GC; +} +extern "C" { + pub fn XGContextFromGC(arg1: GC) -> GContext; +} +extern "C" { + pub fn XFlushGC(arg1: *mut Display, arg2: GC); +} +extern "C" { + pub fn XCreatePixmap( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> Pixmap; +} +extern "C" { + pub fn XCreateBitmapFromData( + arg1: *mut Display, + arg2: Drawable, + arg3: *const ::std::os::raw::c_char, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> Pixmap; +} +extern "C" { + pub fn XCreatePixmapFromBitmapData( + arg1: *mut Display, + arg2: Drawable, + arg3: *mut ::std::os::raw::c_char, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_ulong, + arg7: ::std::os::raw::c_ulong, + arg8: ::std::os::raw::c_uint, + ) -> Pixmap; +} +extern "C" { + pub fn XCreateSimpleWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_ulong, + arg9: ::std::os::raw::c_ulong, + ) -> Window; +} +extern "C" { + pub fn XGetSelectionOwner(arg1: *mut Display, arg2: Atom) -> Window; +} +extern "C" { + pub fn XCreateWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_int, + arg9: ::std::os::raw::c_uint, + arg10: *mut Visual, + arg11: ::std::os::raw::c_ulong, + arg12: *mut XSetWindowAttributes, + ) -> Window; +} +extern "C" { + pub fn XListInstalledColormaps( + arg1: *mut Display, + arg2: Window, + arg3: *mut ::std::os::raw::c_int, + ) -> *mut Colormap; +} +extern "C" { + pub fn XListFonts( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XListFontsWithInfo( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut *mut XFontStruct, + ) -> *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XGetFontPath( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XListExtensions( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + ) -> *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XListProperties( + arg1: *mut Display, + arg2: Window, + arg3: *mut ::std::os::raw::c_int, + ) -> *mut Atom; +} +extern "C" { + pub fn XListHosts( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> *mut XHostAddress; +} +extern "C" { + pub fn XKeycodeToKeysym( + arg1: *mut Display, + arg2: KeyCode, + arg3: ::std::os::raw::c_int, + ) -> KeySym; +} +extern "C" { + pub fn XLookupKeysym(arg1: *mut XKeyEvent, arg2: ::std::os::raw::c_int) -> KeySym; +} +extern "C" { + pub fn XGetKeyboardMapping( + arg1: *mut Display, + arg2: KeyCode, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> *mut KeySym; +} +extern "C" { + pub fn XStringToKeysym(arg1: *const ::std::os::raw::c_char) -> KeySym; +} +extern "C" { + pub fn XMaxRequestSize(arg1: *mut Display) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn XExtendedMaxRequestSize(arg1: *mut Display) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn XResourceManagerString(arg1: *mut Display) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XScreenResourceString(arg1: *mut Screen) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XDisplayMotionBufferSize(arg1: *mut Display) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XVisualIDFromVisual(arg1: *mut Visual) -> VisualID; +} +extern "C" { + pub fn XInitThreads() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XLockDisplay(arg1: *mut Display); +} +extern "C" { + pub fn XUnlockDisplay(arg1: *mut Display); +} +extern "C" { + pub fn XInitExtension( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + ) -> *mut XExtCodes; +} +extern "C" { + pub fn XAddExtension(arg1: *mut Display) -> *mut XExtCodes; +} +extern "C" { + pub fn XFindOnExtensionList( + arg1: *mut *mut XExtData, + arg2: ::std::os::raw::c_int, + ) -> *mut XExtData; +} +extern "C" { + pub fn XEHeadOfExtensionList(arg1: XEDataObject) -> *mut *mut XExtData; +} +extern "C" { + pub fn XRootWindow(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> Window; +} +extern "C" { + pub fn XDefaultRootWindow(arg1: *mut Display) -> Window; +} +extern "C" { + pub fn XRootWindowOfScreen(arg1: *mut Screen) -> Window; +} +extern "C" { + pub fn XDefaultVisual(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> *mut Visual; +} +extern "C" { + pub fn XDefaultVisualOfScreen(arg1: *mut Screen) -> *mut Visual; +} +extern "C" { + pub fn XDefaultGC(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> GC; +} +extern "C" { + pub fn XDefaultGCOfScreen(arg1: *mut Screen) -> GC; +} +extern "C" { + pub fn XBlackPixel(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XWhitePixel(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XAllPlanes() -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XBlackPixelOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XWhitePixelOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XNextRequest(arg1: *mut Display) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XLastKnownRequestProcessed(arg1: *mut Display) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn XServerVendor(arg1: *mut Display) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XDisplayString(arg1: *mut Display) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XDefaultColormap(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> Colormap; +} +extern "C" { + pub fn XDefaultColormapOfScreen(arg1: *mut Screen) -> Colormap; +} +extern "C" { + pub fn XDisplayOfScreen(arg1: *mut Screen) -> *mut Display; +} +extern "C" { + pub fn XScreenOfDisplay(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> *mut Screen; +} +extern "C" { + pub fn XDefaultScreenOfDisplay(arg1: *mut Display) -> *mut Screen; +} +extern "C" { + pub fn XEventMaskOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn XScreenNumberOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +pub type XErrorHandler = ::std::option::Option< + unsafe extern "C" fn(arg1: *mut Display, arg2: *mut XErrorEvent) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn XSetErrorHandler(arg1: XErrorHandler) -> XErrorHandler; +} +pub type XIOErrorHandler = + ::std::option::Option ::std::os::raw::c_int>; +extern "C" { + pub fn XSetIOErrorHandler(arg1: XIOErrorHandler) -> XIOErrorHandler; +} +extern "C" { + pub fn XListPixmapFormats( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + ) -> *mut XPixmapFormatValues; +} +extern "C" { + pub fn XListDepths( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn XReconfigureWMWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_uint, + arg5: *mut XWindowChanges, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWMProtocols( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut Atom, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWMProtocols( + arg1: *mut Display, + arg2: Window, + arg3: *mut Atom, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XIconifyWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWithdrawWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetCommand( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut *mut ::std::os::raw::c_char, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWMColormapWindows( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut Window, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWMColormapWindows( + arg1: *mut Display, + arg2: Window, + arg3: *mut Window, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeStringList(arg1: *mut *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn XSetTransientForHint( + arg1: *mut Display, + arg2: Window, + arg3: Window, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XActivateScreenSaver(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAddHost(arg1: *mut Display, arg2: *mut XHostAddress) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAddHosts( + arg1: *mut Display, + arg2: *mut XHostAddress, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAddToExtensionList( + arg1: *mut *mut _XExtData, + arg2: *mut XExtData, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAddToSaveSet(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAllocColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAllocColorCells( + arg1: *mut Display, + arg2: Colormap, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_ulong, + arg5: ::std::os::raw::c_uint, + arg6: *mut ::std::os::raw::c_ulong, + arg7: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAllocColorPlanes( + arg1: *mut Display, + arg2: Colormap, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_ulong, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + arg8: ::std::os::raw::c_int, + arg9: *mut ::std::os::raw::c_ulong, + arg10: *mut ::std::os::raw::c_ulong, + arg11: *mut ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAllocNamedColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *const ::std::os::raw::c_char, + arg4: *mut XColor, + arg5: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAllowEvents( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAutoRepeatOff(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XAutoRepeatOn(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XBell(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XBitmapBitOrder(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XBitmapPad(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XBitmapUnit(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCellsOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeActivePointerGrab( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: Cursor, + arg4: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeGC( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + arg4: *mut XGCValues, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeKeyboardControl( + arg1: *mut Display, + arg2: ::std::os::raw::c_ulong, + arg3: *mut XKeyboardControl, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeKeyboardMapping( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: *mut KeySym, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangePointerControl( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeProperty( + arg1: *mut Display, + arg2: Window, + arg3: Atom, + arg4: Atom, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const ::std::os::raw::c_uchar, + arg8: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeSaveSet( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XChangeWindowAttributes( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_ulong, + arg4: *mut XSetWindowAttributes, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCheckIfEvent( + arg1: *mut Display, + arg2: *mut XEvent, + arg3: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: *mut XEvent, + arg3: XPointer, + ) -> ::std::os::raw::c_int, + >, + arg4: XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCheckMaskEvent( + arg1: *mut Display, + arg2: ::std::os::raw::c_long, + arg3: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCheckTypedEvent( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCheckTypedWindowEvent( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCheckWindowEvent( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_long, + arg4: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCirculateSubwindows( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCirculateSubwindowsDown(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCirculateSubwindowsUp(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XClearArea( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XClearWindow(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCloseDisplay(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XConfigureWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_uint, + arg4: *mut XWindowChanges, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XConnectionNumber(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XConvertSelection( + arg1: *mut Display, + arg2: Atom, + arg3: Atom, + arg4: Atom, + arg5: Window, + arg6: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCopyArea( + arg1: *mut Display, + arg2: Drawable, + arg3: Drawable, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_uint, + arg9: ::std::os::raw::c_int, + arg10: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCopyGC( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + arg4: GC, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCopyPlane( + arg1: *mut Display, + arg2: Drawable, + arg3: Drawable, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_uint, + arg9: ::std::os::raw::c_int, + arg10: ::std::os::raw::c_int, + arg11: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDefaultDepth(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDefaultDepthOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDefaultScreen(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDefineCursor(arg1: *mut Display, arg2: Window, arg3: Cursor) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDeleteProperty(arg1: *mut Display, arg2: Window, arg3: Atom) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDestroyWindow(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDestroySubwindows(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDoesBackingStore(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDoesSaveUnders(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisableAccessControl(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayCells(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayHeight(arg1: *mut Display, arg2: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayHeightMM( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayKeycodes( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayPlanes(arg1: *mut Display, arg2: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayWidth(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDisplayWidthMM( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawArc( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_int, + arg9: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawArcs( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XArc, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawImageString( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *const ::std::os::raw::c_char, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawImageString16( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *const XChar2b, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawLine( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawLines( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XPoint, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawPoint( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawPoints( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XPoint, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawRectangle( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawRectangles( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XRectangle, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawSegments( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XSegment, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawString( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *const ::std::os::raw::c_char, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawString16( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *const XChar2b, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawText( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut XTextItem, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDrawText16( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut XTextItem16, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XEnableAccessControl(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XEventsQueued(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFetchName( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFillArc( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_int, + arg9: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFillArcs( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XArc, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFillPolygon( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XPoint, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFillRectangle( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFillRectangles( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XRectangle, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFlush(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XForceScreenSaver( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFree(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeColormap(arg1: *mut Display, arg2: Colormap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeColors( + arg1: *mut Display, + arg2: Colormap, + arg3: *mut ::std::os::raw::c_ulong, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeCursor(arg1: *mut Display, arg2: Cursor) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeExtensionList(arg1: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeFont(arg1: *mut Display, arg2: *mut XFontStruct) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeFontInfo( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *mut XFontStruct, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeFontNames(arg1: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeFontPath(arg1: *mut *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeGC(arg1: *mut Display, arg2: GC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeModifiermap(arg1: *mut XModifierKeymap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreePixmap(arg1: *mut Display, arg2: Pixmap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGeometry( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_int, + arg9: ::std::os::raw::c_int, + arg10: *mut ::std::os::raw::c_int, + arg11: *mut ::std::os::raw::c_int, + arg12: *mut ::std::os::raw::c_int, + arg13: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetErrorDatabaseText( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + arg5: *mut ::std::os::raw::c_char, + arg6: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetErrorText( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_char, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetFontProperty( + arg1: *mut XFontStruct, + arg2: Atom, + arg3: *mut ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetGCValues( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + arg4: *mut XGCValues, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetGeometry( + arg1: *mut Display, + arg2: Drawable, + arg3: *mut Window, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_uint, + arg7: *mut ::std::os::raw::c_uint, + arg8: *mut ::std::os::raw::c_uint, + arg9: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetIconName( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetInputFocus( + arg1: *mut Display, + arg2: *mut Window, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetKeyboardControl( + arg1: *mut Display, + arg2: *mut XKeyboardState, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetPointerControl( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetPointerMapping( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_uchar, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetScreenSaver( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetTransientForHint( + arg1: *mut Display, + arg2: Window, + arg3: *mut Window, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWindowProperty( + arg1: *mut Display, + arg2: Window, + arg3: Atom, + arg4: ::std::os::raw::c_long, + arg5: ::std::os::raw::c_long, + arg6: ::std::os::raw::c_int, + arg7: Atom, + arg8: *mut Atom, + arg9: *mut ::std::os::raw::c_int, + arg10: *mut ::std::os::raw::c_ulong, + arg11: *mut ::std::os::raw::c_ulong, + arg12: *mut *mut ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWindowAttributes( + arg1: *mut Display, + arg2: Window, + arg3: *mut XWindowAttributes, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGrabButton( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: Window, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_int, + arg8: ::std::os::raw::c_int, + arg9: Window, + arg10: Cursor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGrabKey( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_uint, + arg4: Window, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGrabKeyboard( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGrabPointer( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: Window, + arg8: Cursor, + arg9: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGrabServer(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XHeightMMOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XHeightOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XIfEvent( + arg1: *mut Display, + arg2: *mut XEvent, + arg3: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: *mut XEvent, + arg3: XPointer, + ) -> ::std::os::raw::c_int, + >, + arg4: XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XImageByteOrder(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XInstallColormap(arg1: *mut Display, arg2: Colormap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XKeysymToKeycode(arg1: *mut Display, arg2: KeySym) -> KeyCode; +} +extern "C" { + pub fn XKillClient(arg1: *mut Display, arg2: XID) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XLookupColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *const ::std::os::raw::c_char, + arg4: *mut XColor, + arg5: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XLowerWindow(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMapRaised(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMapSubwindows(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMapWindow(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMaskEvent( + arg1: *mut Display, + arg2: ::std::os::raw::c_long, + arg3: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMaxCmapsOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMinCmapsOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMoveResizeWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMoveWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XNextEvent(arg1: *mut Display, arg2: *mut XEvent) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XNoOp(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XParseColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *const ::std::os::raw::c_char, + arg4: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XParseGeometry( + arg1: *const ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPeekEvent(arg1: *mut Display, arg2: *mut XEvent) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPeekIfEvent( + arg1: *mut Display, + arg2: *mut XEvent, + arg3: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: *mut XEvent, + arg3: XPointer, + ) -> ::std::os::raw::c_int, + >, + arg4: XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPending(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPlanesOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XProtocolRevision(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XProtocolVersion(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPutBackEvent(arg1: *mut Display, arg2: *mut XEvent) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPutImage( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: *mut XImage, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + arg8: ::std::os::raw::c_int, + arg9: ::std::os::raw::c_uint, + arg10: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQLength(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryBestCursor( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_uint, + arg6: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryBestSize( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: Drawable, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: *mut ::std::os::raw::c_uint, + arg7: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryBestStipple( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_uint, + arg6: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryBestTile( + arg1: *mut Display, + arg2: Drawable, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_uint, + arg6: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryColors( + arg1: *mut Display, + arg2: Colormap, + arg3: *mut XColor, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryExtension( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryKeymap( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryPointer( + arg1: *mut Display, + arg2: Window, + arg3: *mut Window, + arg4: *mut Window, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut ::std::os::raw::c_int, + arg9: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryTextExtents( + arg1: *mut Display, + arg2: XID, + arg3: *const ::std::os::raw::c_char, + arg4: ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut XCharStruct, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryTextExtents16( + arg1: *mut Display, + arg2: XID, + arg3: *const XChar2b, + arg4: ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut XCharStruct, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XQueryTree( + arg1: *mut Display, + arg2: Window, + arg3: *mut Window, + arg4: *mut Window, + arg5: *mut *mut Window, + arg6: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRaiseWindow(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XReadBitmapFile( + arg1: *mut Display, + arg2: Drawable, + arg3: *const ::std::os::raw::c_char, + arg4: *mut ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_uint, + arg6: *mut Pixmap, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XReadBitmapFileData( + arg1: *const ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + arg4: *mut *mut ::std::os::raw::c_uchar, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRebindKeysym( + arg1: *mut Display, + arg2: KeySym, + arg3: *mut KeySym, + arg4: ::std::os::raw::c_int, + arg5: *const ::std::os::raw::c_uchar, + arg6: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRecolorCursor( + arg1: *mut Display, + arg2: Cursor, + arg3: *mut XColor, + arg4: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRefreshKeyboardMapping(arg1: *mut XMappingEvent) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRemoveFromSaveSet(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRemoveHost(arg1: *mut Display, arg2: *mut XHostAddress) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRemoveHosts( + arg1: *mut Display, + arg2: *mut XHostAddress, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XReparentWindow( + arg1: *mut Display, + arg2: Window, + arg3: Window, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XResetScreenSaver(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XResizeWindow( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRestackWindows( + arg1: *mut Display, + arg2: *mut Window, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRotateBuffers(arg1: *mut Display, arg2: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRotateWindowProperties( + arg1: *mut Display, + arg2: Window, + arg3: *mut Atom, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XScreenCount(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSelectInput( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSendEvent( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_long, + arg5: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetAccessControl( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetArcMode( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetBackground( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetClipMask(arg1: *mut Display, arg2: GC, arg3: Pixmap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetClipOrigin( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetClipRectangles( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *mut XRectangle, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetCloseDownMode( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetCommand( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut ::std::os::raw::c_char, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetDashes( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetFillRule( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetFillStyle( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetFont(arg1: *mut Display, arg2: GC, arg3: Font) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetFontPath( + arg1: *mut Display, + arg2: *mut *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetForeground( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetFunction( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetGraphicsExposures( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetIconName( + arg1: *mut Display, + arg2: Window, + arg3: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetInputFocus( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetLineAttributes( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetModifierMapping( + arg1: *mut Display, + arg2: *mut XModifierKeymap, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetPlaneMask( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetPointerMapping( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_uchar, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetScreenSaver( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetSelectionOwner( + arg1: *mut Display, + arg2: Atom, + arg3: Window, + arg4: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetState( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_ulong, + arg4: ::std::os::raw::c_ulong, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetStipple(arg1: *mut Display, arg2: GC, arg3: Pixmap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetSubwindowMode( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetTSOrigin( + arg1: *mut Display, + arg2: GC, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetTile(arg1: *mut Display, arg2: GC, arg3: Pixmap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWindowBackground( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWindowBackgroundPixmap( + arg1: *mut Display, + arg2: Window, + arg3: Pixmap, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWindowBorder( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWindowBorderPixmap( + arg1: *mut Display, + arg2: Window, + arg3: Pixmap, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWindowBorderWidth( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWindowColormap( + arg1: *mut Display, + arg2: Window, + arg3: Colormap, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStoreBuffer( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStoreBytes( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStoreColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *mut XColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStoreColors( + arg1: *mut Display, + arg2: Colormap, + arg3: *mut XColor, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStoreName( + arg1: *mut Display, + arg2: Window, + arg3: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStoreNamedColor( + arg1: *mut Display, + arg2: Colormap, + arg3: *const ::std::os::raw::c_char, + arg4: ::std::os::raw::c_ulong, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSync(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XTextExtents( + arg1: *mut XFontStruct, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut XCharStruct, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XTextExtents16( + arg1: *mut XFontStruct, + arg2: *const XChar2b, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut XCharStruct, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XTextWidth( + arg1: *mut XFontStruct, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XTextWidth16( + arg1: *mut XFontStruct, + arg2: *const XChar2b, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XTranslateCoordinates( + arg1: *mut Display, + arg2: Window, + arg3: Window, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut Window, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUndefineCursor(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUngrabButton( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: Window, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUngrabKey( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_uint, + arg4: Window, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUngrabKeyboard(arg1: *mut Display, arg2: Time) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUngrabPointer(arg1: *mut Display, arg2: Time) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUngrabServer(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUninstallColormap(arg1: *mut Display, arg2: Colormap) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUnloadFont(arg1: *mut Display, arg2: Font) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUnmapSubwindows(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUnmapWindow(arg1: *mut Display, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XVendorRelease(arg1: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWarpPointer( + arg1: *mut Display, + arg2: Window, + arg3: Window, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_uint, + arg7: ::std::os::raw::c_uint, + arg8: ::std::os::raw::c_int, + arg9: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWidthMMOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWidthOfScreen(arg1: *mut Screen) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWindowEvent( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_long, + arg4: *mut XEvent, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWriteBitmapFile( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: Pixmap, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSupportsLocale() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetLocaleModifiers(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XOpenOM( + arg1: *mut Display, + arg2: *mut _XrmHashBucketRec, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + ) -> XOM; +} +extern "C" { + pub fn XCloseOM(arg1: XOM) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetOMValues(arg1: XOM, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XGetOMValues(arg1: XOM, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XDisplayOfOM(arg1: XOM) -> *mut Display; +} +extern "C" { + pub fn XLocaleOfOM(arg1: XOM) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XCreateOC(arg1: XOM, ...) -> XOC; +} +extern "C" { + pub fn XDestroyOC(arg1: XOC); +} +extern "C" { + pub fn XOMOfOC(arg1: XOC) -> XOM; +} +extern "C" { + pub fn XSetOCValues(arg1: XOC, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XGetOCValues(arg1: XOC, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XCreateFontSet( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut *mut ::std::os::raw::c_char, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut *mut ::std::os::raw::c_char, + ) -> XFontSet; +} +extern "C" { + pub fn XFreeFontSet(arg1: *mut Display, arg2: XFontSet); +} +extern "C" { + pub fn XFontsOfFontSet( + arg1: XFontSet, + arg2: *mut *mut *mut XFontStruct, + arg3: *mut *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XBaseFontNameListOfFontSet(arg1: XFontSet) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XLocaleOfFontSet(arg1: XFontSet) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XContextDependentDrawing(arg1: XFontSet) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDirectionalDependentDrawing(arg1: XFontSet) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XContextualDrawing(arg1: XFontSet) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XExtentsOfFontSet(arg1: XFontSet) -> *mut XFontSetExtents; +} +extern "C" { + pub fn XmbTextEscapement( + arg1: XFontSet, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcTextEscapement( + arg1: XFontSet, + arg2: *const wchar_t, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Xutf8TextEscapement( + arg1: XFontSet, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XmbTextExtents( + arg1: XFontSet, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut XRectangle, + arg5: *mut XRectangle, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcTextExtents( + arg1: XFontSet, + arg2: *const wchar_t, + arg3: ::std::os::raw::c_int, + arg4: *mut XRectangle, + arg5: *mut XRectangle, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Xutf8TextExtents( + arg1: XFontSet, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut XRectangle, + arg5: *mut XRectangle, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XmbTextPerCharExtents( + arg1: XFontSet, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut XRectangle, + arg5: *mut XRectangle, + arg6: ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut XRectangle, + arg9: *mut XRectangle, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcTextPerCharExtents( + arg1: XFontSet, + arg2: *const wchar_t, + arg3: ::std::os::raw::c_int, + arg4: *mut XRectangle, + arg5: *mut XRectangle, + arg6: ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut XRectangle, + arg9: *mut XRectangle, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Xutf8TextPerCharExtents( + arg1: XFontSet, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut XRectangle, + arg5: *mut XRectangle, + arg6: ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut XRectangle, + arg9: *mut XRectangle, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XmbDrawText( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut XmbTextItem, + arg7: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XwcDrawText( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut XwcTextItem, + arg7: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn Xutf8DrawText( + arg1: *mut Display, + arg2: Drawable, + arg3: GC, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: *mut XmbTextItem, + arg7: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XmbDrawString( + arg1: *mut Display, + arg2: Drawable, + arg3: XFontSet, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const ::std::os::raw::c_char, + arg8: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XwcDrawString( + arg1: *mut Display, + arg2: Drawable, + arg3: XFontSet, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const wchar_t, + arg8: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn Xutf8DrawString( + arg1: *mut Display, + arg2: Drawable, + arg3: XFontSet, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const ::std::os::raw::c_char, + arg8: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XmbDrawImageString( + arg1: *mut Display, + arg2: Drawable, + arg3: XFontSet, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const ::std::os::raw::c_char, + arg8: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XwcDrawImageString( + arg1: *mut Display, + arg2: Drawable, + arg3: XFontSet, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const wchar_t, + arg8: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn Xutf8DrawImageString( + arg1: *mut Display, + arg2: Drawable, + arg3: XFontSet, + arg4: GC, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: *const ::std::os::raw::c_char, + arg8: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XOpenIM( + arg1: *mut Display, + arg2: *mut _XrmHashBucketRec, + arg3: *mut ::std::os::raw::c_char, + arg4: *mut ::std::os::raw::c_char, + ) -> XIM; +} +extern "C" { + pub fn XCloseIM(arg1: XIM) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetIMValues(arg1: XIM, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XSetIMValues(arg1: XIM, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XDisplayOfIM(arg1: XIM) -> *mut Display; +} +extern "C" { + pub fn XLocaleOfIM(arg1: XIM) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XCreateIC(arg1: XIM, ...) -> XIC; +} +extern "C" { + pub fn XDestroyIC(arg1: XIC); +} +extern "C" { + pub fn XSetICFocus(arg1: XIC); +} +extern "C" { + pub fn XUnsetICFocus(arg1: XIC); +} +extern "C" { + pub fn XwcResetIC(arg1: XIC) -> *mut wchar_t; +} +extern "C" { + pub fn XmbResetIC(arg1: XIC) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn Xutf8ResetIC(arg1: XIC) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XSetICValues(arg1: XIC, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XGetICValues(arg1: XIC, ...) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn XIMOfIC(arg1: XIC) -> XIM; +} +extern "C" { + pub fn XFilterEvent(arg1: *mut XEvent, arg2: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XmbLookupString( + arg1: XIC, + arg2: *mut XKeyPressedEvent, + arg3: *mut ::std::os::raw::c_char, + arg4: ::std::os::raw::c_int, + arg5: *mut KeySym, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcLookupString( + arg1: XIC, + arg2: *mut XKeyPressedEvent, + arg3: *mut wchar_t, + arg4: ::std::os::raw::c_int, + arg5: *mut KeySym, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Xutf8LookupString( + arg1: XIC, + arg2: *mut XKeyPressedEvent, + arg3: *mut ::std::os::raw::c_char, + arg4: ::std::os::raw::c_int, + arg5: *mut KeySym, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XVaCreateNestedList(arg1: ::std::os::raw::c_int, ...) -> XVaNestedList; +} +extern "C" { + pub fn XRegisterIMInstantiateCallback( + arg1: *mut Display, + arg2: *mut _XrmHashBucketRec, + arg3: *mut ::std::os::raw::c_char, + arg4: *mut ::std::os::raw::c_char, + arg5: XIDProc, + arg6: XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUnregisterIMInstantiateCallback( + arg1: *mut Display, + arg2: *mut _XrmHashBucketRec, + arg3: *mut ::std::os::raw::c_char, + arg4: *mut ::std::os::raw::c_char, + arg5: XIDProc, + arg6: XPointer, + ) -> ::std::os::raw::c_int; +} +pub type XConnectionWatchProc = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: XPointer, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *mut XPointer, + ), +>; +extern "C" { + pub fn XInternalConnectionNumbers( + arg1: *mut Display, + arg2: *mut *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XProcessInternalConnection(arg1: *mut Display, arg2: ::std::os::raw::c_int); +} +extern "C" { + pub fn XAddConnectionWatch( + arg1: *mut Display, + arg2: XConnectionWatchProc, + arg3: XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRemoveConnectionWatch(arg1: *mut Display, arg2: XConnectionWatchProc, arg3: XPointer); +} +extern "C" { + pub fn XSetAuthorization( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_char, + arg4: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn _Xmbtowc( + arg1: *mut wchar_t, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _Xwctomb(arg1: *mut ::std::os::raw::c_char, arg2: wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetEventData( + arg1: *mut Display, + arg2: *mut XGenericEventCookie, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFreeEventData(arg1: *mut Display, arg2: *mut XGenericEventCookie); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbStateRec { + pub group: ::std::os::raw::c_uchar, + pub locked_group: ::std::os::raw::c_uchar, + pub base_group: ::std::os::raw::c_ushort, + pub latched_group: ::std::os::raw::c_ushort, + pub mods: ::std::os::raw::c_uchar, + pub base_mods: ::std::os::raw::c_uchar, + pub latched_mods: ::std::os::raw::c_uchar, + pub locked_mods: ::std::os::raw::c_uchar, + pub compat_state: ::std::os::raw::c_uchar, + pub grab_mods: ::std::os::raw::c_uchar, + pub compat_grab_mods: ::std::os::raw::c_uchar, + pub lookup_mods: ::std::os::raw::c_uchar, + pub compat_lookup_mods: ::std::os::raw::c_uchar, + pub ptr_buttons: ::std::os::raw::c_ushort, +} +pub type XkbStateRec = _XkbStateRec; +pub type XkbStatePtr = *mut _XkbStateRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbMods { + pub mask: ::std::os::raw::c_uchar, + pub real_mods: ::std::os::raw::c_uchar, + pub vmods: ::std::os::raw::c_ushort, +} +pub type XkbModsRec = _XkbMods; +pub type XkbModsPtr = *mut _XkbMods; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbKTMapEntry { + pub active: ::std::os::raw::c_int, + pub level: ::std::os::raw::c_uchar, + pub mods: XkbModsRec, +} +pub type XkbKTMapEntryRec = _XkbKTMapEntry; +pub type XkbKTMapEntryPtr = *mut _XkbKTMapEntry; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbKeyType { + pub mods: XkbModsRec, + pub num_levels: ::std::os::raw::c_uchar, + pub map_count: ::std::os::raw::c_uchar, + pub map: XkbKTMapEntryPtr, + pub preserve: XkbModsPtr, + pub name: Atom, + pub level_names: *mut Atom, +} +pub type XkbKeyTypeRec = _XkbKeyType; +pub type XkbKeyTypePtr = *mut _XkbKeyType; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbBehavior { + pub type_: ::std::os::raw::c_uchar, + pub data: ::std::os::raw::c_uchar, +} +pub type XkbBehavior = _XkbBehavior; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbAnyAction { + pub type_: ::std::os::raw::c_uchar, + pub data: [::std::os::raw::c_uchar; 7usize], +} +pub type XkbAnyAction = _XkbAnyAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbModAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub mask: ::std::os::raw::c_uchar, + pub real_mods: ::std::os::raw::c_uchar, + pub vmods1: ::std::os::raw::c_uchar, + pub vmods2: ::std::os::raw::c_uchar, +} +pub type XkbModAction = _XkbModAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbGroupAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub group_XXX: ::std::os::raw::c_char, +} +pub type XkbGroupAction = _XkbGroupAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbISOAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub mask: ::std::os::raw::c_uchar, + pub real_mods: ::std::os::raw::c_uchar, + pub group_XXX: ::std::os::raw::c_char, + pub affect: ::std::os::raw::c_uchar, + pub vmods1: ::std::os::raw::c_uchar, + pub vmods2: ::std::os::raw::c_uchar, +} +pub type XkbISOAction = _XkbISOAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbPtrAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub high_XXX: ::std::os::raw::c_uchar, + pub low_XXX: ::std::os::raw::c_uchar, + pub high_YYY: ::std::os::raw::c_uchar, + pub low_YYY: ::std::os::raw::c_uchar, +} +pub type XkbPtrAction = _XkbPtrAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbPtrBtnAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub count: ::std::os::raw::c_uchar, + pub button: ::std::os::raw::c_uchar, +} +pub type XkbPtrBtnAction = _XkbPtrBtnAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbPtrDfltAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub affect: ::std::os::raw::c_uchar, + pub valueXXX: ::std::os::raw::c_char, +} +pub type XkbPtrDfltAction = _XkbPtrDfltAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbSwitchScreenAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub screenXXX: ::std::os::raw::c_char, +} +pub type XkbSwitchScreenAction = _XkbSwitchScreenAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbCtrlsAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub ctrls3: ::std::os::raw::c_uchar, + pub ctrls2: ::std::os::raw::c_uchar, + pub ctrls1: ::std::os::raw::c_uchar, + pub ctrls0: ::std::os::raw::c_uchar, +} +pub type XkbCtrlsAction = _XkbCtrlsAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbMessageAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub message: [::std::os::raw::c_uchar; 6usize], +} +pub type XkbMessageAction = _XkbMessageAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbRedirectKeyAction { + pub type_: ::std::os::raw::c_uchar, + pub new_key: ::std::os::raw::c_uchar, + pub mods_mask: ::std::os::raw::c_uchar, + pub mods: ::std::os::raw::c_uchar, + pub vmods_mask0: ::std::os::raw::c_uchar, + pub vmods_mask1: ::std::os::raw::c_uchar, + pub vmods0: ::std::os::raw::c_uchar, + pub vmods1: ::std::os::raw::c_uchar, +} +pub type XkbRedirectKeyAction = _XkbRedirectKeyAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDeviceBtnAction { + pub type_: ::std::os::raw::c_uchar, + pub flags: ::std::os::raw::c_uchar, + pub count: ::std::os::raw::c_uchar, + pub button: ::std::os::raw::c_uchar, + pub device: ::std::os::raw::c_uchar, +} +pub type XkbDeviceBtnAction = _XkbDeviceBtnAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDeviceValuatorAction { + pub type_: ::std::os::raw::c_uchar, + pub device: ::std::os::raw::c_uchar, + pub v1_what: ::std::os::raw::c_uchar, + pub v1_ndx: ::std::os::raw::c_uchar, + pub v1_value: ::std::os::raw::c_uchar, + pub v2_what: ::std::os::raw::c_uchar, + pub v2_ndx: ::std::os::raw::c_uchar, + pub v2_value: ::std::os::raw::c_uchar, +} +pub type XkbDeviceValuatorAction = _XkbDeviceValuatorAction; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _XkbAction { + pub any: XkbAnyAction, + pub mods: XkbModAction, + pub group: XkbGroupAction, + pub iso: XkbISOAction, + pub ptr: XkbPtrAction, + pub btn: XkbPtrBtnAction, + pub dflt: XkbPtrDfltAction, + pub screen: XkbSwitchScreenAction, + pub ctrls: XkbCtrlsAction, + pub msg: XkbMessageAction, + pub redirect: XkbRedirectKeyAction, + pub devbtn: XkbDeviceBtnAction, + pub devval: XkbDeviceValuatorAction, + pub type_: ::std::os::raw::c_uchar, + _bindgen_union_align: [u8; 8usize], +} +pub type XkbAction = _XkbAction; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbControls { + pub mk_dflt_btn: ::std::os::raw::c_uchar, + pub num_groups: ::std::os::raw::c_uchar, + pub groups_wrap: ::std::os::raw::c_uchar, + pub internal: XkbModsRec, + pub ignore_lock: XkbModsRec, + pub enabled_ctrls: ::std::os::raw::c_uint, + pub repeat_delay: ::std::os::raw::c_ushort, + pub repeat_interval: ::std::os::raw::c_ushort, + pub slow_keys_delay: ::std::os::raw::c_ushort, + pub debounce_delay: ::std::os::raw::c_ushort, + pub mk_delay: ::std::os::raw::c_ushort, + pub mk_interval: ::std::os::raw::c_ushort, + pub mk_time_to_max: ::std::os::raw::c_ushort, + pub mk_max_speed: ::std::os::raw::c_ushort, + pub mk_curve: ::std::os::raw::c_short, + pub ax_options: ::std::os::raw::c_ushort, + pub ax_timeout: ::std::os::raw::c_ushort, + pub axt_opts_mask: ::std::os::raw::c_ushort, + pub axt_opts_values: ::std::os::raw::c_ushort, + pub axt_ctrls_mask: ::std::os::raw::c_uint, + pub axt_ctrls_values: ::std::os::raw::c_uint, + pub per_key_repeat: [::std::os::raw::c_uchar; 32usize], +} +pub type XkbControlsRec = _XkbControls; +pub type XkbControlsPtr = *mut _XkbControls; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbServerMapRec { + pub num_acts: ::std::os::raw::c_ushort, + pub size_acts: ::std::os::raw::c_ushort, + pub acts: *mut XkbAction, + pub behaviors: *mut XkbBehavior, + pub key_acts: *mut ::std::os::raw::c_ushort, + pub explicit: *mut ::std::os::raw::c_uchar, + pub vmods: [::std::os::raw::c_uchar; 16usize], + pub vmodmap: *mut ::std::os::raw::c_ushort, +} +pub type XkbServerMapRec = _XkbServerMapRec; +pub type XkbServerMapPtr = *mut _XkbServerMapRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbSymMapRec { + pub kt_index: [::std::os::raw::c_uchar; 4usize], + pub group_info: ::std::os::raw::c_uchar, + pub width: ::std::os::raw::c_uchar, + pub offset: ::std::os::raw::c_ushort, +} +pub type XkbSymMapRec = _XkbSymMapRec; +pub type XkbSymMapPtr = *mut _XkbSymMapRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbClientMapRec { + pub size_types: ::std::os::raw::c_uchar, + pub num_types: ::std::os::raw::c_uchar, + pub types: XkbKeyTypePtr, + pub size_syms: ::std::os::raw::c_ushort, + pub num_syms: ::std::os::raw::c_ushort, + pub syms: *mut KeySym, + pub key_sym_map: XkbSymMapPtr, + pub modmap: *mut ::std::os::raw::c_uchar, +} +pub type XkbClientMapRec = _XkbClientMapRec; +pub type XkbClientMapPtr = *mut _XkbClientMapRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbSymInterpretRec { + pub sym: KeySym, + pub flags: ::std::os::raw::c_uchar, + pub match_: ::std::os::raw::c_uchar, + pub mods: ::std::os::raw::c_uchar, + pub virtual_mod: ::std::os::raw::c_uchar, + pub act: XkbAnyAction, +} +pub type XkbSymInterpretRec = _XkbSymInterpretRec; +pub type XkbSymInterpretPtr = *mut _XkbSymInterpretRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbCompatMapRec { + pub sym_interpret: XkbSymInterpretPtr, + pub groups: [XkbModsRec; 4usize], + pub num_si: ::std::os::raw::c_ushort, + pub size_si: ::std::os::raw::c_ushort, +} +pub type XkbCompatMapRec = _XkbCompatMapRec; +pub type XkbCompatMapPtr = *mut _XkbCompatMapRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbIndicatorMapRec { + pub flags: ::std::os::raw::c_uchar, + pub which_groups: ::std::os::raw::c_uchar, + pub groups: ::std::os::raw::c_uchar, + pub which_mods: ::std::os::raw::c_uchar, + pub mods: XkbModsRec, + pub ctrls: ::std::os::raw::c_uint, +} +pub type XkbIndicatorMapRec = _XkbIndicatorMapRec; +pub type XkbIndicatorMapPtr = *mut _XkbIndicatorMapRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbIndicatorRec { + pub phys_indicators: ::std::os::raw::c_ulong, + pub maps: [XkbIndicatorMapRec; 32usize], +} +pub type XkbIndicatorRec = _XkbIndicatorRec; +pub type XkbIndicatorPtr = *mut _XkbIndicatorRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbKeyNameRec { + pub name: [::std::os::raw::c_char; 4usize], +} +pub type XkbKeyNameRec = _XkbKeyNameRec; +pub type XkbKeyNamePtr = *mut _XkbKeyNameRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbKeyAliasRec { + pub real: [::std::os::raw::c_char; 4usize], + pub alias: [::std::os::raw::c_char; 4usize], +} +pub type XkbKeyAliasRec = _XkbKeyAliasRec; +pub type XkbKeyAliasPtr = *mut _XkbKeyAliasRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbNamesRec { + pub keycodes: Atom, + pub geometry: Atom, + pub symbols: Atom, + pub types: Atom, + pub compat: Atom, + pub vmods: [Atom; 16usize], + pub indicators: [Atom; 32usize], + pub groups: [Atom; 4usize], + pub keys: XkbKeyNamePtr, + pub key_aliases: XkbKeyAliasPtr, + pub radio_groups: *mut Atom, + pub phys_symbols: Atom, + pub num_keys: ::std::os::raw::c_uchar, + pub num_key_aliases: ::std::os::raw::c_uchar, + pub num_rg: ::std::os::raw::c_ushort, +} +pub type XkbNamesRec = _XkbNamesRec; +pub type XkbNamesPtr = *mut _XkbNamesRec; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbGeometry { + _unused: [u8; 0], +} +pub type XkbGeometryPtr = *mut _XkbGeometry; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDesc { + pub dpy: *mut _XDisplay, + pub flags: ::std::os::raw::c_ushort, + pub device_spec: ::std::os::raw::c_ushort, + pub min_key_code: KeyCode, + pub max_key_code: KeyCode, + pub ctrls: XkbControlsPtr, + pub server: XkbServerMapPtr, + pub map: XkbClientMapPtr, + pub indicators: XkbIndicatorPtr, + pub names: XkbNamesPtr, + pub compat: XkbCompatMapPtr, + pub geom: XkbGeometryPtr, +} +pub type XkbDescRec = _XkbDesc; +pub type XkbDescPtr = *mut _XkbDesc; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbMapChanges { + pub changed: ::std::os::raw::c_ushort, + pub min_key_code: KeyCode, + pub max_key_code: KeyCode, + pub first_type: ::std::os::raw::c_uchar, + pub num_types: ::std::os::raw::c_uchar, + pub first_key_sym: KeyCode, + pub num_key_syms: ::std::os::raw::c_uchar, + pub first_key_act: KeyCode, + pub num_key_acts: ::std::os::raw::c_uchar, + pub first_key_behavior: KeyCode, + pub num_key_behaviors: ::std::os::raw::c_uchar, + pub first_key_explicit: KeyCode, + pub num_key_explicit: ::std::os::raw::c_uchar, + pub first_modmap_key: KeyCode, + pub num_modmap_keys: ::std::os::raw::c_uchar, + pub first_vmodmap_key: KeyCode, + pub num_vmodmap_keys: ::std::os::raw::c_uchar, + pub pad: ::std::os::raw::c_uchar, + pub vmods: ::std::os::raw::c_ushort, +} +pub type XkbMapChangesRec = _XkbMapChanges; +pub type XkbMapChangesPtr = *mut _XkbMapChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbControlsChanges { + pub changed_ctrls: ::std::os::raw::c_uint, + pub enabled_ctrls_changes: ::std::os::raw::c_uint, + pub num_groups_changed: ::std::os::raw::c_int, +} +pub type XkbControlsChangesRec = _XkbControlsChanges; +pub type XkbControlsChangesPtr = *mut _XkbControlsChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbIndicatorChanges { + pub state_changes: ::std::os::raw::c_uint, + pub map_changes: ::std::os::raw::c_uint, +} +pub type XkbIndicatorChangesRec = _XkbIndicatorChanges; +pub type XkbIndicatorChangesPtr = *mut _XkbIndicatorChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbNameChanges { + pub changed: ::std::os::raw::c_uint, + pub first_type: ::std::os::raw::c_uchar, + pub num_types: ::std::os::raw::c_uchar, + pub first_lvl: ::std::os::raw::c_uchar, + pub num_lvls: ::std::os::raw::c_uchar, + pub num_aliases: ::std::os::raw::c_uchar, + pub num_rg: ::std::os::raw::c_uchar, + pub first_key: ::std::os::raw::c_uchar, + pub num_keys: ::std::os::raw::c_uchar, + pub changed_vmods: ::std::os::raw::c_ushort, + pub changed_indicators: ::std::os::raw::c_ulong, + pub changed_groups: ::std::os::raw::c_uchar, +} +pub type XkbNameChangesRec = _XkbNameChanges; +pub type XkbNameChangesPtr = *mut _XkbNameChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbCompatChanges { + pub changed_groups: ::std::os::raw::c_uchar, + pub first_si: ::std::os::raw::c_ushort, + pub num_si: ::std::os::raw::c_ushort, +} +pub type XkbCompatChangesRec = _XkbCompatChanges; +pub type XkbCompatChangesPtr = *mut _XkbCompatChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbChanges { + pub device_spec: ::std::os::raw::c_ushort, + pub state_changes: ::std::os::raw::c_ushort, + pub map: XkbMapChangesRec, + pub ctrls: XkbControlsChangesRec, + pub indicators: XkbIndicatorChangesRec, + pub names: XkbNameChangesRec, + pub compat: XkbCompatChangesRec, +} +pub type XkbChangesRec = _XkbChanges; +pub type XkbChangesPtr = *mut _XkbChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbComponentNames { + pub keymap: *mut ::std::os::raw::c_char, + pub keycodes: *mut ::std::os::raw::c_char, + pub types: *mut ::std::os::raw::c_char, + pub compat: *mut ::std::os::raw::c_char, + pub symbols: *mut ::std::os::raw::c_char, + pub geometry: *mut ::std::os::raw::c_char, +} +pub type XkbComponentNamesRec = _XkbComponentNames; +pub type XkbComponentNamesPtr = *mut _XkbComponentNames; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbComponentName { + pub flags: ::std::os::raw::c_ushort, + pub name: *mut ::std::os::raw::c_char, +} +pub type XkbComponentNameRec = _XkbComponentName; +pub type XkbComponentNamePtr = *mut _XkbComponentName; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbComponentList { + pub num_keymaps: ::std::os::raw::c_int, + pub num_keycodes: ::std::os::raw::c_int, + pub num_types: ::std::os::raw::c_int, + pub num_compat: ::std::os::raw::c_int, + pub num_symbols: ::std::os::raw::c_int, + pub num_geometry: ::std::os::raw::c_int, + pub keymaps: XkbComponentNamePtr, + pub keycodes: XkbComponentNamePtr, + pub types: XkbComponentNamePtr, + pub compat: XkbComponentNamePtr, + pub symbols: XkbComponentNamePtr, + pub geometry: XkbComponentNamePtr, +} +pub type XkbComponentListRec = _XkbComponentList; +pub type XkbComponentListPtr = *mut _XkbComponentList; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDeviceLedInfo { + pub led_class: ::std::os::raw::c_ushort, + pub led_id: ::std::os::raw::c_ushort, + pub phys_indicators: ::std::os::raw::c_uint, + pub maps_present: ::std::os::raw::c_uint, + pub names_present: ::std::os::raw::c_uint, + pub state: ::std::os::raw::c_uint, + pub names: [Atom; 32usize], + pub maps: [XkbIndicatorMapRec; 32usize], +} +pub type XkbDeviceLedInfoRec = _XkbDeviceLedInfo; +pub type XkbDeviceLedInfoPtr = *mut _XkbDeviceLedInfo; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDeviceInfo { + pub name: *mut ::std::os::raw::c_char, + pub type_: Atom, + pub device_spec: ::std::os::raw::c_ushort, + pub has_own_state: ::std::os::raw::c_int, + pub supported: ::std::os::raw::c_ushort, + pub unsupported: ::std::os::raw::c_ushort, + pub num_btns: ::std::os::raw::c_ushort, + pub btn_acts: *mut XkbAction, + pub sz_leds: ::std::os::raw::c_ushort, + pub num_leds: ::std::os::raw::c_ushort, + pub dflt_kbd_fb: ::std::os::raw::c_ushort, + pub dflt_led_fb: ::std::os::raw::c_ushort, + pub leds: XkbDeviceLedInfoPtr, +} +pub type XkbDeviceInfoRec = _XkbDeviceInfo; +pub type XkbDeviceInfoPtr = *mut _XkbDeviceInfo; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDeviceLedChanges { + pub led_class: ::std::os::raw::c_ushort, + pub led_id: ::std::os::raw::c_ushort, + pub defined: ::std::os::raw::c_uint, + pub next: *mut _XkbDeviceLedChanges, +} +pub type XkbDeviceLedChangesRec = _XkbDeviceLedChanges; +pub type XkbDeviceLedChangesPtr = *mut _XkbDeviceLedChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbDeviceChanges { + pub changed: ::std::os::raw::c_uint, + pub first_btn: ::std::os::raw::c_ushort, + pub num_btns: ::std::os::raw::c_ushort, + pub leds: XkbDeviceLedChangesRec, +} +pub type XkbDeviceChangesRec = _XkbDeviceChanges; +pub type XkbDeviceChangesPtr = *mut _XkbDeviceChanges; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbAnyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_uint, +} +pub type XkbAnyEvent = _XkbAnyEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbNewKeyboardNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub old_device: ::std::os::raw::c_int, + pub min_key_code: ::std::os::raw::c_int, + pub max_key_code: ::std::os::raw::c_int, + pub old_min_key_code: ::std::os::raw::c_int, + pub old_max_key_code: ::std::os::raw::c_int, + pub changed: ::std::os::raw::c_uint, + pub req_major: ::std::os::raw::c_char, + pub req_minor: ::std::os::raw::c_char, +} +pub type XkbNewKeyboardNotifyEvent = _XkbNewKeyboardNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbMapNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub changed: ::std::os::raw::c_uint, + pub flags: ::std::os::raw::c_uint, + pub first_type: ::std::os::raw::c_int, + pub num_types: ::std::os::raw::c_int, + pub min_key_code: KeyCode, + pub max_key_code: KeyCode, + pub first_key_sym: KeyCode, + pub first_key_act: KeyCode, + pub first_key_behavior: KeyCode, + pub first_key_explicit: KeyCode, + pub first_modmap_key: KeyCode, + pub first_vmodmap_key: KeyCode, + pub num_key_syms: ::std::os::raw::c_int, + pub num_key_acts: ::std::os::raw::c_int, + pub num_key_behaviors: ::std::os::raw::c_int, + pub num_key_explicit: ::std::os::raw::c_int, + pub num_modmap_keys: ::std::os::raw::c_int, + pub num_vmodmap_keys: ::std::os::raw::c_int, + pub vmods: ::std::os::raw::c_uint, +} +pub type XkbMapNotifyEvent = _XkbMapNotifyEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbStateNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub changed: ::std::os::raw::c_uint, + pub group: ::std::os::raw::c_int, + pub base_group: ::std::os::raw::c_int, + pub latched_group: ::std::os::raw::c_int, + pub locked_group: ::std::os::raw::c_int, + pub mods: ::std::os::raw::c_uint, + pub base_mods: ::std::os::raw::c_uint, + pub latched_mods: ::std::os::raw::c_uint, + pub locked_mods: ::std::os::raw::c_uint, + pub compat_state: ::std::os::raw::c_int, + pub grab_mods: ::std::os::raw::c_uchar, + pub compat_grab_mods: ::std::os::raw::c_uchar, + pub lookup_mods: ::std::os::raw::c_uchar, + pub compat_lookup_mods: ::std::os::raw::c_uchar, + pub ptr_buttons: ::std::os::raw::c_int, + pub keycode: KeyCode, + pub event_type: ::std::os::raw::c_char, + pub req_major: ::std::os::raw::c_char, + pub req_minor: ::std::os::raw::c_char, +} +pub type XkbStateNotifyEvent = _XkbStateNotifyEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbControlsNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub changed_ctrls: ::std::os::raw::c_uint, + pub enabled_ctrls: ::std::os::raw::c_uint, + pub enabled_ctrl_changes: ::std::os::raw::c_uint, + pub num_groups: ::std::os::raw::c_int, + pub keycode: KeyCode, + pub event_type: ::std::os::raw::c_char, + pub req_major: ::std::os::raw::c_char, + pub req_minor: ::std::os::raw::c_char, +} +pub type XkbControlsNotifyEvent = _XkbControlsNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbIndicatorNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub changed: ::std::os::raw::c_uint, + pub state: ::std::os::raw::c_uint, +} +pub type XkbIndicatorNotifyEvent = _XkbIndicatorNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbNamesNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub changed: ::std::os::raw::c_uint, + pub first_type: ::std::os::raw::c_int, + pub num_types: ::std::os::raw::c_int, + pub first_lvl: ::std::os::raw::c_int, + pub num_lvls: ::std::os::raw::c_int, + pub num_aliases: ::std::os::raw::c_int, + pub num_radio_groups: ::std::os::raw::c_int, + pub changed_vmods: ::std::os::raw::c_uint, + pub changed_groups: ::std::os::raw::c_uint, + pub changed_indicators: ::std::os::raw::c_uint, + pub first_key: ::std::os::raw::c_int, + pub num_keys: ::std::os::raw::c_int, +} +pub type XkbNamesNotifyEvent = _XkbNamesNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbCompatMapNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub changed_groups: ::std::os::raw::c_uint, + pub first_si: ::std::os::raw::c_int, + pub num_si: ::std::os::raw::c_int, + pub num_total_si: ::std::os::raw::c_int, +} +pub type XkbCompatMapNotifyEvent = _XkbCompatMapNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbBellNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub percent: ::std::os::raw::c_int, + pub pitch: ::std::os::raw::c_int, + pub duration: ::std::os::raw::c_int, + pub bell_class: ::std::os::raw::c_int, + pub bell_id: ::std::os::raw::c_int, + pub name: Atom, + pub window: Window, + pub event_only: ::std::os::raw::c_int, +} +pub type XkbBellNotifyEvent = _XkbBellNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbActionMessage { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub keycode: KeyCode, + pub press: ::std::os::raw::c_int, + pub key_event_follows: ::std::os::raw::c_int, + pub group: ::std::os::raw::c_int, + pub mods: ::std::os::raw::c_uint, + pub message: [::std::os::raw::c_char; 7usize], +} +pub type XkbActionMessageEvent = _XkbActionMessage; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbAccessXNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub detail: ::std::os::raw::c_int, + pub keycode: ::std::os::raw::c_int, + pub sk_delay: ::std::os::raw::c_int, + pub debounce_delay: ::std::os::raw::c_int, +} +pub type XkbAccessXNotifyEvent = _XkbAccessXNotify; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbExtensionDeviceNotify { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub time: Time, + pub xkb_type: ::std::os::raw::c_int, + pub device: ::std::os::raw::c_int, + pub reason: ::std::os::raw::c_uint, + pub supported: ::std::os::raw::c_uint, + pub unsupported: ::std::os::raw::c_uint, + pub first_btn: ::std::os::raw::c_int, + pub num_btns: ::std::os::raw::c_int, + pub leds_defined: ::std::os::raw::c_uint, + pub led_state: ::std::os::raw::c_uint, + pub led_class: ::std::os::raw::c_int, + pub led_id: ::std::os::raw::c_int, +} +pub type XkbExtensionDeviceNotifyEvent = _XkbExtensionDeviceNotify; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _XkbEvent { + pub type_: ::std::os::raw::c_int, + pub any: XkbAnyEvent, + pub new_kbd: XkbNewKeyboardNotifyEvent, + pub map: XkbMapNotifyEvent, + pub state: XkbStateNotifyEvent, + pub ctrls: XkbControlsNotifyEvent, + pub indicators: XkbIndicatorNotifyEvent, + pub names: XkbNamesNotifyEvent, + pub compat: XkbCompatMapNotifyEvent, + pub bell: XkbBellNotifyEvent, + pub message: XkbActionMessageEvent, + pub accessx: XkbAccessXNotifyEvent, + pub device: XkbExtensionDeviceNotifyEvent, + pub core: XEvent, + _bindgen_union_align: [u64; 24usize], +} +pub type XkbEvent = _XkbEvent; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XkbKbdDpyState { + _unused: [u8; 0], +} +pub type XkbKbdDpyStateRec = _XkbKbdDpyState; +pub type XkbKbdDpyStatePtr = *mut _XkbKbdDpyState; +extern "C" { + pub fn XkbIgnoreExtension(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbOpenDisplay( + arg1: *mut ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + ) -> *mut Display; +} +extern "C" { + pub fn XkbQueryExtension( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbUseExtension( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbLibraryVersion( + arg1: *mut ::std::os::raw::c_int, + arg2: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetXlibControls( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn XkbGetXlibControls(arg1: *mut Display) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn XkbXlibControlsImplemented() -> ::std::os::raw::c_uint; +} +pub type XkbInternAtomFunc = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> Atom, +>; +pub type XkbGetAtomNameFunc = ::std::option::Option< + unsafe extern "C" fn(arg1: *mut Display, arg2: Atom) -> *mut ::std::os::raw::c_char, +>; +extern "C" { + pub fn XkbSetAtomFuncs(arg1: XkbInternAtomFunc, arg2: XkbGetAtomNameFunc); +} +extern "C" { + pub fn XkbKeycodeToKeysym( + arg1: *mut Display, + arg2: KeyCode, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> KeySym; +} +extern "C" { + pub fn XkbKeysymToModifiers(arg1: *mut Display, arg2: KeySym) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn XkbLookupKeySym( + arg1: *mut Display, + arg2: KeyCode, + arg3: ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_uint, + arg5: *mut KeySym, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbLookupKeyBinding( + arg1: *mut Display, + arg2: KeySym, + arg3: ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_char, + arg5: ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbTranslateKeyCode( + arg1: XkbDescPtr, + arg2: KeyCode, + arg3: ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_uint, + arg5: *mut KeySym, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbTranslateKeySym( + arg1: *mut Display, + arg2: *mut KeySym, + arg3: ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_char, + arg5: ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetAutoRepeatRate( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetAutoRepeatRate( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbChangeEnabledControls( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbDeviceBell( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbForceDeviceBell( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbDeviceBellEvent( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: ::std::os::raw::c_int, + arg7: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbBell( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbForceBell(arg1: *mut Display, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbBellEvent( + arg1: *mut Display, + arg2: Window, + arg3: ::std::os::raw::c_int, + arg4: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSelectEvents( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSelectEventDetails( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_ulong, + arg5: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbNoteMapChanges( + arg1: XkbMapChangesPtr, + arg2: *mut XkbMapNotifyEvent, + arg3: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn XkbNoteNameChanges( + arg1: XkbNameChangesPtr, + arg2: *mut XkbNamesNotifyEvent, + arg3: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn XkbGetIndicatorState( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetDeviceIndicatorState( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetIndicatorMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_ulong, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetIndicatorMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_ulong, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetNamedIndicator( + arg1: *mut Display, + arg2: Atom, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + arg5: XkbIndicatorMapPtr, + arg6: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetNamedDeviceIndicator( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: Atom, + arg6: *mut ::std::os::raw::c_int, + arg7: *mut ::std::os::raw::c_int, + arg8: XkbIndicatorMapPtr, + arg9: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetNamedIndicator( + arg1: *mut Display, + arg2: Atom, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + arg6: XkbIndicatorMapPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetNamedDeviceIndicator( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: Atom, + arg6: ::std::os::raw::c_int, + arg7: ::std::os::raw::c_int, + arg8: ::std::os::raw::c_int, + arg9: XkbIndicatorMapPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbLockModifiers( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbLatchModifiers( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbLockGroup( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbLatchGroup( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetServerInternalMods( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetIgnoreLockMods( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbVirtualModsToReal( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbComputeEffectiveMap( + arg1: XkbDescPtr, + arg2: XkbKeyTypePtr, + arg3: *mut ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbInitCanonicalKeyTypes( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbAllocKeyboard() -> XkbDescPtr; +} +extern "C" { + pub fn XkbFreeKeyboard( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbAllocClientMap( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbAllocServerMap( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbFreeClientMap( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbFreeServerMap( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbAddKeyType( + arg1: XkbDescPtr, + arg2: Atom, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> XkbKeyTypePtr; +} +extern "C" { + pub fn XkbAllocIndicatorMaps(arg1: XkbDescPtr) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbFreeIndicatorMaps(arg1: XkbDescPtr); +} +extern "C" { + pub fn XkbGetMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> XkbDescPtr; +} +extern "C" { + pub fn XkbGetUpdatedMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetMapChanges( + arg1: *mut Display, + arg2: XkbDescPtr, + arg3: XkbMapChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbRefreshKeyboardMapping(arg1: *mut XkbMapNotifyEvent) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeyTypes( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeySyms( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeyActions( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeyBehaviors( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetVirtualMods( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeyExplicitComponents( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeyModifierMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetKeyVirtualModMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbAllocControls( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbFreeControls( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbGetControls( + arg1: *mut Display, + arg2: ::std::os::raw::c_ulong, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetControls( + arg1: *mut Display, + arg2: ::std::os::raw::c_ulong, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbNoteControlsChanges( + arg1: XkbControlsChangesPtr, + arg2: *mut XkbControlsNotifyEvent, + arg3: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn XkbAllocCompatMap( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbFreeCompatMap( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbGetCompatMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetCompatMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDescPtr, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbAddSymInterpret( + arg1: XkbDescPtr, + arg2: XkbSymInterpretPtr, + arg3: ::std::os::raw::c_int, + arg4: XkbChangesPtr, + ) -> XkbSymInterpretPtr; +} +extern "C" { + pub fn XkbAllocNames( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetNames( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetNames( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbChangeNames( + arg1: *mut Display, + arg2: XkbDescPtr, + arg3: XkbNameChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbFreeNames( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbGetState( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbStatePtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetMap( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDescPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbChangeMap( + arg1: *mut Display, + arg2: XkbDescPtr, + arg3: XkbMapChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetDetectableAutoRepeat( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetDetectableAutoRepeat( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetAutoResetControls( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetAutoResetControls( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetPerClientControls( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetPerClientControls( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbCopyKeyType(arg1: XkbKeyTypePtr, arg2: XkbKeyTypePtr) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbCopyKeyTypes( + arg1: XkbKeyTypePtr, + arg2: XkbKeyTypePtr, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbResizeKeyType( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbResizeKeySyms( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> *mut KeySym; +} +extern "C" { + pub fn XkbResizeKeyActions( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> *mut XkbAction; +} +extern "C" { + pub fn XkbChangeTypesOfKey( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_int, + arg6: XkbMapChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbChangeKeycodeRange( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: XkbChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbListComponents( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbComponentNamesPtr, + arg4: *mut ::std::os::raw::c_int, + ) -> XkbComponentListPtr; +} +extern "C" { + pub fn XkbFreeComponentList(arg1: XkbComponentListPtr); +} +extern "C" { + pub fn XkbGetKeyboard( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> XkbDescPtr; +} +extern "C" { + pub fn XkbGetKeyboardByName( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbComponentNamesPtr, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_int, + ) -> XkbDescPtr; +} +extern "C" { + pub fn XkbKeyTypesForCoreSymbols( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_int, + arg3: *mut KeySym, + arg4: ::std::os::raw::c_uint, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut KeySym, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbApplyCompatMapToKey( + arg1: XkbDescPtr, + arg2: KeyCode, + arg3: XkbChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbUpdateMapFromCore( + arg1: XkbDescPtr, + arg2: KeyCode, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *mut KeySym, + arg6: XkbChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbAddDeviceLedInfo( + arg1: XkbDeviceInfoPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> XkbDeviceLedInfoPtr; +} +extern "C" { + pub fn XkbResizeDeviceButtonActions( + arg1: XkbDeviceInfoPtr, + arg2: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbAllocDeviceInfo( + arg1: ::std::os::raw::c_uint, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + ) -> XkbDeviceInfoPtr; +} +extern "C" { + pub fn XkbFreeDeviceInfo( + arg1: XkbDeviceInfoPtr, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XkbNoteDeviceChanges( + arg1: XkbDeviceChangesPtr, + arg2: *mut XkbExtensionDeviceNotifyEvent, + arg3: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn XkbGetDeviceInfo( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> XkbDeviceInfoPtr; +} +extern "C" { + pub fn XkbGetDeviceInfoChanges( + arg1: *mut Display, + arg2: XkbDeviceInfoPtr, + arg3: XkbDeviceChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetDeviceButtonActions( + arg1: *mut Display, + arg2: XkbDeviceInfoPtr, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbGetDeviceLedInfo( + arg1: *mut Display, + arg2: XkbDeviceInfoPtr, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetDeviceInfo( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: XkbDeviceInfoPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbChangeDeviceInfo( + arg1: *mut Display, + arg2: XkbDeviceInfoPtr, + arg3: XkbDeviceChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetDeviceLedInfo( + arg1: *mut Display, + arg2: XkbDeviceInfoPtr, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbSetDeviceButtonActions( + arg1: *mut Display, + arg2: XkbDeviceInfoPtr, + arg3: ::std::os::raw::c_uint, + arg4: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbToControl(arg1: ::std::os::raw::c_char) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn XkbSetDebuggingFlags( + arg1: *mut Display, + arg2: ::std::os::raw::c_uint, + arg3: ::std::os::raw::c_uint, + arg4: *mut ::std::os::raw::c_char, + arg5: ::std::os::raw::c_uint, + arg6: ::std::os::raw::c_uint, + arg7: *mut ::std::os::raw::c_uint, + arg8: *mut ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbApplyVirtualModChanges( + arg1: XkbDescPtr, + arg2: ::std::os::raw::c_uint, + arg3: XkbChangesPtr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbUpdateActionVirtualMods( + arg1: XkbDescPtr, + arg2: *mut XkbAction, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XkbUpdateKeyTypeVirtualMods( + arg1: XkbDescPtr, + arg2: XkbKeyTypePtr, + arg3: ::std::os::raw::c_uint, + arg4: XkbChangesPtr, + ); +} +extern "C" { + pub fn Xpermalloc(arg1: ::std::os::raw::c_uint) -> *mut ::std::os::raw::c_char; +} +pub type XrmQuark = ::std::os::raw::c_int; +pub type XrmQuarkList = *mut ::std::os::raw::c_int; +pub type XrmString = *mut ::std::os::raw::c_char; +extern "C" { + pub fn XrmStringToQuark(arg1: *const ::std::os::raw::c_char) -> XrmQuark; +} +extern "C" { + pub fn XrmPermStringToQuark(arg1: *const ::std::os::raw::c_char) -> XrmQuark; +} +extern "C" { + pub fn XrmQuarkToString(arg1: XrmQuark) -> XrmString; +} +extern "C" { + pub fn XrmUniqueQuark() -> XrmQuark; +} +pub const XrmBinding_XrmBindTightly: XrmBinding = 0; +pub const XrmBinding_XrmBindLoosely: XrmBinding = 1; +pub type XrmBinding = u32; +pub type XrmBindingList = *mut XrmBinding; +extern "C" { + pub fn XrmStringToQuarkList(arg1: *const ::std::os::raw::c_char, arg2: XrmQuarkList); +} +extern "C" { + pub fn XrmStringToBindingQuarkList( + arg1: *const ::std::os::raw::c_char, + arg2: XrmBindingList, + arg3: XrmQuarkList, + ); +} +pub type XrmName = XrmQuark; +pub type XrmNameList = XrmQuarkList; +pub type XrmClass = XrmQuark; +pub type XrmClassList = XrmQuarkList; +pub type XrmRepresentation = XrmQuark; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XrmValue { + pub size: ::std::os::raw::c_uint, + pub addr: XPointer, +} +pub type XrmValuePtr = *mut XrmValue; +pub type XrmHashBucket = *mut _XrmHashBucketRec; +pub type XrmHashTable = *mut XrmHashBucket; +pub type XrmSearchList = [XrmHashTable; 0usize]; +pub type XrmDatabase = *mut _XrmHashBucketRec; +extern "C" { + pub fn XrmDestroyDatabase(arg1: XrmDatabase); +} +extern "C" { + pub fn XrmQPutResource( + arg1: *mut XrmDatabase, + arg2: XrmBindingList, + arg3: XrmQuarkList, + arg4: XrmRepresentation, + arg5: *mut XrmValue, + ); +} +extern "C" { + pub fn XrmPutResource( + arg1: *mut XrmDatabase, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + arg4: *mut XrmValue, + ); +} +extern "C" { + pub fn XrmQPutStringResource( + arg1: *mut XrmDatabase, + arg2: XrmBindingList, + arg3: XrmQuarkList, + arg4: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn XrmPutStringResource( + arg1: *mut XrmDatabase, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn XrmPutLineResource(arg1: *mut XrmDatabase, arg2: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn XrmQGetResource( + arg1: XrmDatabase, + arg2: XrmNameList, + arg3: XrmClassList, + arg4: *mut XrmRepresentation, + arg5: *mut XrmValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XrmGetResource( + arg1: XrmDatabase, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + arg4: *mut *mut ::std::os::raw::c_char, + arg5: *mut XrmValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XrmQGetSearchList( + arg1: XrmDatabase, + arg2: XrmNameList, + arg3: XrmClassList, + arg4: *mut XrmHashTable, + arg5: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XrmQGetSearchResource( + arg1: *mut XrmHashTable, + arg2: XrmName, + arg3: XrmClass, + arg4: *mut XrmRepresentation, + arg5: *mut XrmValue, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XrmSetDatabase(arg1: *mut Display, arg2: XrmDatabase); +} +extern "C" { + pub fn XrmGetDatabase(arg1: *mut Display) -> XrmDatabase; +} +extern "C" { + pub fn XrmGetFileDatabase(arg1: *const ::std::os::raw::c_char) -> XrmDatabase; +} +extern "C" { + pub fn XrmCombineFileDatabase( + arg1: *const ::std::os::raw::c_char, + arg2: *mut XrmDatabase, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XrmGetStringDatabase(arg1: *const ::std::os::raw::c_char) -> XrmDatabase; +} +extern "C" { + pub fn XrmPutFileDatabase(arg1: XrmDatabase, arg2: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn XrmMergeDatabases(arg1: XrmDatabase, arg2: *mut XrmDatabase); +} +extern "C" { + pub fn XrmCombineDatabase( + arg1: XrmDatabase, + arg2: *mut XrmDatabase, + arg3: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XrmEnumerateDatabase( + arg1: XrmDatabase, + arg2: XrmNameList, + arg3: XrmClassList, + arg4: ::std::os::raw::c_int, + arg5: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut XrmDatabase, + arg2: XrmBindingList, + arg3: XrmQuarkList, + arg4: *mut XrmRepresentation, + arg5: *mut XrmValue, + arg6: XPointer, + ) -> ::std::os::raw::c_int, + >, + arg6: XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XrmLocaleOfDatabase(arg1: XrmDatabase) -> *const ::std::os::raw::c_char; +} +pub const XrmOptionKind_XrmoptionNoArg: XrmOptionKind = 0; +pub const XrmOptionKind_XrmoptionIsArg: XrmOptionKind = 1; +pub const XrmOptionKind_XrmoptionStickyArg: XrmOptionKind = 2; +pub const XrmOptionKind_XrmoptionSepArg: XrmOptionKind = 3; +pub const XrmOptionKind_XrmoptionResArg: XrmOptionKind = 4; +pub const XrmOptionKind_XrmoptionSkipArg: XrmOptionKind = 5; +pub const XrmOptionKind_XrmoptionSkipLine: XrmOptionKind = 6; +pub const XrmOptionKind_XrmoptionSkipNArgs: XrmOptionKind = 7; +pub type XrmOptionKind = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XrmOptionDescRec { + pub option: *mut ::std::os::raw::c_char, + pub specifier: *mut ::std::os::raw::c_char, + pub argKind: XrmOptionKind, + pub value: XPointer, +} +pub type XrmOptionDescList = *mut XrmOptionDescRec; +extern "C" { + pub fn XrmParseCommand( + arg1: *mut XrmDatabase, + arg2: XrmOptionDescList, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, + arg5: *mut ::std::os::raw::c_int, + arg6: *mut *mut ::std::os::raw::c_char, + ); +} +pub type Rotation = ::std::os::raw::c_ushort; +pub type SizeID = ::std::os::raw::c_ushort; +pub type SubpixelOrder = ::std::os::raw::c_ushort; +pub type Connection = ::std::os::raw::c_ushort; +pub type XRandrRotation = ::std::os::raw::c_ushort; +pub type XRandrSizeID = ::std::os::raw::c_ushort; +pub type XRandrSubpixelOrder = ::std::os::raw::c_ushort; +pub type XRandrModeFlags = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSizeHints { + pub flags: ::std::os::raw::c_long, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub min_width: ::std::os::raw::c_int, + pub min_height: ::std::os::raw::c_int, + pub max_width: ::std::os::raw::c_int, + pub max_height: ::std::os::raw::c_int, + pub width_inc: ::std::os::raw::c_int, + pub height_inc: ::std::os::raw::c_int, + pub min_aspect: XSizeHints__bindgen_ty_1, + pub max_aspect: XSizeHints__bindgen_ty_1, + pub base_width: ::std::os::raw::c_int, + pub base_height: ::std::os::raw::c_int, + pub win_gravity: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XSizeHints__bindgen_ty_1 { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XWMHints { + pub flags: ::std::os::raw::c_long, + pub input: ::std::os::raw::c_int, + pub initial_state: ::std::os::raw::c_int, + pub icon_pixmap: Pixmap, + pub icon_window: Window, + pub icon_x: ::std::os::raw::c_int, + pub icon_y: ::std::os::raw::c_int, + pub icon_mask: Pixmap, + pub window_group: XID, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XTextProperty { + pub value: *mut ::std::os::raw::c_uchar, + pub encoding: Atom, + pub format: ::std::os::raw::c_int, + pub nitems: ::std::os::raw::c_ulong, +} +pub const XICCEncodingStyle_XStringStyle: XICCEncodingStyle = 0; +pub const XICCEncodingStyle_XCompoundTextStyle: XICCEncodingStyle = 1; +pub const XICCEncodingStyle_XTextStyle: XICCEncodingStyle = 2; +pub const XICCEncodingStyle_XStdICCTextStyle: XICCEncodingStyle = 3; +pub const XICCEncodingStyle_XUTF8StringStyle: XICCEncodingStyle = 4; +pub type XICCEncodingStyle = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XIconSize { + pub min_width: ::std::os::raw::c_int, + pub min_height: ::std::os::raw::c_int, + pub max_width: ::std::os::raw::c_int, + pub max_height: ::std::os::raw::c_int, + pub width_inc: ::std::os::raw::c_int, + pub height_inc: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XClassHint { + pub res_name: *mut ::std::os::raw::c_char, + pub res_class: *mut ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XComposeStatus { + pub compose_ptr: XPointer, + pub chars_matched: ::std::os::raw::c_int, +} +pub type XComposeStatus = _XComposeStatus; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRegion { + _unused: [u8; 0], +} +pub type Region = *mut _XRegion; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XVisualInfo { + pub visual: *mut Visual, + pub visualid: VisualID, + pub screen: ::std::os::raw::c_int, + pub depth: ::std::os::raw::c_int, + pub class: ::std::os::raw::c_int, + pub red_mask: ::std::os::raw::c_ulong, + pub green_mask: ::std::os::raw::c_ulong, + pub blue_mask: ::std::os::raw::c_ulong, + pub colormap_size: ::std::os::raw::c_int, + pub bits_per_rgb: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XStandardColormap { + pub colormap: Colormap, + pub red_max: ::std::os::raw::c_ulong, + pub red_mult: ::std::os::raw::c_ulong, + pub green_max: ::std::os::raw::c_ulong, + pub green_mult: ::std::os::raw::c_ulong, + pub blue_max: ::std::os::raw::c_ulong, + pub blue_mult: ::std::os::raw::c_ulong, + pub base_pixel: ::std::os::raw::c_ulong, + pub visualid: VisualID, + pub killid: XID, +} +pub type XContext = ::std::os::raw::c_int; +extern "C" { + pub fn XAllocClassHint() -> *mut XClassHint; +} +extern "C" { + pub fn XAllocIconSize() -> *mut XIconSize; +} +extern "C" { + pub fn XAllocSizeHints() -> *mut XSizeHints; +} +extern "C" { + pub fn XAllocStandardColormap() -> *mut XStandardColormap; +} +extern "C" { + pub fn XAllocWMHints() -> *mut XWMHints; +} +extern "C" { + pub fn XClipBox(arg1: Region, arg2: *mut XRectangle) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XCreateRegion() -> Region; +} +extern "C" { + pub fn XDefaultString() -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn XDeleteContext(arg1: *mut Display, arg2: XID, arg3: XContext) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XDestroyRegion(arg1: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XEmptyRegion(arg1: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XEqualRegion(arg1: Region, arg2: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XFindContext( + arg1: *mut Display, + arg2: XID, + arg3: XContext, + arg4: *mut XPointer, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetClassHint( + arg1: *mut Display, + arg2: Window, + arg3: *mut XClassHint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetIconSizes( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut XIconSize, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetNormalHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetRGBColormaps( + arg1: *mut Display, + arg2: Window, + arg3: *mut *mut XStandardColormap, + arg4: *mut ::std::os::raw::c_int, + arg5: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetSizeHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + arg4: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetStandardColormap( + arg1: *mut Display, + arg2: Window, + arg3: *mut XStandardColormap, + arg4: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetTextProperty( + arg1: *mut Display, + arg2: Window, + arg3: *mut XTextProperty, + arg4: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetVisualInfo( + arg1: *mut Display, + arg2: ::std::os::raw::c_long, + arg3: *mut XVisualInfo, + arg4: *mut ::std::os::raw::c_int, + ) -> *mut XVisualInfo; +} +extern "C" { + pub fn XGetWMClientMachine( + arg1: *mut Display, + arg2: Window, + arg3: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWMHints(arg1: *mut Display, arg2: Window) -> *mut XWMHints; +} +extern "C" { + pub fn XGetWMIconName( + arg1: *mut Display, + arg2: Window, + arg3: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWMName( + arg1: *mut Display, + arg2: Window, + arg3: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWMNormalHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + arg4: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetWMSizeHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + arg4: *mut ::std::os::raw::c_long, + arg5: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XGetZoomHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XIntersectRegion(arg1: Region, arg2: Region, arg3: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XConvertCase(arg1: KeySym, arg2: *mut KeySym, arg3: *mut KeySym); +} +extern "C" { + pub fn XLookupString( + arg1: *mut XKeyEvent, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *mut KeySym, + arg5: *mut XComposeStatus, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XMatchVisualInfo( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *mut XVisualInfo, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XOffsetRegion( + arg1: Region, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPointInRegion( + arg1: Region, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XPolygonRegion( + arg1: *mut XPoint, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> Region; +} +extern "C" { + pub fn XRectInRegion( + arg1: Region, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_uint, + arg5: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSaveContext( + arg1: *mut Display, + arg2: XID, + arg3: XContext, + arg4: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetClassHint( + arg1: *mut Display, + arg2: Window, + arg3: *mut XClassHint, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetIconSizes( + arg1: *mut Display, + arg2: Window, + arg3: *mut XIconSize, + arg4: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetNormalHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetRGBColormaps( + arg1: *mut Display, + arg2: Window, + arg3: *mut XStandardColormap, + arg4: ::std::os::raw::c_int, + arg5: Atom, + ); +} +extern "C" { + pub fn XSetSizeHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + arg4: Atom, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetStandardProperties( + arg1: *mut Display, + arg2: Window, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + arg5: Pixmap, + arg6: *mut *mut ::std::os::raw::c_char, + arg7: ::std::os::raw::c_int, + arg8: *mut XSizeHints, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetTextProperty(arg1: *mut Display, arg2: Window, arg3: *mut XTextProperty, arg4: Atom); +} +extern "C" { + pub fn XSetWMClientMachine(arg1: *mut Display, arg2: Window, arg3: *mut XTextProperty); +} +extern "C" { + pub fn XSetWMHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XWMHints, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetWMIconName(arg1: *mut Display, arg2: Window, arg3: *mut XTextProperty); +} +extern "C" { + pub fn XSetWMName(arg1: *mut Display, arg2: Window, arg3: *mut XTextProperty); +} +extern "C" { + pub fn XSetWMNormalHints(arg1: *mut Display, arg2: Window, arg3: *mut XSizeHints); +} +extern "C" { + pub fn XSetWMProperties( + arg1: *mut Display, + arg2: Window, + arg3: *mut XTextProperty, + arg4: *mut XTextProperty, + arg5: *mut *mut ::std::os::raw::c_char, + arg6: ::std::os::raw::c_int, + arg7: *mut XSizeHints, + arg8: *mut XWMHints, + arg9: *mut XClassHint, + ); +} +extern "C" { + pub fn XmbSetWMProperties( + arg1: *mut Display, + arg2: Window, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + arg5: *mut *mut ::std::os::raw::c_char, + arg6: ::std::os::raw::c_int, + arg7: *mut XSizeHints, + arg8: *mut XWMHints, + arg9: *mut XClassHint, + ); +} +extern "C" { + pub fn Xutf8SetWMProperties( + arg1: *mut Display, + arg2: Window, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + arg5: *mut *mut ::std::os::raw::c_char, + arg6: ::std::os::raw::c_int, + arg7: *mut XSizeHints, + arg8: *mut XWMHints, + arg9: *mut XClassHint, + ); +} +extern "C" { + pub fn XSetWMSizeHints(arg1: *mut Display, arg2: Window, arg3: *mut XSizeHints, arg4: Atom); +} +extern "C" { + pub fn XSetRegion(arg1: *mut Display, arg2: GC, arg3: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSetStandardColormap( + arg1: *mut Display, + arg2: Window, + arg3: *mut XStandardColormap, + arg4: Atom, + ); +} +extern "C" { + pub fn XSetZoomHints( + arg1: *mut Display, + arg2: Window, + arg3: *mut XSizeHints, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XShrinkRegion( + arg1: Region, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XStringListToTextProperty( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XSubtractRegion(arg1: Region, arg2: Region, arg3: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XmbTextListToTextProperty( + display: *mut Display, + list: *mut *mut ::std::os::raw::c_char, + count: ::std::os::raw::c_int, + style: XICCEncodingStyle, + text_prop_return: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcTextListToTextProperty( + display: *mut Display, + list: *mut *mut wchar_t, + count: ::std::os::raw::c_int, + style: XICCEncodingStyle, + text_prop_return: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Xutf8TextListToTextProperty( + display: *mut Display, + list: *mut *mut ::std::os::raw::c_char, + count: ::std::os::raw::c_int, + style: XICCEncodingStyle, + text_prop_return: *mut XTextProperty, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcFreeStringList(list: *mut *mut wchar_t); +} +extern "C" { + pub fn XTextPropertyToStringList( + arg1: *mut XTextProperty, + arg2: *mut *mut *mut ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XmbTextPropertyToTextList( + display: *mut Display, + text_prop: *const XTextProperty, + list_return: *mut *mut *mut ::std::os::raw::c_char, + count_return: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XwcTextPropertyToTextList( + display: *mut Display, + text_prop: *const XTextProperty, + list_return: *mut *mut *mut wchar_t, + count_return: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Xutf8TextPropertyToTextList( + display: *mut Display, + text_prop: *const XTextProperty, + list_return: *mut *mut *mut ::std::os::raw::c_char, + count_return: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUnionRectWithRegion( + arg1: *mut XRectangle, + arg2: Region, + arg3: Region, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XUnionRegion(arg1: Region, arg2: Region, arg3: Region) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XWMGeometry( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *const ::std::os::raw::c_char, + arg4: *const ::std::os::raw::c_char, + arg5: ::std::os::raw::c_uint, + arg6: *mut XSizeHints, + arg7: *mut ::std::os::raw::c_int, + arg8: *mut ::std::os::raw::c_int, + arg9: *mut ::std::os::raw::c_int, + arg10: *mut ::std::os::raw::c_int, + arg11: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XXorRegion(arg1: Region, arg2: Region, arg3: Region) -> ::std::os::raw::c_int; +} +pub type pointer = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Client { + _unused: [u8; 0], +} +pub type ClientPtr = *mut _Client; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Font { + _unused: [u8; 0], +} +pub type FontPtr = *mut _Font; +pub type FSID = ::std::os::raw::c_ulong; +pub type AccContext = FSID; +pub type OSTimePtr = *mut *mut timeval; +pub type BlockHandlerProcPtr = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: OSTimePtr, + arg3: *mut ::std::os::raw::c_void, + ), +>; +pub type Glyph = XID; +pub type GlyphSet = XID; +pub type Picture = XID; +pub type PictFormat = XID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRenderDirectFormat { + pub red: ::std::os::raw::c_short, + pub redMask: ::std::os::raw::c_short, + pub green: ::std::os::raw::c_short, + pub greenMask: ::std::os::raw::c_short, + pub blue: ::std::os::raw::c_short, + pub blueMask: ::std::os::raw::c_short, + pub alpha: ::std::os::raw::c_short, + pub alphaMask: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRenderPictFormat { + pub id: PictFormat, + pub type_: ::std::os::raw::c_int, + pub depth: ::std::os::raw::c_int, + pub direct: XRenderDirectFormat, + pub colormap: Colormap, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRenderPictureAttributes { + pub repeat: ::std::os::raw::c_int, + pub alpha_map: Picture, + pub alpha_x_origin: ::std::os::raw::c_int, + pub alpha_y_origin: ::std::os::raw::c_int, + pub clip_x_origin: ::std::os::raw::c_int, + pub clip_y_origin: ::std::os::raw::c_int, + pub clip_mask: Pixmap, + pub graphics_exposures: ::std::os::raw::c_int, + pub subwindow_mode: ::std::os::raw::c_int, + pub poly_edge: ::std::os::raw::c_int, + pub poly_mode: ::std::os::raw::c_int, + pub dither: Atom, + pub component_alpha: ::std::os::raw::c_int, +} +pub type XRenderPictureAttributes = _XRenderPictureAttributes; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRenderColor { + pub red: ::std::os::raw::c_ushort, + pub green: ::std::os::raw::c_ushort, + pub blue: ::std::os::raw::c_ushort, + pub alpha: ::std::os::raw::c_ushort, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XGlyphInfo { + pub width: ::std::os::raw::c_ushort, + pub height: ::std::os::raw::c_ushort, + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, + pub xOff: ::std::os::raw::c_short, + pub yOff: ::std::os::raw::c_short, +} +pub type XGlyphInfo = _XGlyphInfo; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XGlyphElt8 { + pub glyphset: GlyphSet, + pub chars: *const ::std::os::raw::c_char, + pub nchars: ::std::os::raw::c_int, + pub xOff: ::std::os::raw::c_int, + pub yOff: ::std::os::raw::c_int, +} +pub type XGlyphElt8 = _XGlyphElt8; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XGlyphElt16 { + pub glyphset: GlyphSet, + pub chars: *const ::std::os::raw::c_ushort, + pub nchars: ::std::os::raw::c_int, + pub xOff: ::std::os::raw::c_int, + pub yOff: ::std::os::raw::c_int, +} +pub type XGlyphElt16 = _XGlyphElt16; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XGlyphElt32 { + pub glyphset: GlyphSet, + pub chars: *const ::std::os::raw::c_uint, + pub nchars: ::std::os::raw::c_int, + pub xOff: ::std::os::raw::c_int, + pub yOff: ::std::os::raw::c_int, +} +pub type XGlyphElt32 = _XGlyphElt32; +pub type XDouble = f64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XPointDouble { + pub x: XDouble, + pub y: XDouble, +} +pub type XPointDouble = _XPointDouble; +pub type XFixed = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XPointFixed { + pub x: XFixed, + pub y: XFixed, +} +pub type XPointFixed = _XPointFixed; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XLineFixed { + pub p1: XPointFixed, + pub p2: XPointFixed, +} +pub type XLineFixed = _XLineFixed; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XTriangle { + pub p1: XPointFixed, + pub p2: XPointFixed, + pub p3: XPointFixed, +} +pub type XTriangle = _XTriangle; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XCircle { + pub x: XFixed, + pub y: XFixed, + pub radius: XFixed, +} +pub type XCircle = _XCircle; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XTrapezoid { + pub top: XFixed, + pub bottom: XFixed, + pub left: XLineFixed, + pub right: XLineFixed, +} +pub type XTrapezoid = _XTrapezoid; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XTransform { + pub matrix: [[XFixed; 3usize]; 3usize], +} +pub type XTransform = _XTransform; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XFilters { + pub nfilter: ::std::os::raw::c_int, + pub filter: *mut *mut ::std::os::raw::c_char, + pub nalias: ::std::os::raw::c_int, + pub alias: *mut ::std::os::raw::c_short, +} +pub type XFilters = _XFilters; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XIndexValue { + pub pixel: ::std::os::raw::c_ulong, + pub red: ::std::os::raw::c_ushort, + pub green: ::std::os::raw::c_ushort, + pub blue: ::std::os::raw::c_ushort, + pub alpha: ::std::os::raw::c_ushort, +} +pub type XIndexValue = _XIndexValue; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XAnimCursor { + pub cursor: Cursor, + pub delay: ::std::os::raw::c_ulong, +} +pub type XAnimCursor = _XAnimCursor; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XSpanFix { + pub left: XFixed, + pub right: XFixed, + pub y: XFixed, +} +pub type XSpanFix = _XSpanFix; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XTrap { + pub top: XSpanFix, + pub bottom: XSpanFix, +} +pub type XTrap = _XTrap; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XLinearGradient { + pub p1: XPointFixed, + pub p2: XPointFixed, +} +pub type XLinearGradient = _XLinearGradient; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRadialGradient { + pub inner: XCircle, + pub outer: XCircle, +} +pub type XRadialGradient = _XRadialGradient; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XConicalGradient { + pub center: XPointFixed, + pub angle: XFixed, +} +pub type XConicalGradient = _XConicalGradient; +extern "C" { + pub fn XRenderQueryExtension( + dpy: *mut Display, + event_basep: *mut ::std::os::raw::c_int, + error_basep: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRenderQueryVersion( + dpy: *mut Display, + major_versionp: *mut ::std::os::raw::c_int, + minor_versionp: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRenderQueryFormats(dpy: *mut Display) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRenderQuerySubpixelOrder( + dpy: *mut Display, + screen: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRenderSetSubpixelOrder( + dpy: *mut Display, + screen: ::std::os::raw::c_int, + subpixel: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRenderFindVisualFormat( + dpy: *mut Display, + visual: *const Visual, + ) -> *mut XRenderPictFormat; +} +extern "C" { + pub fn XRenderFindFormat( + dpy: *mut Display, + mask: ::std::os::raw::c_ulong, + templ: *const XRenderPictFormat, + count: ::std::os::raw::c_int, + ) -> *mut XRenderPictFormat; +} +extern "C" { + pub fn XRenderFindStandardFormat( + dpy: *mut Display, + format: ::std::os::raw::c_int, + ) -> *mut XRenderPictFormat; +} +extern "C" { + pub fn XRenderQueryPictIndexValues( + dpy: *mut Display, + format: *const XRenderPictFormat, + num: *mut ::std::os::raw::c_int, + ) -> *mut XIndexValue; +} +extern "C" { + pub fn XRenderCreatePicture( + dpy: *mut Display, + drawable: Drawable, + format: *const XRenderPictFormat, + valuemask: ::std::os::raw::c_ulong, + attributes: *const XRenderPictureAttributes, + ) -> Picture; +} +extern "C" { + pub fn XRenderChangePicture( + dpy: *mut Display, + picture: Picture, + valuemask: ::std::os::raw::c_ulong, + attributes: *const XRenderPictureAttributes, + ); +} +extern "C" { + pub fn XRenderSetPictureClipRectangles( + dpy: *mut Display, + picture: Picture, + xOrigin: ::std::os::raw::c_int, + yOrigin: ::std::os::raw::c_int, + rects: *const XRectangle, + n: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderSetPictureClipRegion(dpy: *mut Display, picture: Picture, r: Region); +} +extern "C" { + pub fn XRenderSetPictureTransform( + dpy: *mut Display, + picture: Picture, + transform: *mut XTransform, + ); +} +extern "C" { + pub fn XRenderFreePicture(dpy: *mut Display, picture: Picture); +} +extern "C" { + pub fn XRenderComposite( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + mask: Picture, + dst: Picture, + src_x: ::std::os::raw::c_int, + src_y: ::std::os::raw::c_int, + mask_x: ::std::os::raw::c_int, + mask_y: ::std::os::raw::c_int, + dst_x: ::std::os::raw::c_int, + dst_y: ::std::os::raw::c_int, + width: ::std::os::raw::c_uint, + height: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn XRenderCreateGlyphSet(dpy: *mut Display, format: *const XRenderPictFormat) -> GlyphSet; +} +extern "C" { + pub fn XRenderReferenceGlyphSet(dpy: *mut Display, existing: GlyphSet) -> GlyphSet; +} +extern "C" { + pub fn XRenderFreeGlyphSet(dpy: *mut Display, glyphset: GlyphSet); +} +extern "C" { + pub fn XRenderAddGlyphs( + dpy: *mut Display, + glyphset: GlyphSet, + gids: *const Glyph, + glyphs: *const XGlyphInfo, + nglyphs: ::std::os::raw::c_int, + images: *const ::std::os::raw::c_char, + nbyte_images: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderFreeGlyphs( + dpy: *mut Display, + glyphset: GlyphSet, + gids: *const Glyph, + nglyphs: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeString8( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + glyphset: GlyphSet, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + string: *const ::std::os::raw::c_char, + nchar: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeString16( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + glyphset: GlyphSet, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + string: *const ::std::os::raw::c_ushort, + nchar: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeString32( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + glyphset: GlyphSet, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + string: *const ::std::os::raw::c_uint, + nchar: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeText8( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + elts: *const XGlyphElt8, + nelt: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeText16( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + elts: *const XGlyphElt16, + nelt: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeText32( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + elts: *const XGlyphElt32, + nelt: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderFillRectangle( + dpy: *mut Display, + op: ::std::os::raw::c_int, + dst: Picture, + color: *const XRenderColor, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + width: ::std::os::raw::c_uint, + height: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn XRenderFillRectangles( + dpy: *mut Display, + op: ::std::os::raw::c_int, + dst: Picture, + color: *const XRenderColor, + rectangles: *const XRectangle, + n_rects: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeTrapezoids( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + traps: *const XTrapezoid, + ntrap: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeTriangles( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + triangles: *const XTriangle, + ntriangle: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeTriStrip( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + points: *const XPointFixed, + npoint: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeTriFan( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + points: *const XPointFixed, + npoint: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCompositeDoublePoly( + dpy: *mut Display, + op: ::std::os::raw::c_int, + src: Picture, + dst: Picture, + maskFormat: *const XRenderPictFormat, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + xDst: ::std::os::raw::c_int, + yDst: ::std::os::raw::c_int, + fpoints: *const XPointDouble, + npoints: ::std::os::raw::c_int, + winding: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderParseColor( + dpy: *mut Display, + spec: *mut ::std::os::raw::c_char, + def: *mut XRenderColor, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRenderCreateCursor( + dpy: *mut Display, + source: Picture, + x: ::std::os::raw::c_uint, + y: ::std::os::raw::c_uint, + ) -> Cursor; +} +extern "C" { + pub fn XRenderQueryFilters(dpy: *mut Display, drawable: Drawable) -> *mut XFilters; +} +extern "C" { + pub fn XRenderSetPictureFilter( + dpy: *mut Display, + picture: Picture, + filter: *const ::std::os::raw::c_char, + params: *mut XFixed, + nparams: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCreateAnimCursor( + dpy: *mut Display, + ncursor: ::std::os::raw::c_int, + cursors: *mut XAnimCursor, + ) -> Cursor; +} +extern "C" { + pub fn XRenderAddTraps( + dpy: *mut Display, + picture: Picture, + xOff: ::std::os::raw::c_int, + yOff: ::std::os::raw::c_int, + traps: *const XTrap, + ntrap: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRenderCreateSolidFill(dpy: *mut Display, color: *const XRenderColor) -> Picture; +} +extern "C" { + pub fn XRenderCreateLinearGradient( + dpy: *mut Display, + gradient: *const XLinearGradient, + stops: *const XFixed, + colors: *const XRenderColor, + nstops: ::std::os::raw::c_int, + ) -> Picture; +} +extern "C" { + pub fn XRenderCreateRadialGradient( + dpy: *mut Display, + gradient: *const XRadialGradient, + stops: *const XFixed, + colors: *const XRenderColor, + nstops: ::std::os::raw::c_int, + ) -> Picture; +} +extern "C" { + pub fn XRenderCreateConicalGradient( + dpy: *mut Display, + gradient: *const XConicalGradient, + stops: *const XFixed, + colors: *const XRenderColor, + nstops: ::std::os::raw::c_int, + ) -> Picture; +} +pub type RROutput = XID; +pub type RRCrtc = XID; +pub type RRMode = XID; +pub type RRProvider = XID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRScreenSize { + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub mwidth: ::std::os::raw::c_int, + pub mheight: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRScreenChangeNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub root: Window, + pub timestamp: Time, + pub config_timestamp: Time, + pub size_index: SizeID, + pub subpixel_order: SubpixelOrder, + pub rotation: Rotation, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub mwidth: ::std::os::raw::c_int, + pub mheight: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRROutputChangeNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, + pub output: RROutput, + pub crtc: RRCrtc, + pub mode: RRMode, + pub rotation: Rotation, + pub connection: Connection, + pub subpixel_order: SubpixelOrder, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRCrtcChangeNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, + pub crtc: RRCrtc, + pub mode: RRMode, + pub rotation: Rotation, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_uint, + pub height: ::std::os::raw::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRROutputPropertyNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, + pub output: RROutput, + pub property: Atom, + pub timestamp: Time, + pub state: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRProviderChangeNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, + pub provider: RRProvider, + pub timestamp: Time, + pub current_role: ::std::os::raw::c_uint, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRProviderPropertyNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, + pub provider: RRProvider, + pub property: Atom, + pub timestamp: Time, + pub state: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRResourceChangeNotifyEvent { + pub type_: ::std::os::raw::c_int, + pub serial: ::std::os::raw::c_ulong, + pub send_event: ::std::os::raw::c_int, + pub display: *mut Display, + pub window: Window, + pub subtype: ::std::os::raw::c_int, + pub timestamp: Time, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRScreenConfiguration { + _unused: [u8; 0], +} +pub type XRRScreenConfiguration = _XRRScreenConfiguration; +extern "C" { + pub fn XRRQueryExtension( + dpy: *mut Display, + event_base_return: *mut ::std::os::raw::c_int, + error_base_return: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRQueryVersion( + dpy: *mut Display, + major_version_return: *mut ::std::os::raw::c_int, + minor_version_return: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRGetScreenInfo(dpy: *mut Display, window: Window) -> *mut XRRScreenConfiguration; +} +extern "C" { + pub fn XRRFreeScreenConfigInfo(config: *mut XRRScreenConfiguration); +} +extern "C" { + pub fn XRRSetScreenConfig( + dpy: *mut Display, + config: *mut XRRScreenConfiguration, + draw: Drawable, + size_index: ::std::os::raw::c_int, + rotation: Rotation, + timestamp: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRSetScreenConfigAndRate( + dpy: *mut Display, + config: *mut XRRScreenConfiguration, + draw: Drawable, + size_index: ::std::os::raw::c_int, + rotation: Rotation, + rate: ::std::os::raw::c_short, + timestamp: Time, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRConfigRotations( + config: *mut XRRScreenConfiguration, + current_rotation: *mut Rotation, + ) -> Rotation; +} +extern "C" { + pub fn XRRConfigTimes(config: *mut XRRScreenConfiguration, config_timestamp: *mut Time) + -> Time; +} +extern "C" { + pub fn XRRConfigSizes( + config: *mut XRRScreenConfiguration, + nsizes: *mut ::std::os::raw::c_int, + ) -> *mut XRRScreenSize; +} +extern "C" { + pub fn XRRConfigRates( + config: *mut XRRScreenConfiguration, + sizeID: ::std::os::raw::c_int, + nrates: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_short; +} +extern "C" { + pub fn XRRConfigCurrentConfiguration( + config: *mut XRRScreenConfiguration, + rotation: *mut Rotation, + ) -> SizeID; +} +extern "C" { + pub fn XRRConfigCurrentRate(config: *mut XRRScreenConfiguration) -> ::std::os::raw::c_short; +} +extern "C" { + pub fn XRRRootToScreen(dpy: *mut Display, root: Window) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRSelectInput(dpy: *mut Display, window: Window, mask: ::std::os::raw::c_int); +} +extern "C" { + pub fn XRRRotations( + dpy: *mut Display, + screen: ::std::os::raw::c_int, + current_rotation: *mut Rotation, + ) -> Rotation; +} +extern "C" { + pub fn XRRSizes( + dpy: *mut Display, + screen: ::std::os::raw::c_int, + nsizes: *mut ::std::os::raw::c_int, + ) -> *mut XRRScreenSize; +} +extern "C" { + pub fn XRRRates( + dpy: *mut Display, + screen: ::std::os::raw::c_int, + sizeID: ::std::os::raw::c_int, + nrates: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_short; +} +extern "C" { + pub fn XRRTimes( + dpy: *mut Display, + screen: ::std::os::raw::c_int, + config_timestamp: *mut Time, + ) -> Time; +} +extern "C" { + pub fn XRRGetScreenSizeRange( + dpy: *mut Display, + window: Window, + minWidth: *mut ::std::os::raw::c_int, + minHeight: *mut ::std::os::raw::c_int, + maxWidth: *mut ::std::os::raw::c_int, + maxHeight: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRSetScreenSize( + dpy: *mut Display, + window: Window, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + mmWidth: ::std::os::raw::c_int, + mmHeight: ::std::os::raw::c_int, + ); +} +pub type XRRModeFlags = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRModeInfo { + pub id: RRMode, + pub width: ::std::os::raw::c_uint, + pub height: ::std::os::raw::c_uint, + pub dotClock: ::std::os::raw::c_ulong, + pub hSyncStart: ::std::os::raw::c_uint, + pub hSyncEnd: ::std::os::raw::c_uint, + pub hTotal: ::std::os::raw::c_uint, + pub hSkew: ::std::os::raw::c_uint, + pub vSyncStart: ::std::os::raw::c_uint, + pub vSyncEnd: ::std::os::raw::c_uint, + pub vTotal: ::std::os::raw::c_uint, + pub name: *mut ::std::os::raw::c_char, + pub nameLength: ::std::os::raw::c_uint, + pub modeFlags: XRRModeFlags, +} +pub type XRRModeInfo = _XRRModeInfo; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRScreenResources { + pub timestamp: Time, + pub configTimestamp: Time, + pub ncrtc: ::std::os::raw::c_int, + pub crtcs: *mut RRCrtc, + pub noutput: ::std::os::raw::c_int, + pub outputs: *mut RROutput, + pub nmode: ::std::os::raw::c_int, + pub modes: *mut XRRModeInfo, +} +pub type XRRScreenResources = _XRRScreenResources; +extern "C" { + pub fn XRRGetScreenResources(dpy: *mut Display, window: Window) -> *mut XRRScreenResources; +} +extern "C" { + pub fn XRRFreeScreenResources(resources: *mut XRRScreenResources); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRROutputInfo { + pub timestamp: Time, + pub crtc: RRCrtc, + pub name: *mut ::std::os::raw::c_char, + pub nameLen: ::std::os::raw::c_int, + pub mm_width: ::std::os::raw::c_ulong, + pub mm_height: ::std::os::raw::c_ulong, + pub connection: Connection, + pub subpixel_order: SubpixelOrder, + pub ncrtc: ::std::os::raw::c_int, + pub crtcs: *mut RRCrtc, + pub nclone: ::std::os::raw::c_int, + pub clones: *mut RROutput, + pub nmode: ::std::os::raw::c_int, + pub npreferred: ::std::os::raw::c_int, + pub modes: *mut RRMode, +} +pub type XRROutputInfo = _XRROutputInfo; +extern "C" { + pub fn XRRGetOutputInfo( + dpy: *mut Display, + resources: *mut XRRScreenResources, + output: RROutput, + ) -> *mut XRROutputInfo; +} +extern "C" { + pub fn XRRFreeOutputInfo(outputInfo: *mut XRROutputInfo); +} +extern "C" { + pub fn XRRListOutputProperties( + dpy: *mut Display, + output: RROutput, + nprop: *mut ::std::os::raw::c_int, + ) -> *mut Atom; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct XRRPropertyInfo { + pub pending: ::std::os::raw::c_int, + pub range: ::std::os::raw::c_int, + pub immutable: ::std::os::raw::c_int, + pub num_values: ::std::os::raw::c_int, + pub values: *mut ::std::os::raw::c_long, +} +extern "C" { + pub fn XRRQueryOutputProperty( + dpy: *mut Display, + output: RROutput, + property: Atom, + ) -> *mut XRRPropertyInfo; +} +extern "C" { + pub fn XRRConfigureOutputProperty( + dpy: *mut Display, + output: RROutput, + property: Atom, + pending: ::std::os::raw::c_int, + range: ::std::os::raw::c_int, + num_values: ::std::os::raw::c_int, + values: *mut ::std::os::raw::c_long, + ); +} +extern "C" { + pub fn XRRChangeOutputProperty( + dpy: *mut Display, + output: RROutput, + property: Atom, + type_: Atom, + format: ::std::os::raw::c_int, + mode: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_uchar, + nelements: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRRDeleteOutputProperty(dpy: *mut Display, output: RROutput, property: Atom); +} +extern "C" { + pub fn XRRGetOutputProperty( + dpy: *mut Display, + output: RROutput, + property: Atom, + offset: ::std::os::raw::c_long, + length: ::std::os::raw::c_long, + _delete: ::std::os::raw::c_int, + pending: ::std::os::raw::c_int, + req_type: Atom, + actual_type: *mut Atom, + actual_format: *mut ::std::os::raw::c_int, + nitems: *mut ::std::os::raw::c_ulong, + bytes_after: *mut ::std::os::raw::c_ulong, + prop: *mut *mut ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRAllocModeInfo( + name: *const ::std::os::raw::c_char, + nameLength: ::std::os::raw::c_int, + ) -> *mut XRRModeInfo; +} +extern "C" { + pub fn XRRCreateMode(dpy: *mut Display, window: Window, modeInfo: *mut XRRModeInfo) -> RRMode; +} +extern "C" { + pub fn XRRDestroyMode(dpy: *mut Display, mode: RRMode); +} +extern "C" { + pub fn XRRAddOutputMode(dpy: *mut Display, output: RROutput, mode: RRMode); +} +extern "C" { + pub fn XRRDeleteOutputMode(dpy: *mut Display, output: RROutput, mode: RRMode); +} +extern "C" { + pub fn XRRFreeModeInfo(modeInfo: *mut XRRModeInfo); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRCrtcInfo { + pub timestamp: Time, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_uint, + pub height: ::std::os::raw::c_uint, + pub mode: RRMode, + pub rotation: Rotation, + pub noutput: ::std::os::raw::c_int, + pub outputs: *mut RROutput, + pub rotations: Rotation, + pub npossible: ::std::os::raw::c_int, + pub possible: *mut RROutput, +} +pub type XRRCrtcInfo = _XRRCrtcInfo; +extern "C" { + pub fn XRRGetCrtcInfo( + dpy: *mut Display, + resources: *mut XRRScreenResources, + crtc: RRCrtc, + ) -> *mut XRRCrtcInfo; +} +extern "C" { + pub fn XRRFreeCrtcInfo(crtcInfo: *mut XRRCrtcInfo); +} +extern "C" { + pub fn XRRSetCrtcConfig( + dpy: *mut Display, + resources: *mut XRRScreenResources, + crtc: RRCrtc, + timestamp: Time, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + mode: RRMode, + rotation: Rotation, + outputs: *mut RROutput, + noutputs: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRGetCrtcGammaSize(dpy: *mut Display, crtc: RRCrtc) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRCrtcGamma { + pub size: ::std::os::raw::c_int, + pub red: *mut ::std::os::raw::c_ushort, + pub green: *mut ::std::os::raw::c_ushort, + pub blue: *mut ::std::os::raw::c_ushort, +} +pub type XRRCrtcGamma = _XRRCrtcGamma; +extern "C" { + pub fn XRRGetCrtcGamma(dpy: *mut Display, crtc: RRCrtc) -> *mut XRRCrtcGamma; +} +extern "C" { + pub fn XRRAllocGamma(size: ::std::os::raw::c_int) -> *mut XRRCrtcGamma; +} +extern "C" { + pub fn XRRSetCrtcGamma(dpy: *mut Display, crtc: RRCrtc, gamma: *mut XRRCrtcGamma); +} +extern "C" { + pub fn XRRFreeGamma(gamma: *mut XRRCrtcGamma); +} +extern "C" { + pub fn XRRGetScreenResourcesCurrent( + dpy: *mut Display, + window: Window, + ) -> *mut XRRScreenResources; +} +extern "C" { + pub fn XRRSetCrtcTransform( + dpy: *mut Display, + crtc: RRCrtc, + transform: *mut XTransform, + filter: *const ::std::os::raw::c_char, + params: *mut XFixed, + nparams: ::std::os::raw::c_int, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRCrtcTransformAttributes { + pub pendingTransform: XTransform, + pub pendingFilter: *mut ::std::os::raw::c_char, + pub pendingNparams: ::std::os::raw::c_int, + pub pendingParams: *mut XFixed, + pub currentTransform: XTransform, + pub currentFilter: *mut ::std::os::raw::c_char, + pub currentNparams: ::std::os::raw::c_int, + pub currentParams: *mut XFixed, +} +pub type XRRCrtcTransformAttributes = _XRRCrtcTransformAttributes; +extern "C" { + pub fn XRRGetCrtcTransform( + dpy: *mut Display, + crtc: RRCrtc, + attributes: *mut *mut XRRCrtcTransformAttributes, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRUpdateConfiguration(event: *mut XEvent) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRPanning { + pub timestamp: Time, + pub left: ::std::os::raw::c_uint, + pub top: ::std::os::raw::c_uint, + pub width: ::std::os::raw::c_uint, + pub height: ::std::os::raw::c_uint, + pub track_left: ::std::os::raw::c_uint, + pub track_top: ::std::os::raw::c_uint, + pub track_width: ::std::os::raw::c_uint, + pub track_height: ::std::os::raw::c_uint, + pub border_left: ::std::os::raw::c_int, + pub border_top: ::std::os::raw::c_int, + pub border_right: ::std::os::raw::c_int, + pub border_bottom: ::std::os::raw::c_int, +} +pub type XRRPanning = _XRRPanning; +extern "C" { + pub fn XRRGetPanning( + dpy: *mut Display, + resources: *mut XRRScreenResources, + crtc: RRCrtc, + ) -> *mut XRRPanning; +} +extern "C" { + pub fn XRRFreePanning(panning: *mut XRRPanning); +} +extern "C" { + pub fn XRRSetPanning( + dpy: *mut Display, + resources: *mut XRRScreenResources, + crtc: RRCrtc, + panning: *mut XRRPanning, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRSetOutputPrimary(dpy: *mut Display, window: Window, output: RROutput); +} +extern "C" { + pub fn XRRGetOutputPrimary(dpy: *mut Display, window: Window) -> RROutput; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRProviderResources { + pub timestamp: Time, + pub nproviders: ::std::os::raw::c_int, + pub providers: *mut RRProvider, +} +pub type XRRProviderResources = _XRRProviderResources; +extern "C" { + pub fn XRRGetProviderResources(dpy: *mut Display, window: Window) -> *mut XRRProviderResources; +} +extern "C" { + pub fn XRRFreeProviderResources(resources: *mut XRRProviderResources); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRProviderInfo { + pub capabilities: ::std::os::raw::c_uint, + pub ncrtcs: ::std::os::raw::c_int, + pub crtcs: *mut RRCrtc, + pub noutputs: ::std::os::raw::c_int, + pub outputs: *mut RROutput, + pub name: *mut ::std::os::raw::c_char, + pub nassociatedproviders: ::std::os::raw::c_int, + pub associated_providers: *mut RRProvider, + pub associated_capability: *mut ::std::os::raw::c_uint, + pub nameLen: ::std::os::raw::c_int, +} +pub type XRRProviderInfo = _XRRProviderInfo; +extern "C" { + pub fn XRRGetProviderInfo( + dpy: *mut Display, + resources: *mut XRRScreenResources, + provider: RRProvider, + ) -> *mut XRRProviderInfo; +} +extern "C" { + pub fn XRRFreeProviderInfo(provider: *mut XRRProviderInfo); +} +extern "C" { + pub fn XRRSetProviderOutputSource( + dpy: *mut Display, + provider: XID, + source_provider: XID, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRSetProviderOffloadSink( + dpy: *mut Display, + provider: XID, + sink_provider: XID, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn XRRListProviderProperties( + dpy: *mut Display, + provider: RRProvider, + nprop: *mut ::std::os::raw::c_int, + ) -> *mut Atom; +} +extern "C" { + pub fn XRRQueryProviderProperty( + dpy: *mut Display, + provider: RRProvider, + property: Atom, + ) -> *mut XRRPropertyInfo; +} +extern "C" { + pub fn XRRConfigureProviderProperty( + dpy: *mut Display, + provider: RRProvider, + property: Atom, + pending: ::std::os::raw::c_int, + range: ::std::os::raw::c_int, + num_values: ::std::os::raw::c_int, + values: *mut ::std::os::raw::c_long, + ); +} +extern "C" { + pub fn XRRChangeProviderProperty( + dpy: *mut Display, + provider: RRProvider, + property: Atom, + type_: Atom, + format: ::std::os::raw::c_int, + mode: ::std::os::raw::c_int, + data: *const ::std::os::raw::c_uchar, + nelements: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn XRRDeleteProviderProperty(dpy: *mut Display, provider: RRProvider, property: Atom); +} +extern "C" { + pub fn XRRGetProviderProperty( + dpy: *mut Display, + provider: RRProvider, + property: Atom, + offset: ::std::os::raw::c_long, + length: ::std::os::raw::c_long, + _delete: ::std::os::raw::c_int, + pending: ::std::os::raw::c_int, + req_type: Atom, + actual_type: *mut Atom, + actual_format: *mut ::std::os::raw::c_int, + nitems: *mut ::std::os::raw::c_ulong, + bytes_after: *mut ::std::os::raw::c_ulong, + prop: *mut *mut ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XRRMonitorInfo { + pub name: Atom, + pub primary: ::std::os::raw::c_int, + pub automatic: ::std::os::raw::c_int, + pub noutput: ::std::os::raw::c_int, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub mwidth: ::std::os::raw::c_int, + pub mheight: ::std::os::raw::c_int, + pub outputs: *mut RROutput, +} +pub type XRRMonitorInfo = _XRRMonitorInfo; +extern "C" { + pub fn XRRAllocateMonitor( + dpy: *mut Display, + noutput: ::std::os::raw::c_int, + ) -> *mut XRRMonitorInfo; +} +extern "C" { + pub fn XRRGetMonitors( + dpy: *mut Display, + window: Window, + get_active: ::std::os::raw::c_int, + nmonitors: *mut ::std::os::raw::c_int, + ) -> *mut XRRMonitorInfo; +} +extern "C" { + pub fn XRRSetMonitor(dpy: *mut Display, window: Window, monitor: *mut XRRMonitorInfo); +} +extern "C" { + pub fn XRRDeleteMonitor(dpy: *mut Display, window: Window, name: Atom); +} +extern "C" { + pub fn XRRFreeMonitors(monitors: *mut XRRMonitorInfo); +} +pub type INT64 = ::std::os::raw::c_long; +pub type INT32 = ::std::os::raw::c_int; +pub type INT16 = ::std::os::raw::c_short; +pub type INT8 = ::std::os::raw::c_schar; +pub type CARD64 = ::std::os::raw::c_ulong; +pub type CARD32 = ::std::os::raw::c_uint; +pub type CARD16 = ::std::os::raw::c_ushort; +pub type CARD8 = ::std::os::raw::c_uchar; +pub type BITS32 = CARD32; +pub type BITS16 = CARD16; +pub type BYTE = CARD8; +pub type BOOL = CARD8; +pub type GLenum = ::std::os::raw::c_uint; +pub type GLboolean = ::std::os::raw::c_uchar; +pub type GLbitfield = ::std::os::raw::c_uint; +pub type GLvoid = ::std::os::raw::c_void; +pub type GLbyte = ::std::os::raw::c_schar; +pub type GLshort = ::std::os::raw::c_short; +pub type GLint = ::std::os::raw::c_int; +pub type GLubyte = ::std::os::raw::c_uchar; +pub type GLushort = ::std::os::raw::c_ushort; +pub type GLuint = ::std::os::raw::c_uint; +pub type GLsizei = ::std::os::raw::c_int; +pub type GLfloat = f32; +pub type GLclampf = f32; +pub type GLdouble = f64; +pub type GLclampd = f64; +extern "C" { + pub fn glClearIndex(c: GLfloat); +} +extern "C" { + pub fn glClearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf); +} +extern "C" { + pub fn glClear(mask: GLbitfield); +} +extern "C" { + pub fn glIndexMask(mask: GLuint); +} +extern "C" { + pub fn glColorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean); +} +extern "C" { + pub fn glAlphaFunc(func: GLenum, ref_: GLclampf); +} +extern "C" { + pub fn glBlendFunc(sfactor: GLenum, dfactor: GLenum); +} +extern "C" { + pub fn glLogicOp(opcode: GLenum); +} +extern "C" { + pub fn glCullFace(mode: GLenum); +} +extern "C" { + pub fn glFrontFace(mode: GLenum); +} +extern "C" { + pub fn glPointSize(size: GLfloat); +} +extern "C" { + pub fn glLineWidth(width: GLfloat); +} +extern "C" { + pub fn glLineStipple(factor: GLint, pattern: GLushort); +} +extern "C" { + pub fn glPolygonMode(face: GLenum, mode: GLenum); +} +extern "C" { + pub fn glPolygonOffset(factor: GLfloat, units: GLfloat); +} +extern "C" { + pub fn glPolygonStipple(mask: *const GLubyte); +} +extern "C" { + pub fn glGetPolygonStipple(mask: *mut GLubyte); +} +extern "C" { + pub fn glEdgeFlag(flag: GLboolean); +} +extern "C" { + pub fn glEdgeFlagv(flag: *const GLboolean); +} +extern "C" { + pub fn glScissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei); +} +extern "C" { + pub fn glClipPlane(plane: GLenum, equation: *const GLdouble); +} +extern "C" { + pub fn glGetClipPlane(plane: GLenum, equation: *mut GLdouble); +} +extern "C" { + pub fn glDrawBuffer(mode: GLenum); +} +extern "C" { + pub fn glReadBuffer(mode: GLenum); +} +extern "C" { + pub fn glEnable(cap: GLenum); +} +extern "C" { + pub fn glDisable(cap: GLenum); +} +extern "C" { + pub fn glIsEnabled(cap: GLenum) -> GLboolean; +} +extern "C" { + pub fn glEnableClientState(cap: GLenum); +} +extern "C" { + pub fn glDisableClientState(cap: GLenum); +} +extern "C" { + pub fn glGetBooleanv(pname: GLenum, params: *mut GLboolean); +} +extern "C" { + pub fn glGetDoublev(pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glGetFloatv(pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetIntegerv(pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glPushAttrib(mask: GLbitfield); +} +extern "C" { + pub fn glPopAttrib(); +} +extern "C" { + pub fn glPushClientAttrib(mask: GLbitfield); +} +extern "C" { + pub fn glPopClientAttrib(); +} +extern "C" { + pub fn glRenderMode(mode: GLenum) -> GLint; +} +extern "C" { + pub fn glGetError() -> GLenum; +} +extern "C" { + pub fn glGetString(name: GLenum) -> *const GLubyte; +} +extern "C" { + pub fn glFinish(); +} +extern "C" { + pub fn glFlush(); +} +extern "C" { + pub fn glHint(target: GLenum, mode: GLenum); +} +extern "C" { + pub fn glClearDepth(depth: GLclampd); +} +extern "C" { + pub fn glDepthFunc(func: GLenum); +} +extern "C" { + pub fn glDepthMask(flag: GLboolean); +} +extern "C" { + pub fn glDepthRange(near_val: GLclampd, far_val: GLclampd); +} +extern "C" { + pub fn glClearAccum(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat); +} +extern "C" { + pub fn glAccum(op: GLenum, value: GLfloat); +} +extern "C" { + pub fn glMatrixMode(mode: GLenum); +} +extern "C" { + pub fn glOrtho( + left: GLdouble, + right: GLdouble, + bottom: GLdouble, + top: GLdouble, + near_val: GLdouble, + far_val: GLdouble, + ); +} +extern "C" { + pub fn glFrustum( + left: GLdouble, + right: GLdouble, + bottom: GLdouble, + top: GLdouble, + near_val: GLdouble, + far_val: GLdouble, + ); +} +extern "C" { + pub fn glViewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei); +} +extern "C" { + pub fn glPushMatrix(); +} +extern "C" { + pub fn glPopMatrix(); +} +extern "C" { + pub fn glLoadIdentity(); +} +extern "C" { + pub fn glLoadMatrixd(m: *const GLdouble); +} +extern "C" { + pub fn glLoadMatrixf(m: *const GLfloat); +} +extern "C" { + pub fn glMultMatrixd(m: *const GLdouble); +} +extern "C" { + pub fn glMultMatrixf(m: *const GLfloat); +} +extern "C" { + pub fn glRotated(angle: GLdouble, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glRotatef(angle: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glScaled(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glScalef(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glTranslated(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glTranslatef(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glIsList(list: GLuint) -> GLboolean; +} +extern "C" { + pub fn glDeleteLists(list: GLuint, range: GLsizei); +} +extern "C" { + pub fn glGenLists(range: GLsizei) -> GLuint; +} +extern "C" { + pub fn glNewList(list: GLuint, mode: GLenum); +} +extern "C" { + pub fn glEndList(); +} +extern "C" { + pub fn glCallList(list: GLuint); +} +extern "C" { + pub fn glCallLists(n: GLsizei, type_: GLenum, lists: *const GLvoid); +} +extern "C" { + pub fn glListBase(base: GLuint); +} +extern "C" { + pub fn glBegin(mode: GLenum); +} +extern "C" { + pub fn glEnd(); +} +extern "C" { + pub fn glVertex2d(x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertex2f(x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glVertex2i(x: GLint, y: GLint); +} +extern "C" { + pub fn glVertex2s(x: GLshort, y: GLshort); +} +extern "C" { + pub fn glVertex3d(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertex3f(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glVertex3i(x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glVertex3s(x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glVertex4d(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertex4f(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glVertex4i(x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glVertex4s(x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glVertex2dv(v: *const GLdouble); +} +extern "C" { + pub fn glVertex2fv(v: *const GLfloat); +} +extern "C" { + pub fn glVertex2iv(v: *const GLint); +} +extern "C" { + pub fn glVertex2sv(v: *const GLshort); +} +extern "C" { + pub fn glVertex3dv(v: *const GLdouble); +} +extern "C" { + pub fn glVertex3fv(v: *const GLfloat); +} +extern "C" { + pub fn glVertex3iv(v: *const GLint); +} +extern "C" { + pub fn glVertex3sv(v: *const GLshort); +} +extern "C" { + pub fn glVertex4dv(v: *const GLdouble); +} +extern "C" { + pub fn glVertex4fv(v: *const GLfloat); +} +extern "C" { + pub fn glVertex4iv(v: *const GLint); +} +extern "C" { + pub fn glVertex4sv(v: *const GLshort); +} +extern "C" { + pub fn glNormal3b(nx: GLbyte, ny: GLbyte, nz: GLbyte); +} +extern "C" { + pub fn glNormal3d(nx: GLdouble, ny: GLdouble, nz: GLdouble); +} +extern "C" { + pub fn glNormal3f(nx: GLfloat, ny: GLfloat, nz: GLfloat); +} +extern "C" { + pub fn glNormal3i(nx: GLint, ny: GLint, nz: GLint); +} +extern "C" { + pub fn glNormal3s(nx: GLshort, ny: GLshort, nz: GLshort); +} +extern "C" { + pub fn glNormal3bv(v: *const GLbyte); +} +extern "C" { + pub fn glNormal3dv(v: *const GLdouble); +} +extern "C" { + pub fn glNormal3fv(v: *const GLfloat); +} +extern "C" { + pub fn glNormal3iv(v: *const GLint); +} +extern "C" { + pub fn glNormal3sv(v: *const GLshort); +} +extern "C" { + pub fn glIndexd(c: GLdouble); +} +extern "C" { + pub fn glIndexf(c: GLfloat); +} +extern "C" { + pub fn glIndexi(c: GLint); +} +extern "C" { + pub fn glIndexs(c: GLshort); +} +extern "C" { + pub fn glIndexub(c: GLubyte); +} +extern "C" { + pub fn glIndexdv(c: *const GLdouble); +} +extern "C" { + pub fn glIndexfv(c: *const GLfloat); +} +extern "C" { + pub fn glIndexiv(c: *const GLint); +} +extern "C" { + pub fn glIndexsv(c: *const GLshort); +} +extern "C" { + pub fn glIndexubv(c: *const GLubyte); +} +extern "C" { + pub fn glColor3b(red: GLbyte, green: GLbyte, blue: GLbyte); +} +extern "C" { + pub fn glColor3d(red: GLdouble, green: GLdouble, blue: GLdouble); +} +extern "C" { + pub fn glColor3f(red: GLfloat, green: GLfloat, blue: GLfloat); +} +extern "C" { + pub fn glColor3i(red: GLint, green: GLint, blue: GLint); +} +extern "C" { + pub fn glColor3s(red: GLshort, green: GLshort, blue: GLshort); +} +extern "C" { + pub fn glColor3ub(red: GLubyte, green: GLubyte, blue: GLubyte); +} +extern "C" { + pub fn glColor3ui(red: GLuint, green: GLuint, blue: GLuint); +} +extern "C" { + pub fn glColor3us(red: GLushort, green: GLushort, blue: GLushort); +} +extern "C" { + pub fn glColor4b(red: GLbyte, green: GLbyte, blue: GLbyte, alpha: GLbyte); +} +extern "C" { + pub fn glColor4d(red: GLdouble, green: GLdouble, blue: GLdouble, alpha: GLdouble); +} +extern "C" { + pub fn glColor4f(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat); +} +extern "C" { + pub fn glColor4i(red: GLint, green: GLint, blue: GLint, alpha: GLint); +} +extern "C" { + pub fn glColor4s(red: GLshort, green: GLshort, blue: GLshort, alpha: GLshort); +} +extern "C" { + pub fn glColor4ub(red: GLubyte, green: GLubyte, blue: GLubyte, alpha: GLubyte); +} +extern "C" { + pub fn glColor4ui(red: GLuint, green: GLuint, blue: GLuint, alpha: GLuint); +} +extern "C" { + pub fn glColor4us(red: GLushort, green: GLushort, blue: GLushort, alpha: GLushort); +} +extern "C" { + pub fn glColor3bv(v: *const GLbyte); +} +extern "C" { + pub fn glColor3dv(v: *const GLdouble); +} +extern "C" { + pub fn glColor3fv(v: *const GLfloat); +} +extern "C" { + pub fn glColor3iv(v: *const GLint); +} +extern "C" { + pub fn glColor3sv(v: *const GLshort); +} +extern "C" { + pub fn glColor3ubv(v: *const GLubyte); +} +extern "C" { + pub fn glColor3uiv(v: *const GLuint); +} +extern "C" { + pub fn glColor3usv(v: *const GLushort); +} +extern "C" { + pub fn glColor4bv(v: *const GLbyte); +} +extern "C" { + pub fn glColor4dv(v: *const GLdouble); +} +extern "C" { + pub fn glColor4fv(v: *const GLfloat); +} +extern "C" { + pub fn glColor4iv(v: *const GLint); +} +extern "C" { + pub fn glColor4sv(v: *const GLshort); +} +extern "C" { + pub fn glColor4ubv(v: *const GLubyte); +} +extern "C" { + pub fn glColor4uiv(v: *const GLuint); +} +extern "C" { + pub fn glColor4usv(v: *const GLushort); +} +extern "C" { + pub fn glTexCoord1d(s: GLdouble); +} +extern "C" { + pub fn glTexCoord1f(s: GLfloat); +} +extern "C" { + pub fn glTexCoord1i(s: GLint); +} +extern "C" { + pub fn glTexCoord1s(s: GLshort); +} +extern "C" { + pub fn glTexCoord2d(s: GLdouble, t: GLdouble); +} +extern "C" { + pub fn glTexCoord2f(s: GLfloat, t: GLfloat); +} +extern "C" { + pub fn glTexCoord2i(s: GLint, t: GLint); +} +extern "C" { + pub fn glTexCoord2s(s: GLshort, t: GLshort); +} +extern "C" { + pub fn glTexCoord3d(s: GLdouble, t: GLdouble, r: GLdouble); +} +extern "C" { + pub fn glTexCoord3f(s: GLfloat, t: GLfloat, r: GLfloat); +} +extern "C" { + pub fn glTexCoord3i(s: GLint, t: GLint, r: GLint); +} +extern "C" { + pub fn glTexCoord3s(s: GLshort, t: GLshort, r: GLshort); +} +extern "C" { + pub fn glTexCoord4d(s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble); +} +extern "C" { + pub fn glTexCoord4f(s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat); +} +extern "C" { + pub fn glTexCoord4i(s: GLint, t: GLint, r: GLint, q: GLint); +} +extern "C" { + pub fn glTexCoord4s(s: GLshort, t: GLshort, r: GLshort, q: GLshort); +} +extern "C" { + pub fn glTexCoord1dv(v: *const GLdouble); +} +extern "C" { + pub fn glTexCoord1fv(v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord1iv(v: *const GLint); +} +extern "C" { + pub fn glTexCoord1sv(v: *const GLshort); +} +extern "C" { + pub fn glTexCoord2dv(v: *const GLdouble); +} +extern "C" { + pub fn glTexCoord2fv(v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord2iv(v: *const GLint); +} +extern "C" { + pub fn glTexCoord2sv(v: *const GLshort); +} +extern "C" { + pub fn glTexCoord3dv(v: *const GLdouble); +} +extern "C" { + pub fn glTexCoord3fv(v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord3iv(v: *const GLint); +} +extern "C" { + pub fn glTexCoord3sv(v: *const GLshort); +} +extern "C" { + pub fn glTexCoord4dv(v: *const GLdouble); +} +extern "C" { + pub fn glTexCoord4fv(v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord4iv(v: *const GLint); +} +extern "C" { + pub fn glTexCoord4sv(v: *const GLshort); +} +extern "C" { + pub fn glRasterPos2d(x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glRasterPos2f(x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glRasterPos2i(x: GLint, y: GLint); +} +extern "C" { + pub fn glRasterPos2s(x: GLshort, y: GLshort); +} +extern "C" { + pub fn glRasterPos3d(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glRasterPos3f(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glRasterPos3i(x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glRasterPos3s(x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glRasterPos4d(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glRasterPos4f(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glRasterPos4i(x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glRasterPos4s(x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glRasterPos2dv(v: *const GLdouble); +} +extern "C" { + pub fn glRasterPos2fv(v: *const GLfloat); +} +extern "C" { + pub fn glRasterPos2iv(v: *const GLint); +} +extern "C" { + pub fn glRasterPos2sv(v: *const GLshort); +} +extern "C" { + pub fn glRasterPos3dv(v: *const GLdouble); +} +extern "C" { + pub fn glRasterPos3fv(v: *const GLfloat); +} +extern "C" { + pub fn glRasterPos3iv(v: *const GLint); +} +extern "C" { + pub fn glRasterPos3sv(v: *const GLshort); +} +extern "C" { + pub fn glRasterPos4dv(v: *const GLdouble); +} +extern "C" { + pub fn glRasterPos4fv(v: *const GLfloat); +} +extern "C" { + pub fn glRasterPos4iv(v: *const GLint); +} +extern "C" { + pub fn glRasterPos4sv(v: *const GLshort); +} +extern "C" { + pub fn glRectd(x1: GLdouble, y1: GLdouble, x2: GLdouble, y2: GLdouble); +} +extern "C" { + pub fn glRectf(x1: GLfloat, y1: GLfloat, x2: GLfloat, y2: GLfloat); +} +extern "C" { + pub fn glRecti(x1: GLint, y1: GLint, x2: GLint, y2: GLint); +} +extern "C" { + pub fn glRects(x1: GLshort, y1: GLshort, x2: GLshort, y2: GLshort); +} +extern "C" { + pub fn glRectdv(v1: *const GLdouble, v2: *const GLdouble); +} +extern "C" { + pub fn glRectfv(v1: *const GLfloat, v2: *const GLfloat); +} +extern "C" { + pub fn glRectiv(v1: *const GLint, v2: *const GLint); +} +extern "C" { + pub fn glRectsv(v1: *const GLshort, v2: *const GLshort); +} +extern "C" { + pub fn glVertexPointer(size: GLint, type_: GLenum, stride: GLsizei, ptr: *const GLvoid); +} +extern "C" { + pub fn glNormalPointer(type_: GLenum, stride: GLsizei, ptr: *const GLvoid); +} +extern "C" { + pub fn glColorPointer(size: GLint, type_: GLenum, stride: GLsizei, ptr: *const GLvoid); +} +extern "C" { + pub fn glIndexPointer(type_: GLenum, stride: GLsizei, ptr: *const GLvoid); +} +extern "C" { + pub fn glTexCoordPointer(size: GLint, type_: GLenum, stride: GLsizei, ptr: *const GLvoid); +} +extern "C" { + pub fn glEdgeFlagPointer(stride: GLsizei, ptr: *const GLvoid); +} +extern "C" { + pub fn glGetPointerv(pname: GLenum, params: *mut *mut GLvoid); +} +extern "C" { + pub fn glArrayElement(i: GLint); +} +extern "C" { + pub fn glDrawArrays(mode: GLenum, first: GLint, count: GLsizei); +} +extern "C" { + pub fn glDrawElements(mode: GLenum, count: GLsizei, type_: GLenum, indices: *const GLvoid); +} +extern "C" { + pub fn glInterleavedArrays(format: GLenum, stride: GLsizei, pointer: *const GLvoid); +} +extern "C" { + pub fn glShadeModel(mode: GLenum); +} +extern "C" { + pub fn glLightf(light: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glLighti(light: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glLightfv(light: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glLightiv(light: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetLightfv(light: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetLightiv(light: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glLightModelf(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glLightModeli(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glLightModelfv(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glLightModeliv(pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glMaterialf(face: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glMateriali(face: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glMaterialfv(face: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glMaterialiv(face: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetMaterialfv(face: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetMaterialiv(face: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glColorMaterial(face: GLenum, mode: GLenum); +} +extern "C" { + pub fn glPixelZoom(xfactor: GLfloat, yfactor: GLfloat); +} +extern "C" { + pub fn glPixelStoref(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPixelStorei(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPixelTransferf(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPixelTransferi(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPixelMapfv(map: GLenum, mapsize: GLsizei, values: *const GLfloat); +} +extern "C" { + pub fn glPixelMapuiv(map: GLenum, mapsize: GLsizei, values: *const GLuint); +} +extern "C" { + pub fn glPixelMapusv(map: GLenum, mapsize: GLsizei, values: *const GLushort); +} +extern "C" { + pub fn glGetPixelMapfv(map: GLenum, values: *mut GLfloat); +} +extern "C" { + pub fn glGetPixelMapuiv(map: GLenum, values: *mut GLuint); +} +extern "C" { + pub fn glGetPixelMapusv(map: GLenum, values: *mut GLushort); +} +extern "C" { + pub fn glBitmap( + width: GLsizei, + height: GLsizei, + xorig: GLfloat, + yorig: GLfloat, + xmove: GLfloat, + ymove: GLfloat, + bitmap: *const GLubyte, + ); +} +extern "C" { + pub fn glReadPixels( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *mut GLvoid, + ); +} +extern "C" { + pub fn glDrawPixels( + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ); +} +extern "C" { + pub fn glCopyPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, type_: GLenum); +} +extern "C" { + pub fn glStencilFunc(func: GLenum, ref_: GLint, mask: GLuint); +} +extern "C" { + pub fn glStencilMask(mask: GLuint); +} +extern "C" { + pub fn glStencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum); +} +extern "C" { + pub fn glClearStencil(s: GLint); +} +extern "C" { + pub fn glTexGend(coord: GLenum, pname: GLenum, param: GLdouble); +} +extern "C" { + pub fn glTexGenf(coord: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glTexGeni(coord: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glTexGendv(coord: GLenum, pname: GLenum, params: *const GLdouble); +} +extern "C" { + pub fn glTexGenfv(coord: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glTexGeniv(coord: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetTexGendv(coord: GLenum, pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glGetTexGenfv(coord: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetTexGeniv(coord: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glTexEnvf(target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glTexEnvi(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glTexEnvfv(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glTexEnviv(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetTexEnvfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetTexEnviv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glTexParameterf(target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glTexParameteri(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glTexParameterfv(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glTexParameteriv(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetTexParameterfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetTexParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetTexLevelParameterfv( + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetTexLevelParameteriv( + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glTexImage1D( + target: GLenum, + level: GLint, + internalFormat: GLint, + width: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ); +} +extern "C" { + pub fn glTexImage2D( + target: GLenum, + level: GLint, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ); +} +extern "C" { + pub fn glGetTexImage( + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + pixels: *mut GLvoid, + ); +} +extern "C" { + pub fn glGenTextures(n: GLsizei, textures: *mut GLuint); +} +extern "C" { + pub fn glDeleteTextures(n: GLsizei, textures: *const GLuint); +} +extern "C" { + pub fn glBindTexture(target: GLenum, texture: GLuint); +} +extern "C" { + pub fn glPrioritizeTextures(n: GLsizei, textures: *const GLuint, priorities: *const GLclampf); +} +extern "C" { + pub fn glAreTexturesResident( + n: GLsizei, + textures: *const GLuint, + residences: *mut GLboolean, + ) -> GLboolean; +} +extern "C" { + pub fn glIsTexture(texture: GLuint) -> GLboolean; +} +extern "C" { + pub fn glTexSubImage1D( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ); +} +extern "C" { + pub fn glTexSubImage2D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ); +} +extern "C" { + pub fn glCopyTexImage1D( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTexImage2D( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTexSubImage1D( + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyTexSubImage2D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glMap1d( + target: GLenum, + u1: GLdouble, + u2: GLdouble, + stride: GLint, + order: GLint, + points: *const GLdouble, + ); +} +extern "C" { + pub fn glMap1f( + target: GLenum, + u1: GLfloat, + u2: GLfloat, + stride: GLint, + order: GLint, + points: *const GLfloat, + ); +} +extern "C" { + pub fn glMap2d( + target: GLenum, + u1: GLdouble, + u2: GLdouble, + ustride: GLint, + uorder: GLint, + v1: GLdouble, + v2: GLdouble, + vstride: GLint, + vorder: GLint, + points: *const GLdouble, + ); +} +extern "C" { + pub fn glMap2f( + target: GLenum, + u1: GLfloat, + u2: GLfloat, + ustride: GLint, + uorder: GLint, + v1: GLfloat, + v2: GLfloat, + vstride: GLint, + vorder: GLint, + points: *const GLfloat, + ); +} +extern "C" { + pub fn glGetMapdv(target: GLenum, query: GLenum, v: *mut GLdouble); +} +extern "C" { + pub fn glGetMapfv(target: GLenum, query: GLenum, v: *mut GLfloat); +} +extern "C" { + pub fn glGetMapiv(target: GLenum, query: GLenum, v: *mut GLint); +} +extern "C" { + pub fn glEvalCoord1d(u: GLdouble); +} +extern "C" { + pub fn glEvalCoord1f(u: GLfloat); +} +extern "C" { + pub fn glEvalCoord1dv(u: *const GLdouble); +} +extern "C" { + pub fn glEvalCoord1fv(u: *const GLfloat); +} +extern "C" { + pub fn glEvalCoord2d(u: GLdouble, v: GLdouble); +} +extern "C" { + pub fn glEvalCoord2f(u: GLfloat, v: GLfloat); +} +extern "C" { + pub fn glEvalCoord2dv(u: *const GLdouble); +} +extern "C" { + pub fn glEvalCoord2fv(u: *const GLfloat); +} +extern "C" { + pub fn glMapGrid1d(un: GLint, u1: GLdouble, u2: GLdouble); +} +extern "C" { + pub fn glMapGrid1f(un: GLint, u1: GLfloat, u2: GLfloat); +} +extern "C" { + pub fn glMapGrid2d( + un: GLint, + u1: GLdouble, + u2: GLdouble, + vn: GLint, + v1: GLdouble, + v2: GLdouble, + ); +} +extern "C" { + pub fn glMapGrid2f(un: GLint, u1: GLfloat, u2: GLfloat, vn: GLint, v1: GLfloat, v2: GLfloat); +} +extern "C" { + pub fn glEvalPoint1(i: GLint); +} +extern "C" { + pub fn glEvalPoint2(i: GLint, j: GLint); +} +extern "C" { + pub fn glEvalMesh1(mode: GLenum, i1: GLint, i2: GLint); +} +extern "C" { + pub fn glEvalMesh2(mode: GLenum, i1: GLint, i2: GLint, j1: GLint, j2: GLint); +} +extern "C" { + pub fn glFogf(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glFogi(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glFogfv(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glFogiv(pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glFeedbackBuffer(size: GLsizei, type_: GLenum, buffer: *mut GLfloat); +} +extern "C" { + pub fn glPassThrough(token: GLfloat); +} +extern "C" { + pub fn glSelectBuffer(size: GLsizei, buffer: *mut GLuint); +} +extern "C" { + pub fn glInitNames(); +} +extern "C" { + pub fn glLoadName(name: GLuint); +} +extern "C" { + pub fn glPushName(name: GLuint); +} +extern "C" { + pub fn glPopName(); +} +extern "C" { + pub fn glDrawRangeElements( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const GLvoid, + ); +} +extern "C" { + pub fn glTexImage3D( + target: GLenum, + level: GLint, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ); +} +extern "C" { + pub 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, + ); +} +extern "C" { + pub fn glCopyTexSubImage3D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +pub type PFNGLDRAWRANGEELEMENTSPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const GLvoid, + ), +>; +pub type PFNGLTEXIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ), +>; +pub type PFNGLTEXSUBIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const GLvoid, + ), +>; +pub type PFNGLCOPYTEXSUBIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +extern "C" { + pub fn glColorTable( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + table: *const GLvoid, + ); +} +extern "C" { + pub fn glColorSubTable( + target: GLenum, + start: GLsizei, + count: GLsizei, + format: GLenum, + type_: GLenum, + data: *const GLvoid, + ); +} +extern "C" { + pub fn glColorTableParameteriv(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glColorTableParameterfv(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glCopyColorSubTable(target: GLenum, start: GLsizei, x: GLint, y: GLint, width: GLsizei); +} +extern "C" { + pub fn glCopyColorTable( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glGetColorTable(target: GLenum, format: GLenum, type_: GLenum, table: *mut GLvoid); +} +extern "C" { + pub fn glGetColorTableParameterfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetColorTableParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glBlendEquation(mode: GLenum); +} +extern "C" { + pub fn glBlendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf); +} +extern "C" { + pub fn glHistogram(target: GLenum, width: GLsizei, internalformat: GLenum, sink: GLboolean); +} +extern "C" { + pub fn glResetHistogram(target: GLenum); +} +extern "C" { + pub fn glGetHistogram( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + values: *mut GLvoid, + ); +} +extern "C" { + pub fn glGetHistogramParameterfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetHistogramParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glMinmax(target: GLenum, internalformat: GLenum, sink: GLboolean); +} +extern "C" { + pub fn glResetMinmax(target: GLenum); +} +extern "C" { + pub fn glGetMinmax( + target: GLenum, + reset: GLboolean, + format: GLenum, + types: GLenum, + values: *mut GLvoid, + ); +} +extern "C" { + pub fn glGetMinmaxParameterfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetMinmaxParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glConvolutionFilter1D( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + image: *const GLvoid, + ); +} +extern "C" { + pub fn glConvolutionFilter2D( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + image: *const GLvoid, + ); +} +extern "C" { + pub fn glConvolutionParameterf(target: GLenum, pname: GLenum, params: GLfloat); +} +extern "C" { + pub fn glConvolutionParameterfv(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glConvolutionParameteri(target: GLenum, pname: GLenum, params: GLint); +} +extern "C" { + pub fn glConvolutionParameteriv(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glCopyConvolutionFilter1D( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyConvolutionFilter2D( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetConvolutionFilter( + target: GLenum, + format: GLenum, + type_: GLenum, + image: *mut GLvoid, + ); +} +extern "C" { + pub fn glGetConvolutionParameterfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetConvolutionParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glSeparableFilter2D( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + row: *const GLvoid, + column: *const GLvoid, + ); +} +extern "C" { + pub fn glGetSeparableFilter( + target: GLenum, + format: GLenum, + type_: GLenum, + row: *mut GLvoid, + column: *mut GLvoid, + span: *mut GLvoid, + ); +} +extern "C" { + pub fn glActiveTexture(texture: GLenum); +} +extern "C" { + pub fn glClientActiveTexture(texture: GLenum); +} +extern "C" { + pub fn glCompressedTexImage1D( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const GLvoid, + ); +} +extern "C" { + pub fn glCompressedTexImage2D( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const GLvoid, + ); +} +extern "C" { + pub fn glCompressedTexImage3D( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const GLvoid, + ); +} +extern "C" { + pub fn glCompressedTexSubImage1D( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const GLvoid, + ); +} +extern "C" { + pub fn glCompressedTexSubImage2D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const GLvoid, + ); +} +extern "C" { + pub 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, + ); +} +extern "C" { + pub fn glGetCompressedTexImage(target: GLenum, lod: GLint, img: *mut GLvoid); +} +extern "C" { + pub fn glMultiTexCoord1d(target: GLenum, s: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord1dv(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord1f(target: GLenum, s: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord1fv(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord1i(target: GLenum, s: GLint); +} +extern "C" { + pub fn glMultiTexCoord1iv(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord1s(target: GLenum, s: GLshort); +} +extern "C" { + pub fn glMultiTexCoord1sv(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glMultiTexCoord2d(target: GLenum, s: GLdouble, t: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord2dv(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord2f(target: GLenum, s: GLfloat, t: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord2fv(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord2i(target: GLenum, s: GLint, t: GLint); +} +extern "C" { + pub fn glMultiTexCoord2iv(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord2s(target: GLenum, s: GLshort, t: GLshort); +} +extern "C" { + pub fn glMultiTexCoord2sv(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glMultiTexCoord3d(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord3dv(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord3f(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord3fv(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord3i(target: GLenum, s: GLint, t: GLint, r: GLint); +} +extern "C" { + pub fn glMultiTexCoord3iv(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord3s(target: GLenum, s: GLshort, t: GLshort, r: GLshort); +} +extern "C" { + pub fn glMultiTexCoord3sv(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glMultiTexCoord4d(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord4dv(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord4f(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord4fv(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord4i(target: GLenum, s: GLint, t: GLint, r: GLint, q: GLint); +} +extern "C" { + pub fn glMultiTexCoord4iv(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord4s(target: GLenum, s: GLshort, t: GLshort, r: GLshort, q: GLshort); +} +extern "C" { + pub fn glMultiTexCoord4sv(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glLoadTransposeMatrixd(m: *const GLdouble); +} +extern "C" { + pub fn glLoadTransposeMatrixf(m: *const GLfloat); +} +extern "C" { + pub fn glMultTransposeMatrixd(m: *const GLdouble); +} +extern "C" { + pub fn glMultTransposeMatrixf(m: *const GLfloat); +} +extern "C" { + pub fn glSampleCoverage(value: GLclampf, invert: GLboolean); +} +pub type PFNGLACTIVETEXTUREPROC = ::std::option::Option; +pub type PFNGLSAMPLECOVERAGEPROC = + ::std::option::Option; +pub type PFNGLCOMPRESSEDTEXIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const GLvoid, + ), +>; +pub type PFNGLCOMPRESSEDTEXIMAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const GLvoid, + ), +>; +pub type PFNGLCOMPRESSEDTEXIMAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const GLvoid, + ), +>; +pub type PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const GLvoid, + ), +>; +pub type PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const GLvoid, + ), +>; +pub type PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const GLvoid, + ), +>; +pub type PFNGLGETCOMPRESSEDTEXIMAGEPROC = + ::std::option::Option; +extern "C" { + pub fn glActiveTextureARB(texture: GLenum); +} +extern "C" { + pub fn glClientActiveTextureARB(texture: GLenum); +} +extern "C" { + pub fn glMultiTexCoord1dARB(target: GLenum, s: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord1dvARB(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord1fARB(target: GLenum, s: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord1fvARB(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord1iARB(target: GLenum, s: GLint); +} +extern "C" { + pub fn glMultiTexCoord1ivARB(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord1sARB(target: GLenum, s: GLshort); +} +extern "C" { + pub fn glMultiTexCoord1svARB(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glMultiTexCoord2dARB(target: GLenum, s: GLdouble, t: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord2dvARB(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord2fARB(target: GLenum, s: GLfloat, t: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord2fvARB(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord2iARB(target: GLenum, s: GLint, t: GLint); +} +extern "C" { + pub fn glMultiTexCoord2ivARB(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord2sARB(target: GLenum, s: GLshort, t: GLshort); +} +extern "C" { + pub fn glMultiTexCoord2svARB(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glMultiTexCoord3dARB(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord3dvARB(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord3fARB(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord3fvARB(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord3iARB(target: GLenum, s: GLint, t: GLint, r: GLint); +} +extern "C" { + pub fn glMultiTexCoord3ivARB(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord3sARB(target: GLenum, s: GLshort, t: GLshort, r: GLshort); +} +extern "C" { + pub fn glMultiTexCoord3svARB(target: GLenum, v: *const GLshort); +} +extern "C" { + pub fn glMultiTexCoord4dARB(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble); +} +extern "C" { + pub fn glMultiTexCoord4dvARB(target: GLenum, v: *const GLdouble); +} +extern "C" { + pub fn glMultiTexCoord4fARB(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat); +} +extern "C" { + pub fn glMultiTexCoord4fvARB(target: GLenum, v: *const GLfloat); +} +extern "C" { + pub fn glMultiTexCoord4iARB(target: GLenum, s: GLint, t: GLint, r: GLint, q: GLint); +} +extern "C" { + pub fn glMultiTexCoord4ivARB(target: GLenum, v: *const GLint); +} +extern "C" { + pub fn glMultiTexCoord4sARB(target: GLenum, s: GLshort, t: GLshort, r: GLshort, q: GLshort); +} +extern "C" { + pub fn glMultiTexCoord4svARB(target: GLenum, v: *const GLshort); +} +pub type PFNGLACTIVETEXTUREARBPROC = ::std::option::Option; +pub type PFNGLCLIENTACTIVETEXTUREARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1DARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1DVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1FARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1FVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1IARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1IVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1SARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1SVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2DARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2DVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2FARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2FVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2IARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2IVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2SARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2SVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3DARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble), +>; +pub type PFNGLMULTITEXCOORD3DVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3FARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3FVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3IARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3IVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3SARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3SVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4DARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLdouble, t: GLdouble, r: GLdouble, q: GLdouble), +>; +pub type PFNGLMULTITEXCOORD4DVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4FARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLfloat, t: GLfloat, r: GLfloat, q: GLfloat), +>; +pub type PFNGLMULTITEXCOORD4FVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4IARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLint, t: GLint, r: GLint, q: GLint), +>; +pub type PFNGLMULTITEXCOORD4IVARBPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4SARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLshort, t: GLshort, r: GLshort, q: GLshort), +>; +pub type PFNGLMULTITEXCOORD4SVARBPROC = + ::std::option::Option; +pub type khronos_int32_t = i32; +pub type khronos_uint32_t = u32; +pub type khronos_int64_t = i64; +pub type khronos_uint64_t = u64; +pub type khronos_int8_t = ::std::os::raw::c_schar; +pub type khronos_uint8_t = ::std::os::raw::c_uchar; +pub type khronos_int16_t = ::std::os::raw::c_short; +pub type khronos_uint16_t = ::std::os::raw::c_ushort; +pub type khronos_intptr_t = ::std::os::raw::c_long; +pub type khronos_uintptr_t = ::std::os::raw::c_ulong; +pub type khronos_ssize_t = ::std::os::raw::c_long; +pub type khronos_usize_t = ::std::os::raw::c_ulong; +pub type khronos_float_t = f32; +pub type khronos_utime_nanoseconds_t = khronos_uint64_t; +pub type khronos_stime_nanoseconds_t = khronos_int64_t; +pub const khronos_boolean_enum_t_KHRONOS_FALSE: khronos_boolean_enum_t = 0; +pub const khronos_boolean_enum_t_KHRONOS_TRUE: khronos_boolean_enum_t = 1; +pub const khronos_boolean_enum_t_KHRONOS_BOOLEAN_ENUM_FORCE_SIZE: khronos_boolean_enum_t = + 2147483647; +pub type khronos_boolean_enum_t = u32; +pub type PFNGLBLENDFUNCSEPARATEPROC = ::std::option::Option< + unsafe extern "C" fn( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ), +>; +pub type PFNGLMULTIDRAWARRAYSPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + first: *const GLint, + count: *const GLsizei, + drawcount: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + drawcount: GLsizei, + ), +>; +pub type PFNGLPOINTPARAMETERFPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERFVPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLFOGCOORDFPROC = ::std::option::Option; +pub type PFNGLFOGCOORDFVPROC = ::std::option::Option; +pub type PFNGLFOGCOORDDPROC = ::std::option::Option; +pub type PFNGLFOGCOORDDVPROC = ::std::option::Option; +pub type PFNGLFOGCOORDPOINTERPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, stride: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +pub type PFNGLSECONDARYCOLOR3BPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3BVPROC = ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3DPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3DVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3FPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3FVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3IPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3IVPROC = ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3SPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3SVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UBPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UBVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UIPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UIVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3USPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3USVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLORPOINTERPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLWINDOWPOS2DPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2DVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2FPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2FVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2IPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2IVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2SPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2SVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3DPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3DVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3FPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3FVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3IPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3IVPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3SPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3SVPROC = ::std::option::Option; +pub type PFNGLBLENDCOLORPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), +>; +pub type PFNGLBLENDEQUATIONPROC = ::std::option::Option; +extern "C" { + pub fn glBlendFuncSeparate( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ); +} +extern "C" { + pub fn glMultiDrawArrays( + mode: GLenum, + first: *const GLint, + count: *const GLsizei, + drawcount: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElements( + mode: GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + drawcount: GLsizei, + ); +} +extern "C" { + pub fn glPointParameterf(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPointParameterfv(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glPointParameteri(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPointParameteriv(pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glFogCoordf(coord: GLfloat); +} +extern "C" { + pub fn glFogCoordfv(coord: *const GLfloat); +} +extern "C" { + pub fn glFogCoordd(coord: GLdouble); +} +extern "C" { + pub fn glFogCoorddv(coord: *const GLdouble); +} +extern "C" { + pub fn glFogCoordPointer( + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glSecondaryColor3b(red: GLbyte, green: GLbyte, blue: GLbyte); +} +extern "C" { + pub fn glSecondaryColor3bv(v: *const GLbyte); +} +extern "C" { + pub fn glSecondaryColor3d(red: GLdouble, green: GLdouble, blue: GLdouble); +} +extern "C" { + pub fn glSecondaryColor3dv(v: *const GLdouble); +} +extern "C" { + pub fn glSecondaryColor3f(red: GLfloat, green: GLfloat, blue: GLfloat); +} +extern "C" { + pub fn glSecondaryColor3fv(v: *const GLfloat); +} +extern "C" { + pub fn glSecondaryColor3i(red: GLint, green: GLint, blue: GLint); +} +extern "C" { + pub fn glSecondaryColor3iv(v: *const GLint); +} +extern "C" { + pub fn glSecondaryColor3s(red: GLshort, green: GLshort, blue: GLshort); +} +extern "C" { + pub fn glSecondaryColor3sv(v: *const GLshort); +} +extern "C" { + pub fn glSecondaryColor3ub(red: GLubyte, green: GLubyte, blue: GLubyte); +} +extern "C" { + pub fn glSecondaryColor3ubv(v: *const GLubyte); +} +extern "C" { + pub fn glSecondaryColor3ui(red: GLuint, green: GLuint, blue: GLuint); +} +extern "C" { + pub fn glSecondaryColor3uiv(v: *const GLuint); +} +extern "C" { + pub fn glSecondaryColor3us(red: GLushort, green: GLushort, blue: GLushort); +} +extern "C" { + pub fn glSecondaryColor3usv(v: *const GLushort); +} +extern "C" { + pub fn glSecondaryColorPointer( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glWindowPos2d(x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glWindowPos2dv(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos2f(x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glWindowPos2fv(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos2i(x: GLint, y: GLint); +} +extern "C" { + pub fn glWindowPos2iv(v: *const GLint); +} +extern "C" { + pub fn glWindowPos2s(x: GLshort, y: GLshort); +} +extern "C" { + pub fn glWindowPos2sv(v: *const GLshort); +} +extern "C" { + pub fn glWindowPos3d(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glWindowPos3dv(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos3f(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glWindowPos3fv(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos3i(x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glWindowPos3iv(v: *const GLint); +} +extern "C" { + pub fn glWindowPos3s(x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glWindowPos3sv(v: *const GLshort); +} +pub type GLsizeiptr = khronos_ssize_t; +pub type GLintptr = khronos_intptr_t; +pub type PFNGLGENQUERIESPROC = + ::std::option::Option; +pub type PFNGLDELETEQUERIESPROC = + ::std::option::Option; +pub type PFNGLISQUERYPROC = ::std::option::Option GLboolean>; +pub type PFNGLBEGINQUERYPROC = + ::std::option::Option; +pub type PFNGLENDQUERYPROC = ::std::option::Option; +pub type PFNGLGETQUERYIVPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTIVPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTUIVPROC = + ::std::option::Option; +pub type PFNGLBINDBUFFERPROC = + ::std::option::Option; +pub type PFNGLDELETEBUFFERSPROC = + ::std::option::Option; +pub type PFNGLGENBUFFERSPROC = + ::std::option::Option; +pub type PFNGLISBUFFERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBUFFERDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ), +>; +pub type PFNGLBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLMAPBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLUNMAPBUFFERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETBUFFERPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLGETBUFFERPOINTERVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn glGenQueries(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glDeleteQueries(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glIsQuery(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBeginQuery(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glEndQuery(target: GLenum); +} +extern "C" { + pub fn glGetQueryiv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetQueryObjectiv(id: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetQueryObjectuiv(id: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glBindBuffer(target: GLenum, buffer: GLuint); +} +extern "C" { + pub fn glDeleteBuffers(n: GLsizei, buffers: *const GLuint); +} +extern "C" { + pub fn glGenBuffers(n: GLsizei, buffers: *mut GLuint); +} +extern "C" { + pub fn glIsBuffer(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBufferData( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ); +} +extern "C" { + pub fn glBufferSubData( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetBufferSubData( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMapBuffer(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glUnmapBuffer(target: GLenum) -> GLboolean; +} +extern "C" { + pub fn glGetBufferParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetBufferPointerv( + target: GLenum, + pname: GLenum, + params: *mut *mut ::std::os::raw::c_void, + ); +} +pub type GLchar = ::std::os::raw::c_char; +pub type PFNGLBLENDEQUATIONSEPARATEPROC = + ::std::option::Option; +pub type PFNGLDRAWBUFFERSPROC = + ::std::option::Option; +pub type PFNGLSTENCILOPSEPARATEPROC = ::std::option::Option< + unsafe extern "C" fn(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum), +>; +pub type PFNGLSTENCILFUNCSEPARATEPROC = ::std::option::Option< + unsafe extern "C" fn(face: GLenum, func: GLenum, ref_: GLint, mask: GLuint), +>; +pub type PFNGLSTENCILMASKSEPARATEPROC = + ::std::option::Option; +pub type PFNGLATTACHSHADERPROC = + ::std::option::Option; +pub type PFNGLBINDATTRIBLOCATIONPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, index: GLuint, name: *const GLchar), +>; +pub type PFNGLCOMPILESHADERPROC = ::std::option::Option; +pub type PFNGLCREATEPROGRAMPROC = ::std::option::Option GLuint>; +pub type PFNGLCREATESHADERPROC = + ::std::option::Option GLuint>; +pub type PFNGLDELETEPROGRAMPROC = ::std::option::Option; +pub type PFNGLDELETESHADERPROC = ::std::option::Option; +pub type PFNGLDETACHSHADERPROC = + ::std::option::Option; +pub type PFNGLDISABLEVERTEXATTRIBARRAYPROC = + ::std::option::Option; +pub type PFNGLENABLEVERTEXATTRIBARRAYPROC = + ::std::option::Option; +pub type PFNGLGETACTIVEATTRIBPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLchar, + ), +>; +pub type PFNGLGETACTIVEUNIFORMPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLchar, + ), +>; +pub type PFNGLGETATTACHEDSHADERSPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + maxCount: GLsizei, + count: *mut GLsizei, + shaders: *mut GLuint, + ), +>; +pub type PFNGLGETATTRIBLOCATIONPROC = + ::std::option::Option GLint>; +pub type PFNGLGETPROGRAMIVPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMINFOLOGPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ), +>; +pub type PFNGLGETSHADERIVPROC = + ::std::option::Option; +pub type PFNGLGETSHADERINFOLOGPROC = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ), +>; +pub type PFNGLGETSHADERSOURCEPROC = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + source: *mut GLchar, + ), +>; +pub type PFNGLGETUNIFORMLOCATIONPROC = + ::std::option::Option GLint>; +pub type PFNGLGETUNIFORMFVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLfloat), +>; +pub type PFNGLGETUNIFORMIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLint), +>; +pub type PFNGLGETVERTEXATTRIBDVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), +>; +pub type PFNGLGETVERTEXATTRIBFVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBIVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBPOINTERVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, pointer: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLISPROGRAMPROC = + ::std::option::Option GLboolean>; +pub type PFNGLISSHADERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLLINKPROGRAMPROC = ::std::option::Option; +pub type PFNGLSHADERSOURCEPROC = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + count: GLsizei, + string: *const *const GLchar, + length: *const GLint, + ), +>; +pub type PFNGLUSEPROGRAMPROC = ::std::option::Option; +pub type PFNGLUNIFORM1FPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2FPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3FPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat), +>; +pub type PFNGLUNIFORM4FPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat), +>; +pub type PFNGLUNIFORM1IPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2IPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3IPROC = + ::std::option::Option; +pub type PFNGLUNIFORM4IPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint), +>; +pub type PFNGLUNIFORM1FVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM2FVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM3FVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM4FVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM1IVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORM2IVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORM3IVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORM4IVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORMMATRIX2FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX3FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX4FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLVALIDATEPROGRAMPROC = ::std::option::Option; +pub type PFNGLVERTEXATTRIB1DPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1FPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1FVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1SPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1SVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2DPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2FPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2FVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2SPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2SVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3DPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLVERTEXATTRIB3DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3FPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3FVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3SPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3SVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NBVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NSVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NUBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), +>; +pub type PFNGLVERTEXATTRIB4NUBVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NUIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NUSVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4BVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4DPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLVERTEXATTRIB4DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4FPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), +>; +pub type PFNGLVERTEXATTRIB4FVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4IVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4SPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), +>; +pub type PFNGLVERTEXATTRIB4SVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4UBVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4USVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBPOINTERPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glBlendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum); +} +extern "C" { + pub fn glDrawBuffers(n: GLsizei, bufs: *const GLenum); +} +extern "C" { + pub fn glStencilOpSeparate(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum); +} +extern "C" { + pub fn glStencilFuncSeparate(face: GLenum, func: GLenum, ref_: GLint, mask: GLuint); +} +extern "C" { + pub fn glStencilMaskSeparate(face: GLenum, mask: GLuint); +} +extern "C" { + pub fn glAttachShader(program: GLuint, shader: GLuint); +} +extern "C" { + pub fn glBindAttribLocation(program: GLuint, index: GLuint, name: *const GLchar); +} +extern "C" { + pub fn glCompileShader(shader: GLuint); +} +extern "C" { + pub fn glCreateProgram() -> GLuint; +} +extern "C" { + pub fn glCreateShader(type_: GLenum) -> GLuint; +} +extern "C" { + pub fn glDeleteProgram(program: GLuint); +} +extern "C" { + pub fn glDeleteShader(shader: GLuint); +} +extern "C" { + pub fn glDetachShader(program: GLuint, shader: GLuint); +} +extern "C" { + pub fn glDisableVertexAttribArray(index: GLuint); +} +extern "C" { + pub fn glEnableVertexAttribArray(index: GLuint); +} +extern "C" { + pub fn glGetActiveAttrib( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetActiveUniform( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetAttachedShaders( + program: GLuint, + maxCount: GLsizei, + count: *mut GLsizei, + shaders: *mut GLuint, + ); +} +extern "C" { + pub fn glGetAttribLocation(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glGetProgramiv(program: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetProgramInfoLog( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +extern "C" { + pub fn glGetShaderiv(shader: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetShaderInfoLog( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +extern "C" { + pub fn glGetShaderSource( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + source: *mut GLchar, + ); +} +extern "C" { + pub fn glGetUniformLocation(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glGetUniformfv(program: GLuint, location: GLint, params: *mut GLfloat); +} +extern "C" { + pub fn glGetUniformiv(program: GLuint, location: GLint, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribdv(index: GLuint, pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glGetVertexAttribfv(index: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetVertexAttribiv(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribPointerv( + index: GLuint, + pname: GLenum, + pointer: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glIsProgram(program: GLuint) -> GLboolean; +} +extern "C" { + pub fn glIsShader(shader: GLuint) -> GLboolean; +} +extern "C" { + pub fn glLinkProgram(program: GLuint); +} +extern "C" { + pub fn glShaderSource( + shader: GLuint, + count: GLsizei, + string: *const *const GLchar, + length: *const GLint, + ); +} +extern "C" { + pub fn glUseProgram(program: GLuint); +} +extern "C" { + pub fn glUniform1f(location: GLint, v0: GLfloat); +} +extern "C" { + pub fn glUniform2f(location: GLint, v0: GLfloat, v1: GLfloat); +} +extern "C" { + pub fn glUniform3f(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat); +} +extern "C" { + pub fn glUniform4f(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat); +} +extern "C" { + pub fn glUniform1i(location: GLint, v0: GLint); +} +extern "C" { + pub fn glUniform2i(location: GLint, v0: GLint, v1: GLint); +} +extern "C" { + pub fn glUniform3i(location: GLint, v0: GLint, v1: GLint, v2: GLint); +} +extern "C" { + pub fn glUniform4i(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint); +} +extern "C" { + pub fn glUniform1fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform2fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform3fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform4fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform1iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform2iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform3iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform4iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniformMatrix2fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glValidateProgram(program: GLuint); +} +extern "C" { + pub fn glVertexAttrib1d(index: GLuint, x: GLdouble); +} +extern "C" { + pub fn glVertexAttrib1dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib1f(index: GLuint, x: GLfloat); +} +extern "C" { + pub fn glVertexAttrib1fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib1s(index: GLuint, x: GLshort); +} +extern "C" { + pub fn glVertexAttrib1sv(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib2d(index: GLuint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertexAttrib2dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glVertexAttrib2fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib2s(index: GLuint, x: GLshort, y: GLshort); +} +extern "C" { + pub fn glVertexAttrib2sv(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib3d(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertexAttrib3dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glVertexAttrib3fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib3s(index: GLuint, x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glVertexAttrib3sv(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4Nbv(index: GLuint, v: *const GLbyte); +} +extern "C" { + pub fn glVertexAttrib4Niv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttrib4Nsv(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4Nub(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte); +} +extern "C" { + pub fn glVertexAttrib4Nubv(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttrib4Nuiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttrib4Nusv(index: GLuint, v: *const GLushort); +} +extern "C" { + pub fn glVertexAttrib4bv(index: GLuint, v: *const GLbyte); +} +extern "C" { + pub fn glVertexAttrib4d(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertexAttrib4dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glVertexAttrib4fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib4iv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttrib4s(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glVertexAttrib4sv(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4ubv(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttrib4uiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttrib4usv(index: GLuint, v: *const GLushort); +} +extern "C" { + pub fn glVertexAttribPointer( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLUNIFORMMATRIX2X3FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX3X2FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX2X4FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX4X2FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX3X4FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX4X3FVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +extern "C" { + pub fn glUniformMatrix2x3fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3x2fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix2x4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4x2fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3x4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4x3fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +pub type GLhalf = khronos_uint16_t; +pub type PFNGLCOLORMASKIPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean), +>; +pub type PFNGLGETBOOLEANI_VPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, data: *mut GLboolean), +>; +pub type PFNGLGETINTEGERI_VPROC = + ::std::option::Option; +pub type PFNGLENABLEIPROC = + ::std::option::Option; +pub type PFNGLDISABLEIPROC = + ::std::option::Option; +pub type PFNGLISENABLEDIPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBEGINTRANSFORMFEEDBACKPROC = + ::std::option::Option; +pub type PFNGLENDTRANSFORMFEEDBACKPROC = ::std::option::Option; +pub type PFNGLBINDBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLBINDBUFFERBASEPROC = + ::std::option::Option; +pub type PFNGLTRANSFORMFEEDBACKVARYINGSPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + count: GLsizei, + varyings: *const *const GLchar, + bufferMode: GLenum, + ), +>; +pub type PFNGLGETTRANSFORMFEEDBACKVARYINGPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ), +>; +pub type PFNGLCLAMPCOLORPROC = + ::std::option::Option; +pub type PFNGLBEGINCONDITIONALRENDERPROC = + ::std::option::Option; +pub type PFNGLENDCONDITIONALRENDERPROC = ::std::option::Option; +pub type PFNGLVERTEXATTRIBIPOINTERPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETVERTEXATTRIBIIVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBIUIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI1IPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2IPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3IPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4IPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint), +>; +pub type PFNGLVERTEXATTRIBI1UIPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2UIPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3UIPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4UIPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint), +>; +pub type PFNGLVERTEXATTRIBI1IVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2IVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3IVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4IVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI1UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4BVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4SVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4UBVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4USVPROC = + ::std::option::Option; +pub type PFNGLGETUNIFORMUIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLuint), +>; +pub type PFNGLBINDFRAGDATALOCATIONPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, color: GLuint, name: *const GLchar), +>; +pub type PFNGLGETFRAGDATALOCATIONPROC = + ::std::option::Option GLint>; +pub type PFNGLUNIFORM1UIPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2UIPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3UIPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint), +>; +pub type PFNGLUNIFORM4UIPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint), +>; +pub type PFNGLUNIFORM1UIVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLUNIFORM2UIVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLUNIFORM3UIVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLUNIFORM4UIVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLTEXPARAMETERIIVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLTEXPARAMETERIUIVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLuint), +>; +pub type PFNGLGETTEXPARAMETERIIVPROC = + ::std::option::Option; +pub type PFNGLGETTEXPARAMETERIUIVPROC = + ::std::option::Option; +pub type PFNGLCLEARBUFFERIVPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLint), +>; +pub type PFNGLCLEARBUFFERUIVPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLuint), +>; +pub type PFNGLCLEARBUFFERFVPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat), +>; +pub type PFNGLCLEARBUFFERFIPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint), +>; +pub type PFNGLGETSTRINGIPROC = + ::std::option::Option *const GLubyte>; +pub type PFNGLISRENDERBUFFERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBINDRENDERBUFFERPROC = + ::std::option::Option; +pub type PFNGLDELETERENDERBUFFERSPROC = + ::std::option::Option; +pub type PFNGLGENRENDERBUFFERSPROC = + ::std::option::Option; +pub type PFNGLRENDERBUFFERSTORAGEPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), +>; +pub type PFNGLGETRENDERBUFFERPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLISFRAMEBUFFERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBINDFRAMEBUFFERPROC = + ::std::option::Option; +pub type PFNGLDELETEFRAMEBUFFERSPROC = + ::std::option::Option; +pub type PFNGLGENFRAMEBUFFERSPROC = + ::std::option::Option; +pub type PFNGLCHECKFRAMEBUFFERSTATUSPROC = + ::std::option::Option GLenum>; +pub type PFNGLFRAMEBUFFERTEXTURE1DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERTEXTURE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERTEXTURE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + zoffset: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERRENDERBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ), +>; +pub type PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, attachment: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGENERATEMIPMAPPROC = ::std::option::Option; +pub type PFNGLBLITFRAMEBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn( + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ), +>; +pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLFRAMEBUFFERTEXTURELAYERPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ), +>; +pub type PFNGLMAPBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLFLUSHMAPPEDBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, offset: GLintptr, length: GLsizeiptr), +>; +pub type PFNGLBINDVERTEXARRAYPROC = ::std::option::Option; +pub type PFNGLDELETEVERTEXARRAYSPROC = + ::std::option::Option; +pub type PFNGLGENVERTEXARRAYSPROC = + ::std::option::Option; +pub type PFNGLISVERTEXARRAYPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glColorMaski(index: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean); +} +extern "C" { + pub fn glGetBooleani_v(target: GLenum, index: GLuint, data: *mut GLboolean); +} +extern "C" { + pub fn glGetIntegeri_v(target: GLenum, index: GLuint, data: *mut GLint); +} +extern "C" { + pub fn glEnablei(target: GLenum, index: GLuint); +} +extern "C" { + pub fn glDisablei(target: GLenum, index: GLuint); +} +extern "C" { + pub fn glIsEnabledi(target: GLenum, index: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBeginTransformFeedback(primitiveMode: GLenum); +} +extern "C" { + pub fn glEndTransformFeedback(); +} +extern "C" { + pub fn glBindBufferRange( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glBindBufferBase(target: GLenum, index: GLuint, buffer: GLuint); +} +extern "C" { + pub fn glTransformFeedbackVaryings( + program: GLuint, + count: GLsizei, + varyings: *const *const GLchar, + bufferMode: GLenum, + ); +} +extern "C" { + pub fn glGetTransformFeedbackVarying( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glClampColor(target: GLenum, clamp: GLenum); +} +extern "C" { + pub fn glBeginConditionalRender(id: GLuint, mode: GLenum); +} +extern "C" { + pub fn glEndConditionalRender(); +} +extern "C" { + pub fn glVertexAttribIPointer( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetVertexAttribIiv(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribIuiv(index: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glVertexAttribI1i(index: GLuint, x: GLint); +} +extern "C" { + pub fn glVertexAttribI2i(index: GLuint, x: GLint, y: GLint); +} +extern "C" { + pub fn glVertexAttribI3i(index: GLuint, x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glVertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glVertexAttribI1ui(index: GLuint, x: GLuint); +} +extern "C" { + pub fn glVertexAttribI2ui(index: GLuint, x: GLuint, y: GLuint); +} +extern "C" { + pub fn glVertexAttribI3ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint); +} +extern "C" { + pub fn glVertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint); +} +extern "C" { + pub fn glVertexAttribI1iv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI2iv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI3iv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI4iv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI1uiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI2uiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI3uiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI4uiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI4bv(index: GLuint, v: *const GLbyte); +} +extern "C" { + pub fn glVertexAttribI4sv(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttribI4ubv(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttribI4usv(index: GLuint, v: *const GLushort); +} +extern "C" { + pub fn glGetUniformuiv(program: GLuint, location: GLint, params: *mut GLuint); +} +extern "C" { + pub fn glBindFragDataLocation(program: GLuint, color: GLuint, name: *const GLchar); +} +extern "C" { + pub fn glGetFragDataLocation(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glUniform1ui(location: GLint, v0: GLuint); +} +extern "C" { + pub fn glUniform2ui(location: GLint, v0: GLuint, v1: GLuint); +} +extern "C" { + pub fn glUniform3ui(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint); +} +extern "C" { + pub fn glUniform4ui(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint); +} +extern "C" { + pub fn glUniform1uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform2uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform3uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform4uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glTexParameterIiv(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glTexParameterIuiv(target: GLenum, pname: GLenum, params: *const GLuint); +} +extern "C" { + pub fn glGetTexParameterIiv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetTexParameterIuiv(target: GLenum, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glClearBufferiv(buffer: GLenum, drawbuffer: GLint, value: *const GLint); +} +extern "C" { + pub fn glClearBufferuiv(buffer: GLenum, drawbuffer: GLint, value: *const GLuint); +} +extern "C" { + pub fn glClearBufferfv(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat); +} +extern "C" { + pub fn glClearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint); +} +extern "C" { + pub fn glGetStringi(name: GLenum, index: GLuint) -> *const GLubyte; +} +extern "C" { + pub fn glIsRenderbuffer(renderbuffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBindRenderbuffer(target: GLenum, renderbuffer: GLuint); +} +extern "C" { + pub fn glDeleteRenderbuffers(n: GLsizei, renderbuffers: *const GLuint); +} +extern "C" { + pub fn glGenRenderbuffers(n: GLsizei, renderbuffers: *mut GLuint); +} +extern "C" { + pub fn glRenderbufferStorage( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetRenderbufferParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glIsFramebuffer(framebuffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBindFramebuffer(target: GLenum, framebuffer: GLuint); +} +extern "C" { + pub fn glDeleteFramebuffers(n: GLsizei, framebuffers: *const GLuint); +} +extern "C" { + pub fn glGenFramebuffers(n: GLsizei, framebuffers: *mut GLuint); +} +extern "C" { + pub fn glCheckFramebufferStatus(target: GLenum) -> GLenum; +} +extern "C" { + pub fn glFramebufferTexture1D( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFramebufferTexture2D( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFramebufferTexture3D( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + zoffset: GLint, + ); +} +extern "C" { + pub fn glFramebufferRenderbuffer( + target: GLenum, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ); +} +extern "C" { + pub fn glGetFramebufferAttachmentParameteriv( + target: GLenum, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGenerateMipmap(target: GLenum); +} +extern "C" { + pub fn glBlitFramebuffer( + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ); +} +extern "C" { + pub fn glRenderbufferStorageMultisample( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glFramebufferTextureLayer( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ); +} +extern "C" { + pub fn glMapBufferRange( + target: GLenum, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glFlushMappedBufferRange(target: GLenum, offset: GLintptr, length: GLsizeiptr); +} +extern "C" { + pub fn glBindVertexArray(array: GLuint); +} +extern "C" { + pub fn glDeleteVertexArrays(n: GLsizei, arrays: *const GLuint); +} +extern "C" { + pub fn glGenVertexArrays(n: GLsizei, arrays: *mut GLuint); +} +extern "C" { + pub fn glIsVertexArray(array: GLuint) -> GLboolean; +} +pub type PFNGLDRAWARRAYSINSTANCEDPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, first: GLint, count: GLsizei, instancecount: GLsizei), +>; +pub type PFNGLDRAWELEMENTSINSTANCEDPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + ), +>; +pub type PFNGLTEXBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, buffer: GLuint), +>; +pub type PFNGLPRIMITIVERESTARTINDEXPROC = + ::std::option::Option; +pub type PFNGLCOPYBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + readTarget: GLenum, + writeTarget: GLenum, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLGETUNIFORMINDICESPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + uniformCount: GLsizei, + uniformNames: *const *const GLchar, + uniformIndices: *mut GLuint, + ), +>; +pub type PFNGLGETACTIVEUNIFORMSIVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + uniformCount: GLsizei, + uniformIndices: *const GLuint, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLGETACTIVEUNIFORMNAMEPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + uniformIndex: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + uniformName: *mut GLchar, + ), +>; +pub type PFNGLGETUNIFORMBLOCKINDEXPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, uniformBlockName: *const GLchar) -> GLuint, +>; +pub type PFNGLGETACTIVEUNIFORMBLOCKIVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + uniformBlockIndex: GLuint, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + uniformBlockIndex: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + uniformBlockName: *mut GLchar, + ), +>; +pub type PFNGLUNIFORMBLOCKBINDINGPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint), +>; +extern "C" { + pub fn glDrawArraysInstanced( + mode: GLenum, + first: GLint, + count: GLsizei, + instancecount: GLsizei, + ); +} +extern "C" { + pub fn glDrawElementsInstanced( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + ); +} +extern "C" { + pub fn glTexBuffer(target: GLenum, internalformat: GLenum, buffer: GLuint); +} +extern "C" { + pub fn glPrimitiveRestartIndex(index: GLuint); +} +extern "C" { + pub fn glCopyBufferSubData( + readTarget: GLenum, + writeTarget: GLenum, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glGetUniformIndices( + program: GLuint, + uniformCount: GLsizei, + uniformNames: *const *const GLchar, + uniformIndices: *mut GLuint, + ); +} +extern "C" { + pub fn glGetActiveUniformsiv( + program: GLuint, + uniformCount: GLsizei, + uniformIndices: *const GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetActiveUniformName( + program: GLuint, + uniformIndex: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + uniformName: *mut GLchar, + ); +} +extern "C" { + pub fn glGetUniformBlockIndex(program: GLuint, uniformBlockName: *const GLchar) -> GLuint; +} +extern "C" { + pub fn glGetActiveUniformBlockiv( + program: GLuint, + uniformBlockIndex: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetActiveUniformBlockName( + program: GLuint, + uniformBlockIndex: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + uniformBlockName: *mut GLchar, + ); +} +extern "C" { + pub fn glUniformBlockBinding( + program: GLuint, + uniformBlockIndex: GLuint, + uniformBlockBinding: GLuint, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __GLsync { + _unused: [u8; 0], +} +pub type GLsync = *mut __GLsync; +pub type GLuint64 = khronos_uint64_t; +pub type GLint64 = khronos_int64_t; +pub type PFNGLDRAWELEMENTSBASEVERTEXPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + basevertex: GLint, + ), +>; +pub type PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + basevertex: GLint, + ), +>; +pub type PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + basevertex: GLint, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + drawcount: GLsizei, + basevertex: *const GLint, + ), +>; +pub type PFNGLPROVOKINGVERTEXPROC = ::std::option::Option; +pub type PFNGLFENCESYNCPROC = + ::std::option::Option GLsync>; +pub type PFNGLISSYNCPROC = ::std::option::Option GLboolean>; +pub type PFNGLDELETESYNCPROC = ::std::option::Option; +pub type PFNGLCLIENTWAITSYNCPROC = ::std::option::Option< + unsafe extern "C" fn(sync: GLsync, flags: GLbitfield, timeout: GLuint64) -> GLenum, +>; +pub type PFNGLWAITSYNCPROC = + ::std::option::Option; +pub type PFNGLGETINTEGER64VPROC = + ::std::option::Option; +pub type PFNGLGETSYNCIVPROC = ::std::option::Option< + unsafe extern "C" fn( + sync: GLsync, + pname: GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + values: *mut GLint, + ), +>; +pub type PFNGLGETINTEGER64I_VPROC = + ::std::option::Option; +pub type PFNGLGETBUFFERPARAMETERI64VPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLint64), +>; +pub type PFNGLFRAMEBUFFERTEXTUREPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, attachment: GLenum, texture: GLuint, level: GLint), +>; +pub type PFNGLTEXIMAGE2DMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLTEXIMAGE3DMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLGETMULTISAMPLEFVPROC = + ::std::option::Option; +pub type PFNGLSAMPLEMASKIPROC = + ::std::option::Option; +extern "C" { + pub fn glDrawElementsBaseVertex( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + basevertex: GLint, + ); +} +extern "C" { + pub fn glDrawRangeElementsBaseVertex( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + basevertex: GLint, + ); +} +extern "C" { + pub fn glDrawElementsInstancedBaseVertex( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + basevertex: GLint, + ); +} +extern "C" { + pub fn glMultiDrawElementsBaseVertex( + mode: GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + drawcount: GLsizei, + basevertex: *const GLint, + ); +} +extern "C" { + pub fn glProvokingVertex(mode: GLenum); +} +extern "C" { + pub fn glFenceSync(condition: GLenum, flags: GLbitfield) -> GLsync; +} +extern "C" { + pub fn glIsSync(sync: GLsync) -> GLboolean; +} +extern "C" { + pub fn glDeleteSync(sync: GLsync); +} +extern "C" { + pub fn glClientWaitSync(sync: GLsync, flags: GLbitfield, timeout: GLuint64) -> GLenum; +} +extern "C" { + pub fn glWaitSync(sync: GLsync, flags: GLbitfield, timeout: GLuint64); +} +extern "C" { + pub fn glGetInteger64v(pname: GLenum, data: *mut GLint64); +} +extern "C" { + pub fn glGetSynciv( + sync: GLsync, + pname: GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + values: *mut GLint, + ); +} +extern "C" { + pub fn glGetInteger64i_v(target: GLenum, index: GLuint, data: *mut GLint64); +} +extern "C" { + pub fn glGetBufferParameteri64v(target: GLenum, pname: GLenum, params: *mut GLint64); +} +extern "C" { + pub fn glFramebufferTexture(target: GLenum, attachment: GLenum, texture: GLuint, level: GLint); +} +extern "C" { + pub fn glTexImage2DMultisample( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glTexImage3DMultisample( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glGetMultisamplefv(pname: GLenum, index: GLuint, val: *mut GLfloat); +} +extern "C" { + pub fn glSampleMaski(maskNumber: GLuint, mask: GLbitfield); +} +pub type PFNGLBINDFRAGDATALOCATIONINDEXEDPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, colorNumber: GLuint, index: GLuint, name: *const GLchar), +>; +pub type PFNGLGETFRAGDATAINDEXPROC = + ::std::option::Option GLint>; +pub type PFNGLGENSAMPLERSPROC = + ::std::option::Option; +pub type PFNGLDELETESAMPLERSPROC = + ::std::option::Option; +pub type PFNGLISSAMPLERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBINDSAMPLERPROC = + ::std::option::Option; +pub type PFNGLSAMPLERPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLSAMPLERPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLint), +>; +pub type PFNGLSAMPLERPARAMETERFPROC = + ::std::option::Option; +pub type PFNGLSAMPLERPARAMETERFVPROC = ::std::option::Option< + unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLfloat), +>; +pub type PFNGLSAMPLERPARAMETERIIVPROC = ::std::option::Option< + unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLint), +>; +pub type PFNGLSAMPLERPARAMETERIUIVPROC = ::std::option::Option< + unsafe extern "C" fn(sampler: GLuint, pname: GLenum, param: *const GLuint), +>; +pub type PFNGLGETSAMPLERPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLGETSAMPLERPARAMETERIIVPROC = + ::std::option::Option; +pub type PFNGLGETSAMPLERPARAMETERFVPROC = ::std::option::Option< + unsafe extern "C" fn(sampler: GLuint, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETSAMPLERPARAMETERIUIVPROC = ::std::option::Option< + unsafe extern "C" fn(sampler: GLuint, pname: GLenum, params: *mut GLuint), +>; +pub type PFNGLQUERYCOUNTERPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTI64VPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTUI64VPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBDIVISORPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBP1UIPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), +>; +pub type PFNGLVERTEXATTRIBP1UIVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), +>; +pub type PFNGLVERTEXATTRIBP2UIPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), +>; +pub type PFNGLVERTEXATTRIBP2UIVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), +>; +pub type PFNGLVERTEXATTRIBP3UIPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), +>; +pub type PFNGLVERTEXATTRIBP3UIVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), +>; +pub type PFNGLVERTEXATTRIBP4UIPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint), +>; +pub type PFNGLVERTEXATTRIBP4UIVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, type_: GLenum, normalized: GLboolean, value: *const GLuint), +>; +pub type PFNGLVERTEXP2UIPROC = + ::std::option::Option; +pub type PFNGLVERTEXP2UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXP3UIPROC = + ::std::option::Option; +pub type PFNGLVERTEXP3UIVPROC = + ::std::option::Option; +pub type PFNGLVERTEXP4UIPROC = + ::std::option::Option; +pub type PFNGLVERTEXP4UIVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP1UIPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP1UIVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP2UIPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP2UIVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP3UIPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP3UIVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP4UIPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDP4UIVPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORDP1UIPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORDP1UIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), +>; +pub type PFNGLMULTITEXCOORDP2UIPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORDP2UIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), +>; +pub type PFNGLMULTITEXCOORDP3UIPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORDP3UIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), +>; +pub type PFNGLMULTITEXCOORDP4UIPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORDP4UIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, type_: GLenum, coords: *const GLuint), +>; +pub type PFNGLNORMALP3UIPROC = + ::std::option::Option; +pub type PFNGLNORMALP3UIVPROC = + ::std::option::Option; +pub type PFNGLCOLORP3UIPROC = + ::std::option::Option; +pub type PFNGLCOLORP3UIVPROC = + ::std::option::Option; +pub type PFNGLCOLORP4UIPROC = + ::std::option::Option; +pub type PFNGLCOLORP4UIVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLORP3UIPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLORP3UIVPROC = + ::std::option::Option; +extern "C" { + pub fn glBindFragDataLocationIndexed( + program: GLuint, + colorNumber: GLuint, + index: GLuint, + name: *const GLchar, + ); +} +extern "C" { + pub fn glGetFragDataIndex(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glGenSamplers(count: GLsizei, samplers: *mut GLuint); +} +extern "C" { + pub fn glDeleteSamplers(count: GLsizei, samplers: *const GLuint); +} +extern "C" { + pub fn glIsSampler(sampler: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBindSampler(unit: GLuint, sampler: GLuint); +} +extern "C" { + pub fn glSamplerParameteri(sampler: GLuint, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glSamplerParameteriv(sampler: GLuint, pname: GLenum, param: *const GLint); +} +extern "C" { + pub fn glSamplerParameterf(sampler: GLuint, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glSamplerParameterfv(sampler: GLuint, pname: GLenum, param: *const GLfloat); +} +extern "C" { + pub fn glSamplerParameterIiv(sampler: GLuint, pname: GLenum, param: *const GLint); +} +extern "C" { + pub fn glSamplerParameterIuiv(sampler: GLuint, pname: GLenum, param: *const GLuint); +} +extern "C" { + pub fn glGetSamplerParameteriv(sampler: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetSamplerParameterIiv(sampler: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetSamplerParameterfv(sampler: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetSamplerParameterIuiv(sampler: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glQueryCounter(id: GLuint, target: GLenum); +} +extern "C" { + pub fn glGetQueryObjecti64v(id: GLuint, pname: GLenum, params: *mut GLint64); +} +extern "C" { + pub fn glGetQueryObjectui64v(id: GLuint, pname: GLenum, params: *mut GLuint64); +} +extern "C" { + pub fn glVertexAttribDivisor(index: GLuint, divisor: GLuint); +} +extern "C" { + pub fn glVertexAttribP1ui(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint); +} +extern "C" { + pub fn glVertexAttribP1uiv( + index: GLuint, + type_: GLenum, + normalized: GLboolean, + value: *const GLuint, + ); +} +extern "C" { + pub fn glVertexAttribP2ui(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint); +} +extern "C" { + pub fn glVertexAttribP2uiv( + index: GLuint, + type_: GLenum, + normalized: GLboolean, + value: *const GLuint, + ); +} +extern "C" { + pub fn glVertexAttribP3ui(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint); +} +extern "C" { + pub fn glVertexAttribP3uiv( + index: GLuint, + type_: GLenum, + normalized: GLboolean, + value: *const GLuint, + ); +} +extern "C" { + pub fn glVertexAttribP4ui(index: GLuint, type_: GLenum, normalized: GLboolean, value: GLuint); +} +extern "C" { + pub fn glVertexAttribP4uiv( + index: GLuint, + type_: GLenum, + normalized: GLboolean, + value: *const GLuint, + ); +} +extern "C" { + pub fn glVertexP2ui(type_: GLenum, value: GLuint); +} +extern "C" { + pub fn glVertexP2uiv(type_: GLenum, value: *const GLuint); +} +extern "C" { + pub fn glVertexP3ui(type_: GLenum, value: GLuint); +} +extern "C" { + pub fn glVertexP3uiv(type_: GLenum, value: *const GLuint); +} +extern "C" { + pub fn glVertexP4ui(type_: GLenum, value: GLuint); +} +extern "C" { + pub fn glVertexP4uiv(type_: GLenum, value: *const GLuint); +} +extern "C" { + pub fn glTexCoordP1ui(type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glTexCoordP1uiv(type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glTexCoordP2ui(type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glTexCoordP2uiv(type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glTexCoordP3ui(type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glTexCoordP3uiv(type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glTexCoordP4ui(type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glTexCoordP4uiv(type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glMultiTexCoordP1ui(texture: GLenum, type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glMultiTexCoordP1uiv(texture: GLenum, type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glMultiTexCoordP2ui(texture: GLenum, type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glMultiTexCoordP2uiv(texture: GLenum, type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glMultiTexCoordP3ui(texture: GLenum, type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glMultiTexCoordP3uiv(texture: GLenum, type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glMultiTexCoordP4ui(texture: GLenum, type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glMultiTexCoordP4uiv(texture: GLenum, type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glNormalP3ui(type_: GLenum, coords: GLuint); +} +extern "C" { + pub fn glNormalP3uiv(type_: GLenum, coords: *const GLuint); +} +extern "C" { + pub fn glColorP3ui(type_: GLenum, color: GLuint); +} +extern "C" { + pub fn glColorP3uiv(type_: GLenum, color: *const GLuint); +} +extern "C" { + pub fn glColorP4ui(type_: GLenum, color: GLuint); +} +extern "C" { + pub fn glColorP4uiv(type_: GLenum, color: *const GLuint); +} +extern "C" { + pub fn glSecondaryColorP3ui(type_: GLenum, color: GLuint); +} +extern "C" { + pub fn glSecondaryColorP3uiv(type_: GLenum, color: *const GLuint); +} +pub type PFNGLMINSAMPLESHADINGPROC = ::std::option::Option; +pub type PFNGLBLENDEQUATIONIPROC = + ::std::option::Option; +pub type PFNGLBLENDEQUATIONSEPARATEIPROC = + ::std::option::Option; +pub type PFNGLBLENDFUNCIPROC = + ::std::option::Option; +pub type PFNGLBLENDFUNCSEPARATEIPROC = ::std::option::Option< + unsafe extern "C" fn( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum, + ), +>; +pub type PFNGLDRAWARRAYSINDIRECTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, indirect: *const ::std::os::raw::c_void), +>; +pub type PFNGLDRAWELEMENTSINDIRECTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, type_: GLenum, indirect: *const ::std::os::raw::c_void), +>; +pub type PFNGLUNIFORM1DPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2DPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3DPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLUNIFORM4DPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLUNIFORM1DVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLUNIFORM2DVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLUNIFORM3DVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLUNIFORM4DVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLUNIFORMMATRIX2DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX3DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX4DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX2X3DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX2X4DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX3X2DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX3X4DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX4X2DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLUNIFORMMATRIX4X3DVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLGETUNIFORMDVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLdouble), +>; +pub type PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, shadertype: GLenum, name: *const GLchar) -> GLint, +>; +pub type PFNGLGETSUBROUTINEINDEXPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, shadertype: GLenum, name: *const GLchar) -> GLuint, +>; +pub type PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + shadertype: GLenum, + index: GLuint, + pname: GLenum, + values: *mut GLint, + ), +>; +pub type PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + shadertype: GLenum, + index: GLuint, + bufsize: GLsizei, + length: *mut GLsizei, + name: *mut GLchar, + ), +>; +pub type PFNGLGETACTIVESUBROUTINENAMEPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + shadertype: GLenum, + index: GLuint, + bufsize: GLsizei, + length: *mut GLsizei, + name: *mut GLchar, + ), +>; +pub type PFNGLUNIFORMSUBROUTINESUIVPROC = ::std::option::Option< + unsafe extern "C" fn(shadertype: GLenum, count: GLsizei, indices: *const GLuint), +>; +pub type PFNGLGETUNIFORMSUBROUTINEUIVPROC = ::std::option::Option< + unsafe extern "C" fn(shadertype: GLenum, location: GLint, params: *mut GLuint), +>; +pub type PFNGLGETPROGRAMSTAGEIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, shadertype: GLenum, pname: GLenum, values: *mut GLint), +>; +pub type PFNGLPATCHPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLPATCHPARAMETERFVPROC = + ::std::option::Option; +pub type PFNGLBINDTRANSFORMFEEDBACKPROC = + ::std::option::Option; +pub type PFNGLDELETETRANSFORMFEEDBACKSPROC = + ::std::option::Option; +pub type PFNGLGENTRANSFORMFEEDBACKSPROC = + ::std::option::Option; +pub type PFNGLISTRANSFORMFEEDBACKPROC = + ::std::option::Option GLboolean>; +pub type PFNGLPAUSETRANSFORMFEEDBACKPROC = ::std::option::Option; +pub type PFNGLRESUMETRANSFORMFEEDBACKPROC = ::std::option::Option; +pub type PFNGLDRAWTRANSFORMFEEDBACKPROC = + ::std::option::Option; +pub type PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC = + ::std::option::Option; +pub type PFNGLBEGINQUERYINDEXEDPROC = + ::std::option::Option; +pub type PFNGLENDQUERYINDEXEDPROC = + ::std::option::Option; +pub type PFNGLGETQUERYINDEXEDIVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, pname: GLenum, params: *mut GLint), +>; +extern "C" { + pub fn glMinSampleShading(value: GLfloat); +} +extern "C" { + pub fn glBlendEquationi(buf: GLuint, mode: GLenum); +} +extern "C" { + pub fn glBlendEquationSeparatei(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum); +} +extern "C" { + pub fn glBlendFunci(buf: GLuint, src: GLenum, dst: GLenum); +} +extern "C" { + pub fn glBlendFuncSeparatei( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum, + ); +} +extern "C" { + pub fn glDrawArraysIndirect(mode: GLenum, indirect: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glDrawElementsIndirect( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glUniform1d(location: GLint, x: GLdouble); +} +extern "C" { + pub fn glUniform2d(location: GLint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glUniform3d(location: GLint, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glUniform4d(location: GLint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glUniform1dv(location: GLint, count: GLsizei, value: *const GLdouble); +} +extern "C" { + pub fn glUniform2dv(location: GLint, count: GLsizei, value: *const GLdouble); +} +extern "C" { + pub fn glUniform3dv(location: GLint, count: GLsizei, value: *const GLdouble); +} +extern "C" { + pub fn glUniform4dv(location: GLint, count: GLsizei, value: *const GLdouble); +} +extern "C" { + pub fn glUniformMatrix2dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix3dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix4dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix2x3dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix2x4dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix3x2dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix3x4dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix4x2dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glUniformMatrix4x3dv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glGetUniformdv(program: GLuint, location: GLint, params: *mut GLdouble); +} +extern "C" { + pub fn glGetSubroutineUniformLocation( + program: GLuint, + shadertype: GLenum, + name: *const GLchar, + ) -> GLint; +} +extern "C" { + pub fn glGetSubroutineIndex(program: GLuint, shadertype: GLenum, name: *const GLchar) + -> GLuint; +} +extern "C" { + pub fn glGetActiveSubroutineUniformiv( + program: GLuint, + shadertype: GLenum, + index: GLuint, + pname: GLenum, + values: *mut GLint, + ); +} +extern "C" { + pub fn glGetActiveSubroutineUniformName( + program: GLuint, + shadertype: GLenum, + index: GLuint, + bufsize: GLsizei, + length: *mut GLsizei, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetActiveSubroutineName( + program: GLuint, + shadertype: GLenum, + index: GLuint, + bufsize: GLsizei, + length: *mut GLsizei, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glUniformSubroutinesuiv(shadertype: GLenum, count: GLsizei, indices: *const GLuint); +} +extern "C" { + pub fn glGetUniformSubroutineuiv(shadertype: GLenum, location: GLint, params: *mut GLuint); +} +extern "C" { + pub fn glGetProgramStageiv( + program: GLuint, + shadertype: GLenum, + pname: GLenum, + values: *mut GLint, + ); +} +extern "C" { + pub fn glPatchParameteri(pname: GLenum, value: GLint); +} +extern "C" { + pub fn glPatchParameterfv(pname: GLenum, values: *const GLfloat); +} +extern "C" { + pub fn glBindTransformFeedback(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glDeleteTransformFeedbacks(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glGenTransformFeedbacks(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glIsTransformFeedback(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glPauseTransformFeedback(); +} +extern "C" { + pub fn glResumeTransformFeedback(); +} +extern "C" { + pub fn glDrawTransformFeedback(mode: GLenum, id: GLuint); +} +extern "C" { + pub fn glDrawTransformFeedbackStream(mode: GLenum, id: GLuint, stream: GLuint); +} +extern "C" { + pub fn glBeginQueryIndexed(target: GLenum, index: GLuint, id: GLuint); +} +extern "C" { + pub fn glEndQueryIndexed(target: GLenum, index: GLuint); +} +extern "C" { + pub fn glGetQueryIndexediv(target: GLenum, index: GLuint, pname: GLenum, params: *mut GLint); +} +pub type PFNGLRELEASESHADERCOMPILERPROC = ::std::option::Option; +pub type PFNGLSHADERBINARYPROC = ::std::option::Option< + unsafe extern "C" fn( + count: GLsizei, + shaders: *const GLuint, + binaryformat: GLenum, + binary: *const ::std::os::raw::c_void, + length: GLsizei, + ), +>; +pub type PFNGLGETSHADERPRECISIONFORMATPROC = ::std::option::Option< + unsafe extern "C" fn( + shadertype: GLenum, + precisiontype: GLenum, + range: *mut GLint, + precision: *mut GLint, + ), +>; +pub type PFNGLDEPTHRANGEFPROC = ::std::option::Option; +pub type PFNGLCLEARDEPTHFPROC = ::std::option::Option; +pub type PFNGLGETPROGRAMBINARYPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + binaryFormat: *mut GLenum, + binary: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLPROGRAMBINARYPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + binaryFormat: GLenum, + binary: *const ::std::os::raw::c_void, + length: GLsizei, + ), +>; +pub type PFNGLPROGRAMPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLUSEPROGRAMSTAGESPROC = ::std::option::Option< + unsafe extern "C" fn(pipeline: GLuint, stages: GLbitfield, program: GLuint), +>; +pub type PFNGLACTIVESHADERPROGRAMPROC = + ::std::option::Option; +pub type PFNGLCREATESHADERPROGRAMVPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, count: GLsizei, strings: *const *const GLchar) -> GLuint, +>; +pub type PFNGLBINDPROGRAMPIPELINEPROC = + ::std::option::Option; +pub type PFNGLDELETEPROGRAMPIPELINESPROC = + ::std::option::Option; +pub type PFNGLGENPROGRAMPIPELINESPROC = + ::std::option::Option; +pub type PFNGLISPROGRAMPIPELINEPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETPROGRAMPIPELINEIVPROC = ::std::option::Option< + unsafe extern "C" fn(pipeline: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLPROGRAMUNIFORM1IPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM1IVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM1FPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM1FVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM1DPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM1DVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM1UIPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM1UIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORM2IPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLint, v1: GLint), +>; +pub type PFNGLPROGRAMUNIFORM2IVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM2FPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLfloat, v1: GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM2FVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM2DPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLdouble, v1: GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM2DVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM2UIPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLuint, v1: GLuint), +>; +pub type PFNGLPROGRAMUNIFORM2UIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORM3IPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLint, v1: GLint, v2: GLint), +>; +pub type PFNGLPROGRAMUNIFORM3IVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM3FPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM3FVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM3DPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLdouble, + v1: GLdouble, + v2: GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORM3DVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM3UIPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLuint, v1: GLuint, v2: GLuint), +>; +pub type PFNGLPROGRAMUNIFORM3UIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORM4IPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLint, + v1: GLint, + v2: GLint, + v3: GLint, + ), +>; +pub type PFNGLPROGRAMUNIFORM4IVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM4FPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLfloat, + v1: GLfloat, + v2: GLfloat, + v3: GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORM4FVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM4DPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLdouble, + v1: GLdouble, + v2: GLdouble, + v3: GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORM4DVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM4UIPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLuint, + v1: GLuint, + v2: GLuint, + v3: GLuint, + ), +>; +pub type PFNGLPROGRAMUNIFORM4UIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLVALIDATEPROGRAMPIPELINEPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMPIPELINEINFOLOGPROC = ::std::option::Option< + unsafe extern "C" fn( + pipeline: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ), +>; +pub type PFNGLVERTEXATTRIBL1DPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2DPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3DPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLVERTEXATTRIBL4DPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLVERTEXATTRIBL1DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL4DVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBLPOINTERPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETVERTEXATTRIBLDVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), +>; +pub type PFNGLVIEWPORTARRAYVPROC = + ::std::option::Option; +pub type PFNGLVIEWPORTINDEXEDFPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, w: GLfloat, h: GLfloat), +>; +pub type PFNGLVIEWPORTINDEXEDFVPROC = + ::std::option::Option; +pub type PFNGLSCISSORARRAYVPROC = + ::std::option::Option; +pub type PFNGLSCISSORINDEXEDPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + left: GLint, + bottom: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLSCISSORINDEXEDVPROC = + ::std::option::Option; +pub type PFNGLDEPTHRANGEARRAYVPROC = + ::std::option::Option; +pub type PFNGLDEPTHRANGEINDEXEDPROC = + ::std::option::Option; +pub type PFNGLGETFLOATI_VPROC = + ::std::option::Option; +pub type PFNGLGETDOUBLEI_VPROC = + ::std::option::Option; +extern "C" { + pub fn glReleaseShaderCompiler(); +} +extern "C" { + pub fn glShaderBinary( + count: GLsizei, + shaders: *const GLuint, + binaryformat: GLenum, + binary: *const ::std::os::raw::c_void, + length: GLsizei, + ); +} +extern "C" { + pub fn glGetShaderPrecisionFormat( + shadertype: GLenum, + precisiontype: GLenum, + range: *mut GLint, + precision: *mut GLint, + ); +} +extern "C" { + pub fn glDepthRangef(n: GLfloat, f: GLfloat); +} +extern "C" { + pub fn glClearDepthf(d: GLfloat); +} +extern "C" { + pub fn glGetProgramBinary( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + binaryFormat: *mut GLenum, + binary: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glProgramBinary( + program: GLuint, + binaryFormat: GLenum, + binary: *const ::std::os::raw::c_void, + length: GLsizei, + ); +} +extern "C" { + pub fn glProgramParameteri(program: GLuint, pname: GLenum, value: GLint); +} +extern "C" { + pub fn glUseProgramStages(pipeline: GLuint, stages: GLbitfield, program: GLuint); +} +extern "C" { + pub fn glActiveShaderProgram(pipeline: GLuint, program: GLuint); +} +extern "C" { + pub fn glCreateShaderProgramv( + type_: GLenum, + count: GLsizei, + strings: *const *const GLchar, + ) -> GLuint; +} +extern "C" { + pub fn glBindProgramPipeline(pipeline: GLuint); +} +extern "C" { + pub fn glDeleteProgramPipelines(n: GLsizei, pipelines: *const GLuint); +} +extern "C" { + pub fn glGenProgramPipelines(n: GLsizei, pipelines: *mut GLuint); +} +extern "C" { + pub fn glIsProgramPipeline(pipeline: GLuint) -> GLboolean; +} +extern "C" { + pub fn glGetProgramPipelineiv(pipeline: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glProgramUniform1i(program: GLuint, location: GLint, v0: GLint); +} +extern "C" { + pub fn glProgramUniform1iv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform1f(program: GLuint, location: GLint, v0: GLfloat); +} +extern "C" { + pub fn glProgramUniform1fv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform1d(program: GLuint, location: GLint, v0: GLdouble); +} +extern "C" { + pub fn glProgramUniform1dv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform1ui(program: GLuint, location: GLint, v0: GLuint); +} +extern "C" { + pub fn glProgramUniform1uiv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniform2i(program: GLuint, location: GLint, v0: GLint, v1: GLint); +} +extern "C" { + pub fn glProgramUniform2iv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform2f(program: GLuint, location: GLint, v0: GLfloat, v1: GLfloat); +} +extern "C" { + pub fn glProgramUniform2fv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform2d(program: GLuint, location: GLint, v0: GLdouble, v1: GLdouble); +} +extern "C" { + pub fn glProgramUniform2dv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform2ui(program: GLuint, location: GLint, v0: GLuint, v1: GLuint); +} +extern "C" { + pub fn glProgramUniform2uiv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniform3i(program: GLuint, location: GLint, v0: GLint, v1: GLint, v2: GLint); +} +extern "C" { + pub fn glProgramUniform3iv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform3f( + program: GLuint, + location: GLint, + v0: GLfloat, + v1: GLfloat, + v2: GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform3fv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform3d( + program: GLuint, + location: GLint, + v0: GLdouble, + v1: GLdouble, + v2: GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform3dv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform3ui( + program: GLuint, + location: GLint, + v0: GLuint, + v1: GLuint, + v2: GLuint, + ); +} +extern "C" { + pub fn glProgramUniform3uiv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniform4i( + program: GLuint, + location: GLint, + v0: GLint, + v1: GLint, + v2: GLint, + v3: GLint, + ); +} +extern "C" { + pub fn glProgramUniform4iv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform4f( + program: GLuint, + location: GLint, + v0: GLfloat, + v1: GLfloat, + v2: GLfloat, + v3: GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform4fv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform4d( + program: GLuint, + location: GLint, + v0: GLdouble, + v1: GLdouble, + v2: GLdouble, + v3: GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform4dv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform4ui( + program: GLuint, + location: GLint, + v0: GLuint, + v1: GLuint, + v2: GLuint, + v3: GLuint, + ); +} +extern "C" { + pub fn glProgramUniform4uiv( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x3fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x2fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x4fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x2fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x4fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x3fv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x3dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x2dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x4dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x2dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x4dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x3dv( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glValidateProgramPipeline(pipeline: GLuint); +} +extern "C" { + pub fn glGetProgramPipelineInfoLog( + pipeline: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +extern "C" { + pub fn glVertexAttribL1d(index: GLuint, x: GLdouble); +} +extern "C" { + pub fn glVertexAttribL2d(index: GLuint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertexAttribL3d(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertexAttribL4d(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertexAttribL1dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribL2dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribL3dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribL4dv(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribLPointer( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetVertexAttribLdv(index: GLuint, pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glViewportArrayv(first: GLuint, count: GLsizei, v: *const GLfloat); +} +extern "C" { + pub fn glViewportIndexedf(index: GLuint, x: GLfloat, y: GLfloat, w: GLfloat, h: GLfloat); +} +extern "C" { + pub fn glViewportIndexedfv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glScissorArrayv(first: GLuint, count: GLsizei, v: *const GLint); +} +extern "C" { + pub fn glScissorIndexed( + index: GLuint, + left: GLint, + bottom: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glScissorIndexedv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glDepthRangeArrayv(first: GLuint, count: GLsizei, v: *const GLdouble); +} +extern "C" { + pub fn glDepthRangeIndexed(index: GLuint, n: GLdouble, f: GLdouble); +} +extern "C" { + pub fn glGetFloati_v(target: GLenum, index: GLuint, data: *mut GLfloat); +} +extern "C" { + pub fn glGetDoublei_v(target: GLenum, index: GLuint, data: *mut GLdouble); +} +pub type PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + first: GLint, + count: GLsizei, + instancecount: GLsizei, + baseinstance: GLuint, + ), +>; +pub type PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + baseinstance: GLuint, + ), +>; +pub type PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + basevertex: GLint, + baseinstance: GLuint, + ), +>; +pub type PFNGLGETINTERNALFORMATIVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint, + ), +>; +pub type PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, bufferIndex: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLBINDIMAGETEXTUREPROC = ::std::option::Option< + unsafe extern "C" fn( + unit: GLuint, + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + access: GLenum, + format: GLenum, + ), +>; +pub type PFNGLMEMORYBARRIERPROC = ::std::option::Option; +pub type PFNGLTEXSTORAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei), +>; +pub type PFNGLTEXSTORAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLTEXSTORAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ), +>; +pub type PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC = + ::std::option::Option; +pub type PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, id: GLuint, stream: GLuint, instancecount: GLsizei), +>; +extern "C" { + pub fn glDrawArraysInstancedBaseInstance( + mode: GLenum, + first: GLint, + count: GLsizei, + instancecount: GLsizei, + baseinstance: GLuint, + ); +} +extern "C" { + pub fn glDrawElementsInstancedBaseInstance( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + baseinstance: GLuint, + ); +} +extern "C" { + pub fn glDrawElementsInstancedBaseVertexBaseInstance( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + basevertex: GLint, + baseinstance: GLuint, + ); +} +extern "C" { + pub fn glGetInternalformativ( + target: GLenum, + internalformat: GLenum, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetActiveAtomicCounterBufferiv( + program: GLuint, + bufferIndex: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glBindImageTexture( + unit: GLuint, + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + access: GLenum, + format: GLenum, + ); +} +extern "C" { + pub fn glMemoryBarrier(barriers: GLbitfield); +} +extern "C" { + pub fn glTexStorage1D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei); +} +extern "C" { + pub fn glTexStorage2D( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glTexStorage3D( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +extern "C" { + pub fn glDrawTransformFeedbackInstanced(mode: GLenum, id: GLuint, instancecount: GLsizei); +} +extern "C" { + pub fn glDrawTransformFeedbackStreamInstanced( + mode: GLenum, + id: GLuint, + stream: GLuint, + instancecount: GLsizei, + ); +} +pub type GLDEBUGPROC = ::std::option::Option< + unsafe extern "C" fn( + source: GLenum, + type_: GLenum, + id: GLuint, + severity: GLenum, + length: GLsizei, + message: *const GLchar, + userParam: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCLEARBUFFERDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCLEARBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + offset: GLintptr, + size: GLsizeiptr, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLDISPATCHCOMPUTEPROC = ::std::option::Option< + unsafe extern "C" fn(num_groups_x: GLuint, num_groups_y: GLuint, num_groups_z: GLuint), +>; +pub type PFNGLDISPATCHCOMPUTEINDIRECTPROC = + ::std::option::Option; +pub type PFNGLCOPYIMAGESUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + srcWidth: GLsizei, + srcHeight: GLsizei, + srcDepth: GLsizei, + ), +>; +pub type PFNGLFRAMEBUFFERPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLGETFRAMEBUFFERPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLGETINTERNALFORMATI64VPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint64, + ), +>; +pub type PFNGLINVALIDATETEXSUBIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ), +>; +pub type PFNGLINVALIDATETEXIMAGEPROC = + ::std::option::Option; +pub type PFNGLINVALIDATEBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, offset: GLintptr, length: GLsizeiptr), +>; +pub type PFNGLINVALIDATEBUFFERDATAPROC = + ::std::option::Option; +pub type PFNGLINVALIDATEFRAMEBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, numAttachments: GLsizei, attachments: *const GLenum), +>; +pub type PFNGLINVALIDATESUBFRAMEBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + numAttachments: GLsizei, + attachments: *const GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWARRAYSINDIRECTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLsizei, + stride: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSINDIRECTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLsizei, + stride: GLsizei, + ), +>; +pub type PFNGLGETPROGRAMINTERFACEIVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + programInterface: GLenum, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLGETPROGRAMRESOURCEINDEXPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, programInterface: GLenum, name: *const GLchar) -> GLuint, +>; +pub type PFNGLGETPROGRAMRESOURCENAMEPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + programInterface: GLenum, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + name: *mut GLchar, + ), +>; +pub type PFNGLGETPROGRAMRESOURCEIVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + programInterface: GLenum, + index: GLuint, + propCount: GLsizei, + props: *const GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + params: *mut GLint, + ), +>; +pub type PFNGLGETPROGRAMRESOURCELOCATIONPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, programInterface: GLenum, name: *const GLchar) -> GLint, +>; +pub type PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, programInterface: GLenum, name: *const GLchar) -> GLint, +>; +pub type PFNGLSHADERSTORAGEBLOCKBINDINGPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, storageBlockIndex: GLuint, storageBlockBinding: GLuint), +>; +pub type PFNGLTEXBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLTEXSTORAGE2DMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLTEXSTORAGE3DMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLTEXTUREVIEWPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + origtexture: GLuint, + internalformat: GLenum, + minlevel: GLuint, + numlevels: GLuint, + minlayer: GLuint, + numlayers: GLuint, + ), +>; +pub type PFNGLBINDVERTEXBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn(bindingindex: GLuint, buffer: GLuint, offset: GLintptr, stride: GLsizei), +>; +pub type PFNGLVERTEXATTRIBFORMATPROC = ::std::option::Option< + unsafe extern "C" fn( + attribindex: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXATTRIBIFORMATPROC = ::std::option::Option< + unsafe extern "C" fn(attribindex: GLuint, size: GLint, type_: GLenum, relativeoffset: GLuint), +>; +pub type PFNGLVERTEXATTRIBLFORMATPROC = ::std::option::Option< + unsafe extern "C" fn(attribindex: GLuint, size: GLint, type_: GLenum, relativeoffset: GLuint), +>; +pub type PFNGLVERTEXATTRIBBINDINGPROC = + ::std::option::Option; +pub type PFNGLVERTEXBINDINGDIVISORPROC = + ::std::option::Option; +pub type PFNGLDEBUGMESSAGECONTROLPROC = ::std::option::Option< + unsafe extern "C" fn( + source: GLenum, + type_: GLenum, + severity: GLenum, + count: GLsizei, + ids: *const GLuint, + enabled: GLboolean, + ), +>; +pub type PFNGLDEBUGMESSAGEINSERTPROC = ::std::option::Option< + unsafe extern "C" fn( + source: GLenum, + type_: GLenum, + id: GLuint, + severity: GLenum, + length: GLsizei, + buf: *const GLchar, + ), +>; +pub type PFNGLDEBUGMESSAGECALLBACKPROC = ::std::option::Option< + unsafe extern "C" fn(callback: GLDEBUGPROC, userParam: *const ::std::os::raw::c_void), +>; +pub type PFNGLGETDEBUGMESSAGELOGPROC = ::std::option::Option< + unsafe extern "C" fn( + count: GLuint, + bufSize: GLsizei, + sources: *mut GLenum, + types: *mut GLenum, + ids: *mut GLuint, + severities: *mut GLenum, + lengths: *mut GLsizei, + messageLog: *mut GLchar, + ) -> GLuint, +>; +pub type PFNGLPUSHDEBUGGROUPPROC = ::std::option::Option< + unsafe extern "C" fn(source: GLenum, id: GLuint, length: GLsizei, message: *const GLchar), +>; +pub type PFNGLPOPDEBUGGROUPPROC = ::std::option::Option; +pub type PFNGLOBJECTLABELPROC = ::std::option::Option< + unsafe extern "C" fn(identifier: GLenum, name: GLuint, length: GLsizei, label: *const GLchar), +>; +pub type PFNGLGETOBJECTLABELPROC = ::std::option::Option< + unsafe extern "C" fn( + identifier: GLenum, + name: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + label: *mut GLchar, + ), +>; +pub type PFNGLOBJECTPTRLABELPROC = ::std::option::Option< + unsafe extern "C" fn(ptr: *const ::std::os::raw::c_void, length: GLsizei, label: *const GLchar), +>; +pub type PFNGLGETOBJECTPTRLABELPROC = ::std::option::Option< + unsafe extern "C" fn( + ptr: *const ::std::os::raw::c_void, + bufSize: GLsizei, + length: *mut GLsizei, + label: *mut GLchar, + ), +>; +extern "C" { + pub fn glClearBufferData( + target: GLenum, + internalformat: GLenum, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glClearBufferSubData( + target: GLenum, + internalformat: GLenum, + offset: GLintptr, + size: GLsizeiptr, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glDispatchCompute(num_groups_x: GLuint, num_groups_y: GLuint, num_groups_z: GLuint); +} +extern "C" { + pub fn glDispatchComputeIndirect(indirect: GLintptr); +} +extern "C" { + pub fn glCopyImageSubData( + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + srcWidth: GLsizei, + srcHeight: GLsizei, + srcDepth: GLsizei, + ); +} +extern "C" { + pub fn glFramebufferParameteri(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glGetFramebufferParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetInternalformati64v( + target: GLenum, + internalformat: GLenum, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint64, + ); +} +extern "C" { + pub fn glInvalidateTexSubImage( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +extern "C" { + pub fn glInvalidateTexImage(texture: GLuint, level: GLint); +} +extern "C" { + pub fn glInvalidateBufferSubData(buffer: GLuint, offset: GLintptr, length: GLsizeiptr); +} +extern "C" { + pub fn glInvalidateBufferData(buffer: GLuint); +} +extern "C" { + pub fn glInvalidateFramebuffer( + target: GLenum, + numAttachments: GLsizei, + attachments: *const GLenum, + ); +} +extern "C" { + pub fn glInvalidateSubFramebuffer( + target: GLenum, + numAttachments: GLsizei, + attachments: *const GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawArraysIndirect( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLsizei, + stride: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElementsIndirect( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLsizei, + stride: GLsizei, + ); +} +extern "C" { + pub fn glGetProgramInterfaceiv( + program: GLuint, + programInterface: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetProgramResourceIndex( + program: GLuint, + programInterface: GLenum, + name: *const GLchar, + ) -> GLuint; +} +extern "C" { + pub fn glGetProgramResourceName( + program: GLuint, + programInterface: GLenum, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetProgramResourceiv( + program: GLuint, + programInterface: GLenum, + index: GLuint, + propCount: GLsizei, + props: *const GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetProgramResourceLocation( + program: GLuint, + programInterface: GLenum, + name: *const GLchar, + ) -> GLint; +} +extern "C" { + pub fn glGetProgramResourceLocationIndex( + program: GLuint, + programInterface: GLenum, + name: *const GLchar, + ) -> GLint; +} +extern "C" { + pub fn glShaderStorageBlockBinding( + program: GLuint, + storageBlockIndex: GLuint, + storageBlockBinding: GLuint, + ); +} +extern "C" { + pub fn glTexBufferRange( + target: GLenum, + internalformat: GLenum, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glTexStorage2DMultisample( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glTexStorage3DMultisample( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureView( + texture: GLuint, + target: GLenum, + origtexture: GLuint, + internalformat: GLenum, + minlevel: GLuint, + numlevels: GLuint, + minlayer: GLuint, + numlayers: GLuint, + ); +} +extern "C" { + pub fn glBindVertexBuffer( + bindingindex: GLuint, + buffer: GLuint, + offset: GLintptr, + stride: GLsizei, + ); +} +extern "C" { + pub fn glVertexAttribFormat( + attribindex: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexAttribIFormat( + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexAttribLFormat( + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexAttribBinding(attribindex: GLuint, bindingindex: GLuint); +} +extern "C" { + pub fn glVertexBindingDivisor(bindingindex: GLuint, divisor: GLuint); +} +extern "C" { + pub fn glDebugMessageControl( + source: GLenum, + type_: GLenum, + severity: GLenum, + count: GLsizei, + ids: *const GLuint, + enabled: GLboolean, + ); +} +extern "C" { + pub fn glDebugMessageInsert( + source: GLenum, + type_: GLenum, + id: GLuint, + severity: GLenum, + length: GLsizei, + buf: *const GLchar, + ); +} +extern "C" { + pub fn glDebugMessageCallback(callback: GLDEBUGPROC, userParam: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glGetDebugMessageLog( + count: GLuint, + bufSize: GLsizei, + sources: *mut GLenum, + types: *mut GLenum, + ids: *mut GLuint, + severities: *mut GLenum, + lengths: *mut GLsizei, + messageLog: *mut GLchar, + ) -> GLuint; +} +extern "C" { + pub fn glPushDebugGroup(source: GLenum, id: GLuint, length: GLsizei, message: *const GLchar); +} +extern "C" { + pub fn glPopDebugGroup(); +} +extern "C" { + pub fn glObjectLabel(identifier: GLenum, name: GLuint, length: GLsizei, label: *const GLchar); +} +extern "C" { + pub fn glGetObjectLabel( + identifier: GLenum, + name: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + label: *mut GLchar, + ); +} +extern "C" { + pub fn glObjectPtrLabel( + ptr: *const ::std::os::raw::c_void, + length: GLsizei, + label: *const GLchar, + ); +} +extern "C" { + pub fn glGetObjectPtrLabel( + ptr: *const ::std::os::raw::c_void, + bufSize: GLsizei, + length: *mut GLsizei, + label: *mut GLchar, + ); +} +pub type PFNGLBUFFERSTORAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + flags: GLbitfield, + ), +>; +pub type PFNGLCLEARTEXIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCLEARTEXSUBIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLBINDBUFFERSBASEPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, first: GLuint, count: GLsizei, buffers: *const GLuint), +>; +pub type PFNGLBINDBUFFERSRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + first: GLuint, + count: GLsizei, + buffers: *const GLuint, + offsets: *const GLintptr, + sizes: *const GLsizeiptr, + ), +>; +pub type PFNGLBINDTEXTURESPROC = ::std::option::Option< + unsafe extern "C" fn(first: GLuint, count: GLsizei, textures: *const GLuint), +>; +pub type PFNGLBINDSAMPLERSPROC = ::std::option::Option< + unsafe extern "C" fn(first: GLuint, count: GLsizei, samplers: *const GLuint), +>; +pub type PFNGLBINDIMAGETEXTURESPROC = ::std::option::Option< + unsafe extern "C" fn(first: GLuint, count: GLsizei, textures: *const GLuint), +>; +pub type PFNGLBINDVERTEXBUFFERSPROC = ::std::option::Option< + unsafe extern "C" fn( + first: GLuint, + count: GLsizei, + buffers: *const GLuint, + offsets: *const GLintptr, + strides: *const GLsizei, + ), +>; +extern "C" { + pub fn glBufferStorage( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + flags: GLbitfield, + ); +} +extern "C" { + pub fn glClearTexImage( + texture: GLuint, + level: GLint, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glClearTexSubImage( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glBindBuffersBase(target: GLenum, first: GLuint, count: GLsizei, buffers: *const GLuint); +} +extern "C" { + pub fn glBindBuffersRange( + target: GLenum, + first: GLuint, + count: GLsizei, + buffers: *const GLuint, + offsets: *const GLintptr, + sizes: *const GLsizeiptr, + ); +} +extern "C" { + pub fn glBindTextures(first: GLuint, count: GLsizei, textures: *const GLuint); +} +extern "C" { + pub fn glBindSamplers(first: GLuint, count: GLsizei, samplers: *const GLuint); +} +extern "C" { + pub fn glBindImageTextures(first: GLuint, count: GLsizei, textures: *const GLuint); +} +extern "C" { + pub fn glBindVertexBuffers( + first: GLuint, + count: GLsizei, + buffers: *const GLuint, + offsets: *const GLintptr, + strides: *const GLsizei, + ); +} +pub type PFNGLCLIPCONTROLPROC = + ::std::option::Option; +pub type PFNGLCREATETRANSFORMFEEDBACKSPROC = + ::std::option::Option; +pub type PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC = + ::std::option::Option; +pub type PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + xfb: GLuint, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLGETTRANSFORMFEEDBACKIVPROC = + ::std::option::Option; +pub type PFNGLGETTRANSFORMFEEDBACKI_VPROC = ::std::option::Option< + unsafe extern "C" fn(xfb: GLuint, pname: GLenum, index: GLuint, param: *mut GLint), +>; +pub type PFNGLGETTRANSFORMFEEDBACKI64_VPROC = ::std::option::Option< + unsafe extern "C" fn(xfb: GLuint, pname: GLenum, index: GLuint, param: *mut GLint64), +>; +pub type PFNGLCREATEBUFFERSPROC = + ::std::option::Option; +pub type PFNGLNAMEDBUFFERSTORAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + flags: GLbitfield, + ), +>; +pub type PFNGLNAMEDBUFFERDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ), +>; +pub type PFNGLNAMEDBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYNAMEDBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLCLEARNAMEDBUFFERDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + internalformat: GLenum, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCLEARNAMEDBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + internalformat: GLenum, + offset: GLintptr, + size: GLsizeiptr, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMAPNAMEDBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, access: GLenum) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLMAPNAMEDBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLUNMAPNAMEDBUFFERPROC = + ::std::option::Option GLboolean>; +pub type PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, offset: GLintptr, length: GLsizeiptr), +>; +pub type PFNGLGETNAMEDBUFFERPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLGETNAMEDBUFFERPARAMETERI64VPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut GLint64), +>; +pub type PFNGLGETNAMEDBUFFERPOINTERVPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLGETNAMEDBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLCREATEFRAMEBUFFERSPROC = + ::std::option::Option; +pub type PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLNAMEDFRAMEBUFFERTEXTUREPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, attachment: GLenum, texture: GLuint, level: GLint), +>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC = + ::std::option::Option; +pub type PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, n: GLsizei, bufs: *const GLenum), +>; +pub type PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC = + ::std::option::Option; +pub type PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, numAttachments: GLsizei, attachments: *const GLenum), +>; +pub type PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + numAttachments: GLsizei, + attachments: *const GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLCLEARNAMEDFRAMEBUFFERIVPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + value: *const GLint, + ), +>; +pub type PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + value: *const GLuint, + ), +>; +pub type PFNGLCLEARNAMEDFRAMEBUFFERFVPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + value: *const GLfloat, + ), +>; +pub type PFNGLCLEARNAMEDFRAMEBUFFERFIPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + depth: GLfloat, + stencil: GLint, + ), +>; +pub type PFNGLBLITNAMEDFRAMEBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn( + readFramebuffer: GLuint, + drawFramebuffer: GLuint, + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ), +>; +pub type PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC = + ::std::option::Option GLenum>; +pub type PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, pname: GLenum, param: *mut GLint), +>; +pub type PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLCREATERENDERBUFFERSPROC = + ::std::option::Option; +pub type PFNGLNAMEDRENDERBUFFERSTORAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + renderbuffer: GLuint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + renderbuffer: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn(renderbuffer: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLCREATETEXTURESPROC = + ::std::option::Option; +pub type PFNGLTEXTUREBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, internalformat: GLenum, buffer: GLuint), +>; +pub type PFNGLTEXTUREBUFFERRANGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + internalformat: GLenum, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLTEXTURESTORAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, levels: GLsizei, internalformat: GLenum, width: GLsizei), +>; +pub type PFNGLTEXTURESTORAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLTEXTURESTORAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ), +>; +pub type PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLTEXTURESUBIMAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTURESUBIMAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTURESUBIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYTEXTURESUBIMAGE1DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ), +>; +pub type PFNGLCOPYTEXTURESUBIMAGE2DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLCOPYTEXTURESUBIMAGE3DPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLTEXTUREPARAMETERFPROC = + ::std::option::Option; +pub type PFNGLTEXTUREPARAMETERFVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, pname: GLenum, param: *const GLfloat), +>; +pub type PFNGLTEXTUREPARAMETERIPROC = + ::std::option::Option; +pub type PFNGLTEXTUREPARAMETERIIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, pname: GLenum, params: *const GLint), +>; +pub type PFNGLTEXTUREPARAMETERIUIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, pname: GLenum, params: *const GLuint), +>; +pub type PFNGLTEXTUREPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, pname: GLenum, param: *const GLint), +>; +pub type PFNGLGENERATETEXTUREMIPMAPPROC = + ::std::option::Option; +pub type PFNGLBINDTEXTUREUNITPROC = + ::std::option::Option; +pub type PFNGLGETTEXTUREIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETTEXTURELEVELPARAMETERFVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, level: GLint, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETTEXTURELEVELPARAMETERIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, level: GLint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETTEXTUREPARAMETERFVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETTEXTUREPARAMETERIIVPROC = + ::std::option::Option; +pub type PFNGLGETTEXTUREPARAMETERIUIVPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, pname: GLenum, params: *mut GLuint), +>; +pub type PFNGLGETTEXTUREPARAMETERIVPROC = + ::std::option::Option; +pub type PFNGLCREATEVERTEXARRAYSPROC = + ::std::option::Option; +pub type PFNGLDISABLEVERTEXARRAYATTRIBPROC = + ::std::option::Option; +pub type PFNGLENABLEVERTEXARRAYATTRIBPROC = + ::std::option::Option; +pub type PFNGLVERTEXARRAYELEMENTBUFFERPROC = + ::std::option::Option; +pub type PFNGLVERTEXARRAYVERTEXBUFFERPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + bindingindex: GLuint, + buffer: GLuint, + offset: GLintptr, + stride: GLsizei, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXBUFFERSPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + first: GLuint, + count: GLsizei, + buffers: *const GLuint, + offsets: *const GLintptr, + strides: *const GLsizei, + ), +>; +pub type PFNGLVERTEXARRAYATTRIBBINDINGPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, attribindex: GLuint, bindingindex: GLuint), +>; +pub type PFNGLVERTEXARRAYATTRIBFORMATPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXARRAYATTRIBIFORMATPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXARRAYATTRIBLFORMATPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXARRAYBINDINGDIVISORPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, bindingindex: GLuint, divisor: GLuint), +>; +pub type PFNGLGETVERTEXARRAYIVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXARRAYINDEXEDIVPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, index: GLuint, pname: GLenum, param: *mut GLint), +>; +pub type PFNGLGETVERTEXARRAYINDEXED64IVPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, index: GLuint, pname: GLenum, param: *mut GLint64), +>; +pub type PFNGLCREATESAMPLERSPROC = + ::std::option::Option; +pub type PFNGLCREATEPROGRAMPIPELINESPROC = + ::std::option::Option; +pub type PFNGLCREATEQUERIESPROC = + ::std::option::Option; +pub type PFNGLGETQUERYBUFFEROBJECTI64VPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr), +>; +pub type PFNGLGETQUERYBUFFEROBJECTIVPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr), +>; +pub type PFNGLGETQUERYBUFFEROBJECTUI64VPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr), +>; +pub type PFNGLGETQUERYBUFFEROBJECTUIVPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr), +>; +pub type PFNGLMEMORYBARRIERBYREGIONPROC = + ::std::option::Option; +pub type PFNGLGETTEXTURESUBIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETGRAPHICSRESETSTATUSPROC = ::std::option::Option GLenum>; +pub type PFNGLGETNCOMPRESSEDTEXIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + lod: GLint, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNTEXIMAGEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNUNIFORMDVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLdouble), +>; +pub type PFNGLGETNUNIFORMFVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLfloat), +>; +pub type PFNGLGETNUNIFORMIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLint), +>; +pub type PFNGLGETNUNIFORMUIVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLuint), +>; +pub type PFNGLREADNPIXELSPROC = ::std::option::Option< + unsafe extern "C" fn( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNMAPDVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLdouble), +>; +pub type PFNGLGETNMAPFVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLfloat), +>; +pub type PFNGLGETNMAPIVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLint), +>; +pub type PFNGLGETNPIXELMAPFVPROC = ::std::option::Option< + unsafe extern "C" fn(map: GLenum, bufSize: GLsizei, values: *mut GLfloat), +>; +pub type PFNGLGETNPIXELMAPUIVPROC = + ::std::option::Option; +pub type PFNGLGETNPIXELMAPUSVPROC = ::std::option::Option< + unsafe extern "C" fn(map: GLenum, bufSize: GLsizei, values: *mut GLushort), +>; +pub type PFNGLGETNPOLYGONSTIPPLEPROC = + ::std::option::Option; +pub type PFNGLGETNCOLORTABLEPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + table: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNCONVOLUTIONFILTERPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + image: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNSEPARABLEFILTERPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + rowBufSize: GLsizei, + row: *mut ::std::os::raw::c_void, + columnBufSize: GLsizei, + column: *mut ::std::os::raw::c_void, + span: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNHISTOGRAMPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNMINMAXPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTUREBARRIERPROC = ::std::option::Option; +extern "C" { + pub fn glClipControl(origin: GLenum, depth: GLenum); +} +extern "C" { + pub fn glCreateTransformFeedbacks(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glTransformFeedbackBufferBase(xfb: GLuint, index: GLuint, buffer: GLuint); +} +extern "C" { + pub fn glTransformFeedbackBufferRange( + xfb: GLuint, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glGetTransformFeedbackiv(xfb: GLuint, pname: GLenum, param: *mut GLint); +} +extern "C" { + pub fn glGetTransformFeedbacki_v(xfb: GLuint, pname: GLenum, index: GLuint, param: *mut GLint); +} +extern "C" { + pub fn glGetTransformFeedbacki64_v( + xfb: GLuint, + pname: GLenum, + index: GLuint, + param: *mut GLint64, + ); +} +extern "C" { + pub fn glCreateBuffers(n: GLsizei, buffers: *mut GLuint); +} +extern "C" { + pub fn glNamedBufferStorage( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + flags: GLbitfield, + ); +} +extern "C" { + pub fn glNamedBufferData( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ); +} +extern "C" { + pub fn glNamedBufferSubData( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyNamedBufferSubData( + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glClearNamedBufferData( + buffer: GLuint, + internalformat: GLenum, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glClearNamedBufferSubData( + buffer: GLuint, + internalformat: GLenum, + offset: GLintptr, + size: GLsizeiptr, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMapNamedBuffer(buffer: GLuint, access: GLenum) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glMapNamedBufferRange( + buffer: GLuint, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glUnmapNamedBuffer(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glFlushMappedNamedBufferRange(buffer: GLuint, offset: GLintptr, length: GLsizeiptr); +} +extern "C" { + pub fn glGetNamedBufferParameteriv(buffer: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetNamedBufferParameteri64v(buffer: GLuint, pname: GLenum, params: *mut GLint64); +} +extern "C" { + pub fn glGetNamedBufferPointerv( + buffer: GLuint, + pname: GLenum, + params: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetNamedBufferSubData( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCreateFramebuffers(n: GLsizei, framebuffers: *mut GLuint); +} +extern "C" { + pub fn glNamedFramebufferRenderbuffer( + framebuffer: GLuint, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ); +} +extern "C" { + pub fn glNamedFramebufferParameteri(framebuffer: GLuint, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glNamedFramebufferTexture( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferTextureLayer( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferDrawBuffer(framebuffer: GLuint, buf: GLenum); +} +extern "C" { + pub fn glNamedFramebufferDrawBuffers(framebuffer: GLuint, n: GLsizei, bufs: *const GLenum); +} +extern "C" { + pub fn glNamedFramebufferReadBuffer(framebuffer: GLuint, src: GLenum); +} +extern "C" { + pub fn glInvalidateNamedFramebufferData( + framebuffer: GLuint, + numAttachments: GLsizei, + attachments: *const GLenum, + ); +} +extern "C" { + pub fn glInvalidateNamedFramebufferSubData( + framebuffer: GLuint, + numAttachments: GLsizei, + attachments: *const GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glClearNamedFramebufferiv( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + value: *const GLint, + ); +} +extern "C" { + pub fn glClearNamedFramebufferuiv( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + value: *const GLuint, + ); +} +extern "C" { + pub fn glClearNamedFramebufferfv( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glClearNamedFramebufferfi( + framebuffer: GLuint, + buffer: GLenum, + drawbuffer: GLint, + depth: GLfloat, + stencil: GLint, + ); +} +extern "C" { + pub fn glBlitNamedFramebuffer( + readFramebuffer: GLuint, + drawFramebuffer: GLuint, + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ); +} +extern "C" { + pub fn glCheckNamedFramebufferStatus(framebuffer: GLuint, target: GLenum) -> GLenum; +} +extern "C" { + pub fn glGetNamedFramebufferParameteriv(framebuffer: GLuint, pname: GLenum, param: *mut GLint); +} +extern "C" { + pub fn glGetNamedFramebufferAttachmentParameteriv( + framebuffer: GLuint, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glCreateRenderbuffers(n: GLsizei, renderbuffers: *mut GLuint); +} +extern "C" { + pub fn glNamedRenderbufferStorage( + renderbuffer: GLuint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glNamedRenderbufferStorageMultisample( + renderbuffer: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetNamedRenderbufferParameteriv( + renderbuffer: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glCreateTextures(target: GLenum, n: GLsizei, textures: *mut GLuint); +} +extern "C" { + pub fn glTextureBuffer(texture: GLuint, internalformat: GLenum, buffer: GLuint); +} +extern "C" { + pub fn glTextureBufferRange( + texture: GLuint, + internalformat: GLenum, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glTextureStorage1D( + texture: GLuint, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + ); +} +extern "C" { + pub fn glTextureStorage2D( + texture: GLuint, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glTextureStorage3D( + texture: GLuint, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +extern "C" { + pub fn glTextureStorage2DMultisample( + texture: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureStorage3DMultisample( + texture: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureSubImage1D( + texture: GLuint, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureSubImage2D( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureSubImage3D( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureSubImage1D( + texture: GLuint, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureSubImage2D( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureSubImage3D( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyTextureSubImage1D( + texture: GLuint, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyTextureSubImage2D( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glCopyTextureSubImage3D( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glTextureParameterf(texture: GLuint, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glTextureParameterfv(texture: GLuint, pname: GLenum, param: *const GLfloat); +} +extern "C" { + pub fn glTextureParameteri(texture: GLuint, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glTextureParameterIiv(texture: GLuint, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glTextureParameterIuiv(texture: GLuint, pname: GLenum, params: *const GLuint); +} +extern "C" { + pub fn glTextureParameteriv(texture: GLuint, pname: GLenum, param: *const GLint); +} +extern "C" { + pub fn glGenerateTextureMipmap(texture: GLuint); +} +extern "C" { + pub fn glBindTextureUnit(unit: GLuint, texture: GLuint); +} +extern "C" { + pub fn glGetTextureImage( + texture: GLuint, + level: GLint, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetCompressedTextureImage( + texture: GLuint, + level: GLint, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetTextureLevelParameterfv( + texture: GLuint, + level: GLint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetTextureLevelParameteriv( + texture: GLuint, + level: GLint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetTextureParameterfv(texture: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetTextureParameterIiv(texture: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetTextureParameterIuiv(texture: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glGetTextureParameteriv(texture: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glCreateVertexArrays(n: GLsizei, arrays: *mut GLuint); +} +extern "C" { + pub fn glDisableVertexArrayAttrib(vaobj: GLuint, index: GLuint); +} +extern "C" { + pub fn glEnableVertexArrayAttrib(vaobj: GLuint, index: GLuint); +} +extern "C" { + pub fn glVertexArrayElementBuffer(vaobj: GLuint, buffer: GLuint); +} +extern "C" { + pub fn glVertexArrayVertexBuffer( + vaobj: GLuint, + bindingindex: GLuint, + buffer: GLuint, + offset: GLintptr, + stride: GLsizei, + ); +} +extern "C" { + pub fn glVertexArrayVertexBuffers( + vaobj: GLuint, + first: GLuint, + count: GLsizei, + buffers: *const GLuint, + offsets: *const GLintptr, + strides: *const GLsizei, + ); +} +extern "C" { + pub fn glVertexArrayAttribBinding(vaobj: GLuint, attribindex: GLuint, bindingindex: GLuint); +} +extern "C" { + pub fn glVertexArrayAttribFormat( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayAttribIFormat( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayAttribLFormat( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayBindingDivisor(vaobj: GLuint, bindingindex: GLuint, divisor: GLuint); +} +extern "C" { + pub fn glGetVertexArrayiv(vaobj: GLuint, pname: GLenum, param: *mut GLint); +} +extern "C" { + pub fn glGetVertexArrayIndexediv( + vaobj: GLuint, + index: GLuint, + pname: GLenum, + param: *mut GLint, + ); +} +extern "C" { + pub fn glGetVertexArrayIndexed64iv( + vaobj: GLuint, + index: GLuint, + pname: GLenum, + param: *mut GLint64, + ); +} +extern "C" { + pub fn glCreateSamplers(n: GLsizei, samplers: *mut GLuint); +} +extern "C" { + pub fn glCreateProgramPipelines(n: GLsizei, pipelines: *mut GLuint); +} +extern "C" { + pub fn glCreateQueries(target: GLenum, n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glGetQueryBufferObjecti64v(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr); +} +extern "C" { + pub fn glGetQueryBufferObjectiv(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr); +} +extern "C" { + pub fn glGetQueryBufferObjectui64v(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr); +} +extern "C" { + pub fn glGetQueryBufferObjectuiv(id: GLuint, buffer: GLuint, pname: GLenum, offset: GLintptr); +} +extern "C" { + pub fn glMemoryBarrierByRegion(barriers: GLbitfield); +} +extern "C" { + pub fn glGetTextureSubImage( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetCompressedTextureSubImage( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetGraphicsResetStatus() -> GLenum; +} +extern "C" { + pub fn glGetnCompressedTexImage( + target: GLenum, + lod: GLint, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnTexImage( + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnUniformdv( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLdouble, + ); +} +extern "C" { + pub fn glGetnUniformfv( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetnUniformiv(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLint); +} +extern "C" { + pub fn glGetnUniformuiv( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glReadnPixels( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnMapdv(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLdouble); +} +extern "C" { + pub fn glGetnMapfv(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLfloat); +} +extern "C" { + pub fn glGetnMapiv(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLint); +} +extern "C" { + pub fn glGetnPixelMapfv(map: GLenum, bufSize: GLsizei, values: *mut GLfloat); +} +extern "C" { + pub fn glGetnPixelMapuiv(map: GLenum, bufSize: GLsizei, values: *mut GLuint); +} +extern "C" { + pub fn glGetnPixelMapusv(map: GLenum, bufSize: GLsizei, values: *mut GLushort); +} +extern "C" { + pub fn glGetnPolygonStipple(bufSize: GLsizei, pattern: *mut GLubyte); +} +extern "C" { + pub fn glGetnColorTable( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + table: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnConvolutionFilter( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + image: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnSeparableFilter( + target: GLenum, + format: GLenum, + type_: GLenum, + rowBufSize: GLsizei, + row: *mut ::std::os::raw::c_void, + columnBufSize: GLsizei, + column: *mut ::std::os::raw::c_void, + span: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnHistogram( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnMinmax( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureBarrier(); +} +pub type PFNGLSPECIALIZESHADERPROC = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + pEntryPoint: *const GLchar, + numSpecializationConstants: GLuint, + pConstantIndex: *const GLuint, + pConstantValue: *const GLuint, + ), +>; +pub type PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ), +>; +pub type PFNGLPOLYGONOFFSETCLAMPPROC = + ::std::option::Option; +extern "C" { + pub fn glSpecializeShader( + shader: GLuint, + pEntryPoint: *const GLchar, + numSpecializationConstants: GLuint, + pConstantIndex: *const GLuint, + pConstantValue: *const GLuint, + ); +} +extern "C" { + pub fn glMultiDrawArraysIndirectCount( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElementsIndirectCount( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ); +} +extern "C" { + pub fn glPolygonOffsetClamp(factor: GLfloat, units: GLfloat, clamp: GLfloat); +} +pub type PFNGLPRIMITIVEBOUNDINGBOXARBPROC = ::std::option::Option< + unsafe extern "C" fn( + minX: GLfloat, + minY: GLfloat, + minZ: GLfloat, + minW: GLfloat, + maxX: GLfloat, + maxY: GLfloat, + maxZ: GLfloat, + maxW: GLfloat, + ), +>; +extern "C" { + pub fn glPrimitiveBoundingBoxARB( + minX: GLfloat, + minY: GLfloat, + minZ: GLfloat, + minW: GLfloat, + maxX: GLfloat, + maxY: GLfloat, + maxZ: GLfloat, + maxW: GLfloat, + ); +} +pub type GLuint64EXT = khronos_uint64_t; +pub type PFNGLGETTEXTUREHANDLEARBPROC = + ::std::option::Option GLuint64>; +pub type PFNGLGETTEXTURESAMPLERHANDLEARBPROC = + ::std::option::Option GLuint64>; +pub type PFNGLMAKETEXTUREHANDLERESIDENTARBPROC = + ::std::option::Option; +pub type PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC = + ::std::option::Option; +pub type PFNGLGETIMAGEHANDLEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + format: GLenum, + ) -> GLuint64, +>; +pub type PFNGLMAKEIMAGEHANDLERESIDENTARBPROC = + ::std::option::Option; +pub type PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORMHANDLEUI64ARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORMHANDLEUI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, values: *const GLuint64), +>; +pub type PFNGLISTEXTUREHANDLERESIDENTARBPROC = + ::std::option::Option GLboolean>; +pub type PFNGLISIMAGEHANDLERESIDENTARBPROC = + ::std::option::Option GLboolean>; +pub type PFNGLVERTEXATTRIBL1UI64ARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL1UI64VARBPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBLUI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLuint64EXT), +>; +extern "C" { + pub fn glGetTextureHandleARB(texture: GLuint) -> GLuint64; +} +extern "C" { + pub fn glGetTextureSamplerHandleARB(texture: GLuint, sampler: GLuint) -> GLuint64; +} +extern "C" { + pub fn glMakeTextureHandleResidentARB(handle: GLuint64); +} +extern "C" { + pub fn glMakeTextureHandleNonResidentARB(handle: GLuint64); +} +extern "C" { + pub fn glGetImageHandleARB( + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + format: GLenum, + ) -> GLuint64; +} +extern "C" { + pub fn glMakeImageHandleResidentARB(handle: GLuint64, access: GLenum); +} +extern "C" { + pub fn glMakeImageHandleNonResidentARB(handle: GLuint64); +} +extern "C" { + pub fn glUniformHandleui64ARB(location: GLint, value: GLuint64); +} +extern "C" { + pub fn glUniformHandleui64vARB(location: GLint, count: GLsizei, value: *const GLuint64); +} +extern "C" { + pub fn glProgramUniformHandleui64ARB(program: GLuint, location: GLint, value: GLuint64); +} +extern "C" { + pub fn glProgramUniformHandleui64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + values: *const GLuint64, + ); +} +extern "C" { + pub fn glIsTextureHandleResidentARB(handle: GLuint64) -> GLboolean; +} +extern "C" { + pub fn glIsImageHandleResidentARB(handle: GLuint64) -> GLboolean; +} +extern "C" { + pub fn glVertexAttribL1ui64ARB(index: GLuint, x: GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL1ui64vARB(index: GLuint, v: *const GLuint64EXT); +} +extern "C" { + pub fn glGetVertexAttribLui64vARB(index: GLuint, pname: GLenum, params: *mut GLuint64EXT); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _cl_context { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _cl_event { + _unused: [u8; 0], +} +pub type PFNGLCREATESYNCFROMCLEVENTARBPROC = ::std::option::Option< + unsafe extern "C" fn( + context: *mut _cl_context, + event: *mut _cl_event, + flags: GLbitfield, + ) -> GLsync, +>; +extern "C" { + pub fn glCreateSyncFromCLeventARB( + context: *mut _cl_context, + event: *mut _cl_event, + flags: GLbitfield, + ) -> GLsync; +} +pub type PFNGLCLAMPCOLORARBPROC = + ::std::option::Option; +extern "C" { + pub fn glClampColorARB(target: GLenum, clamp: GLenum); +} +pub type PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + num_groups_x: GLuint, + num_groups_y: GLuint, + num_groups_z: GLuint, + group_size_x: GLuint, + group_size_y: GLuint, + group_size_z: GLuint, + ), +>; +extern "C" { + pub fn glDispatchComputeGroupSizeARB( + num_groups_x: GLuint, + num_groups_y: GLuint, + num_groups_z: GLuint, + group_size_x: GLuint, + group_size_y: GLuint, + group_size_z: GLuint, + ); +} +pub type GLDEBUGPROCARB = ::std::option::Option< + unsafe extern "C" fn( + source: GLenum, + type_: GLenum, + id: GLuint, + severity: GLenum, + length: GLsizei, + message: *const GLchar, + userParam: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLDEBUGMESSAGECONTROLARBPROC = ::std::option::Option< + unsafe extern "C" fn( + source: GLenum, + type_: GLenum, + severity: GLenum, + count: GLsizei, + ids: *const GLuint, + enabled: GLboolean, + ), +>; +pub type PFNGLDEBUGMESSAGEINSERTARBPROC = ::std::option::Option< + unsafe extern "C" fn( + source: GLenum, + type_: GLenum, + id: GLuint, + severity: GLenum, + length: GLsizei, + buf: *const GLchar, + ), +>; +pub type PFNGLDEBUGMESSAGECALLBACKARBPROC = ::std::option::Option< + unsafe extern "C" fn(callback: GLDEBUGPROCARB, userParam: *const ::std::os::raw::c_void), +>; +pub type PFNGLGETDEBUGMESSAGELOGARBPROC = ::std::option::Option< + unsafe extern "C" fn( + count: GLuint, + bufSize: GLsizei, + sources: *mut GLenum, + types: *mut GLenum, + ids: *mut GLuint, + severities: *mut GLenum, + lengths: *mut GLsizei, + messageLog: *mut GLchar, + ) -> GLuint, +>; +extern "C" { + pub fn glDebugMessageControlARB( + source: GLenum, + type_: GLenum, + severity: GLenum, + count: GLsizei, + ids: *const GLuint, + enabled: GLboolean, + ); +} +extern "C" { + pub fn glDebugMessageInsertARB( + source: GLenum, + type_: GLenum, + id: GLuint, + severity: GLenum, + length: GLsizei, + buf: *const GLchar, + ); +} +extern "C" { + pub fn glDebugMessageCallbackARB( + callback: GLDEBUGPROCARB, + userParam: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetDebugMessageLogARB( + count: GLuint, + bufSize: GLsizei, + sources: *mut GLenum, + types: *mut GLenum, + ids: *mut GLuint, + severities: *mut GLenum, + lengths: *mut GLsizei, + messageLog: *mut GLchar, + ) -> GLuint; +} +pub type PFNGLDRAWBUFFERSARBPROC = + ::std::option::Option; +extern "C" { + pub fn glDrawBuffersARB(n: GLsizei, bufs: *const GLenum); +} +pub type PFNGLBLENDEQUATIONIARBPROC = + ::std::option::Option; +pub type PFNGLBLENDEQUATIONSEPARATEIARBPROC = + ::std::option::Option; +pub type PFNGLBLENDFUNCIARBPROC = + ::std::option::Option; +pub type PFNGLBLENDFUNCSEPARATEIARBPROC = ::std::option::Option< + unsafe extern "C" fn( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum, + ), +>; +extern "C" { + pub fn glBlendEquationiARB(buf: GLuint, mode: GLenum); +} +extern "C" { + pub fn glBlendEquationSeparateiARB(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum); +} +extern "C" { + pub fn glBlendFunciARB(buf: GLuint, src: GLenum, dst: GLenum); +} +extern "C" { + pub fn glBlendFuncSeparateiARB( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum, + ); +} +pub type PFNGLDRAWARRAYSINSTANCEDARBPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei), +>; +pub type PFNGLDRAWELEMENTSINSTANCEDARBPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + primcount: GLsizei, + ), +>; +extern "C" { + pub fn glDrawArraysInstancedARB(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei); +} +extern "C" { + pub fn glDrawElementsInstancedARB( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + primcount: GLsizei, + ); +} +pub type PFNGLPROGRAMSTRINGARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + len: GLsizei, + string: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLBINDPROGRAMARBPROC = + ::std::option::Option; +pub type PFNGLDELETEPROGRAMSARBPROC = + ::std::option::Option; +pub type PFNGLGENPROGRAMSARBPROC = + ::std::option::Option; +pub type PFNGLPROGRAMENVPARAMETER4DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ), +>; +pub type PFNGLPROGRAMENVPARAMETER4DVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLdouble), +>; +pub type PFNGLPROGRAMENVPARAMETER4FARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLPROGRAMENVPARAMETER4FVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLfloat), +>; +pub type PFNGLPROGRAMLOCALPARAMETER4DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ), +>; +pub type PFNGLPROGRAMLOCALPARAMETER4DVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLdouble), +>; +pub type PFNGLPROGRAMLOCALPARAMETER4FARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLPROGRAMLOCALPARAMETER4FVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLfloat), +>; +pub type PFNGLGETPROGRAMENVPARAMETERDVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLdouble), +>; +pub type PFNGLGETPROGRAMENVPARAMETERFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLfloat), +>; +pub type PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLdouble), +>; +pub type PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *mut GLfloat), +>; +pub type PFNGLGETPROGRAMIVARBPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMSTRINGARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, string: *mut ::std::os::raw::c_void), +>; +pub type PFNGLISPROGRAMARBPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glProgramStringARB( + target: GLenum, + format: GLenum, + len: GLsizei, + string: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glBindProgramARB(target: GLenum, program: GLuint); +} +extern "C" { + pub fn glDeleteProgramsARB(n: GLsizei, programs: *const GLuint); +} +extern "C" { + pub fn glGenProgramsARB(n: GLsizei, programs: *mut GLuint); +} +extern "C" { + pub fn glProgramEnvParameter4dARB( + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ); +} +extern "C" { + pub fn glProgramEnvParameter4dvARB(target: GLenum, index: GLuint, params: *const GLdouble); +} +extern "C" { + pub fn glProgramEnvParameter4fARB( + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glProgramEnvParameter4fvARB(target: GLenum, index: GLuint, params: *const GLfloat); +} +extern "C" { + pub fn glProgramLocalParameter4dARB( + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ); +} +extern "C" { + pub fn glProgramLocalParameter4dvARB(target: GLenum, index: GLuint, params: *const GLdouble); +} +extern "C" { + pub fn glProgramLocalParameter4fARB( + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glProgramLocalParameter4fvARB(target: GLenum, index: GLuint, params: *const GLfloat); +} +extern "C" { + pub fn glGetProgramEnvParameterdvARB(target: GLenum, index: GLuint, params: *mut GLdouble); +} +extern "C" { + pub fn glGetProgramEnvParameterfvARB(target: GLenum, index: GLuint, params: *mut GLfloat); +} +extern "C" { + pub fn glGetProgramLocalParameterdvARB(target: GLenum, index: GLuint, params: *mut GLdouble); +} +extern "C" { + pub fn glGetProgramLocalParameterfvARB(target: GLenum, index: GLuint, params: *mut GLfloat); +} +extern "C" { + pub fn glGetProgramivARB(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetProgramStringARB( + target: GLenum, + pname: GLenum, + string: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glIsProgramARB(program: GLuint) -> GLboolean; +} +pub type PFNGLPROGRAMPARAMETERIARBPROC = + ::std::option::Option; +pub type PFNGLFRAMEBUFFERTEXTUREARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, attachment: GLenum, texture: GLuint, level: GLint), +>; +pub type PFNGLFRAMEBUFFERTEXTURELAYERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERTEXTUREFACEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + face: GLenum, + ), +>; +extern "C" { + pub fn glProgramParameteriARB(program: GLuint, pname: GLenum, value: GLint); +} +extern "C" { + pub fn glFramebufferTextureARB( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFramebufferTextureLayerARB( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ); +} +extern "C" { + pub fn glFramebufferTextureFaceARB( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + face: GLenum, + ); +} +pub type PFNGLSPECIALIZESHADERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + pEntryPoint: *const GLchar, + numSpecializationConstants: GLuint, + pConstantIndex: *const GLuint, + pConstantValue: *const GLuint, + ), +>; +extern "C" { + pub fn glSpecializeShaderARB( + shader: GLuint, + pEntryPoint: *const GLchar, + numSpecializationConstants: GLuint, + pConstantIndex: *const GLuint, + pConstantValue: *const GLuint, + ); +} +pub type PFNGLUNIFORM1I64ARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2I64ARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3I64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLint64, y: GLint64, z: GLint64), +>; +pub type PFNGLUNIFORM4I64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLint64, y: GLint64, z: GLint64, w: GLint64), +>; +pub type PFNGLUNIFORM1I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLUNIFORM2I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLUNIFORM3I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLUNIFORM4I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLUNIFORM1UI64ARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2UI64ARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3UI64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLuint64, y: GLuint64, z: GLuint64), +>; +pub type PFNGLUNIFORM4UI64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLuint64, y: GLuint64, z: GLuint64, w: GLuint64), +>; +pub type PFNGLUNIFORM1UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLUNIFORM2UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLUNIFORM3UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLUNIFORM4UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLGETUNIFORMI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLint64), +>; +pub type PFNGLGETUNIFORMUI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLuint64), +>; +pub type PFNGLGETNUNIFORMI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLint64), +>; +pub type PFNGLGETNUNIFORMUI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLuint64), +>; +pub type PFNGLPROGRAMUNIFORM1I64ARBPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2I64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLint64, y: GLint64), +>; +pub type PFNGLPROGRAMUNIFORM3I64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLint64, y: GLint64, z: GLint64), +>; +pub type PFNGLPROGRAMUNIFORM4I64ARBPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLint64, + y: GLint64, + z: GLint64, + w: GLint64, + ), +>; +pub type PFNGLPROGRAMUNIFORM1I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLPROGRAMUNIFORM2I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLPROGRAMUNIFORM3I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLPROGRAMUNIFORM4I64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint64), +>; +pub type PFNGLPROGRAMUNIFORM1UI64ARBPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2UI64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLuint64, y: GLuint64), +>; +pub type PFNGLPROGRAMUNIFORM3UI64ARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLuint64, y: GLuint64, z: GLuint64), +>; +pub type PFNGLPROGRAMUNIFORM4UI64ARBPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLuint64, + y: GLuint64, + z: GLuint64, + w: GLuint64, + ), +>; +pub type PFNGLPROGRAMUNIFORM1UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLPROGRAMUNIFORM2UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLPROGRAMUNIFORM3UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLPROGRAMUNIFORM4UI64VARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint64), +>; +extern "C" { + pub fn glUniform1i64ARB(location: GLint, x: GLint64); +} +extern "C" { + pub fn glUniform2i64ARB(location: GLint, x: GLint64, y: GLint64); +} +extern "C" { + pub fn glUniform3i64ARB(location: GLint, x: GLint64, y: GLint64, z: GLint64); +} +extern "C" { + pub fn glUniform4i64ARB(location: GLint, x: GLint64, y: GLint64, z: GLint64, w: GLint64); +} +extern "C" { + pub fn glUniform1i64vARB(location: GLint, count: GLsizei, value: *const GLint64); +} +extern "C" { + pub fn glUniform2i64vARB(location: GLint, count: GLsizei, value: *const GLint64); +} +extern "C" { + pub fn glUniform3i64vARB(location: GLint, count: GLsizei, value: *const GLint64); +} +extern "C" { + pub fn glUniform4i64vARB(location: GLint, count: GLsizei, value: *const GLint64); +} +extern "C" { + pub fn glUniform1ui64ARB(location: GLint, x: GLuint64); +} +extern "C" { + pub fn glUniform2ui64ARB(location: GLint, x: GLuint64, y: GLuint64); +} +extern "C" { + pub fn glUniform3ui64ARB(location: GLint, x: GLuint64, y: GLuint64, z: GLuint64); +} +extern "C" { + pub fn glUniform4ui64ARB(location: GLint, x: GLuint64, y: GLuint64, z: GLuint64, w: GLuint64); +} +extern "C" { + pub fn glUniform1ui64vARB(location: GLint, count: GLsizei, value: *const GLuint64); +} +extern "C" { + pub fn glUniform2ui64vARB(location: GLint, count: GLsizei, value: *const GLuint64); +} +extern "C" { + pub fn glUniform3ui64vARB(location: GLint, count: GLsizei, value: *const GLuint64); +} +extern "C" { + pub fn glUniform4ui64vARB(location: GLint, count: GLsizei, value: *const GLuint64); +} +extern "C" { + pub fn glGetUniformi64vARB(program: GLuint, location: GLint, params: *mut GLint64); +} +extern "C" { + pub fn glGetUniformui64vARB(program: GLuint, location: GLint, params: *mut GLuint64); +} +extern "C" { + pub fn glGetnUniformi64vARB( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLint64, + ); +} +extern "C" { + pub fn glGetnUniformui64vARB( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLuint64, + ); +} +extern "C" { + pub fn glProgramUniform1i64ARB(program: GLuint, location: GLint, x: GLint64); +} +extern "C" { + pub fn glProgramUniform2i64ARB(program: GLuint, location: GLint, x: GLint64, y: GLint64); +} +extern "C" { + pub fn glProgramUniform3i64ARB( + program: GLuint, + location: GLint, + x: GLint64, + y: GLint64, + z: GLint64, + ); +} +extern "C" { + pub fn glProgramUniform4i64ARB( + program: GLuint, + location: GLint, + x: GLint64, + y: GLint64, + z: GLint64, + w: GLint64, + ); +} +extern "C" { + pub fn glProgramUniform1i64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64, + ); +} +extern "C" { + pub fn glProgramUniform2i64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64, + ); +} +extern "C" { + pub fn glProgramUniform3i64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64, + ); +} +extern "C" { + pub fn glProgramUniform4i64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64, + ); +} +extern "C" { + pub fn glProgramUniform1ui64ARB(program: GLuint, location: GLint, x: GLuint64); +} +extern "C" { + pub fn glProgramUniform2ui64ARB(program: GLuint, location: GLint, x: GLuint64, y: GLuint64); +} +extern "C" { + pub fn glProgramUniform3ui64ARB( + program: GLuint, + location: GLint, + x: GLuint64, + y: GLuint64, + z: GLuint64, + ); +} +extern "C" { + pub fn glProgramUniform4ui64ARB( + program: GLuint, + location: GLint, + x: GLuint64, + y: GLuint64, + z: GLuint64, + w: GLuint64, + ); +} +extern "C" { + pub fn glProgramUniform1ui64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64, + ); +} +extern "C" { + pub fn glProgramUniform2ui64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64, + ); +} +extern "C" { + pub fn glProgramUniform3ui64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64, + ); +} +extern "C" { + pub fn glProgramUniform4ui64vARB( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64, + ); +} +pub type GLhalfARB = khronos_uint16_t; +pub type PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ), +>; +extern "C" { + pub fn glMultiDrawArraysIndirectCountARB( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElementsIndirectCountARB( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ); +} +pub type PFNGLVERTEXATTRIBDIVISORARBPROC = + ::std::option::Option; +extern "C" { + pub fn glVertexAttribDivisorARB(index: GLuint, divisor: GLuint); +} +pub type PFNGLCURRENTPALETTEMATRIXARBPROC = + ::std::option::Option; +pub type PFNGLMATRIXINDEXUBVARBPROC = + ::std::option::Option; +pub type PFNGLMATRIXINDEXUSVARBPROC = + ::std::option::Option; +pub type PFNGLMATRIXINDEXUIVARBPROC = + ::std::option::Option; +pub type PFNGLMATRIXINDEXPOINTERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glCurrentPaletteMatrixARB(index: GLint); +} +extern "C" { + pub fn glMatrixIndexubvARB(size: GLint, indices: *const GLubyte); +} +extern "C" { + pub fn glMatrixIndexusvARB(size: GLint, indices: *const GLushort); +} +extern "C" { + pub fn glMatrixIndexuivARB(size: GLint, indices: *const GLuint); +} +extern "C" { + pub fn glMatrixIndexPointerARB( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLSAMPLECOVERAGEARBPROC = + ::std::option::Option; +extern "C" { + pub fn glSampleCoverageARB(value: GLfloat, invert: GLboolean); +} +pub type PFNGLGENQUERIESARBPROC = + ::std::option::Option; +pub type PFNGLDELETEQUERIESARBPROC = + ::std::option::Option; +pub type PFNGLISQUERYARBPROC = ::std::option::Option GLboolean>; +pub type PFNGLBEGINQUERYARBPROC = + ::std::option::Option; +pub type PFNGLENDQUERYARBPROC = ::std::option::Option; +pub type PFNGLGETQUERYIVARBPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTIVARBPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTUIVARBPROC = + ::std::option::Option; +extern "C" { + pub fn glGenQueriesARB(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glDeleteQueriesARB(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glIsQueryARB(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBeginQueryARB(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glEndQueryARB(target: GLenum); +} +extern "C" { + pub fn glGetQueryivARB(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetQueryObjectivARB(id: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetQueryObjectuivARB(id: GLuint, pname: GLenum, params: *mut GLuint); +} +pub type PFNGLMAXSHADERCOMPILERTHREADSARBPROC = + ::std::option::Option; +extern "C" { + pub fn glMaxShaderCompilerThreadsARB(count: GLuint); +} +pub type PFNGLPOINTPARAMETERFARBPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERFVARBPROC = + ::std::option::Option; +extern "C" { + pub fn glPointParameterfARB(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPointParameterfvARB(pname: GLenum, params: *const GLfloat); +} +pub type PFNGLGETGRAPHICSRESETSTATUSARBPROC = + ::std::option::Option GLenum>; +pub type PFNGLGETNTEXIMAGEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + img: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLREADNPIXELSARBPROC = ::std::option::Option< + unsafe extern "C" fn( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + lod: GLint, + bufSize: GLsizei, + img: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNUNIFORMFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLfloat), +>; +pub type PFNGLGETNUNIFORMIVARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLint), +>; +pub type PFNGLGETNUNIFORMUIVARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLuint), +>; +pub type PFNGLGETNUNIFORMDVARBPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, bufSize: GLsizei, params: *mut GLdouble), +>; +pub type PFNGLGETNMAPDVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLdouble), +>; +pub type PFNGLGETNMAPFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLfloat), +>; +pub type PFNGLGETNMAPIVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLint), +>; +pub type PFNGLGETNPIXELMAPFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(map: GLenum, bufSize: GLsizei, values: *mut GLfloat), +>; +pub type PFNGLGETNPIXELMAPUIVARBPROC = + ::std::option::Option; +pub type PFNGLGETNPIXELMAPUSVARBPROC = ::std::option::Option< + unsafe extern "C" fn(map: GLenum, bufSize: GLsizei, values: *mut GLushort), +>; +pub type PFNGLGETNPOLYGONSTIPPLEARBPROC = + ::std::option::Option; +pub type PFNGLGETNCOLORTABLEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + table: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNCONVOLUTIONFILTERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + image: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNSEPARABLEFILTERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + rowBufSize: GLsizei, + row: *mut ::std::os::raw::c_void, + columnBufSize: GLsizei, + column: *mut ::std::os::raw::c_void, + span: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNHISTOGRAMARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETNMINMAXARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glGetGraphicsResetStatusARB() -> GLenum; +} +extern "C" { + pub fn glGetnTexImageARB( + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + img: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glReadnPixelsARB( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnCompressedTexImageARB( + target: GLenum, + lod: GLint, + bufSize: GLsizei, + img: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnUniformfvARB( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetnUniformivARB( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetnUniformuivARB( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glGetnUniformdvARB( + program: GLuint, + location: GLint, + bufSize: GLsizei, + params: *mut GLdouble, + ); +} +extern "C" { + pub fn glGetnMapdvARB(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLdouble); +} +extern "C" { + pub fn glGetnMapfvARB(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLfloat); +} +extern "C" { + pub fn glGetnMapivARB(target: GLenum, query: GLenum, bufSize: GLsizei, v: *mut GLint); +} +extern "C" { + pub fn glGetnPixelMapfvARB(map: GLenum, bufSize: GLsizei, values: *mut GLfloat); +} +extern "C" { + pub fn glGetnPixelMapuivARB(map: GLenum, bufSize: GLsizei, values: *mut GLuint); +} +extern "C" { + pub fn glGetnPixelMapusvARB(map: GLenum, bufSize: GLsizei, values: *mut GLushort); +} +extern "C" { + pub fn glGetnPolygonStippleARB(bufSize: GLsizei, pattern: *mut GLubyte); +} +extern "C" { + pub fn glGetnColorTableARB( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + table: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnConvolutionFilterARB( + target: GLenum, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + image: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnSeparableFilterARB( + target: GLenum, + format: GLenum, + type_: GLenum, + rowBufSize: GLsizei, + row: *mut ::std::os::raw::c_void, + columnBufSize: GLsizei, + column: *mut ::std::os::raw::c_void, + span: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnHistogramARB( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetnMinmaxARB( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + bufSize: GLsizei, + values: *mut ::std::os::raw::c_void, + ); +} +pub type PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, start: GLuint, count: GLsizei, v: *const GLfloat), +>; +pub type PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, start: GLuint, count: GLsizei, v: *const GLfloat), +>; +pub type PFNGLEVALUATEDEPTHVALUESARBPROC = ::std::option::Option; +extern "C" { + pub fn glFramebufferSampleLocationsfvARB( + target: GLenum, + start: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glNamedFramebufferSampleLocationsfvARB( + framebuffer: GLuint, + start: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glEvaluateDepthValuesARB(); +} +pub type PFNGLMINSAMPLESHADINGARBPROC = ::std::option::Option; +extern "C" { + pub fn glMinSampleShadingARB(value: GLfloat); +} +pub type GLhandleARB = ::std::os::raw::c_uint; +pub type GLcharARB = ::std::os::raw::c_char; +pub type PFNGLDELETEOBJECTARBPROC = ::std::option::Option; +pub type PFNGLGETHANDLEARBPROC = + ::std::option::Option GLhandleARB>; +pub type PFNGLDETACHOBJECTARBPROC = ::std::option::Option< + unsafe extern "C" fn(containerObj: GLhandleARB, attachedObj: GLhandleARB), +>; +pub type PFNGLCREATESHADEROBJECTARBPROC = + ::std::option::Option GLhandleARB>; +pub type PFNGLSHADERSOURCEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + shaderObj: GLhandleARB, + count: GLsizei, + string: *mut *const GLcharARB, + length: *const GLint, + ), +>; +pub type PFNGLCOMPILESHADERARBPROC = + ::std::option::Option; +pub type PFNGLCREATEPROGRAMOBJECTARBPROC = + ::std::option::Option GLhandleARB>; +pub type PFNGLATTACHOBJECTARBPROC = + ::std::option::Option; +pub type PFNGLLINKPROGRAMARBPROC = + ::std::option::Option; +pub type PFNGLUSEPROGRAMOBJECTARBPROC = + ::std::option::Option; +pub type PFNGLVALIDATEPROGRAMARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM1FARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2FARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3FARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat), +>; +pub type PFNGLUNIFORM4FARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat), +>; +pub type PFNGLUNIFORM1IARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2IARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3IARBPROC = + ::std::option::Option; +pub type PFNGLUNIFORM4IARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint), +>; +pub type PFNGLUNIFORM1FVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM2FVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM3FVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM4FVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLUNIFORM1IVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORM2IVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORM3IVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORM4IVARBPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLUNIFORMMATRIX2FVARBPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX3FVARBPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLUNIFORMMATRIX4FVARBPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLGETOBJECTPARAMETERFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(obj: GLhandleARB, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETOBJECTPARAMETERIVARBPROC = ::std::option::Option< + unsafe extern "C" fn(obj: GLhandleARB, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETINFOLOGARBPROC = ::std::option::Option< + unsafe extern "C" fn( + obj: GLhandleARB, + maxLength: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLcharARB, + ), +>; +pub type PFNGLGETATTACHEDOBJECTSARBPROC = ::std::option::Option< + unsafe extern "C" fn( + containerObj: GLhandleARB, + maxCount: GLsizei, + count: *mut GLsizei, + obj: *mut GLhandleARB, + ), +>; +pub type PFNGLGETUNIFORMLOCATIONARBPROC = ::std::option::Option< + unsafe extern "C" fn(programObj: GLhandleARB, name: *const GLcharARB) -> GLint, +>; +pub type PFNGLGETACTIVEUNIFORMARBPROC = ::std::option::Option< + unsafe extern "C" fn( + programObj: GLhandleARB, + index: GLuint, + maxLength: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLcharARB, + ), +>; +pub type PFNGLGETUNIFORMFVARBPROC = ::std::option::Option< + unsafe extern "C" fn(programObj: GLhandleARB, location: GLint, params: *mut GLfloat), +>; +pub type PFNGLGETUNIFORMIVARBPROC = ::std::option::Option< + unsafe extern "C" fn(programObj: GLhandleARB, location: GLint, params: *mut GLint), +>; +pub type PFNGLGETSHADERSOURCEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + obj: GLhandleARB, + maxLength: GLsizei, + length: *mut GLsizei, + source: *mut GLcharARB, + ), +>; +extern "C" { + pub fn glDeleteObjectARB(obj: GLhandleARB); +} +extern "C" { + pub fn glGetHandleARB(pname: GLenum) -> GLhandleARB; +} +extern "C" { + pub fn glDetachObjectARB(containerObj: GLhandleARB, attachedObj: GLhandleARB); +} +extern "C" { + pub fn glCreateShaderObjectARB(shaderType: GLenum) -> GLhandleARB; +} +extern "C" { + pub fn glShaderSourceARB( + shaderObj: GLhandleARB, + count: GLsizei, + string: *mut *const GLcharARB, + length: *const GLint, + ); +} +extern "C" { + pub fn glCompileShaderARB(shaderObj: GLhandleARB); +} +extern "C" { + pub fn glCreateProgramObjectARB() -> GLhandleARB; +} +extern "C" { + pub fn glAttachObjectARB(containerObj: GLhandleARB, obj: GLhandleARB); +} +extern "C" { + pub fn glLinkProgramARB(programObj: GLhandleARB); +} +extern "C" { + pub fn glUseProgramObjectARB(programObj: GLhandleARB); +} +extern "C" { + pub fn glValidateProgramARB(programObj: GLhandleARB); +} +extern "C" { + pub fn glUniform1fARB(location: GLint, v0: GLfloat); +} +extern "C" { + pub fn glUniform2fARB(location: GLint, v0: GLfloat, v1: GLfloat); +} +extern "C" { + pub fn glUniform3fARB(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat); +} +extern "C" { + pub fn glUniform4fARB(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat); +} +extern "C" { + pub fn glUniform1iARB(location: GLint, v0: GLint); +} +extern "C" { + pub fn glUniform2iARB(location: GLint, v0: GLint, v1: GLint); +} +extern "C" { + pub fn glUniform3iARB(location: GLint, v0: GLint, v1: GLint, v2: GLint); +} +extern "C" { + pub fn glUniform4iARB(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint); +} +extern "C" { + pub fn glUniform1fvARB(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform2fvARB(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform3fvARB(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform4fvARB(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform1ivARB(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform2ivARB(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform3ivARB(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform4ivARB(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniformMatrix2fvARB( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3fvARB( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4fvARB( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glGetObjectParameterfvARB(obj: GLhandleARB, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetObjectParameterivARB(obj: GLhandleARB, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetInfoLogARB( + obj: GLhandleARB, + maxLength: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLcharARB, + ); +} +extern "C" { + pub fn glGetAttachedObjectsARB( + containerObj: GLhandleARB, + maxCount: GLsizei, + count: *mut GLsizei, + obj: *mut GLhandleARB, + ); +} +extern "C" { + pub fn glGetUniformLocationARB(programObj: GLhandleARB, name: *const GLcharARB) -> GLint; +} +extern "C" { + pub fn glGetActiveUniformARB( + programObj: GLhandleARB, + index: GLuint, + maxLength: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLcharARB, + ); +} +extern "C" { + pub fn glGetUniformfvARB(programObj: GLhandleARB, location: GLint, params: *mut GLfloat); +} +extern "C" { + pub fn glGetUniformivARB(programObj: GLhandleARB, location: GLint, params: *mut GLint); +} +extern "C" { + pub fn glGetShaderSourceARB( + obj: GLhandleARB, + maxLength: GLsizei, + length: *mut GLsizei, + source: *mut GLcharARB, + ); +} +pub type PFNGLNAMEDSTRINGARBPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + namelen: GLint, + name: *const GLchar, + stringlen: GLint, + string: *const GLchar, + ), +>; +pub type PFNGLDELETENAMEDSTRINGARBPROC = + ::std::option::Option; +pub type PFNGLCOMPILESHADERINCLUDEARBPROC = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + count: GLsizei, + path: *const *const GLchar, + length: *const GLint, + ), +>; +pub type PFNGLISNAMEDSTRINGARBPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETNAMEDSTRINGARBPROC = ::std::option::Option< + unsafe extern "C" fn( + namelen: GLint, + name: *const GLchar, + bufSize: GLsizei, + stringlen: *mut GLint, + string: *mut GLchar, + ), +>; +pub type PFNGLGETNAMEDSTRINGIVARBPROC = ::std::option::Option< + unsafe extern "C" fn(namelen: GLint, name: *const GLchar, pname: GLenum, params: *mut GLint), +>; +extern "C" { + pub fn glNamedStringARB( + type_: GLenum, + namelen: GLint, + name: *const GLchar, + stringlen: GLint, + string: *const GLchar, + ); +} +extern "C" { + pub fn glDeleteNamedStringARB(namelen: GLint, name: *const GLchar); +} +extern "C" { + pub fn glCompileShaderIncludeARB( + shader: GLuint, + count: GLsizei, + path: *const *const GLchar, + length: *const GLint, + ); +} +extern "C" { + pub fn glIsNamedStringARB(namelen: GLint, name: *const GLchar) -> GLboolean; +} +extern "C" { + pub fn glGetNamedStringARB( + namelen: GLint, + name: *const GLchar, + bufSize: GLsizei, + stringlen: *mut GLint, + string: *mut GLchar, + ); +} +extern "C" { + pub fn glGetNamedStringivARB( + namelen: GLint, + name: *const GLchar, + pname: GLenum, + params: *mut GLint, + ); +} +pub type PFNGLBUFFERPAGECOMMITMENTARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, offset: GLintptr, size: GLsizeiptr, commit: GLboolean), +>; +pub type PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, offset: GLintptr, size: GLsizeiptr, commit: GLboolean), +>; +pub type PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, offset: GLintptr, size: GLsizeiptr, commit: GLboolean), +>; +extern "C" { + pub fn glBufferPageCommitmentARB( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + commit: GLboolean, + ); +} +extern "C" { + pub fn glNamedBufferPageCommitmentEXT( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + commit: GLboolean, + ); +} +extern "C" { + pub fn glNamedBufferPageCommitmentARB( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + commit: GLboolean, + ); +} +pub type PFNGLTEXPAGECOMMITMENTARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + commit: GLboolean, + ), +>; +extern "C" { + pub fn glTexPageCommitmentARB( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + commit: GLboolean, + ); +} +pub type PFNGLTEXBUFFERARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, buffer: GLuint), +>; +extern "C" { + pub fn glTexBufferARB(target: GLenum, internalformat: GLenum, buffer: GLuint); +} +pub type PFNGLCOMPRESSEDTEXIMAGE3DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXIMAGE2DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXIMAGE1DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOMPRESSEDTEXIMAGEARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, level: GLint, img: *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn glCompressedTexImage3DARB( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexImage2DARB( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexImage1DARB( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexSubImage3DARB( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexSubImage2DARB( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexSubImage1DARB( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetCompressedTexImageARB( + target: GLenum, + level: GLint, + img: *mut ::std::os::raw::c_void, + ); +} +pub type PFNGLLOADTRANSPOSEMATRIXFARBPROC = + ::std::option::Option; +pub type PFNGLLOADTRANSPOSEMATRIXDARBPROC = + ::std::option::Option; +pub type PFNGLMULTTRANSPOSEMATRIXFARBPROC = + ::std::option::Option; +pub type PFNGLMULTTRANSPOSEMATRIXDARBPROC = + ::std::option::Option; +extern "C" { + pub fn glLoadTransposeMatrixfARB(m: *const GLfloat); +} +extern "C" { + pub fn glLoadTransposeMatrixdARB(m: *const GLdouble); +} +extern "C" { + pub fn glMultTransposeMatrixfARB(m: *const GLfloat); +} +extern "C" { + pub fn glMultTransposeMatrixdARB(m: *const GLdouble); +} +pub type PFNGLWEIGHTBVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTSVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTIVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTFVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTDVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTUBVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTUSVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTUIVARBPROC = + ::std::option::Option; +pub type PFNGLWEIGHTPOINTERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLVERTEXBLENDARBPROC = ::std::option::Option; +extern "C" { + pub fn glWeightbvARB(size: GLint, weights: *const GLbyte); +} +extern "C" { + pub fn glWeightsvARB(size: GLint, weights: *const GLshort); +} +extern "C" { + pub fn glWeightivARB(size: GLint, weights: *const GLint); +} +extern "C" { + pub fn glWeightfvARB(size: GLint, weights: *const GLfloat); +} +extern "C" { + pub fn glWeightdvARB(size: GLint, weights: *const GLdouble); +} +extern "C" { + pub fn glWeightubvARB(size: GLint, weights: *const GLubyte); +} +extern "C" { + pub fn glWeightusvARB(size: GLint, weights: *const GLushort); +} +extern "C" { + pub fn glWeightuivARB(size: GLint, weights: *const GLuint); +} +extern "C" { + pub fn glWeightPointerARB( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glVertexBlendARB(count: GLint); +} +pub type GLsizeiptrARB = khronos_ssize_t; +pub type GLintptrARB = khronos_intptr_t; +pub type PFNGLBINDBUFFERARBPROC = + ::std::option::Option; +pub type PFNGLDELETEBUFFERSARBPROC = + ::std::option::Option; +pub type PFNGLGENBUFFERSARBPROC = + ::std::option::Option; +pub type PFNGLISBUFFERARBPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBUFFERDATAARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + size: GLsizeiptrARB, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ), +>; +pub type PFNGLBUFFERSUBDATAARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptrARB, + size: GLsizeiptrARB, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETBUFFERSUBDATAARBPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptrARB, + size: GLsizeiptrARB, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLMAPBUFFERARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLUNMAPBUFFERARBPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETBUFFERPARAMETERIVARBPROC = + ::std::option::Option; +pub type PFNGLGETBUFFERPOINTERVARBPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn glBindBufferARB(target: GLenum, buffer: GLuint); +} +extern "C" { + pub fn glDeleteBuffersARB(n: GLsizei, buffers: *const GLuint); +} +extern "C" { + pub fn glGenBuffersARB(n: GLsizei, buffers: *mut GLuint); +} +extern "C" { + pub fn glIsBufferARB(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBufferDataARB( + target: GLenum, + size: GLsizeiptrARB, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ); +} +extern "C" { + pub fn glBufferSubDataARB( + target: GLenum, + offset: GLintptrARB, + size: GLsizeiptrARB, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetBufferSubDataARB( + target: GLenum, + offset: GLintptrARB, + size: GLsizeiptrARB, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMapBufferARB(target: GLenum, access: GLenum) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glUnmapBufferARB(target: GLenum) -> GLboolean; +} +extern "C" { + pub fn glGetBufferParameterivARB(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetBufferPointervARB( + target: GLenum, + pname: GLenum, + params: *mut *mut ::std::os::raw::c_void, + ); +} +pub type PFNGLVERTEXATTRIB1DARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1DVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1FARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1FVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1SARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1SVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2DARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2DVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2FARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2FVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2SARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2SVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3DARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLVERTEXATTRIB3DVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3FARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3FVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3SARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3SVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NBVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NIVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NSVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NUBARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), +>; +pub type PFNGLVERTEXATTRIB4NUBVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NUIVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4NUSVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4BVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4DARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLVERTEXATTRIB4DVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4FARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), +>; +pub type PFNGLVERTEXATTRIB4FVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4IVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4SARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), +>; +pub type PFNGLVERTEXATTRIB4SVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4UBVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4UIVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4USVARBPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBPOINTERARBPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLENABLEVERTEXATTRIBARRAYARBPROC = + ::std::option::Option; +pub type PFNGLDISABLEVERTEXATTRIBARRAYARBPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBDVARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), +>; +pub type PFNGLGETVERTEXATTRIBFVARBPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBIVARBPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBPOINTERVARBPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, pointer: *mut *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn glVertexAttrib1dARB(index: GLuint, x: GLdouble); +} +extern "C" { + pub fn glVertexAttrib1dvARB(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib1fARB(index: GLuint, x: GLfloat); +} +extern "C" { + pub fn glVertexAttrib1fvARB(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib1sARB(index: GLuint, x: GLshort); +} +extern "C" { + pub fn glVertexAttrib1svARB(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib2dARB(index: GLuint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertexAttrib2dvARB(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib2fARB(index: GLuint, x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glVertexAttrib2fvARB(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib2sARB(index: GLuint, x: GLshort, y: GLshort); +} +extern "C" { + pub fn glVertexAttrib2svARB(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib3dARB(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertexAttrib3dvARB(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib3fARB(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glVertexAttrib3fvARB(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib3sARB(index: GLuint, x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glVertexAttrib3svARB(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4NbvARB(index: GLuint, v: *const GLbyte); +} +extern "C" { + pub fn glVertexAttrib4NivARB(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttrib4NsvARB(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4NubARB(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte); +} +extern "C" { + pub fn glVertexAttrib4NubvARB(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttrib4NuivARB(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttrib4NusvARB(index: GLuint, v: *const GLushort); +} +extern "C" { + pub fn glVertexAttrib4bvARB(index: GLuint, v: *const GLbyte); +} +extern "C" { + pub fn glVertexAttrib4dARB(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertexAttrib4dvARB(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib4fARB(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glVertexAttrib4fvARB(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib4ivARB(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttrib4sARB(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glVertexAttrib4svARB(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4ubvARB(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttrib4uivARB(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttrib4usvARB(index: GLuint, v: *const GLushort); +} +extern "C" { + pub fn glVertexAttribPointerARB( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glEnableVertexAttribArrayARB(index: GLuint); +} +extern "C" { + pub fn glDisableVertexAttribArrayARB(index: GLuint); +} +extern "C" { + pub fn glGetVertexAttribdvARB(index: GLuint, pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glGetVertexAttribfvARB(index: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetVertexAttribivARB(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribPointervARB( + index: GLuint, + pname: GLenum, + pointer: *mut *mut ::std::os::raw::c_void, + ); +} +pub type PFNGLBINDATTRIBLOCATIONARBPROC = ::std::option::Option< + unsafe extern "C" fn(programObj: GLhandleARB, index: GLuint, name: *const GLcharARB), +>; +pub type PFNGLGETACTIVEATTRIBARBPROC = ::std::option::Option< + unsafe extern "C" fn( + programObj: GLhandleARB, + index: GLuint, + maxLength: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLcharARB, + ), +>; +pub type PFNGLGETATTRIBLOCATIONARBPROC = ::std::option::Option< + unsafe extern "C" fn(programObj: GLhandleARB, name: *const GLcharARB) -> GLint, +>; +extern "C" { + pub fn glBindAttribLocationARB(programObj: GLhandleARB, index: GLuint, name: *const GLcharARB); +} +extern "C" { + pub fn glGetActiveAttribARB( + programObj: GLhandleARB, + index: GLuint, + maxLength: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLcharARB, + ); +} +extern "C" { + pub fn glGetAttribLocationARB(programObj: GLhandleARB, name: *const GLcharARB) -> GLint; +} +pub type PFNGLWINDOWPOS2DARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2DVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2FARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2FVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2IARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2IVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2SARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2SVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3DARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3DVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3FARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3FVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3IARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3IVARBPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3SARBPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3SVARBPROC = ::std::option::Option; +extern "C" { + pub fn glWindowPos2dARB(x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glWindowPos2dvARB(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos2fARB(x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glWindowPos2fvARB(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos2iARB(x: GLint, y: GLint); +} +extern "C" { + pub fn glWindowPos2ivARB(v: *const GLint); +} +extern "C" { + pub fn glWindowPos2sARB(x: GLshort, y: GLshort); +} +extern "C" { + pub fn glWindowPos2svARB(v: *const GLshort); +} +extern "C" { + pub fn glWindowPos3dARB(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glWindowPos3dvARB(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos3fARB(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glWindowPos3fvARB(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos3iARB(x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glWindowPos3ivARB(v: *const GLint); +} +extern "C" { + pub fn glWindowPos3sARB(x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glWindowPos3svARB(v: *const GLshort); +} +pub type PFNGLBLENDBARRIERKHRPROC = ::std::option::Option; +extern "C" { + pub fn glBlendBarrierKHR(); +} +pub type PFNGLMAXSHADERCOMPILERTHREADSKHRPROC = + ::std::option::Option; +extern "C" { + pub fn glMaxShaderCompilerThreadsKHR(count: GLuint); +} +pub type PFNGLMULTITEXCOORD1BOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1BVOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2BOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2BVOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3BOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3BVOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4BOESPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, s: GLbyte, t: GLbyte, r: GLbyte, q: GLbyte), +>; +pub type PFNGLMULTITEXCOORD4BVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD1BOESPROC = ::std::option::Option; +pub type PFNGLTEXCOORD1BVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD2BOESPROC = ::std::option::Option; +pub type PFNGLTEXCOORD2BVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD3BOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD3BVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD4BOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD4BVOESPROC = + ::std::option::Option; +pub type PFNGLVERTEX2BOESPROC = ::std::option::Option; +pub type PFNGLVERTEX2BVOESPROC = ::std::option::Option; +pub type PFNGLVERTEX3BOESPROC = + ::std::option::Option; +pub type PFNGLVERTEX3BVOESPROC = ::std::option::Option; +pub type PFNGLVERTEX4BOESPROC = + ::std::option::Option; +pub type PFNGLVERTEX4BVOESPROC = ::std::option::Option; +extern "C" { + pub fn glMultiTexCoord1bOES(texture: GLenum, s: GLbyte); +} +extern "C" { + pub fn glMultiTexCoord1bvOES(texture: GLenum, coords: *const GLbyte); +} +extern "C" { + pub fn glMultiTexCoord2bOES(texture: GLenum, s: GLbyte, t: GLbyte); +} +extern "C" { + pub fn glMultiTexCoord2bvOES(texture: GLenum, coords: *const GLbyte); +} +extern "C" { + pub fn glMultiTexCoord3bOES(texture: GLenum, s: GLbyte, t: GLbyte, r: GLbyte); +} +extern "C" { + pub fn glMultiTexCoord3bvOES(texture: GLenum, coords: *const GLbyte); +} +extern "C" { + pub fn glMultiTexCoord4bOES(texture: GLenum, s: GLbyte, t: GLbyte, r: GLbyte, q: GLbyte); +} +extern "C" { + pub fn glMultiTexCoord4bvOES(texture: GLenum, coords: *const GLbyte); +} +extern "C" { + pub fn glTexCoord1bOES(s: GLbyte); +} +extern "C" { + pub fn glTexCoord1bvOES(coords: *const GLbyte); +} +extern "C" { + pub fn glTexCoord2bOES(s: GLbyte, t: GLbyte); +} +extern "C" { + pub fn glTexCoord2bvOES(coords: *const GLbyte); +} +extern "C" { + pub fn glTexCoord3bOES(s: GLbyte, t: GLbyte, r: GLbyte); +} +extern "C" { + pub fn glTexCoord3bvOES(coords: *const GLbyte); +} +extern "C" { + pub fn glTexCoord4bOES(s: GLbyte, t: GLbyte, r: GLbyte, q: GLbyte); +} +extern "C" { + pub fn glTexCoord4bvOES(coords: *const GLbyte); +} +extern "C" { + pub fn glVertex2bOES(x: GLbyte, y: GLbyte); +} +extern "C" { + pub fn glVertex2bvOES(coords: *const GLbyte); +} +extern "C" { + pub fn glVertex3bOES(x: GLbyte, y: GLbyte, z: GLbyte); +} +extern "C" { + pub fn glVertex3bvOES(coords: *const GLbyte); +} +extern "C" { + pub fn glVertex4bOES(x: GLbyte, y: GLbyte, z: GLbyte, w: GLbyte); +} +extern "C" { + pub fn glVertex4bvOES(coords: *const GLbyte); +} +pub type GLfixed = khronos_int32_t; +pub type PFNGLALPHAFUNCXOESPROC = + ::std::option::Option; +pub type PFNGLCLEARCOLORXOESPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed), +>; +pub type PFNGLCLEARDEPTHXOESPROC = ::std::option::Option; +pub type PFNGLCLIPPLANEXOESPROC = + ::std::option::Option; +pub type PFNGLCOLOR4XOESPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed), +>; +pub type PFNGLDEPTHRANGEXOESPROC = + ::std::option::Option; +pub type PFNGLFOGXOESPROC = + ::std::option::Option; +pub type PFNGLFOGXVOESPROC = + ::std::option::Option; +pub type PFNGLFRUSTUMXOESPROC = ::std::option::Option< + unsafe extern "C" fn(l: GLfixed, r: GLfixed, b: GLfixed, t: GLfixed, n: GLfixed, f: GLfixed), +>; +pub type PFNGLGETCLIPPLANEXOESPROC = + ::std::option::Option; +pub type PFNGLGETFIXEDVOESPROC = + ::std::option::Option; +pub type PFNGLGETTEXENVXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfixed), +>; +pub type PFNGLGETTEXPARAMETERXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfixed), +>; +pub type PFNGLLIGHTMODELXOESPROC = + ::std::option::Option; +pub type PFNGLLIGHTMODELXVOESPROC = + ::std::option::Option; +pub type PFNGLLIGHTXOESPROC = + ::std::option::Option; +pub type PFNGLLIGHTXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(light: GLenum, pname: GLenum, params: *const GLfixed), +>; +pub type PFNGLLINEWIDTHXOESPROC = ::std::option::Option; +pub type PFNGLLOADMATRIXXOESPROC = ::std::option::Option; +pub type PFNGLMATERIALXOESPROC = + ::std::option::Option; +pub type PFNGLMATERIALXVOESPROC = + ::std::option::Option; +pub type PFNGLMULTMATRIXXOESPROC = ::std::option::Option; +pub type PFNGLMULTITEXCOORD4XOESPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, s: GLfixed, t: GLfixed, r: GLfixed, q: GLfixed), +>; +pub type PFNGLNORMAL3XOESPROC = + ::std::option::Option; +pub type PFNGLORTHOXOESPROC = ::std::option::Option< + unsafe extern "C" fn(l: GLfixed, r: GLfixed, b: GLfixed, t: GLfixed, n: GLfixed, f: GLfixed), +>; +pub type PFNGLPOINTPARAMETERXVOESPROC = + ::std::option::Option; +pub type PFNGLPOINTSIZEXOESPROC = ::std::option::Option; +pub type PFNGLPOLYGONOFFSETXOESPROC = + ::std::option::Option; +pub type PFNGLROTATEXOESPROC = + ::std::option::Option; +pub type PFNGLSCALEXOESPROC = + ::std::option::Option; +pub type PFNGLTEXENVXOESPROC = + ::std::option::Option; +pub type PFNGLTEXENVXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfixed), +>; +pub type PFNGLTEXPARAMETERXOESPROC = + ::std::option::Option; +pub type PFNGLTEXPARAMETERXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfixed), +>; +pub type PFNGLTRANSLATEXOESPROC = + ::std::option::Option; +pub type PFNGLACCUMXOESPROC = + ::std::option::Option; +pub type PFNGLBITMAPXOESPROC = ::std::option::Option< + unsafe extern "C" fn( + width: GLsizei, + height: GLsizei, + xorig: GLfixed, + yorig: GLfixed, + xmove: GLfixed, + ymove: GLfixed, + bitmap: *const GLubyte, + ), +>; +pub type PFNGLBLENDCOLORXOESPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed), +>; +pub type PFNGLCLEARACCUMXOESPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed), +>; +pub type PFNGLCOLOR3XOESPROC = + ::std::option::Option; +pub type PFNGLCOLOR3XVOESPROC = + ::std::option::Option; +pub type PFNGLCOLOR4XVOESPROC = + ::std::option::Option; +pub type PFNGLCONVOLUTIONPARAMETERXOESPROC = + ::std::option::Option; +pub type PFNGLCONVOLUTIONPARAMETERXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfixed), +>; +pub type PFNGLEVALCOORD1XOESPROC = ::std::option::Option; +pub type PFNGLEVALCOORD1XVOESPROC = + ::std::option::Option; +pub type PFNGLEVALCOORD2XOESPROC = + ::std::option::Option; +pub type PFNGLEVALCOORD2XVOESPROC = + ::std::option::Option; +pub type PFNGLFEEDBACKBUFFERXOESPROC = + ::std::option::Option; +pub type PFNGLGETCONVOLUTIONPARAMETERXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfixed), +>; +pub type PFNGLGETHISTOGRAMPARAMETERXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfixed), +>; +pub type PFNGLGETLIGHTXOESPROC = + ::std::option::Option; +pub type PFNGLGETMAPXVOESPROC = + ::std::option::Option; +pub type PFNGLGETMATERIALXOESPROC = + ::std::option::Option; +pub type PFNGLGETPIXELMAPXVPROC = + ::std::option::Option; +pub type PFNGLGETTEXGENXVOESPROC = + ::std::option::Option; +pub type PFNGLGETTEXLEVELPARAMETERXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, level: GLint, pname: GLenum, params: *mut GLfixed), +>; +pub type PFNGLINDEXXOESPROC = ::std::option::Option; +pub type PFNGLINDEXXVOESPROC = + ::std::option::Option; +pub type PFNGLLOADTRANSPOSEMATRIXXOESPROC = + ::std::option::Option; +pub type PFNGLMAP1XOESPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + u1: GLfixed, + u2: GLfixed, + stride: GLint, + order: GLint, + points: GLfixed, + ), +>; +pub type PFNGLMAP2XOESPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + u1: GLfixed, + u2: GLfixed, + ustride: GLint, + uorder: GLint, + v1: GLfixed, + v2: GLfixed, + vstride: GLint, + vorder: GLint, + points: GLfixed, + ), +>; +pub type PFNGLMAPGRID1XOESPROC = + ::std::option::Option; +pub type PFNGLMAPGRID2XOESPROC = ::std::option::Option< + unsafe extern "C" fn(n: GLint, u1: GLfixed, u2: GLfixed, v1: GLfixed, v2: GLfixed), +>; +pub type PFNGLMULTTRANSPOSEMATRIXXOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1XOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1XVOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2XOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2XVOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3XOESPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLenum, s: GLfixed, t: GLfixed, r: GLfixed), +>; +pub type PFNGLMULTITEXCOORD3XVOESPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4XVOESPROC = + ::std::option::Option; +pub type PFNGLNORMAL3XVOESPROC = + ::std::option::Option; +pub type PFNGLPASSTHROUGHXOESPROC = ::std::option::Option; +pub type PFNGLPIXELMAPXPROC = + ::std::option::Option; +pub type PFNGLPIXELSTOREXPROC = + ::std::option::Option; +pub type PFNGLPIXELTRANSFERXOESPROC = + ::std::option::Option; +pub type PFNGLPIXELZOOMXOESPROC = + ::std::option::Option; +pub type PFNGLPRIORITIZETEXTURESXOESPROC = ::std::option::Option< + unsafe extern "C" fn(n: GLsizei, textures: *const GLuint, priorities: *const GLfixed), +>; +pub type PFNGLRASTERPOS2XOESPROC = + ::std::option::Option; +pub type PFNGLRASTERPOS2XVOESPROC = + ::std::option::Option; +pub type PFNGLRASTERPOS3XOESPROC = + ::std::option::Option; +pub type PFNGLRASTERPOS3XVOESPROC = + ::std::option::Option; +pub type PFNGLRASTERPOS4XOESPROC = + ::std::option::Option; +pub type PFNGLRASTERPOS4XVOESPROC = + ::std::option::Option; +pub type PFNGLRECTXOESPROC = + ::std::option::Option; +pub type PFNGLRECTXVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD1XOESPROC = ::std::option::Option; +pub type PFNGLTEXCOORD1XVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD2XOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD2XVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD3XOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD3XVOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD4XOESPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD4XVOESPROC = + ::std::option::Option; +pub type PFNGLTEXGENXOESPROC = + ::std::option::Option; +pub type PFNGLTEXGENXVOESPROC = ::std::option::Option< + unsafe extern "C" fn(coord: GLenum, pname: GLenum, params: *const GLfixed), +>; +pub type PFNGLVERTEX2XOESPROC = ::std::option::Option; +pub type PFNGLVERTEX2XVOESPROC = + ::std::option::Option; +pub type PFNGLVERTEX3XOESPROC = ::std::option::Option; +pub type PFNGLVERTEX3XVOESPROC = + ::std::option::Option; +pub type PFNGLVERTEX4XOESPROC = + ::std::option::Option; +pub type PFNGLVERTEX4XVOESPROC = + ::std::option::Option; +extern "C" { + pub fn glAlphaFuncxOES(func: GLenum, ref_: GLfixed); +} +extern "C" { + pub fn glClearColorxOES(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed); +} +extern "C" { + pub fn glClearDepthxOES(depth: GLfixed); +} +extern "C" { + pub fn glClipPlanexOES(plane: GLenum, equation: *const GLfixed); +} +extern "C" { + pub fn glColor4xOES(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed); +} +extern "C" { + pub fn glDepthRangexOES(n: GLfixed, f: GLfixed); +} +extern "C" { + pub fn glFogxOES(pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glFogxvOES(pname: GLenum, param: *const GLfixed); +} +extern "C" { + pub fn glFrustumxOES(l: GLfixed, r: GLfixed, b: GLfixed, t: GLfixed, n: GLfixed, f: GLfixed); +} +extern "C" { + pub fn glGetClipPlanexOES(plane: GLenum, equation: *mut GLfixed); +} +extern "C" { + pub fn glGetFixedvOES(pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glGetTexEnvxvOES(target: GLenum, pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glGetTexParameterxvOES(target: GLenum, pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glLightModelxOES(pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glLightModelxvOES(pname: GLenum, param: *const GLfixed); +} +extern "C" { + pub fn glLightxOES(light: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glLightxvOES(light: GLenum, pname: GLenum, params: *const GLfixed); +} +extern "C" { + pub fn glLineWidthxOES(width: GLfixed); +} +extern "C" { + pub fn glLoadMatrixxOES(m: *const GLfixed); +} +extern "C" { + pub fn glMaterialxOES(face: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glMaterialxvOES(face: GLenum, pname: GLenum, param: *const GLfixed); +} +extern "C" { + pub fn glMultMatrixxOES(m: *const GLfixed); +} +extern "C" { + pub fn glMultiTexCoord4xOES(texture: GLenum, s: GLfixed, t: GLfixed, r: GLfixed, q: GLfixed); +} +extern "C" { + pub fn glNormal3xOES(nx: GLfixed, ny: GLfixed, nz: GLfixed); +} +extern "C" { + pub fn glOrthoxOES(l: GLfixed, r: GLfixed, b: GLfixed, t: GLfixed, n: GLfixed, f: GLfixed); +} +extern "C" { + pub fn glPointParameterxvOES(pname: GLenum, params: *const GLfixed); +} +extern "C" { + pub fn glPointSizexOES(size: GLfixed); +} +extern "C" { + pub fn glPolygonOffsetxOES(factor: GLfixed, units: GLfixed); +} +extern "C" { + pub fn glRotatexOES(angle: GLfixed, x: GLfixed, y: GLfixed, z: GLfixed); +} +extern "C" { + pub fn glScalexOES(x: GLfixed, y: GLfixed, z: GLfixed); +} +extern "C" { + pub fn glTexEnvxOES(target: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glTexEnvxvOES(target: GLenum, pname: GLenum, params: *const GLfixed); +} +extern "C" { + pub fn glTexParameterxOES(target: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glTexParameterxvOES(target: GLenum, pname: GLenum, params: *const GLfixed); +} +extern "C" { + pub fn glTranslatexOES(x: GLfixed, y: GLfixed, z: GLfixed); +} +extern "C" { + pub fn glAccumxOES(op: GLenum, value: GLfixed); +} +extern "C" { + pub fn glBitmapxOES( + width: GLsizei, + height: GLsizei, + xorig: GLfixed, + yorig: GLfixed, + xmove: GLfixed, + ymove: GLfixed, + bitmap: *const GLubyte, + ); +} +extern "C" { + pub fn glBlendColorxOES(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed); +} +extern "C" { + pub fn glClearAccumxOES(red: GLfixed, green: GLfixed, blue: GLfixed, alpha: GLfixed); +} +extern "C" { + pub fn glColor3xOES(red: GLfixed, green: GLfixed, blue: GLfixed); +} +extern "C" { + pub fn glColor3xvOES(components: *const GLfixed); +} +extern "C" { + pub fn glColor4xvOES(components: *const GLfixed); +} +extern "C" { + pub fn glConvolutionParameterxOES(target: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glConvolutionParameterxvOES(target: GLenum, pname: GLenum, params: *const GLfixed); +} +extern "C" { + pub fn glEvalCoord1xOES(u: GLfixed); +} +extern "C" { + pub fn glEvalCoord1xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glEvalCoord2xOES(u: GLfixed, v: GLfixed); +} +extern "C" { + pub fn glEvalCoord2xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glFeedbackBufferxOES(n: GLsizei, type_: GLenum, buffer: *const GLfixed); +} +extern "C" { + pub fn glGetConvolutionParameterxvOES(target: GLenum, pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glGetHistogramParameterxvOES(target: GLenum, pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glGetLightxOES(light: GLenum, pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glGetMapxvOES(target: GLenum, query: GLenum, v: *mut GLfixed); +} +extern "C" { + pub fn glGetMaterialxOES(face: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glGetPixelMapxv(map: GLenum, size: GLint, values: *mut GLfixed); +} +extern "C" { + pub fn glGetTexGenxvOES(coord: GLenum, pname: GLenum, params: *mut GLfixed); +} +extern "C" { + pub fn glGetTexLevelParameterxvOES( + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLfixed, + ); +} +extern "C" { + pub fn glIndexxOES(component: GLfixed); +} +extern "C" { + pub fn glIndexxvOES(component: *const GLfixed); +} +extern "C" { + pub fn glLoadTransposeMatrixxOES(m: *const GLfixed); +} +extern "C" { + pub fn glMap1xOES( + target: GLenum, + u1: GLfixed, + u2: GLfixed, + stride: GLint, + order: GLint, + points: GLfixed, + ); +} +extern "C" { + pub fn glMap2xOES( + target: GLenum, + u1: GLfixed, + u2: GLfixed, + ustride: GLint, + uorder: GLint, + v1: GLfixed, + v2: GLfixed, + vstride: GLint, + vorder: GLint, + points: GLfixed, + ); +} +extern "C" { + pub fn glMapGrid1xOES(n: GLint, u1: GLfixed, u2: GLfixed); +} +extern "C" { + pub fn glMapGrid2xOES(n: GLint, u1: GLfixed, u2: GLfixed, v1: GLfixed, v2: GLfixed); +} +extern "C" { + pub fn glMultTransposeMatrixxOES(m: *const GLfixed); +} +extern "C" { + pub fn glMultiTexCoord1xOES(texture: GLenum, s: GLfixed); +} +extern "C" { + pub fn glMultiTexCoord1xvOES(texture: GLenum, coords: *const GLfixed); +} +extern "C" { + pub fn glMultiTexCoord2xOES(texture: GLenum, s: GLfixed, t: GLfixed); +} +extern "C" { + pub fn glMultiTexCoord2xvOES(texture: GLenum, coords: *const GLfixed); +} +extern "C" { + pub fn glMultiTexCoord3xOES(texture: GLenum, s: GLfixed, t: GLfixed, r: GLfixed); +} +extern "C" { + pub fn glMultiTexCoord3xvOES(texture: GLenum, coords: *const GLfixed); +} +extern "C" { + pub fn glMultiTexCoord4xvOES(texture: GLenum, coords: *const GLfixed); +} +extern "C" { + pub fn glNormal3xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glPassThroughxOES(token: GLfixed); +} +extern "C" { + pub fn glPixelMapx(map: GLenum, size: GLint, values: *const GLfixed); +} +extern "C" { + pub fn glPixelStorex(pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glPixelTransferxOES(pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glPixelZoomxOES(xfactor: GLfixed, yfactor: GLfixed); +} +extern "C" { + pub fn glPrioritizeTexturesxOES( + n: GLsizei, + textures: *const GLuint, + priorities: *const GLfixed, + ); +} +extern "C" { + pub fn glRasterPos2xOES(x: GLfixed, y: GLfixed); +} +extern "C" { + pub fn glRasterPos2xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glRasterPos3xOES(x: GLfixed, y: GLfixed, z: GLfixed); +} +extern "C" { + pub fn glRasterPos3xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glRasterPos4xOES(x: GLfixed, y: GLfixed, z: GLfixed, w: GLfixed); +} +extern "C" { + pub fn glRasterPos4xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glRectxOES(x1: GLfixed, y1: GLfixed, x2: GLfixed, y2: GLfixed); +} +extern "C" { + pub fn glRectxvOES(v1: *const GLfixed, v2: *const GLfixed); +} +extern "C" { + pub fn glTexCoord1xOES(s: GLfixed); +} +extern "C" { + pub fn glTexCoord1xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glTexCoord2xOES(s: GLfixed, t: GLfixed); +} +extern "C" { + pub fn glTexCoord2xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glTexCoord3xOES(s: GLfixed, t: GLfixed, r: GLfixed); +} +extern "C" { + pub fn glTexCoord3xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glTexCoord4xOES(s: GLfixed, t: GLfixed, r: GLfixed, q: GLfixed); +} +extern "C" { + pub fn glTexCoord4xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glTexGenxOES(coord: GLenum, pname: GLenum, param: GLfixed); +} +extern "C" { + pub fn glTexGenxvOES(coord: GLenum, pname: GLenum, params: *const GLfixed); +} +extern "C" { + pub fn glVertex2xOES(x: GLfixed); +} +extern "C" { + pub fn glVertex2xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glVertex3xOES(x: GLfixed, y: GLfixed); +} +extern "C" { + pub fn glVertex3xvOES(coords: *const GLfixed); +} +extern "C" { + pub fn glVertex4xOES(x: GLfixed, y: GLfixed, z: GLfixed); +} +extern "C" { + pub fn glVertex4xvOES(coords: *const GLfixed); +} +pub type PFNGLQUERYMATRIXXOESPROC = ::std::option::Option< + unsafe extern "C" fn(mantissa: *mut GLfixed, exponent: *mut GLint) -> GLbitfield, +>; +extern "C" { + pub fn glQueryMatrixxOES(mantissa: *mut GLfixed, exponent: *mut GLint) -> GLbitfield; +} +pub type PFNGLCLEARDEPTHFOESPROC = ::std::option::Option; +pub type PFNGLCLIPPLANEFOESPROC = + ::std::option::Option; +pub type PFNGLDEPTHRANGEFOESPROC = + ::std::option::Option; +pub type PFNGLFRUSTUMFOESPROC = ::std::option::Option< + unsafe extern "C" fn(l: GLfloat, r: GLfloat, b: GLfloat, t: GLfloat, n: GLfloat, f: GLfloat), +>; +pub type PFNGLGETCLIPPLANEFOESPROC = + ::std::option::Option; +pub type PFNGLORTHOFOESPROC = ::std::option::Option< + unsafe extern "C" fn(l: GLfloat, r: GLfloat, b: GLfloat, t: GLfloat, n: GLfloat, f: GLfloat), +>; +extern "C" { + pub fn glClearDepthfOES(depth: GLclampf); +} +extern "C" { + pub fn glClipPlanefOES(plane: GLenum, equation: *const GLfloat); +} +extern "C" { + pub fn glDepthRangefOES(n: GLclampf, f: GLclampf); +} +extern "C" { + pub fn glFrustumfOES(l: GLfloat, r: GLfloat, b: GLfloat, t: GLfloat, n: GLfloat, f: GLfloat); +} +extern "C" { + pub fn glGetClipPlanefOES(plane: GLenum, equation: *mut GLfloat); +} +extern "C" { + pub fn glOrthofOES(l: GLfloat, r: GLfloat, b: GLfloat, t: GLfloat, n: GLfloat, f: GLfloat); +} +pub type PFNGLTBUFFERMASK3DFXPROC = ::std::option::Option; +extern "C" { + pub fn glTbufferMask3DFX(mask: GLuint); +} +pub type GLDEBUGPROCAMD = ::std::option::Option< + unsafe extern "C" fn( + id: GLuint, + category: GLenum, + severity: GLenum, + length: GLsizei, + message: *const GLchar, + userParam: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLDEBUGMESSAGEENABLEAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + category: GLenum, + severity: GLenum, + count: GLsizei, + ids: *const GLuint, + enabled: GLboolean, + ), +>; +pub type PFNGLDEBUGMESSAGEINSERTAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + category: GLenum, + severity: GLenum, + id: GLuint, + length: GLsizei, + buf: *const GLchar, + ), +>; +pub type PFNGLDEBUGMESSAGECALLBACKAMDPROC = ::std::option::Option< + unsafe extern "C" fn(callback: GLDEBUGPROCAMD, userParam: *mut ::std::os::raw::c_void), +>; +pub type PFNGLGETDEBUGMESSAGELOGAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + count: GLuint, + bufsize: GLsizei, + categories: *mut GLenum, + severities: *mut GLuint, + ids: *mut GLuint, + lengths: *mut GLsizei, + message: *mut GLchar, + ) -> GLuint, +>; +extern "C" { + pub fn glDebugMessageEnableAMD( + category: GLenum, + severity: GLenum, + count: GLsizei, + ids: *const GLuint, + enabled: GLboolean, + ); +} +extern "C" { + pub fn glDebugMessageInsertAMD( + category: GLenum, + severity: GLenum, + id: GLuint, + length: GLsizei, + buf: *const GLchar, + ); +} +extern "C" { + pub fn glDebugMessageCallbackAMD( + callback: GLDEBUGPROCAMD, + userParam: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetDebugMessageLogAMD( + count: GLuint, + bufsize: GLsizei, + categories: *mut GLenum, + severities: *mut GLuint, + ids: *mut GLuint, + lengths: *mut GLsizei, + message: *mut GLchar, + ) -> GLuint; +} +pub type PFNGLBLENDFUNCINDEXEDAMDPROC = + ::std::option::Option; +pub type PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum, + ), +>; +pub type PFNGLBLENDEQUATIONINDEXEDAMDPROC = + ::std::option::Option; +pub type PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC = + ::std::option::Option; +extern "C" { + pub fn glBlendFuncIndexedAMD(buf: GLuint, src: GLenum, dst: GLenum); +} +extern "C" { + pub fn glBlendFuncSeparateIndexedAMD( + buf: GLuint, + srcRGB: GLenum, + dstRGB: GLenum, + srcAlpha: GLenum, + dstAlpha: GLenum, + ); +} +extern "C" { + pub fn glBlendEquationIndexedAMD(buf: GLuint, mode: GLenum); +} +extern "C" { + pub fn glBlendEquationSeparateIndexedAMD(buf: GLuint, modeRGB: GLenum, modeAlpha: GLenum); +} +pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + storageSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + renderbuffer: GLuint, + samples: GLsizei, + storageSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +extern "C" { + pub fn glRenderbufferStorageMultisampleAdvancedAMD( + target: GLenum, + samples: GLsizei, + storageSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glNamedRenderbufferStorageMultisampleAdvancedAMD( + renderbuffer: GLuint, + samples: GLsizei, + storageSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +pub type PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + numsamples: GLuint, + pixelindex: GLuint, + values: *const GLfloat, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + numsamples: GLuint, + pixelindex: GLuint, + values: *const GLfloat, + ), +>; +pub type PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + pname: GLenum, + numsamples: GLuint, + pixelindex: GLuint, + size: GLsizei, + values: *mut GLfloat, + ), +>; +pub type PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + pname: GLenum, + numsamples: GLuint, + pixelindex: GLuint, + size: GLsizei, + values: *mut GLfloat, + ), +>; +extern "C" { + pub fn glFramebufferSamplePositionsfvAMD( + target: GLenum, + numsamples: GLuint, + pixelindex: GLuint, + values: *const GLfloat, + ); +} +extern "C" { + pub fn glNamedFramebufferSamplePositionsfvAMD( + framebuffer: GLuint, + numsamples: GLuint, + pixelindex: GLuint, + values: *const GLfloat, + ); +} +extern "C" { + pub fn glGetFramebufferParameterfvAMD( + target: GLenum, + pname: GLenum, + numsamples: GLuint, + pixelindex: GLuint, + size: GLsizei, + values: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetNamedFramebufferParameterfvAMD( + framebuffer: GLuint, + pname: GLenum, + numsamples: GLuint, + pixelindex: GLuint, + size: GLsizei, + values: *mut GLfloat, + ); +} +pub type GLint64EXT = khronos_int64_t; +pub type PFNGLUNIFORM1I64NVPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2I64NVPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3I64NVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLint64EXT, y: GLint64EXT, z: GLint64EXT), +>; +pub type PFNGLUNIFORM4I64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + w: GLint64EXT, + ), +>; +pub type PFNGLUNIFORM1I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64EXT), +>; +pub type PFNGLUNIFORM2I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64EXT), +>; +pub type PFNGLUNIFORM3I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64EXT), +>; +pub type PFNGLUNIFORM4I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLint64EXT), +>; +pub type PFNGLUNIFORM1UI64NVPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2UI64NVPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, x: GLuint64EXT, y: GLuint64EXT, z: GLuint64EXT), +>; +pub type PFNGLUNIFORM4UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + w: GLuint64EXT, + ), +>; +pub type PFNGLUNIFORM1UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64EXT), +>; +pub type PFNGLUNIFORM2UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64EXT), +>; +pub type PFNGLUNIFORM3UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64EXT), +>; +pub type PFNGLUNIFORM4UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64EXT), +>; +pub type PFNGLGETUNIFORMI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLint64EXT), +>; +pub type PFNGLGETUNIFORMUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLuint64EXT), +>; +pub type PFNGLPROGRAMUNIFORM1I64NVPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2I64NVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLint64EXT, y: GLint64EXT), +>; +pub type PFNGLPROGRAMUNIFORM3I64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM4I64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + w: GLint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM1I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM2I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM3I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM4I64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM1UI64NVPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLuint64EXT, y: GLuint64EXT), +>; +pub type PFNGLPROGRAMUNIFORM3UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM4UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + w: GLuint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM1UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM2UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM3UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ), +>; +pub type PFNGLPROGRAMUNIFORM4UI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ), +>; +extern "C" { + pub fn glUniform1i64NV(location: GLint, x: GLint64EXT); +} +extern "C" { + pub fn glUniform2i64NV(location: GLint, x: GLint64EXT, y: GLint64EXT); +} +extern "C" { + pub fn glUniform3i64NV(location: GLint, x: GLint64EXT, y: GLint64EXT, z: GLint64EXT); +} +extern "C" { + pub fn glUniform4i64NV( + location: GLint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + w: GLint64EXT, + ); +} +extern "C" { + pub fn glUniform1i64vNV(location: GLint, count: GLsizei, value: *const GLint64EXT); +} +extern "C" { + pub fn glUniform2i64vNV(location: GLint, count: GLsizei, value: *const GLint64EXT); +} +extern "C" { + pub fn glUniform3i64vNV(location: GLint, count: GLsizei, value: *const GLint64EXT); +} +extern "C" { + pub fn glUniform4i64vNV(location: GLint, count: GLsizei, value: *const GLint64EXT); +} +extern "C" { + pub fn glUniform1ui64NV(location: GLint, x: GLuint64EXT); +} +extern "C" { + pub fn glUniform2ui64NV(location: GLint, x: GLuint64EXT, y: GLuint64EXT); +} +extern "C" { + pub fn glUniform3ui64NV(location: GLint, x: GLuint64EXT, y: GLuint64EXT, z: GLuint64EXT); +} +extern "C" { + pub fn glUniform4ui64NV( + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + w: GLuint64EXT, + ); +} +extern "C" { + pub fn glUniform1ui64vNV(location: GLint, count: GLsizei, value: *const GLuint64EXT); +} +extern "C" { + pub fn glUniform2ui64vNV(location: GLint, count: GLsizei, value: *const GLuint64EXT); +} +extern "C" { + pub fn glUniform3ui64vNV(location: GLint, count: GLsizei, value: *const GLuint64EXT); +} +extern "C" { + pub fn glUniform4ui64vNV(location: GLint, count: GLsizei, value: *const GLuint64EXT); +} +extern "C" { + pub fn glGetUniformi64vNV(program: GLuint, location: GLint, params: *mut GLint64EXT); +} +extern "C" { + pub fn glGetUniformui64vNV(program: GLuint, location: GLint, params: *mut GLuint64EXT); +} +extern "C" { + pub fn glProgramUniform1i64NV(program: GLuint, location: GLint, x: GLint64EXT); +} +extern "C" { + pub fn glProgramUniform2i64NV(program: GLuint, location: GLint, x: GLint64EXT, y: GLint64EXT); +} +extern "C" { + pub fn glProgramUniform3i64NV( + program: GLuint, + location: GLint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform4i64NV( + program: GLuint, + location: GLint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + w: GLint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform1i64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform2i64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform3i64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform4i64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform1ui64NV(program: GLuint, location: GLint, x: GLuint64EXT); +} +extern "C" { + pub fn glProgramUniform2ui64NV( + program: GLuint, + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform3ui64NV( + program: GLuint, + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform4ui64NV( + program: GLuint, + location: GLint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + w: GLuint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform1ui64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform2ui64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform3ui64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ); +} +extern "C" { + pub fn glProgramUniform4ui64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ); +} +pub type PFNGLVERTEXATTRIBPARAMETERIAMDPROC = + ::std::option::Option; +extern "C" { + pub fn glVertexAttribParameteriAMD(index: GLuint, pname: GLenum, param: GLint); +} +pub type PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + primcount: GLsizei, + stride: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + primcount: GLsizei, + stride: GLsizei, + ), +>; +extern "C" { + pub fn glMultiDrawArraysIndirectAMD( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + primcount: GLsizei, + stride: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElementsIndirectAMD( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + primcount: GLsizei, + stride: GLsizei, + ); +} +pub type PFNGLGENNAMESAMDPROC = ::std::option::Option< + unsafe extern "C" fn(identifier: GLenum, num: GLuint, names: *mut GLuint), +>; +pub type PFNGLDELETENAMESAMDPROC = ::std::option::Option< + unsafe extern "C" fn(identifier: GLenum, num: GLuint, names: *const GLuint), +>; +pub type PFNGLISNAMEAMDPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glGenNamesAMD(identifier: GLenum, num: GLuint, names: *mut GLuint); +} +extern "C" { + pub fn glDeleteNamesAMD(identifier: GLenum, num: GLuint, names: *const GLuint); +} +extern "C" { + pub fn glIsNameAMD(identifier: GLenum, name: GLuint) -> GLboolean; +} +pub type PFNGLQUERYOBJECTPARAMETERUIAMDPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, id: GLuint, pname: GLenum, param: GLuint), +>; +extern "C" { + pub fn glQueryObjectParameteruiAMD(target: GLenum, id: GLuint, pname: GLenum, param: GLuint); +} +pub type PFNGLGETPERFMONITORGROUPSAMDPROC = ::std::option::Option< + unsafe extern "C" fn(numGroups: *mut GLint, groupsSize: GLsizei, groups: *mut GLuint), +>; +pub type PFNGLGETPERFMONITORCOUNTERSAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + group: GLuint, + numCounters: *mut GLint, + maxActiveCounters: *mut GLint, + counterSize: GLsizei, + counters: *mut GLuint, + ), +>; +pub type PFNGLGETPERFMONITORGROUPSTRINGAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + group: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + groupString: *mut GLchar, + ), +>; +pub type PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + group: GLuint, + counter: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + counterString: *mut GLchar, + ), +>; +pub type PFNGLGETPERFMONITORCOUNTERINFOAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + group: GLuint, + counter: GLuint, + pname: GLenum, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGENPERFMONITORSAMDPROC = + ::std::option::Option; +pub type PFNGLDELETEPERFMONITORSAMDPROC = + ::std::option::Option; +pub type PFNGLSELECTPERFMONITORCOUNTERSAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + monitor: GLuint, + enable: GLboolean, + group: GLuint, + numCounters: GLint, + counterList: *mut GLuint, + ), +>; +pub type PFNGLBEGINPERFMONITORAMDPROC = + ::std::option::Option; +pub type PFNGLENDPERFMONITORAMDPROC = ::std::option::Option; +pub type PFNGLGETPERFMONITORCOUNTERDATAAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + monitor: GLuint, + pname: GLenum, + dataSize: GLsizei, + data: *mut GLuint, + bytesWritten: *mut GLint, + ), +>; +extern "C" { + pub fn glGetPerfMonitorGroupsAMD( + numGroups: *mut GLint, + groupsSize: GLsizei, + groups: *mut GLuint, + ); +} +extern "C" { + pub fn glGetPerfMonitorCountersAMD( + group: GLuint, + numCounters: *mut GLint, + maxActiveCounters: *mut GLint, + counterSize: GLsizei, + counters: *mut GLuint, + ); +} +extern "C" { + pub fn glGetPerfMonitorGroupStringAMD( + group: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + groupString: *mut GLchar, + ); +} +extern "C" { + pub fn glGetPerfMonitorCounterStringAMD( + group: GLuint, + counter: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + counterString: *mut GLchar, + ); +} +extern "C" { + pub fn glGetPerfMonitorCounterInfoAMD( + group: GLuint, + counter: GLuint, + pname: GLenum, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGenPerfMonitorsAMD(n: GLsizei, monitors: *mut GLuint); +} +extern "C" { + pub fn glDeletePerfMonitorsAMD(n: GLsizei, monitors: *mut GLuint); +} +extern "C" { + pub fn glSelectPerfMonitorCountersAMD( + monitor: GLuint, + enable: GLboolean, + group: GLuint, + numCounters: GLint, + counterList: *mut GLuint, + ); +} +extern "C" { + pub fn glBeginPerfMonitorAMD(monitor: GLuint); +} +extern "C" { + pub fn glEndPerfMonitorAMD(monitor: GLuint); +} +extern "C" { + pub fn glGetPerfMonitorCounterDataAMD( + monitor: GLuint, + pname: GLenum, + dataSize: GLsizei, + data: *mut GLuint, + bytesWritten: *mut GLint, + ); +} +pub type PFNGLSETMULTISAMPLEFVAMDPROC = + ::std::option::Option; +extern "C" { + pub fn glSetMultisamplefvAMD(pname: GLenum, index: GLuint, val: *const GLfloat); +} +pub type PFNGLTEXSTORAGESPARSEAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + layers: GLsizei, + flags: GLbitfield, + ), +>; +pub type PFNGLTEXTURESTORAGESPARSEAMDPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + layers: GLsizei, + flags: GLbitfield, + ), +>; +extern "C" { + pub fn glTexStorageSparseAMD( + target: GLenum, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + layers: GLsizei, + flags: GLbitfield, + ); +} +extern "C" { + pub fn glTextureStorageSparseAMD( + texture: GLuint, + target: GLenum, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + layers: GLsizei, + flags: GLbitfield, + ); +} +pub type PFNGLSTENCILOPVALUEAMDPROC = + ::std::option::Option; +extern "C" { + pub fn glStencilOpValueAMD(face: GLenum, value: GLuint); +} +pub type PFNGLTESSELLATIONFACTORAMDPROC = + ::std::option::Option; +pub type PFNGLTESSELLATIONMODEAMDPROC = ::std::option::Option; +extern "C" { + pub fn glTessellationFactorAMD(factor: GLfloat); +} +extern "C" { + pub fn glTessellationModeAMD(mode: GLenum); +} +pub type PFNGLELEMENTPOINTERAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, pointer: *const ::std::os::raw::c_void), +>; +pub type PFNGLDRAWELEMENTARRAYAPPLEPROC = + ::std::option::Option; +pub type PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, start: GLuint, end: GLuint, first: GLint, count: GLsizei), +>; +pub type PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + start: GLuint, + end: GLuint, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + ), +>; +extern "C" { + pub fn glElementPointerAPPLE(type_: GLenum, pointer: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glDrawElementArrayAPPLE(mode: GLenum, first: GLint, count: GLsizei); +} +extern "C" { + pub fn glDrawRangeElementArrayAPPLE( + mode: GLenum, + start: GLuint, + end: GLuint, + first: GLint, + count: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElementArrayAPPLE( + mode: GLenum, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawRangeElementArrayAPPLE( + mode: GLenum, + start: GLuint, + end: GLuint, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + ); +} +pub type PFNGLGENFENCESAPPLEPROC = + ::std::option::Option; +pub type PFNGLDELETEFENCESAPPLEPROC = + ::std::option::Option; +pub type PFNGLSETFENCEAPPLEPROC = ::std::option::Option; +pub type PFNGLISFENCEAPPLEPROC = + ::std::option::Option GLboolean>; +pub type PFNGLTESTFENCEAPPLEPROC = + ::std::option::Option GLboolean>; +pub type PFNGLFINISHFENCEAPPLEPROC = ::std::option::Option; +pub type PFNGLTESTOBJECTAPPLEPROC = + ::std::option::Option GLboolean>; +pub type PFNGLFINISHOBJECTAPPLEPROC = + ::std::option::Option; +extern "C" { + pub fn glGenFencesAPPLE(n: GLsizei, fences: *mut GLuint); +} +extern "C" { + pub fn glDeleteFencesAPPLE(n: GLsizei, fences: *const GLuint); +} +extern "C" { + pub fn glSetFenceAPPLE(fence: GLuint); +} +extern "C" { + pub fn glIsFenceAPPLE(fence: GLuint) -> GLboolean; +} +extern "C" { + pub fn glTestFenceAPPLE(fence: GLuint) -> GLboolean; +} +extern "C" { + pub fn glFinishFenceAPPLE(fence: GLuint); +} +extern "C" { + pub fn glTestObjectAPPLE(object: GLenum, name: GLuint) -> GLboolean; +} +extern "C" { + pub fn glFinishObjectAPPLE(object: GLenum, name: GLint); +} +pub type PFNGLBUFFERPARAMETERIAPPLEPROC = + ::std::option::Option; +pub type PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC = + ::std::option::Option; +extern "C" { + pub fn glBufferParameteriAPPLE(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glFlushMappedBufferRangeAPPLE(target: GLenum, offset: GLintptr, size: GLsizeiptr); +} +pub type PFNGLOBJECTPURGEABLEAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(objectType: GLenum, name: GLuint, option: GLenum) -> GLenum, +>; +pub type PFNGLOBJECTUNPURGEABLEAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(objectType: GLenum, name: GLuint, option: GLenum) -> GLenum, +>; +pub type PFNGLGETOBJECTPARAMETERIVAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(objectType: GLenum, name: GLuint, pname: GLenum, params: *mut GLint), +>; +extern "C" { + pub fn glObjectPurgeableAPPLE(objectType: GLenum, name: GLuint, option: GLenum) -> GLenum; +} +extern "C" { + pub fn glObjectUnpurgeableAPPLE(objectType: GLenum, name: GLuint, option: GLenum) -> GLenum; +} +extern "C" { + pub fn glGetObjectParameterivAPPLE( + objectType: GLenum, + name: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +pub type PFNGLTEXTURERANGEAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, length: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +pub type PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut *mut ::std::os::raw::c_void), +>; +extern "C" { + pub fn glTextureRangeAPPLE( + target: GLenum, + length: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetTexParameterPointervAPPLE( + target: GLenum, + pname: GLenum, + params: *mut *mut ::std::os::raw::c_void, + ); +} +pub type PFNGLBINDVERTEXARRAYAPPLEPROC = ::std::option::Option; +pub type PFNGLDELETEVERTEXARRAYSAPPLEPROC = + ::std::option::Option; +pub type PFNGLGENVERTEXARRAYSAPPLEPROC = + ::std::option::Option; +pub type PFNGLISVERTEXARRAYAPPLEPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glBindVertexArrayAPPLE(array: GLuint); +} +extern "C" { + pub fn glDeleteVertexArraysAPPLE(n: GLsizei, arrays: *const GLuint); +} +extern "C" { + pub fn glGenVertexArraysAPPLE(n: GLsizei, arrays: *mut GLuint); +} +extern "C" { + pub fn glIsVertexArrayAPPLE(array: GLuint) -> GLboolean; +} +pub type PFNGLVERTEXARRAYRANGEAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(length: GLsizei, pointer: *mut ::std::os::raw::c_void), +>; +pub type PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn(length: GLsizei, pointer: *mut ::std::os::raw::c_void), +>; +pub type PFNGLVERTEXARRAYPARAMETERIAPPLEPROC = + ::std::option::Option; +extern "C" { + pub fn glVertexArrayRangeAPPLE(length: GLsizei, pointer: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn glFlushVertexArrayRangeAPPLE(length: GLsizei, pointer: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn glVertexArrayParameteriAPPLE(pname: GLenum, param: GLint); +} +pub type PFNGLENABLEVERTEXATTRIBAPPLEPROC = + ::std::option::Option; +pub type PFNGLDISABLEVERTEXATTRIBAPPLEPROC = + ::std::option::Option; +pub type PFNGLISVERTEXATTRIBENABLEDAPPLEPROC = + ::std::option::Option GLboolean>; +pub type PFNGLMAPVERTEXATTRIB1DAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLuint, + u1: GLdouble, + u2: GLdouble, + stride: GLint, + order: GLint, + points: *const GLdouble, + ), +>; +pub type PFNGLMAPVERTEXATTRIB1FAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLuint, + u1: GLfloat, + u2: GLfloat, + stride: GLint, + order: GLint, + points: *const GLfloat, + ), +>; +pub type PFNGLMAPVERTEXATTRIB2DAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLuint, + u1: GLdouble, + u2: GLdouble, + ustride: GLint, + uorder: GLint, + v1: GLdouble, + v2: GLdouble, + vstride: GLint, + vorder: GLint, + points: *const GLdouble, + ), +>; +pub type PFNGLMAPVERTEXATTRIB2FAPPLEPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLuint, + u1: GLfloat, + u2: GLfloat, + ustride: GLint, + uorder: GLint, + v1: GLfloat, + v2: GLfloat, + vstride: GLint, + vorder: GLint, + points: *const GLfloat, + ), +>; +extern "C" { + pub fn glEnableVertexAttribAPPLE(index: GLuint, pname: GLenum); +} +extern "C" { + pub fn glDisableVertexAttribAPPLE(index: GLuint, pname: GLenum); +} +extern "C" { + pub fn glIsVertexAttribEnabledAPPLE(index: GLuint, pname: GLenum) -> GLboolean; +} +extern "C" { + pub fn glMapVertexAttrib1dAPPLE( + index: GLuint, + size: GLuint, + u1: GLdouble, + u2: GLdouble, + stride: GLint, + order: GLint, + points: *const GLdouble, + ); +} +extern "C" { + pub fn glMapVertexAttrib1fAPPLE( + index: GLuint, + size: GLuint, + u1: GLfloat, + u2: GLfloat, + stride: GLint, + order: GLint, + points: *const GLfloat, + ); +} +extern "C" { + pub fn glMapVertexAttrib2dAPPLE( + index: GLuint, + size: GLuint, + u1: GLdouble, + u2: GLdouble, + ustride: GLint, + uorder: GLint, + v1: GLdouble, + v2: GLdouble, + vstride: GLint, + vorder: GLint, + points: *const GLdouble, + ); +} +extern "C" { + pub fn glMapVertexAttrib2fAPPLE( + index: GLuint, + size: GLuint, + u1: GLfloat, + u2: GLfloat, + ustride: GLint, + uorder: GLint, + v1: GLfloat, + v2: GLfloat, + vstride: GLint, + vorder: GLint, + points: *const GLfloat, + ); +} +pub type PFNGLDRAWBUFFERSATIPROC = + ::std::option::Option; +extern "C" { + pub fn glDrawBuffersATI(n: GLsizei, bufs: *const GLenum); +} +pub type PFNGLELEMENTPOINTERATIPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, pointer: *const ::std::os::raw::c_void), +>; +pub type PFNGLDRAWELEMENTARRAYATIPROC = + ::std::option::Option; +pub type PFNGLDRAWRANGEELEMENTARRAYATIPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei), +>; +extern "C" { + pub fn glElementPointerATI(type_: GLenum, pointer: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glDrawElementArrayATI(mode: GLenum, count: GLsizei); +} +extern "C" { + pub fn glDrawRangeElementArrayATI(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei); +} +pub type PFNGLTEXBUMPPARAMETERIVATIPROC = + ::std::option::Option; +pub type PFNGLTEXBUMPPARAMETERFVATIPROC = + ::std::option::Option; +pub type PFNGLGETTEXBUMPPARAMETERIVATIPROC = + ::std::option::Option; +pub type PFNGLGETTEXBUMPPARAMETERFVATIPROC = + ::std::option::Option; +extern "C" { + pub fn glTexBumpParameterivATI(pname: GLenum, param: *const GLint); +} +extern "C" { + pub fn glTexBumpParameterfvATI(pname: GLenum, param: *const GLfloat); +} +extern "C" { + pub fn glGetTexBumpParameterivATI(pname: GLenum, param: *mut GLint); +} +extern "C" { + pub fn glGetTexBumpParameterfvATI(pname: GLenum, param: *mut GLfloat); +} +pub type PFNGLGENFRAGMENTSHADERSATIPROC = + ::std::option::Option GLuint>; +pub type PFNGLBINDFRAGMENTSHADERATIPROC = ::std::option::Option; +pub type PFNGLDELETEFRAGMENTSHADERATIPROC = ::std::option::Option; +pub type PFNGLBEGINFRAGMENTSHADERATIPROC = ::std::option::Option; +pub type PFNGLENDFRAGMENTSHADERATIPROC = ::std::option::Option; +pub type PFNGLPASSTEXCOORDATIPROC = + ::std::option::Option; +pub type PFNGLSAMPLEMAPATIPROC = + ::std::option::Option; +pub type PFNGLCOLORFRAGMENTOP1ATIPROC = ::std::option::Option< + unsafe extern "C" fn( + op: GLenum, + dst: GLuint, + dstMask: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + ), +>; +pub type PFNGLCOLORFRAGMENTOP2ATIPROC = ::std::option::Option< + unsafe extern "C" fn( + op: GLenum, + dst: GLuint, + dstMask: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + ), +>; +pub type PFNGLCOLORFRAGMENTOP3ATIPROC = ::std::option::Option< + unsafe extern "C" fn( + op: GLenum, + dst: GLuint, + dstMask: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + arg3: GLuint, + arg3Rep: GLuint, + arg3Mod: GLuint, + ), +>; +pub type PFNGLALPHAFRAGMENTOP1ATIPROC = ::std::option::Option< + unsafe extern "C" fn( + op: GLenum, + dst: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + ), +>; +pub type PFNGLALPHAFRAGMENTOP2ATIPROC = ::std::option::Option< + unsafe extern "C" fn( + op: GLenum, + dst: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + ), +>; +pub type PFNGLALPHAFRAGMENTOP3ATIPROC = ::std::option::Option< + unsafe extern "C" fn( + op: GLenum, + dst: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + arg3: GLuint, + arg3Rep: GLuint, + arg3Mod: GLuint, + ), +>; +pub type PFNGLSETFRAGMENTSHADERCONSTANTATIPROC = + ::std::option::Option; +extern "C" { + pub fn glGenFragmentShadersATI(range: GLuint) -> GLuint; +} +extern "C" { + pub fn glBindFragmentShaderATI(id: GLuint); +} +extern "C" { + pub fn glDeleteFragmentShaderATI(id: GLuint); +} +extern "C" { + pub fn glBeginFragmentShaderATI(); +} +extern "C" { + pub fn glEndFragmentShaderATI(); +} +extern "C" { + pub fn glPassTexCoordATI(dst: GLuint, coord: GLuint, swizzle: GLenum); +} +extern "C" { + pub fn glSampleMapATI(dst: GLuint, interp: GLuint, swizzle: GLenum); +} +extern "C" { + pub fn glColorFragmentOp1ATI( + op: GLenum, + dst: GLuint, + dstMask: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + ); +} +extern "C" { + pub fn glColorFragmentOp2ATI( + op: GLenum, + dst: GLuint, + dstMask: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + ); +} +extern "C" { + pub fn glColorFragmentOp3ATI( + op: GLenum, + dst: GLuint, + dstMask: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + arg3: GLuint, + arg3Rep: GLuint, + arg3Mod: GLuint, + ); +} +extern "C" { + pub fn glAlphaFragmentOp1ATI( + op: GLenum, + dst: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + ); +} +extern "C" { + pub fn glAlphaFragmentOp2ATI( + op: GLenum, + dst: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + ); +} +extern "C" { + pub fn glAlphaFragmentOp3ATI( + op: GLenum, + dst: GLuint, + dstMod: GLuint, + arg1: GLuint, + arg1Rep: GLuint, + arg1Mod: GLuint, + arg2: GLuint, + arg2Rep: GLuint, + arg2Mod: GLuint, + arg3: GLuint, + arg3Rep: GLuint, + arg3Mod: GLuint, + ); +} +extern "C" { + pub fn glSetFragmentShaderConstantATI(dst: GLuint, value: *const GLfloat); +} +pub type PFNGLMAPOBJECTBUFFERATIPROC = + ::std::option::Option *mut ::std::os::raw::c_void>; +pub type PFNGLUNMAPOBJECTBUFFERATIPROC = + ::std::option::Option; +extern "C" { + pub fn glMapObjectBufferATI(buffer: GLuint) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glUnmapObjectBufferATI(buffer: GLuint); +} +pub type PFNGLPNTRIANGLESIATIPROC = + ::std::option::Option; +pub type PFNGLPNTRIANGLESFATIPROC = + ::std::option::Option; +extern "C" { + pub fn glPNTrianglesiATI(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPNTrianglesfATI(pname: GLenum, param: GLfloat); +} +pub type PFNGLSTENCILOPSEPARATEATIPROC = ::std::option::Option< + unsafe extern "C" fn(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum), +>; +pub type PFNGLSTENCILFUNCSEPARATEATIPROC = ::std::option::Option< + unsafe extern "C" fn(frontfunc: GLenum, backfunc: GLenum, ref_: GLint, mask: GLuint), +>; +extern "C" { + pub fn glStencilOpSeparateATI(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum); +} +extern "C" { + pub fn glStencilFuncSeparateATI(frontfunc: GLenum, backfunc: GLenum, ref_: GLint, mask: GLuint); +} +pub type PFNGLNEWOBJECTBUFFERATIPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLsizei, + pointer: *const ::std::os::raw::c_void, + usage: GLenum, + ) -> GLuint, +>; +pub type PFNGLISOBJECTBUFFERATIPROC = + ::std::option::Option GLboolean>; +pub type PFNGLUPDATEOBJECTBUFFERATIPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLuint, + size: GLsizei, + pointer: *const ::std::os::raw::c_void, + preserve: GLenum, + ), +>; +pub type PFNGLGETOBJECTBUFFERFVATIPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETOBJECTBUFFERIVATIPROC = + ::std::option::Option; +pub type PFNGLFREEOBJECTBUFFERATIPROC = ::std::option::Option; +pub type PFNGLARRAYOBJECTATIPROC = ::std::option::Option< + unsafe extern "C" fn( + array: GLenum, + size: GLint, + type_: GLenum, + stride: GLsizei, + buffer: GLuint, + offset: GLuint, + ), +>; +pub type PFNGLGETARRAYOBJECTFVATIPROC = + ::std::option::Option; +pub type PFNGLGETARRAYOBJECTIVATIPROC = + ::std::option::Option; +pub type PFNGLVARIANTARRAYOBJECTATIPROC = ::std::option::Option< + unsafe extern "C" fn( + id: GLuint, + type_: GLenum, + stride: GLsizei, + buffer: GLuint, + offset: GLuint, + ), +>; +pub type PFNGLGETVARIANTARRAYOBJECTFVATIPROC = + ::std::option::Option; +pub type PFNGLGETVARIANTARRAYOBJECTIVATIPROC = + ::std::option::Option; +extern "C" { + pub fn glNewObjectBufferATI( + size: GLsizei, + pointer: *const ::std::os::raw::c_void, + usage: GLenum, + ) -> GLuint; +} +extern "C" { + pub fn glIsObjectBufferATI(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glUpdateObjectBufferATI( + buffer: GLuint, + offset: GLuint, + size: GLsizei, + pointer: *const ::std::os::raw::c_void, + preserve: GLenum, + ); +} +extern "C" { + pub fn glGetObjectBufferfvATI(buffer: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetObjectBufferivATI(buffer: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glFreeObjectBufferATI(buffer: GLuint); +} +extern "C" { + pub fn glArrayObjectATI( + array: GLenum, + size: GLint, + type_: GLenum, + stride: GLsizei, + buffer: GLuint, + offset: GLuint, + ); +} +extern "C" { + pub fn glGetArrayObjectfvATI(array: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetArrayObjectivATI(array: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glVariantArrayObjectATI( + id: GLuint, + type_: GLenum, + stride: GLsizei, + buffer: GLuint, + offset: GLuint, + ); +} +extern "C" { + pub fn glGetVariantArrayObjectfvATI(id: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetVariantArrayObjectivATI(id: GLuint, pname: GLenum, params: *mut GLint); +} +pub type PFNGLVERTEXATTRIBARRAYOBJECTATIPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + buffer: GLuint, + offset: GLuint, + ), +>; +pub type PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC = + ::std::option::Option; +extern "C" { + pub fn glVertexAttribArrayObjectATI( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + buffer: GLuint, + offset: GLuint, + ); +} +extern "C" { + pub fn glGetVertexAttribArrayObjectfvATI(index: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetVertexAttribArrayObjectivATI(index: GLuint, pname: GLenum, params: *mut GLint); +} +pub type PFNGLVERTEXSTREAM1SATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1SVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1IATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1IVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1FATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1FVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1DATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM1DVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2SATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2SVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2IATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2IVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2FATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2FVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2DATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM2DVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3SATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3SVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3IATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3IVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3FATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3FVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM3DATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLVERTEXSTREAM3DVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM4SATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, x: GLshort, y: GLshort, z: GLshort, w: GLshort), +>; +pub type PFNGLVERTEXSTREAM4SVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM4IATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, x: GLint, y: GLint, z: GLint, w: GLint), +>; +pub type PFNGLVERTEXSTREAM4IVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM4FATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), +>; +pub type PFNGLVERTEXSTREAM4FVATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXSTREAM4DATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLVERTEXSTREAM4DVATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3BATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3BVATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3SATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, nx: GLshort, ny: GLshort, nz: GLshort), +>; +pub type PFNGLNORMALSTREAM3SVATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3IATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3IVATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3FATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, nx: GLfloat, ny: GLfloat, nz: GLfloat), +>; +pub type PFNGLNORMALSTREAM3FVATIPROC = + ::std::option::Option; +pub type PFNGLNORMALSTREAM3DATIPROC = ::std::option::Option< + unsafe extern "C" fn(stream: GLenum, nx: GLdouble, ny: GLdouble, nz: GLdouble), +>; +pub type PFNGLNORMALSTREAM3DVATIPROC = + ::std::option::Option; +pub type PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXBLENDENVIATIPROC = + ::std::option::Option; +pub type PFNGLVERTEXBLENDENVFATIPROC = + ::std::option::Option; +extern "C" { + pub fn glVertexStream1sATI(stream: GLenum, x: GLshort); +} +extern "C" { + pub fn glVertexStream1svATI(stream: GLenum, coords: *const GLshort); +} +extern "C" { + pub fn glVertexStream1iATI(stream: GLenum, x: GLint); +} +extern "C" { + pub fn glVertexStream1ivATI(stream: GLenum, coords: *const GLint); +} +extern "C" { + pub fn glVertexStream1fATI(stream: GLenum, x: GLfloat); +} +extern "C" { + pub fn glVertexStream1fvATI(stream: GLenum, coords: *const GLfloat); +} +extern "C" { + pub fn glVertexStream1dATI(stream: GLenum, x: GLdouble); +} +extern "C" { + pub fn glVertexStream1dvATI(stream: GLenum, coords: *const GLdouble); +} +extern "C" { + pub fn glVertexStream2sATI(stream: GLenum, x: GLshort, y: GLshort); +} +extern "C" { + pub fn glVertexStream2svATI(stream: GLenum, coords: *const GLshort); +} +extern "C" { + pub fn glVertexStream2iATI(stream: GLenum, x: GLint, y: GLint); +} +extern "C" { + pub fn glVertexStream2ivATI(stream: GLenum, coords: *const GLint); +} +extern "C" { + pub fn glVertexStream2fATI(stream: GLenum, x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glVertexStream2fvATI(stream: GLenum, coords: *const GLfloat); +} +extern "C" { + pub fn glVertexStream2dATI(stream: GLenum, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertexStream2dvATI(stream: GLenum, coords: *const GLdouble); +} +extern "C" { + pub fn glVertexStream3sATI(stream: GLenum, x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glVertexStream3svATI(stream: GLenum, coords: *const GLshort); +} +extern "C" { + pub fn glVertexStream3iATI(stream: GLenum, x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glVertexStream3ivATI(stream: GLenum, coords: *const GLint); +} +extern "C" { + pub fn glVertexStream3fATI(stream: GLenum, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glVertexStream3fvATI(stream: GLenum, coords: *const GLfloat); +} +extern "C" { + pub fn glVertexStream3dATI(stream: GLenum, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertexStream3dvATI(stream: GLenum, coords: *const GLdouble); +} +extern "C" { + pub fn glVertexStream4sATI(stream: GLenum, x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glVertexStream4svATI(stream: GLenum, coords: *const GLshort); +} +extern "C" { + pub fn glVertexStream4iATI(stream: GLenum, x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glVertexStream4ivATI(stream: GLenum, coords: *const GLint); +} +extern "C" { + pub fn glVertexStream4fATI(stream: GLenum, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glVertexStream4fvATI(stream: GLenum, coords: *const GLfloat); +} +extern "C" { + pub fn glVertexStream4dATI(stream: GLenum, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertexStream4dvATI(stream: GLenum, coords: *const GLdouble); +} +extern "C" { + pub fn glNormalStream3bATI(stream: GLenum, nx: GLbyte, ny: GLbyte, nz: GLbyte); +} +extern "C" { + pub fn glNormalStream3bvATI(stream: GLenum, coords: *const GLbyte); +} +extern "C" { + pub fn glNormalStream3sATI(stream: GLenum, nx: GLshort, ny: GLshort, nz: GLshort); +} +extern "C" { + pub fn glNormalStream3svATI(stream: GLenum, coords: *const GLshort); +} +extern "C" { + pub fn glNormalStream3iATI(stream: GLenum, nx: GLint, ny: GLint, nz: GLint); +} +extern "C" { + pub fn glNormalStream3ivATI(stream: GLenum, coords: *const GLint); +} +extern "C" { + pub fn glNormalStream3fATI(stream: GLenum, nx: GLfloat, ny: GLfloat, nz: GLfloat); +} +extern "C" { + pub fn glNormalStream3fvATI(stream: GLenum, coords: *const GLfloat); +} +extern "C" { + pub fn glNormalStream3dATI(stream: GLenum, nx: GLdouble, ny: GLdouble, nz: GLdouble); +} +extern "C" { + pub fn glNormalStream3dvATI(stream: GLenum, coords: *const GLdouble); +} +extern "C" { + pub fn glClientActiveVertexStreamATI(stream: GLenum); +} +extern "C" { + pub fn glVertexBlendEnviATI(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glVertexBlendEnvfATI(pname: GLenum, param: GLfloat); +} +pub type GLeglImageOES = *mut ::std::os::raw::c_void; +pub type PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, image: GLeglImageOES, attrib_list: *const GLint), +>; +pub type PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, image: GLeglImageOES, attrib_list: *const GLint), +>; +extern "C" { + pub fn glEGLImageTargetTexStorageEXT( + target: GLenum, + image: GLeglImageOES, + attrib_list: *const GLint, + ); +} +extern "C" { + pub fn glEGLImageTargetTextureStorageEXT( + texture: GLuint, + image: GLeglImageOES, + attrib_list: *const GLint, + ); +} +pub type PFNGLUNIFORMBUFFEREXTPROC = + ::std::option::Option; +pub type PFNGLGETUNIFORMBUFFERSIZEEXTPROC = + ::std::option::Option GLint>; +pub type PFNGLGETUNIFORMOFFSETEXTPROC = + ::std::option::Option GLintptr>; +extern "C" { + pub fn glUniformBufferEXT(program: GLuint, location: GLint, buffer: GLuint); +} +extern "C" { + pub fn glGetUniformBufferSizeEXT(program: GLuint, location: GLint) -> GLint; +} +extern "C" { + pub fn glGetUniformOffsetEXT(program: GLuint, location: GLint) -> GLintptr; +} +pub type PFNGLBLENDCOLOREXTPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), +>; +extern "C" { + pub fn glBlendColorEXT(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat); +} +pub type PFNGLBLENDEQUATIONSEPARATEEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glBlendEquationSeparateEXT(modeRGB: GLenum, modeAlpha: GLenum); +} +pub type PFNGLBLENDFUNCSEPARATEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ), +>; +extern "C" { + pub fn glBlendFuncSeparateEXT( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ); +} +pub type PFNGLBLENDEQUATIONEXTPROC = ::std::option::Option; +extern "C" { + pub fn glBlendEquationEXT(mode: GLenum); +} +pub type PFNGLCOLORSUBTABLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + start: GLsizei, + count: GLsizei, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYCOLORSUBTABLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, start: GLsizei, x: GLint, y: GLint, width: GLsizei), +>; +extern "C" { + pub fn glColorSubTableEXT( + target: GLenum, + start: GLsizei, + count: GLsizei, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyColorSubTableEXT( + target: GLenum, + start: GLsizei, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +pub type PFNGLLOCKARRAYSEXTPROC = + ::std::option::Option; +pub type PFNGLUNLOCKARRAYSEXTPROC = ::std::option::Option; +extern "C" { + pub fn glLockArraysEXT(first: GLint, count: GLsizei); +} +extern "C" { + pub fn glUnlockArraysEXT(); +} +pub type PFNGLCONVOLUTIONFILTER1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + image: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCONVOLUTIONFILTER2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + image: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCONVOLUTIONPARAMETERFEXTPROC = + ::std::option::Option; +pub type PFNGLCONVOLUTIONPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLCONVOLUTIONPARAMETERIEXTPROC = + ::std::option::Option; +pub type PFNGLCONVOLUTIONPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + ), +>; +pub type PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLGETCONVOLUTIONFILTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + image: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETSEPARABLEFILTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + row: *mut ::std::os::raw::c_void, + column: *mut ::std::os::raw::c_void, + span: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLSEPARABLEFILTER2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + row: *const ::std::os::raw::c_void, + column: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glConvolutionFilter1DEXT( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + image: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glConvolutionFilter2DEXT( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + image: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glConvolutionParameterfEXT(target: GLenum, pname: GLenum, params: GLfloat); +} +extern "C" { + pub fn glConvolutionParameterfvEXT(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glConvolutionParameteriEXT(target: GLenum, pname: GLenum, params: GLint); +} +extern "C" { + pub fn glConvolutionParameterivEXT(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glCopyConvolutionFilter1DEXT( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyConvolutionFilter2DEXT( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetConvolutionFilterEXT( + target: GLenum, + format: GLenum, + type_: GLenum, + image: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetConvolutionParameterfvEXT(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetConvolutionParameterivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetSeparableFilterEXT( + target: GLenum, + format: GLenum, + type_: GLenum, + row: *mut ::std::os::raw::c_void, + column: *mut ::std::os::raw::c_void, + span: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glSeparableFilter2DEXT( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + row: *const ::std::os::raw::c_void, + column: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLTANGENT3BEXTPROC = + ::std::option::Option; +pub type PFNGLTANGENT3BVEXTPROC = ::std::option::Option; +pub type PFNGLTANGENT3DEXTPROC = + ::std::option::Option; +pub type PFNGLTANGENT3DVEXTPROC = ::std::option::Option; +pub type PFNGLTANGENT3FEXTPROC = + ::std::option::Option; +pub type PFNGLTANGENT3FVEXTPROC = ::std::option::Option; +pub type PFNGLTANGENT3IEXTPROC = + ::std::option::Option; +pub type PFNGLTANGENT3IVEXTPROC = ::std::option::Option; +pub type PFNGLTANGENT3SEXTPROC = + ::std::option::Option; +pub type PFNGLTANGENT3SVEXTPROC = ::std::option::Option; +pub type PFNGLBINORMAL3BEXTPROC = + ::std::option::Option; +pub type PFNGLBINORMAL3BVEXTPROC = ::std::option::Option; +pub type PFNGLBINORMAL3DEXTPROC = + ::std::option::Option; +pub type PFNGLBINORMAL3DVEXTPROC = ::std::option::Option; +pub type PFNGLBINORMAL3FEXTPROC = + ::std::option::Option; +pub type PFNGLBINORMAL3FVEXTPROC = ::std::option::Option; +pub type PFNGLBINORMAL3IEXTPROC = + ::std::option::Option; +pub type PFNGLBINORMAL3IVEXTPROC = ::std::option::Option; +pub type PFNGLBINORMAL3SEXTPROC = + ::std::option::Option; +pub type PFNGLBINORMAL3SVEXTPROC = ::std::option::Option; +pub type PFNGLTANGENTPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, stride: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +pub type PFNGLBINORMALPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, stride: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +extern "C" { + pub fn glTangent3bEXT(tx: GLbyte, ty: GLbyte, tz: GLbyte); +} +extern "C" { + pub fn glTangent3bvEXT(v: *const GLbyte); +} +extern "C" { + pub fn glTangent3dEXT(tx: GLdouble, ty: GLdouble, tz: GLdouble); +} +extern "C" { + pub fn glTangent3dvEXT(v: *const GLdouble); +} +extern "C" { + pub fn glTangent3fEXT(tx: GLfloat, ty: GLfloat, tz: GLfloat); +} +extern "C" { + pub fn glTangent3fvEXT(v: *const GLfloat); +} +extern "C" { + pub fn glTangent3iEXT(tx: GLint, ty: GLint, tz: GLint); +} +extern "C" { + pub fn glTangent3ivEXT(v: *const GLint); +} +extern "C" { + pub fn glTangent3sEXT(tx: GLshort, ty: GLshort, tz: GLshort); +} +extern "C" { + pub fn glTangent3svEXT(v: *const GLshort); +} +extern "C" { + pub fn glBinormal3bEXT(bx: GLbyte, by: GLbyte, bz: GLbyte); +} +extern "C" { + pub fn glBinormal3bvEXT(v: *const GLbyte); +} +extern "C" { + pub fn glBinormal3dEXT(bx: GLdouble, by: GLdouble, bz: GLdouble); +} +extern "C" { + pub fn glBinormal3dvEXT(v: *const GLdouble); +} +extern "C" { + pub fn glBinormal3fEXT(bx: GLfloat, by: GLfloat, bz: GLfloat); +} +extern "C" { + pub fn glBinormal3fvEXT(v: *const GLfloat); +} +extern "C" { + pub fn glBinormal3iEXT(bx: GLint, by: GLint, bz: GLint); +} +extern "C" { + pub fn glBinormal3ivEXT(v: *const GLint); +} +extern "C" { + pub fn glBinormal3sEXT(bx: GLshort, by: GLshort, bz: GLshort); +} +extern "C" { + pub fn glBinormal3svEXT(v: *const GLshort); +} +extern "C" { + pub fn glTangentPointerEXT( + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glBinormalPointerEXT( + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLCOPYTEXIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ), +>; +pub type PFNGLCOPYTEXIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ), +>; +pub type PFNGLCOPYTEXSUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ), +>; +pub type PFNGLCOPYTEXSUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLCOPYTEXSUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +extern "C" { + pub fn glCopyTexImage1DEXT( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTexImage2DEXT( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTexSubImage1DEXT( + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyTexSubImage2DEXT( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glCopyTexSubImage3DEXT( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +pub type PFNGLCULLPARAMETERDVEXTPROC = + ::std::option::Option; +pub type PFNGLCULLPARAMETERFVEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glCullParameterdvEXT(pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glCullParameterfvEXT(pname: GLenum, params: *mut GLfloat); +} +pub type PFNGLLABELOBJECTEXTPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, object: GLuint, length: GLsizei, label: *const GLchar), +>; +pub type PFNGLGETOBJECTLABELEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + object: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + label: *mut GLchar, + ), +>; +extern "C" { + pub fn glLabelObjectEXT(type_: GLenum, object: GLuint, length: GLsizei, label: *const GLchar); +} +extern "C" { + pub fn glGetObjectLabelEXT( + type_: GLenum, + object: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + label: *mut GLchar, + ); +} +pub type PFNGLINSERTEVENTMARKEREXTPROC = + ::std::option::Option; +pub type PFNGLPUSHGROUPMARKEREXTPROC = + ::std::option::Option; +pub type PFNGLPOPGROUPMARKEREXTPROC = ::std::option::Option; +extern "C" { + pub fn glInsertEventMarkerEXT(length: GLsizei, marker: *const GLchar); +} +extern "C" { + pub fn glPushGroupMarkerEXT(length: GLsizei, marker: *const GLchar); +} +extern "C" { + pub fn glPopGroupMarkerEXT(); +} +pub type PFNGLDEPTHBOUNDSEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glDepthBoundsEXT(zmin: GLclampd, zmax: GLclampd); +} +pub type PFNGLMATRIXLOADFEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXLOADDEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULTFEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULTDEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXLOADIDENTITYEXTPROC = ::std::option::Option; +pub type PFNGLMATRIXROTATEFEXTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, angle: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat), +>; +pub type PFNGLMATRIXROTATEDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, angle: GLdouble, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLMATRIXSCALEFEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXSCALEDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLMATRIXTRANSLATEFEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXTRANSLATEDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLMATRIXFRUSTUMEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + left: GLdouble, + right: GLdouble, + bottom: GLdouble, + top: GLdouble, + zNear: GLdouble, + zFar: GLdouble, + ), +>; +pub type PFNGLMATRIXORTHOEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + left: GLdouble, + right: GLdouble, + bottom: GLdouble, + top: GLdouble, + zNear: GLdouble, + zFar: GLdouble, + ), +>; +pub type PFNGLMATRIXPOPEXTPROC = ::std::option::Option; +pub type PFNGLMATRIXPUSHEXTPROC = ::std::option::Option; +pub type PFNGLCLIENTATTRIBDEFAULTEXTPROC = + ::std::option::Option; +pub type PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC = + ::std::option::Option; +pub type PFNGLTEXTUREPARAMETERFEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, param: GLfloat), +>; +pub type PFNGLTEXTUREPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLTEXTUREPARAMETERIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, param: GLint), +>; +pub type PFNGLTEXTUREPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLTEXTUREIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTUREIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTURESUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTURESUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYTEXTUREIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ), +>; +pub type PFNGLCOPYTEXTUREIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ), +>; +pub type PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ), +>; +pub type PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLGETTEXTUREIMAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETTEXTUREPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETTEXTUREPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLfloat, + ), +>; +pub type PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLTEXTUREIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXTURESUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLBINDMULTITEXTUREEXTPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORDPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMULTITEXENVFEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, param: GLfloat), +>; +pub type PFNGLMULTITEXENVFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLMULTITEXENVIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, param: GLint), +>; +pub type PFNGLMULTITEXENVIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLMULTITEXGENDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, param: GLdouble), +>; +pub type PFNGLMULTITEXGENDVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, params: *const GLdouble), +>; +pub type PFNGLMULTITEXGENFEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, param: GLfloat), +>; +pub type PFNGLMULTITEXGENFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLMULTITEXGENIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, param: GLint), +>; +pub type PFNGLMULTITEXGENIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLGETMULTITEXENVFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETMULTITEXENVIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETMULTITEXGENDVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, params: *mut GLdouble), +>; +pub type PFNGLGETMULTITEXGENFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETMULTITEXGENIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, coord: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLMULTITEXPARAMETERIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, param: GLint), +>; +pub type PFNGLMULTITEXPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLMULTITEXPARAMETERFEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, param: GLfloat), +>; +pub type PFNGLMULTITEXPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLMULTITEXIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMULTITEXIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMULTITEXSUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMULTITEXSUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYMULTITEXIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ), +>; +pub type PFNGLCOPYMULTITEXIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ), +>; +pub type PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ), +>; +pub type PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLGETMULTITEXIMAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + pixels: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETMULTITEXPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETMULTITEXPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLfloat, + ), +>; +pub type PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLMULTITEXIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMULTITEXSUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLENABLECLIENTSTATEINDEXEDEXTPROC = + ::std::option::Option; +pub type PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC = + ::std::option::Option; +pub type PFNGLGETFLOATINDEXEDVEXTPROC = + ::std::option::Option; +pub type PFNGLGETDOUBLEINDEXEDVEXTPROC = + ::std::option::Option; +pub type PFNGLGETPOINTERINDEXEDVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, data: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLENABLEINDEXEDEXTPROC = + ::std::option::Option; +pub type PFNGLDISABLEINDEXEDEXTPROC = + ::std::option::Option; +pub type PFNGLISENABLEDINDEXEDEXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETINTEGERINDEXEDVEXTPROC = + ::std::option::Option; +pub type PFNGLGETBOOLEANINDEXEDVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, data: *mut GLboolean), +>; +pub type PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + lod: GLint, + img: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texunit: GLenum, + target: GLenum, + lod: GLint, + img: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLMATRIXLOADTRANSPOSEFEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXLOADTRANSPOSEDEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULTTRANSPOSEFEXTPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULTTRANSPOSEDEXTPROC = + ::std::option::Option; +pub type PFNGLNAMEDBUFFERDATAEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ), +>; +pub type PFNGLNAMEDBUFFERSUBDATAEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMAPNAMEDBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, access: GLenum) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLUNMAPNAMEDBUFFEREXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETNAMEDBUFFERPOINTERVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLGETNAMEDBUFFERSUBDATAEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLPROGRAMUNIFORM1FEXTPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2FEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLfloat, v1: GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM3FEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM4FEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLfloat, + v1: GLfloat, + v2: GLfloat, + v3: GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORM1IEXTPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2IEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLint, v1: GLint), +>; +pub type PFNGLPROGRAMUNIFORM3IEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLint, v1: GLint, v2: GLint), +>; +pub type PFNGLPROGRAMUNIFORM4IEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLint, + v1: GLint, + v2: GLint, + v3: GLint, + ), +>; +pub type PFNGLPROGRAMUNIFORM1FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM2FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM3FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLfloat), +>; +pub type PFNGLPROGRAMUNIFORM1IVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM2IVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM3IVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORM4IVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLint), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +pub type PFNGLTEXTUREBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, internalformat: GLenum, buffer: GLuint), +>; +pub type PFNGLMULTITEXBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, internalformat: GLenum, buffer: GLuint), +>; +pub type PFNGLTEXTUREPARAMETERIIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLTEXTUREPARAMETERIUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *const GLuint), +>; +pub type PFNGLGETTEXTUREPARAMETERIIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETTEXTUREPARAMETERIUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, pname: GLenum, params: *mut GLuint), +>; +pub type PFNGLMULTITEXPARAMETERIIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLMULTITEXPARAMETERIUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLuint), +>; +pub type PFNGLGETMULTITEXPARAMETERIIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETMULTITEXPARAMETERIUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, pname: GLenum, params: *mut GLuint), +>; +pub type PFNGLPROGRAMUNIFORM1UIEXTPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLuint, v1: GLuint), +>; +pub type PFNGLPROGRAMUNIFORM3UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, v0: GLuint, v1: GLuint, v2: GLuint), +>; +pub type PFNGLPROGRAMUNIFORM4UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + v0: GLuint, + v1: GLuint, + v2: GLuint, + v3: GLuint, + ), +>; +pub type PFNGLPROGRAMUNIFORM1UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORM2UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORM3UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLPROGRAMUNIFORM4UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLfloat, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLint, + y: GLint, + z: GLint, + w: GLint, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *const GLint), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLint, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLuint, + y: GLuint, + z: GLuint, + w: GLuint, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *const GLuint), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLuint, + ), +>; +pub type PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *mut GLint), +>; +pub type PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *mut GLuint), +>; +pub type PFNGLENABLECLIENTSTATEIEXTPROC = + ::std::option::Option; +pub type PFNGLDISABLECLIENTSTATEIEXTPROC = + ::std::option::Option; +pub type PFNGLGETFLOATI_VEXTPROC = + ::std::option::Option; +pub type PFNGLGETDOUBLEI_VEXTPROC = ::std::option::Option< + unsafe extern "C" fn(pname: GLenum, index: GLuint, params: *mut GLdouble), +>; +pub type PFNGLGETPOINTERI_VEXTPROC = ::std::option::Option< + unsafe extern "C" fn(pname: GLenum, index: GLuint, params: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLNAMEDPROGRAMSTRINGEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + format: GLenum, + len: GLsizei, + string: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *const GLdouble), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *const GLfloat), +>; +pub type PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *mut GLdouble), +>; +pub type PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, index: GLuint, params: *mut GLfloat), +>; +pub type PFNGLGETNAMEDPROGRAMIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, target: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETNAMEDPROGRAMSTRINGEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + target: GLenum, + pname: GLenum, + string: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + renderbuffer: GLuint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(renderbuffer: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + renderbuffer: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + renderbuffer: GLuint, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC = + ::std::option::Option GLenum>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + zoffset: GLint, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ), +>; +pub type PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLGENERATETEXTUREMIPMAPEXTPROC = + ::std::option::Option; +pub type PFNGLGENERATEMULTITEXMIPMAPEXTPROC = + ::std::option::Option; +pub type PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC = + ::std::option::Option; +pub type PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, n: GLsizei, bufs: *const GLenum), +>; +pub type PFNGLFRAMEBUFFERREADBUFFEREXTPROC = + ::std::option::Option; +pub type PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, attachment: GLenum, texture: GLuint, level: GLint), +>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + face: GLenum, + ), +>; +pub type PFNGLTEXTURERENDERBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(texture: GLuint, target: GLenum, renderbuffer: GLuint), +>; +pub type PFNGLMULTITEXRENDERBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(texunit: GLenum, target: GLenum, renderbuffer: GLuint), +>; +pub type PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYCOLOROFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, buffer: GLuint, stride: GLsizei, offset: GLintptr), +>; +pub type PFNGLVERTEXARRAYINDEXOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYNORMALOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + texunit: GLenum, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLENABLEVERTEXARRAYEXTPROC = + ::std::option::Option; +pub type PFNGLDISABLEVERTEXARRAYEXTPROC = + ::std::option::Option; +pub type PFNGLENABLEVERTEXARRAYATTRIBEXTPROC = + ::std::option::Option; +pub type PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXARRAYINTEGERVEXTPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXARRAYPOINTERVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, pname: GLenum, param: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, index: GLuint, pname: GLenum, param: *mut GLint), +>; +pub type PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + index: GLuint, + pname: GLenum, + param: *mut *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLMAPNAMEDBUFFERRANGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void, +>; +pub type PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, offset: GLintptr, length: GLsizeiptr), +>; +pub type PFNGLNAMEDBUFFERSTORAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + flags: GLbitfield, + ), +>; +pub type PFNGLCLEARNAMEDBUFFERDATAEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + internalformat: GLenum, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + internalformat: GLenum, + offset: GLsizeiptr, + size: GLsizeiptr, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC = + ::std::option::Option; +pub type PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLPROGRAMUNIFORM1DEXTPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORM2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLdouble, y: GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM4DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORM1DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM2DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM3DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORM4DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, value: *const GLdouble), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ), +>; +pub type PFNGLTEXTUREBUFFERRANGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + internalformat: GLenum, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLTEXTURESTORAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + ), +>; +pub type PFNGLTEXTURESTORAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +pub type PFNGLTEXTURESTORAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ), +>; +pub type PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ), +>; +pub type PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + bindingindex: GLuint, + buffer: GLuint, + offset: GLintptr, + stride: GLsizei, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, attribindex: GLuint, bindingindex: GLuint), +>; +pub type PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC = ::std::option::Option< + unsafe extern "C" fn(vaobj: GLuint, bindingindex: GLuint, divisor: GLuint), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + vaobj: GLuint, + buffer: GLuint, + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ), +>; +pub type PFNGLTEXTUREPAGECOMMITMENTEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + commit: GLboolean, + ), +>; +pub type PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC = + ::std::option::Option; +extern "C" { + pub fn glMatrixLoadfEXT(mode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixLoaddEXT(mode: GLenum, m: *const GLdouble); +} +extern "C" { + pub fn glMatrixMultfEXT(mode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixMultdEXT(mode: GLenum, m: *const GLdouble); +} +extern "C" { + pub fn glMatrixLoadIdentityEXT(mode: GLenum); +} +extern "C" { + pub fn glMatrixRotatefEXT(mode: GLenum, angle: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glMatrixRotatedEXT(mode: GLenum, angle: GLdouble, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glMatrixScalefEXT(mode: GLenum, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glMatrixScaledEXT(mode: GLenum, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glMatrixTranslatefEXT(mode: GLenum, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glMatrixTranslatedEXT(mode: GLenum, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glMatrixFrustumEXT( + mode: GLenum, + left: GLdouble, + right: GLdouble, + bottom: GLdouble, + top: GLdouble, + zNear: GLdouble, + zFar: GLdouble, + ); +} +extern "C" { + pub fn glMatrixOrthoEXT( + mode: GLenum, + left: GLdouble, + right: GLdouble, + bottom: GLdouble, + top: GLdouble, + zNear: GLdouble, + zFar: GLdouble, + ); +} +extern "C" { + pub fn glMatrixPopEXT(mode: GLenum); +} +extern "C" { + pub fn glMatrixPushEXT(mode: GLenum); +} +extern "C" { + pub fn glClientAttribDefaultEXT(mask: GLbitfield); +} +extern "C" { + pub fn glPushClientAttribDefaultEXT(mask: GLbitfield); +} +extern "C" { + pub fn glTextureParameterfEXT(texture: GLuint, target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glTextureParameterfvEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glTextureParameteriEXT(texture: GLuint, target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glTextureParameterivEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *const GLint, + ); +} +extern "C" { + pub fn glTextureImage1DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureImage2DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureSubImage1DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureSubImage2DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyTextureImage1DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTextureImage2DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTextureSubImage1DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyTextureSubImage2DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetTextureImageEXT( + texture: GLuint, + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetTextureParameterfvEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetTextureParameterivEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetTextureLevelParameterfvEXT( + texture: GLuint, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetTextureLevelParameterivEXT( + texture: GLuint, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glTextureImage3DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTextureSubImage3DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyTextureSubImage3DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glBindMultiTextureEXT(texunit: GLenum, target: GLenum, texture: GLuint); +} +extern "C" { + pub fn glMultiTexCoordPointerEXT( + texunit: GLenum, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMultiTexEnvfEXT(texunit: GLenum, target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glMultiTexEnvfvEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glMultiTexEnviEXT(texunit: GLenum, target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glMultiTexEnvivEXT(texunit: GLenum, target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glMultiTexGendEXT(texunit: GLenum, coord: GLenum, pname: GLenum, param: GLdouble); +} +extern "C" { + pub fn glMultiTexGendvEXT( + texunit: GLenum, + coord: GLenum, + pname: GLenum, + params: *const GLdouble, + ); +} +extern "C" { + pub fn glMultiTexGenfEXT(texunit: GLenum, coord: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glMultiTexGenfvEXT( + texunit: GLenum, + coord: GLenum, + pname: GLenum, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glMultiTexGeniEXT(texunit: GLenum, coord: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glMultiTexGenivEXT(texunit: GLenum, coord: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetMultiTexEnvfvEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetMultiTexEnvivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetMultiTexGendvEXT( + texunit: GLenum, + coord: GLenum, + pname: GLenum, + params: *mut GLdouble, + ); +} +extern "C" { + pub fn glGetMultiTexGenfvEXT( + texunit: GLenum, + coord: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetMultiTexGenivEXT(texunit: GLenum, coord: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glMultiTexParameteriEXT(texunit: GLenum, target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glMultiTexParameterivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *const GLint, + ); +} +extern "C" { + pub fn glMultiTexParameterfEXT(texunit: GLenum, target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glMultiTexParameterfvEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glMultiTexImage1DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMultiTexImage2DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMultiTexSubImage1DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMultiTexSubImage2DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyMultiTexImage1DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyMultiTexImage2DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyMultiTexSubImage1DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glCopyMultiTexSubImage2DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetMultiTexImageEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + format: GLenum, + type_: GLenum, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetMultiTexParameterfvEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetMultiTexParameterivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetMultiTexLevelParameterfvEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetMultiTexLevelParameterivEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glMultiTexImage3DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMultiTexSubImage3DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyMultiTexSubImage3DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glEnableClientStateIndexedEXT(array: GLenum, index: GLuint); +} +extern "C" { + pub fn glDisableClientStateIndexedEXT(array: GLenum, index: GLuint); +} +extern "C" { + pub fn glGetFloatIndexedvEXT(target: GLenum, index: GLuint, data: *mut GLfloat); +} +extern "C" { + pub fn glGetDoubleIndexedvEXT(target: GLenum, index: GLuint, data: *mut GLdouble); +} +extern "C" { + pub fn glGetPointerIndexedvEXT( + target: GLenum, + index: GLuint, + data: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glEnableIndexedEXT(target: GLenum, index: GLuint); +} +extern "C" { + pub fn glDisableIndexedEXT(target: GLenum, index: GLuint); +} +extern "C" { + pub fn glIsEnabledIndexedEXT(target: GLenum, index: GLuint) -> GLboolean; +} +extern "C" { + pub fn glGetIntegerIndexedvEXT(target: GLenum, index: GLuint, data: *mut GLint); +} +extern "C" { + pub fn glGetBooleanIndexedvEXT(target: GLenum, index: GLuint, data: *mut GLboolean); +} +extern "C" { + pub fn glCompressedTextureImage3DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureImage2DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureImage1DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureSubImage3DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureSubImage2DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTextureSubImage1DEXT( + texture: GLuint, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetCompressedTextureImageEXT( + texture: GLuint, + target: GLenum, + lod: GLint, + img: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedMultiTexImage3DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedMultiTexImage2DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedMultiTexImage1DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + border: GLint, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedMultiTexSubImage3DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedMultiTexSubImage2DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedMultiTexSubImage1DEXT( + texunit: GLenum, + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + imageSize: GLsizei, + bits: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetCompressedMultiTexImageEXT( + texunit: GLenum, + target: GLenum, + lod: GLint, + img: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMatrixLoadTransposefEXT(mode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixLoadTransposedEXT(mode: GLenum, m: *const GLdouble); +} +extern "C" { + pub fn glMatrixMultTransposefEXT(mode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixMultTransposedEXT(mode: GLenum, m: *const GLdouble); +} +extern "C" { + pub fn glNamedBufferDataEXT( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ); +} +extern "C" { + pub fn glNamedBufferSubDataEXT( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMapNamedBufferEXT(buffer: GLuint, access: GLenum) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glUnmapNamedBufferEXT(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glGetNamedBufferParameterivEXT(buffer: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetNamedBufferPointervEXT( + buffer: GLuint, + pname: GLenum, + params: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetNamedBufferSubDataEXT( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glProgramUniform1fEXT(program: GLuint, location: GLint, v0: GLfloat); +} +extern "C" { + pub fn glProgramUniform2fEXT(program: GLuint, location: GLint, v0: GLfloat, v1: GLfloat); +} +extern "C" { + pub fn glProgramUniform3fEXT( + program: GLuint, + location: GLint, + v0: GLfloat, + v1: GLfloat, + v2: GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform4fEXT( + program: GLuint, + location: GLint, + v0: GLfloat, + v1: GLfloat, + v2: GLfloat, + v3: GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform1iEXT(program: GLuint, location: GLint, v0: GLint); +} +extern "C" { + pub fn glProgramUniform2iEXT(program: GLuint, location: GLint, v0: GLint, v1: GLint); +} +extern "C" { + pub fn glProgramUniform3iEXT(program: GLuint, location: GLint, v0: GLint, v1: GLint, v2: GLint); +} +extern "C" { + pub fn glProgramUniform4iEXT( + program: GLuint, + location: GLint, + v0: GLint, + v1: GLint, + v2: GLint, + v3: GLint, + ); +} +extern "C" { + pub fn glProgramUniform1fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform2fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform3fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform4fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniform1ivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform2ivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform3ivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniform4ivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLint, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x3fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x2fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x4fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x2fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x4fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x3fvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glTextureBufferEXT( + texture: GLuint, + target: GLenum, + internalformat: GLenum, + buffer: GLuint, + ); +} +extern "C" { + pub fn glMultiTexBufferEXT( + texunit: GLenum, + target: GLenum, + internalformat: GLenum, + buffer: GLuint, + ); +} +extern "C" { + pub fn glTextureParameterIivEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *const GLint, + ); +} +extern "C" { + pub fn glTextureParameterIuivEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *const GLuint, + ); +} +extern "C" { + pub fn glGetTextureParameterIivEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetTextureParameterIuivEXT( + texture: GLuint, + target: GLenum, + pname: GLenum, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glMultiTexParameterIivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *const GLint, + ); +} +extern "C" { + pub fn glMultiTexParameterIuivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *const GLuint, + ); +} +extern "C" { + pub fn glGetMultiTexParameterIivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetMultiTexParameterIuivEXT( + texunit: GLenum, + target: GLenum, + pname: GLenum, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glProgramUniform1uiEXT(program: GLuint, location: GLint, v0: GLuint); +} +extern "C" { + pub fn glProgramUniform2uiEXT(program: GLuint, location: GLint, v0: GLuint, v1: GLuint); +} +extern "C" { + pub fn glProgramUniform3uiEXT( + program: GLuint, + location: GLint, + v0: GLuint, + v1: GLuint, + v2: GLuint, + ); +} +extern "C" { + pub fn glProgramUniform4uiEXT( + program: GLuint, + location: GLint, + v0: GLuint, + v1: GLuint, + v2: GLuint, + v3: GLuint, + ); +} +extern "C" { + pub fn glProgramUniform1uivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniform2uivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniform3uivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glProgramUniform4uivEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameters4fvEXT( + program: GLuint, + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameterI4iEXT( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLint, + y: GLint, + z: GLint, + w: GLint, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameterI4ivEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *const GLint, + ); +} +extern "C" { + pub fn glNamedProgramLocalParametersI4ivEXT( + program: GLuint, + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLint, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameterI4uiEXT( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLuint, + y: GLuint, + z: GLuint, + w: GLuint, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameterI4uivEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *const GLuint, + ); +} +extern "C" { + pub fn glNamedProgramLocalParametersI4uivEXT( + program: GLuint, + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLuint, + ); +} +extern "C" { + pub fn glGetNamedProgramLocalParameterIivEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetNamedProgramLocalParameterIuivEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glEnableClientStateiEXT(array: GLenum, index: GLuint); +} +extern "C" { + pub fn glDisableClientStateiEXT(array: GLenum, index: GLuint); +} +extern "C" { + pub fn glGetFloati_vEXT(pname: GLenum, index: GLuint, params: *mut GLfloat); +} +extern "C" { + pub fn glGetDoublei_vEXT(pname: GLenum, index: GLuint, params: *mut GLdouble); +} +extern "C" { + pub fn glGetPointeri_vEXT( + pname: GLenum, + index: GLuint, + params: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glNamedProgramStringEXT( + program: GLuint, + target: GLenum, + format: GLenum, + len: GLsizei, + string: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameter4dEXT( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameter4dvEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *const GLdouble, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameter4fEXT( + program: GLuint, + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glNamedProgramLocalParameter4fvEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glGetNamedProgramLocalParameterdvEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *mut GLdouble, + ); +} +extern "C" { + pub fn glGetNamedProgramLocalParameterfvEXT( + program: GLuint, + target: GLenum, + index: GLuint, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetNamedProgramivEXT( + program: GLuint, + target: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetNamedProgramStringEXT( + program: GLuint, + target: GLenum, + pname: GLenum, + string: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glNamedRenderbufferStorageEXT( + renderbuffer: GLuint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetNamedRenderbufferParameterivEXT( + renderbuffer: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glNamedRenderbufferStorageMultisampleEXT( + renderbuffer: GLuint, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glNamedRenderbufferStorageMultisampleCoverageEXT( + renderbuffer: GLuint, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glCheckNamedFramebufferStatusEXT(framebuffer: GLuint, target: GLenum) -> GLenum; +} +extern "C" { + pub fn glNamedFramebufferTexture1DEXT( + framebuffer: GLuint, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferTexture2DEXT( + framebuffer: GLuint, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferTexture3DEXT( + framebuffer: GLuint, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + zoffset: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferRenderbufferEXT( + framebuffer: GLuint, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ); +} +extern "C" { + pub fn glGetNamedFramebufferAttachmentParameterivEXT( + framebuffer: GLuint, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGenerateTextureMipmapEXT(texture: GLuint, target: GLenum); +} +extern "C" { + pub fn glGenerateMultiTexMipmapEXT(texunit: GLenum, target: GLenum); +} +extern "C" { + pub fn glFramebufferDrawBufferEXT(framebuffer: GLuint, mode: GLenum); +} +extern "C" { + pub fn glFramebufferDrawBuffersEXT(framebuffer: GLuint, n: GLsizei, bufs: *const GLenum); +} +extern "C" { + pub fn glFramebufferReadBufferEXT(framebuffer: GLuint, mode: GLenum); +} +extern "C" { + pub fn glGetFramebufferParameterivEXT(framebuffer: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glNamedCopyBufferSubDataEXT( + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glNamedFramebufferTextureEXT( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferTextureLayerEXT( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ); +} +extern "C" { + pub fn glNamedFramebufferTextureFaceEXT( + framebuffer: GLuint, + attachment: GLenum, + texture: GLuint, + level: GLint, + face: GLenum, + ); +} +extern "C" { + pub fn glTextureRenderbufferEXT(texture: GLuint, target: GLenum, renderbuffer: GLuint); +} +extern "C" { + pub fn glMultiTexRenderbufferEXT(texunit: GLenum, target: GLenum, renderbuffer: GLuint); +} +extern "C" { + pub fn glVertexArrayVertexOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayColorOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayEdgeFlagOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayIndexOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayNormalOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayTexCoordOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayMultiTexCoordOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + texunit: GLenum, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayFogCoordOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArraySecondaryColorOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribIOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glEnableVertexArrayEXT(vaobj: GLuint, array: GLenum); +} +extern "C" { + pub fn glDisableVertexArrayEXT(vaobj: GLuint, array: GLenum); +} +extern "C" { + pub fn glEnableVertexArrayAttribEXT(vaobj: GLuint, index: GLuint); +} +extern "C" { + pub fn glDisableVertexArrayAttribEXT(vaobj: GLuint, index: GLuint); +} +extern "C" { + pub fn glGetVertexArrayIntegervEXT(vaobj: GLuint, pname: GLenum, param: *mut GLint); +} +extern "C" { + pub fn glGetVertexArrayPointervEXT( + vaobj: GLuint, + pname: GLenum, + param: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetVertexArrayIntegeri_vEXT( + vaobj: GLuint, + index: GLuint, + pname: GLenum, + param: *mut GLint, + ); +} +extern "C" { + pub fn glGetVertexArrayPointeri_vEXT( + vaobj: GLuint, + index: GLuint, + pname: GLenum, + param: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMapNamedBufferRangeEXT( + buffer: GLuint, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glFlushMappedNamedBufferRangeEXT(buffer: GLuint, offset: GLintptr, length: GLsizeiptr); +} +extern "C" { + pub fn glNamedBufferStorageEXT( + buffer: GLuint, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + flags: GLbitfield, + ); +} +extern "C" { + pub fn glClearNamedBufferDataEXT( + buffer: GLuint, + internalformat: GLenum, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glClearNamedBufferSubDataEXT( + buffer: GLuint, + internalformat: GLenum, + offset: GLsizeiptr, + size: GLsizeiptr, + format: GLenum, + type_: GLenum, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glNamedFramebufferParameteriEXT(framebuffer: GLuint, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glGetNamedFramebufferParameterivEXT( + framebuffer: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glProgramUniform1dEXT(program: GLuint, location: GLint, x: GLdouble); +} +extern "C" { + pub fn glProgramUniform2dEXT(program: GLuint, location: GLint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glProgramUniform3dEXT( + program: GLuint, + location: GLint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform4dEXT( + program: GLuint, + location: GLint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform1dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform2dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform3dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniform4dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x3dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix2x4dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x2dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix3x4dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x2dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramUniformMatrix4x3dvEXT( + program: GLuint, + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLdouble, + ); +} +extern "C" { + pub fn glTextureBufferRangeEXT( + texture: GLuint, + target: GLenum, + internalformat: GLenum, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glTextureStorage1DEXT( + texture: GLuint, + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + ); +} +extern "C" { + pub fn glTextureStorage2DEXT( + texture: GLuint, + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glTextureStorage3DEXT( + texture: GLuint, + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +extern "C" { + pub fn glTextureStorage2DMultisampleEXT( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureStorage3DMultisampleEXT( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedsamplelocations: GLboolean, + ); +} +extern "C" { + pub fn glVertexArrayBindVertexBufferEXT( + vaobj: GLuint, + bindingindex: GLuint, + buffer: GLuint, + offset: GLintptr, + stride: GLsizei, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribFormatEXT( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribIFormatEXT( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribLFormatEXT( + vaobj: GLuint, + attribindex: GLuint, + size: GLint, + type_: GLenum, + relativeoffset: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribBindingEXT( + vaobj: GLuint, + attribindex: GLuint, + bindingindex: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayVertexBindingDivisorEXT( + vaobj: GLuint, + bindingindex: GLuint, + divisor: GLuint, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribLOffsetEXT( + vaobj: GLuint, + buffer: GLuint, + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + offset: GLintptr, + ); +} +extern "C" { + pub fn glTexturePageCommitmentEXT( + texture: GLuint, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + commit: GLboolean, + ); +} +extern "C" { + pub fn glVertexArrayVertexAttribDivisorEXT(vaobj: GLuint, index: GLuint, divisor: GLuint); +} +pub type PFNGLCOLORMASKINDEXEDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, r: GLboolean, g: GLboolean, b: GLboolean, a: GLboolean), +>; +extern "C" { + pub fn glColorMaskIndexedEXT( + index: GLuint, + r: GLboolean, + g: GLboolean, + b: GLboolean, + a: GLboolean, + ); +} +pub type PFNGLDRAWARRAYSINSTANCEDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, start: GLint, count: GLsizei, primcount: GLsizei), +>; +pub type PFNGLDRAWELEMENTSINSTANCEDEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + primcount: GLsizei, + ), +>; +extern "C" { + pub fn glDrawArraysInstancedEXT(mode: GLenum, start: GLint, count: GLsizei, primcount: GLsizei); +} +extern "C" { + pub fn glDrawElementsInstancedEXT( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + primcount: GLsizei, + ); +} +pub type PFNGLDRAWRANGEELEMENTSEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glDrawRangeElementsEXT( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + ); +} +pub type GLeglClientBufferEXT = *mut ::std::os::raw::c_void; +pub type PFNGLBUFFERSTORAGEEXTERNALEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + clientBuffer: GLeglClientBufferEXT, + flags: GLbitfield, + ), +>; +pub type PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + clientBuffer: GLeglClientBufferEXT, + flags: GLbitfield, + ), +>; +extern "C" { + pub fn glBufferStorageExternalEXT( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + clientBuffer: GLeglClientBufferEXT, + flags: GLbitfield, + ); +} +extern "C" { + pub fn glNamedBufferStorageExternalEXT( + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + clientBuffer: GLeglClientBufferEXT, + flags: GLbitfield, + ); +} +pub type PFNGLFOGCOORDFEXTPROC = ::std::option::Option; +pub type PFNGLFOGCOORDFVEXTPROC = + ::std::option::Option; +pub type PFNGLFOGCOORDDEXTPROC = ::std::option::Option; +pub type PFNGLFOGCOORDDVEXTPROC = + ::std::option::Option; +pub type PFNGLFOGCOORDPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, stride: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +extern "C" { + pub fn glFogCoordfEXT(coord: GLfloat); +} +extern "C" { + pub fn glFogCoordfvEXT(coord: *const GLfloat); +} +extern "C" { + pub fn glFogCoorddEXT(coord: GLdouble); +} +extern "C" { + pub fn glFogCoorddvEXT(coord: *const GLdouble); +} +extern "C" { + pub fn glFogCoordPointerEXT( + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLBLITFRAMEBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ), +>; +extern "C" { + pub fn glBlitFramebufferEXT( + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ); +} +pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +extern "C" { + pub fn glRenderbufferStorageMultisampleEXT( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +pub type PFNGLISRENDERBUFFEREXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBINDRENDERBUFFEREXTPROC = + ::std::option::Option; +pub type PFNGLDELETERENDERBUFFERSEXTPROC = + ::std::option::Option; +pub type PFNGLGENRENDERBUFFERSEXTPROC = + ::std::option::Option; +pub type PFNGLRENDERBUFFERSTORAGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), +>; +pub type PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLISFRAMEBUFFEREXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBINDFRAMEBUFFEREXTPROC = + ::std::option::Option; +pub type PFNGLDELETEFRAMEBUFFERSEXTPROC = + ::std::option::Option; +pub type PFNGLGENFRAMEBUFFERSEXTPROC = + ::std::option::Option; +pub type PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC = + ::std::option::Option GLenum>; +pub type PFNGLFRAMEBUFFERTEXTURE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERTEXTURE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERTEXTURE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + zoffset: GLint, + ), +>; +pub type PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ), +>; +pub type PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, attachment: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGENERATEMIPMAPEXTPROC = ::std::option::Option; +extern "C" { + pub fn glIsRenderbufferEXT(renderbuffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBindRenderbufferEXT(target: GLenum, renderbuffer: GLuint); +} +extern "C" { + pub fn glDeleteRenderbuffersEXT(n: GLsizei, renderbuffers: *const GLuint); +} +extern "C" { + pub fn glGenRenderbuffersEXT(n: GLsizei, renderbuffers: *mut GLuint); +} +extern "C" { + pub fn glRenderbufferStorageEXT( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glGetRenderbufferParameterivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glIsFramebufferEXT(framebuffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBindFramebufferEXT(target: GLenum, framebuffer: GLuint); +} +extern "C" { + pub fn glDeleteFramebuffersEXT(n: GLsizei, framebuffers: *const GLuint); +} +extern "C" { + pub fn glGenFramebuffersEXT(n: GLsizei, framebuffers: *mut GLuint); +} +extern "C" { + pub fn glCheckFramebufferStatusEXT(target: GLenum) -> GLenum; +} +extern "C" { + pub fn glFramebufferTexture1DEXT( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFramebufferTexture2DEXT( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFramebufferTexture3DEXT( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + zoffset: GLint, + ); +} +extern "C" { + pub fn glFramebufferRenderbufferEXT( + target: GLenum, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ); +} +extern "C" { + pub fn glGetFramebufferAttachmentParameterivEXT( + target: GLenum, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGenerateMipmapEXT(target: GLenum); +} +pub type PFNGLPROGRAMPARAMETERIEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glProgramParameteriEXT(program: GLuint, pname: GLenum, value: GLint); +} +pub type PFNGLPROGRAMENVPARAMETERS4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, params: *const GLfloat), +>; +pub type PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, params: *const GLfloat), +>; +extern "C" { + pub fn glProgramEnvParameters4fvEXT( + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramLocalParameters4fvEXT( + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLfloat, + ); +} +pub type PFNGLGETUNIFORMUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, params: *mut GLuint), +>; +pub type PFNGLBINDFRAGDATALOCATIONEXTPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, color: GLuint, name: *const GLchar), +>; +pub type PFNGLGETFRAGDATALOCATIONEXTPROC = + ::std::option::Option GLint>; +pub type PFNGLUNIFORM1UIEXTPROC = + ::std::option::Option; +pub type PFNGLUNIFORM2UIEXTPROC = + ::std::option::Option; +pub type PFNGLUNIFORM3UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint), +>; +pub type PFNGLUNIFORM4UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint), +>; +pub type PFNGLUNIFORM1UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLUNIFORM2UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLUNIFORM3UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +pub type PFNGLUNIFORM4UIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint), +>; +extern "C" { + pub fn glGetUniformuivEXT(program: GLuint, location: GLint, params: *mut GLuint); +} +extern "C" { + pub fn glBindFragDataLocationEXT(program: GLuint, color: GLuint, name: *const GLchar); +} +extern "C" { + pub fn glGetFragDataLocationEXT(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glUniform1uiEXT(location: GLint, v0: GLuint); +} +extern "C" { + pub fn glUniform2uiEXT(location: GLint, v0: GLuint, v1: GLuint); +} +extern "C" { + pub fn glUniform3uiEXT(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint); +} +extern "C" { + pub fn glUniform4uiEXT(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint); +} +extern "C" { + pub fn glUniform1uivEXT(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform2uivEXT(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform3uivEXT(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform4uivEXT(location: GLint, count: GLsizei, value: *const GLuint); +} +pub type PFNGLGETHISTOGRAMEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + values: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETHISTOGRAMPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETHISTOGRAMPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETMINMAXEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + values: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETMINMAXPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETMINMAXPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLHISTOGRAMEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, width: GLsizei, internalformat: GLenum, sink: GLboolean), +>; +pub type PFNGLMINMAXEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, sink: GLboolean), +>; +pub type PFNGLRESETHISTOGRAMEXTPROC = ::std::option::Option; +pub type PFNGLRESETMINMAXEXTPROC = ::std::option::Option; +extern "C" { + pub fn glGetHistogramEXT( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + values: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetHistogramParameterfvEXT(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetHistogramParameterivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetMinmaxEXT( + target: GLenum, + reset: GLboolean, + format: GLenum, + type_: GLenum, + values: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetMinmaxParameterfvEXT(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetMinmaxParameterivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glHistogramEXT(target: GLenum, width: GLsizei, internalformat: GLenum, sink: GLboolean); +} +extern "C" { + pub fn glMinmaxEXT(target: GLenum, internalformat: GLenum, sink: GLboolean); +} +extern "C" { + pub fn glResetHistogramEXT(target: GLenum); +} +extern "C" { + pub fn glResetMinmaxEXT(target: GLenum); +} +pub type PFNGLINDEXFUNCEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glIndexFuncEXT(func: GLenum, ref_: GLclampf); +} +pub type PFNGLINDEXMATERIALEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glIndexMaterialEXT(face: GLenum, mode: GLenum); +} +pub type PFNGLAPPLYTEXTUREEXTPROC = ::std::option::Option; +pub type PFNGLTEXTURELIGHTEXTPROC = ::std::option::Option; +pub type PFNGLTEXTUREMATERIALEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glApplyTextureEXT(mode: GLenum); +} +extern "C" { + pub fn glTextureLightEXT(pname: GLenum); +} +extern "C" { + pub fn glTextureMaterialEXT(face: GLenum, mode: GLenum); +} +pub type PFNGLGETUNSIGNEDBYTEVEXTPROC = + ::std::option::Option; +pub type PFNGLGETUNSIGNEDBYTEI_VEXTPROC = + ::std::option::Option; +pub type PFNGLDELETEMEMORYOBJECTSEXTPROC = + ::std::option::Option; +pub type PFNGLISMEMORYOBJECTEXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLCREATEMEMORYOBJECTSEXTPROC = + ::std::option::Option; +pub type PFNGLMEMORYOBJECTPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(memoryObject: GLuint, pname: GLenum, params: *const GLint), +>; +pub type PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(memoryObject: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLTEXSTORAGEMEM2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXSTORAGEMEM3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLBUFFERSTORAGEMEMEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, size: GLsizeiptr, memory: GLuint, offset: GLuint64), +>; +pub type PFNGLTEXTURESTORAGEMEM2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXTURESTORAGEMEM3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, size: GLsizeiptr, memory: GLuint, offset: GLuint64), +>; +pub type PFNGLTEXSTORAGEMEM1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + memory: GLuint, + offset: GLuint64, + ), +>; +pub type PFNGLTEXTURESTORAGEMEM1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + memory: GLuint, + offset: GLuint64, + ), +>; +extern "C" { + pub fn glGetUnsignedBytevEXT(pname: GLenum, data: *mut GLubyte); +} +extern "C" { + pub fn glGetUnsignedBytei_vEXT(target: GLenum, index: GLuint, data: *mut GLubyte); +} +extern "C" { + pub fn glDeleteMemoryObjectsEXT(n: GLsizei, memoryObjects: *const GLuint); +} +extern "C" { + pub fn glIsMemoryObjectEXT(memoryObject: GLuint) -> GLboolean; +} +extern "C" { + pub fn glCreateMemoryObjectsEXT(n: GLsizei, memoryObjects: *mut GLuint); +} +extern "C" { + pub fn glMemoryObjectParameterivEXT(memoryObject: GLuint, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetMemoryObjectParameterivEXT(memoryObject: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glTexStorageMem2DEXT( + target: GLenum, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTexStorageMem2DMultisampleEXT( + target: GLenum, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTexStorageMem3DEXT( + target: GLenum, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTexStorageMem3DMultisampleEXT( + target: GLenum, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glBufferStorageMemEXT( + target: GLenum, + size: GLsizeiptr, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTextureStorageMem2DEXT( + texture: GLuint, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTextureStorageMem2DMultisampleEXT( + texture: GLuint, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTextureStorageMem3DEXT( + texture: GLuint, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTextureStorageMem3DMultisampleEXT( + texture: GLuint, + samples: GLsizei, + internalFormat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glNamedBufferStorageMemEXT( + buffer: GLuint, + size: GLsizeiptr, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTexStorageMem1DEXT( + target: GLenum, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + memory: GLuint, + offset: GLuint64, + ); +} +extern "C" { + pub fn glTextureStorageMem1DEXT( + texture: GLuint, + levels: GLsizei, + internalFormat: GLenum, + width: GLsizei, + memory: GLuint, + offset: GLuint64, + ); +} +pub type PFNGLIMPORTMEMORYFDEXTPROC = ::std::option::Option< + unsafe extern "C" fn(memory: GLuint, size: GLuint64, handleType: GLenum, fd: GLint), +>; +extern "C" { + pub fn glImportMemoryFdEXT(memory: GLuint, size: GLuint64, handleType: GLenum, fd: GLint); +} +pub type PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + memory: GLuint, + size: GLuint64, + handleType: GLenum, + handle: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLIMPORTMEMORYWIN32NAMEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + memory: GLuint, + size: GLuint64, + handleType: GLenum, + name: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glImportMemoryWin32HandleEXT( + memory: GLuint, + size: GLuint64, + handleType: GLenum, + handle: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glImportMemoryWin32NameEXT( + memory: GLuint, + size: GLuint64, + handleType: GLenum, + name: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLMULTIDRAWARRAYSEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + primcount: GLsizei, + ), +>; +extern "C" { + pub fn glMultiDrawArraysEXT( + mode: GLenum, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + ); +} +extern "C" { + pub fn glMultiDrawElementsEXT( + mode: GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + primcount: GLsizei, + ); +} +pub type PFNGLSAMPLEMASKEXTPROC = + ::std::option::Option; +pub type PFNGLSAMPLEPATTERNEXTPROC = ::std::option::Option; +extern "C" { + pub fn glSampleMaskEXT(value: GLclampf, invert: GLboolean); +} +extern "C" { + pub fn glSamplePatternEXT(pattern: GLenum); +} +pub type PFNGLCOLORTABLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalFormat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + table: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOLORTABLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + data: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOLORTABLEPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETCOLORTABLEPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +extern "C" { + pub fn glColorTableEXT( + target: GLenum, + internalFormat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + table: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetColorTableEXT( + target: GLenum, + format: GLenum, + type_: GLenum, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetColorTableParameterivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetColorTableParameterfvEXT(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +pub type PFNGLPIXELTRANSFORMPARAMETERIEXTPROC = + ::std::option::Option; +pub type PFNGLPIXELTRANSFORMPARAMETERFEXTPROC = + ::std::option::Option; +pub type PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +extern "C" { + pub fn glPixelTransformParameteriEXT(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPixelTransformParameterfEXT(target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPixelTransformParameterivEXT(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glPixelTransformParameterfvEXT(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glGetPixelTransformParameterivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetPixelTransformParameterfvEXT(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +pub type PFNGLPOINTPARAMETERFEXTPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERFVEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glPointParameterfEXT(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPointParameterfvEXT(pname: GLenum, params: *const GLfloat); +} +pub type PFNGLPOLYGONOFFSETEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glPolygonOffsetEXT(factor: GLfloat, bias: GLfloat); +} +pub type PFNGLPOLYGONOFFSETCLAMPEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glPolygonOffsetClampEXT(factor: GLfloat, units: GLfloat, clamp: GLfloat); +} +pub type PFNGLPROVOKINGVERTEXEXTPROC = ::std::option::Option; +extern "C" { + pub fn glProvokingVertexEXT(mode: GLenum); +} +pub type PFNGLRASTERSAMPLESEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glRasterSamplesEXT(samples: GLuint, fixedsamplelocations: GLboolean); +} +pub type PFNGLSECONDARYCOLOR3BEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3BVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3DEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3DVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3FEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3FVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3IEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3IVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3SEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3SVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UBEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UBVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UIEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3UIVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3USEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3USVEXTPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLORPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glSecondaryColor3bEXT(red: GLbyte, green: GLbyte, blue: GLbyte); +} +extern "C" { + pub fn glSecondaryColor3bvEXT(v: *const GLbyte); +} +extern "C" { + pub fn glSecondaryColor3dEXT(red: GLdouble, green: GLdouble, blue: GLdouble); +} +extern "C" { + pub fn glSecondaryColor3dvEXT(v: *const GLdouble); +} +extern "C" { + pub fn glSecondaryColor3fEXT(red: GLfloat, green: GLfloat, blue: GLfloat); +} +extern "C" { + pub fn glSecondaryColor3fvEXT(v: *const GLfloat); +} +extern "C" { + pub fn glSecondaryColor3iEXT(red: GLint, green: GLint, blue: GLint); +} +extern "C" { + pub fn glSecondaryColor3ivEXT(v: *const GLint); +} +extern "C" { + pub fn glSecondaryColor3sEXT(red: GLshort, green: GLshort, blue: GLshort); +} +extern "C" { + pub fn glSecondaryColor3svEXT(v: *const GLshort); +} +extern "C" { + pub fn glSecondaryColor3ubEXT(red: GLubyte, green: GLubyte, blue: GLubyte); +} +extern "C" { + pub fn glSecondaryColor3ubvEXT(v: *const GLubyte); +} +extern "C" { + pub fn glSecondaryColor3uiEXT(red: GLuint, green: GLuint, blue: GLuint); +} +extern "C" { + pub fn glSecondaryColor3uivEXT(v: *const GLuint); +} +extern "C" { + pub fn glSecondaryColor3usEXT(red: GLushort, green: GLushort, blue: GLushort); +} +extern "C" { + pub fn glSecondaryColor3usvEXT(v: *const GLushort); +} +extern "C" { + pub fn glSecondaryColorPointerEXT( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLGENSEMAPHORESEXTPROC = + ::std::option::Option; +pub type PFNGLDELETESEMAPHORESEXTPROC = + ::std::option::Option; +pub type PFNGLISSEMAPHOREEXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLSEMAPHOREPARAMETERUI64VEXTPROC = ::std::option::Option< + unsafe extern "C" fn(semaphore: GLuint, pname: GLenum, params: *const GLuint64), +>; +pub type PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC = ::std::option::Option< + unsafe extern "C" fn(semaphore: GLuint, pname: GLenum, params: *mut GLuint64), +>; +pub type PFNGLWAITSEMAPHOREEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + semaphore: GLuint, + numBufferBarriers: GLuint, + buffers: *const GLuint, + numTextureBarriers: GLuint, + textures: *const GLuint, + srcLayouts: *const GLenum, + ), +>; +pub type PFNGLSIGNALSEMAPHOREEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + semaphore: GLuint, + numBufferBarriers: GLuint, + buffers: *const GLuint, + numTextureBarriers: GLuint, + textures: *const GLuint, + dstLayouts: *const GLenum, + ), +>; +extern "C" { + pub fn glGenSemaphoresEXT(n: GLsizei, semaphores: *mut GLuint); +} +extern "C" { + pub fn glDeleteSemaphoresEXT(n: GLsizei, semaphores: *const GLuint); +} +extern "C" { + pub fn glIsSemaphoreEXT(semaphore: GLuint) -> GLboolean; +} +extern "C" { + pub fn glSemaphoreParameterui64vEXT(semaphore: GLuint, pname: GLenum, params: *const GLuint64); +} +extern "C" { + pub fn glGetSemaphoreParameterui64vEXT(semaphore: GLuint, pname: GLenum, params: *mut GLuint64); +} +extern "C" { + pub fn glWaitSemaphoreEXT( + semaphore: GLuint, + numBufferBarriers: GLuint, + buffers: *const GLuint, + numTextureBarriers: GLuint, + textures: *const GLuint, + srcLayouts: *const GLenum, + ); +} +extern "C" { + pub fn glSignalSemaphoreEXT( + semaphore: GLuint, + numBufferBarriers: GLuint, + buffers: *const GLuint, + numTextureBarriers: GLuint, + textures: *const GLuint, + dstLayouts: *const GLenum, + ); +} +pub type PFNGLIMPORTSEMAPHOREFDEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glImportSemaphoreFdEXT(semaphore: GLuint, handleType: GLenum, fd: GLint); +} +pub type PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + semaphore: GLuint, + handleType: GLenum, + handle: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + semaphore: GLuint, + handleType: GLenum, + name: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glImportSemaphoreWin32HandleEXT( + semaphore: GLuint, + handleType: GLenum, + handle: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glImportSemaphoreWin32NameEXT( + semaphore: GLuint, + handleType: GLenum, + name: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLUSESHADERPROGRAMEXTPROC = + ::std::option::Option; +pub type PFNGLACTIVEPROGRAMEXTPROC = ::std::option::Option; +pub type PFNGLCREATESHADERPROGRAMEXTPROC = + ::std::option::Option GLuint>; +extern "C" { + pub fn glUseShaderProgramEXT(type_: GLenum, program: GLuint); +} +extern "C" { + pub fn glActiveProgramEXT(program: GLuint); +} +extern "C" { + pub fn glCreateShaderProgramEXT(type_: GLenum, string: *const GLchar) -> GLuint; +} +pub type PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC = ::std::option::Option; +extern "C" { + pub fn glFramebufferFetchBarrierEXT(); +} +pub type PFNGLBINDIMAGETEXTUREEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + access: GLenum, + format: GLint, + ), +>; +pub type PFNGLMEMORYBARRIEREXTPROC = + ::std::option::Option; +extern "C" { + pub fn glBindImageTextureEXT( + index: GLuint, + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + access: GLenum, + format: GLint, + ); +} +extern "C" { + pub fn glMemoryBarrierEXT(barriers: GLbitfield); +} +pub type PFNGLSTENCILCLEARTAGEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glStencilClearTagEXT(stencilTagBits: GLsizei, stencilClearTag: GLuint); +} +pub type PFNGLACTIVESTENCILFACEEXTPROC = ::std::option::Option; +extern "C" { + pub fn glActiveStencilFaceEXT(face: GLenum); +} +pub type PFNGLTEXSUBIMAGE1DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXSUBIMAGE2DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glTexSubImage1DEXT( + target: GLenum, + level: GLint, + xoffset: GLint, + width: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexSubImage2DEXT( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLTEXIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXSUBIMAGE3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glTexImage3DEXT( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexSubImage3DEXT( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ), +>; +extern "C" { + pub fn glFramebufferTextureLayerEXT( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ); +} +pub type PFNGLTEXBUFFEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, buffer: GLuint), +>; +extern "C" { + pub fn glTexBufferEXT(target: GLenum, internalformat: GLenum, buffer: GLuint); +} +pub type PFNGLTEXPARAMETERIIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLTEXPARAMETERIUIVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLuint), +>; +pub type PFNGLGETTEXPARAMETERIIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETTEXPARAMETERIUIVEXTPROC = + ::std::option::Option; +pub type PFNGLCLEARCOLORIIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLint, green: GLint, blue: GLint, alpha: GLint), +>; +pub type PFNGLCLEARCOLORIUIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLuint, green: GLuint, blue: GLuint, alpha: GLuint), +>; +extern "C" { + pub fn glTexParameterIivEXT(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glTexParameterIuivEXT(target: GLenum, pname: GLenum, params: *const GLuint); +} +extern "C" { + pub fn glGetTexParameterIivEXT(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetTexParameterIuivEXT(target: GLenum, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glClearColorIiEXT(red: GLint, green: GLint, blue: GLint, alpha: GLint); +} +extern "C" { + pub fn glClearColorIuiEXT(red: GLuint, green: GLuint, blue: GLuint, alpha: GLuint); +} +pub type PFNGLARETEXTURESRESIDENTEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + n: GLsizei, + textures: *const GLuint, + residences: *mut GLboolean, + ) -> GLboolean, +>; +pub type PFNGLBINDTEXTUREEXTPROC = + ::std::option::Option; +pub type PFNGLDELETETEXTURESEXTPROC = + ::std::option::Option; +pub type PFNGLGENTEXTURESEXTPROC = + ::std::option::Option; +pub type PFNGLISTEXTUREEXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLPRIORITIZETEXTURESEXTPROC = ::std::option::Option< + unsafe extern "C" fn(n: GLsizei, textures: *const GLuint, priorities: *const GLclampf), +>; +extern "C" { + pub fn glAreTexturesResidentEXT( + n: GLsizei, + textures: *const GLuint, + residences: *mut GLboolean, + ) -> GLboolean; +} +extern "C" { + pub fn glBindTextureEXT(target: GLenum, texture: GLuint); +} +extern "C" { + pub fn glDeleteTexturesEXT(n: GLsizei, textures: *const GLuint); +} +extern "C" { + pub fn glGenTexturesEXT(n: GLsizei, textures: *mut GLuint); +} +extern "C" { + pub fn glIsTextureEXT(texture: GLuint) -> GLboolean; +} +extern "C" { + pub fn glPrioritizeTexturesEXT( + n: GLsizei, + textures: *const GLuint, + priorities: *const GLclampf, + ); +} +pub type PFNGLTEXTURENORMALEXTPROC = ::std::option::Option; +extern "C" { + pub fn glTextureNormalEXT(mode: GLenum); +} +pub type PFNGLGETQUERYOBJECTI64VEXTPROC = + ::std::option::Option; +pub type PFNGLGETQUERYOBJECTUI64VEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glGetQueryObjecti64vEXT(id: GLuint, pname: GLenum, params: *mut GLint64); +} +extern "C" { + pub fn glGetQueryObjectui64vEXT(id: GLuint, pname: GLenum, params: *mut GLuint64); +} +pub type PFNGLBEGINTRANSFORMFEEDBACKEXTPROC = + ::std::option::Option; +pub type PFNGLENDTRANSFORMFEEDBACKEXTPROC = ::std::option::Option; +pub type PFNGLBINDBUFFERRANGEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLBINDBUFFEROFFSETEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr), +>; +pub type PFNGLBINDBUFFERBASEEXTPROC = + ::std::option::Option; +pub type PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + count: GLsizei, + varyings: *const *const GLchar, + bufferMode: GLenum, + ), +>; +pub type PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ), +>; +extern "C" { + pub fn glBeginTransformFeedbackEXT(primitiveMode: GLenum); +} +extern "C" { + pub fn glEndTransformFeedbackEXT(); +} +extern "C" { + pub fn glBindBufferRangeEXT( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glBindBufferOffsetEXT(target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr); +} +extern "C" { + pub fn glBindBufferBaseEXT(target: GLenum, index: GLuint, buffer: GLuint); +} +extern "C" { + pub fn glTransformFeedbackVaryingsEXT( + program: GLuint, + count: GLsizei, + varyings: *const *const GLchar, + bufferMode: GLenum, + ); +} +extern "C" { + pub fn glGetTransformFeedbackVaryingEXT( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +pub type PFNGLARRAYELEMENTEXTPROC = ::std::option::Option; +pub type PFNGLCOLORPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLDRAWARRAYSEXTPROC = + ::std::option::Option; +pub type PFNGLEDGEFLAGPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(stride: GLsizei, count: GLsizei, pointer: *const GLboolean), +>; +pub type PFNGLGETPOINTERVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(pname: GLenum, params: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLINDEXPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLNORMALPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXCOORDPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLVERTEXPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glArrayElementEXT(i: GLint); +} +extern "C" { + pub fn glColorPointerEXT( + size: GLint, + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glDrawArraysEXT(mode: GLenum, first: GLint, count: GLsizei); +} +extern "C" { + pub fn glEdgeFlagPointerEXT(stride: GLsizei, count: GLsizei, pointer: *const GLboolean); +} +extern "C" { + pub fn glGetPointervEXT(pname: GLenum, params: *mut *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn glIndexPointerEXT( + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glNormalPointerEXT( + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexCoordPointerEXT( + size: GLint, + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glVertexPointerEXT( + size: GLint, + type_: GLenum, + stride: GLsizei, + count: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLVERTEXATTRIBL1DEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2DEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3DEXTPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLVERTEXATTRIBL4DEXTPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLVERTEXATTRIBL1DVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2DVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3DVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL4DVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBLPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETVERTEXATTRIBLDVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), +>; +extern "C" { + pub fn glVertexAttribL1dEXT(index: GLuint, x: GLdouble); +} +extern "C" { + pub fn glVertexAttribL2dEXT(index: GLuint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertexAttribL3dEXT(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertexAttribL4dEXT(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertexAttribL1dvEXT(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribL2dvEXT(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribL3dvEXT(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribL4dvEXT(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribLPointerEXT( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetVertexAttribLdvEXT(index: GLuint, pname: GLenum, params: *mut GLdouble); +} +pub type PFNGLBEGINVERTEXSHADEREXTPROC = ::std::option::Option; +pub type PFNGLENDVERTEXSHADEREXTPROC = ::std::option::Option; +pub type PFNGLBINDVERTEXSHADEREXTPROC = ::std::option::Option; +pub type PFNGLGENVERTEXSHADERSEXTPROC = + ::std::option::Option GLuint>; +pub type PFNGLDELETEVERTEXSHADEREXTPROC = ::std::option::Option; +pub type PFNGLSHADEROP1EXTPROC = + ::std::option::Option; +pub type PFNGLSHADEROP2EXTPROC = ::std::option::Option< + unsafe extern "C" fn(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint), +>; +pub type PFNGLSHADEROP3EXTPROC = ::std::option::Option< + unsafe extern "C" fn(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint, arg3: GLuint), +>; +pub type PFNGLSWIZZLEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + res: GLuint, + in_: GLuint, + outX: GLenum, + outY: GLenum, + outZ: GLenum, + outW: GLenum, + ), +>; +pub type PFNGLWRITEMASKEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + res: GLuint, + in_: GLuint, + outX: GLenum, + outY: GLenum, + outZ: GLenum, + outW: GLenum, + ), +>; +pub type PFNGLINSERTCOMPONENTEXTPROC = + ::std::option::Option; +pub type PFNGLEXTRACTCOMPONENTEXTPROC = + ::std::option::Option; +pub type PFNGLGENSYMBOLSEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + datatype: GLenum, + storagetype: GLenum, + range: GLenum, + components: GLuint, + ) -> GLuint, +>; +pub type PFNGLSETINVARIANTEXTPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void), +>; +pub type PFNGLSETLOCALCONSTANTEXTPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void), +>; +pub type PFNGLVARIANTBVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTSVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTIVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTFVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTDVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTUBVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTUSVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTUIVEXTPROC = + ::std::option::Option; +pub type PFNGLVARIANTPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + id: GLuint, + type_: GLenum, + stride: GLuint, + addr: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLENABLEVARIANTCLIENTSTATEEXTPROC = + ::std::option::Option; +pub type PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC = + ::std::option::Option; +pub type PFNGLBINDLIGHTPARAMETEREXTPROC = + ::std::option::Option GLuint>; +pub type PFNGLBINDMATERIALPARAMETEREXTPROC = + ::std::option::Option GLuint>; +pub type PFNGLBINDTEXGENPARAMETEREXTPROC = ::std::option::Option< + unsafe extern "C" fn(unit: GLenum, coord: GLenum, value: GLenum) -> GLuint, +>; +pub type PFNGLBINDTEXTUREUNITPARAMETEREXTPROC = + ::std::option::Option GLuint>; +pub type PFNGLBINDPARAMETEREXTPROC = + ::std::option::Option GLuint>; +pub type PFNGLISVARIANTENABLEDEXTPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETVARIANTBOOLEANVEXTPROC = + ::std::option::Option; +pub type PFNGLGETVARIANTINTEGERVEXTPROC = + ::std::option::Option; +pub type PFNGLGETVARIANTFLOATVEXTPROC = + ::std::option::Option; +pub type PFNGLGETVARIANTPOINTERVEXTPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, value: GLenum, data: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLGETINVARIANTBOOLEANVEXTPROC = + ::std::option::Option; +pub type PFNGLGETINVARIANTINTEGERVEXTPROC = + ::std::option::Option; +pub type PFNGLGETINVARIANTFLOATVEXTPROC = + ::std::option::Option; +pub type PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC = + ::std::option::Option; +pub type PFNGLGETLOCALCONSTANTINTEGERVEXTPROC = + ::std::option::Option; +pub type PFNGLGETLOCALCONSTANTFLOATVEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glBeginVertexShaderEXT(); +} +extern "C" { + pub fn glEndVertexShaderEXT(); +} +extern "C" { + pub fn glBindVertexShaderEXT(id: GLuint); +} +extern "C" { + pub fn glGenVertexShadersEXT(range: GLuint) -> GLuint; +} +extern "C" { + pub fn glDeleteVertexShaderEXT(id: GLuint); +} +extern "C" { + pub fn glShaderOp1EXT(op: GLenum, res: GLuint, arg1: GLuint); +} +extern "C" { + pub fn glShaderOp2EXT(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint); +} +extern "C" { + pub fn glShaderOp3EXT(op: GLenum, res: GLuint, arg1: GLuint, arg2: GLuint, arg3: GLuint); +} +extern "C" { + pub fn glSwizzleEXT( + res: GLuint, + in_: GLuint, + outX: GLenum, + outY: GLenum, + outZ: GLenum, + outW: GLenum, + ); +} +extern "C" { + pub fn glWriteMaskEXT( + res: GLuint, + in_: GLuint, + outX: GLenum, + outY: GLenum, + outZ: GLenum, + outW: GLenum, + ); +} +extern "C" { + pub fn glInsertComponentEXT(res: GLuint, src: GLuint, num: GLuint); +} +extern "C" { + pub fn glExtractComponentEXT(res: GLuint, src: GLuint, num: GLuint); +} +extern "C" { + pub fn glGenSymbolsEXT( + datatype: GLenum, + storagetype: GLenum, + range: GLenum, + components: GLuint, + ) -> GLuint; +} +extern "C" { + pub fn glSetInvariantEXT(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glSetLocalConstantEXT(id: GLuint, type_: GLenum, addr: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glVariantbvEXT(id: GLuint, addr: *const GLbyte); +} +extern "C" { + pub fn glVariantsvEXT(id: GLuint, addr: *const GLshort); +} +extern "C" { + pub fn glVariantivEXT(id: GLuint, addr: *const GLint); +} +extern "C" { + pub fn glVariantfvEXT(id: GLuint, addr: *const GLfloat); +} +extern "C" { + pub fn glVariantdvEXT(id: GLuint, addr: *const GLdouble); +} +extern "C" { + pub fn glVariantubvEXT(id: GLuint, addr: *const GLubyte); +} +extern "C" { + pub fn glVariantusvEXT(id: GLuint, addr: *const GLushort); +} +extern "C" { + pub fn glVariantuivEXT(id: GLuint, addr: *const GLuint); +} +extern "C" { + pub fn glVariantPointerEXT( + id: GLuint, + type_: GLenum, + stride: GLuint, + addr: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glEnableVariantClientStateEXT(id: GLuint); +} +extern "C" { + pub fn glDisableVariantClientStateEXT(id: GLuint); +} +extern "C" { + pub fn glBindLightParameterEXT(light: GLenum, value: GLenum) -> GLuint; +} +extern "C" { + pub fn glBindMaterialParameterEXT(face: GLenum, value: GLenum) -> GLuint; +} +extern "C" { + pub fn glBindTexGenParameterEXT(unit: GLenum, coord: GLenum, value: GLenum) -> GLuint; +} +extern "C" { + pub fn glBindTextureUnitParameterEXT(unit: GLenum, value: GLenum) -> GLuint; +} +extern "C" { + pub fn glBindParameterEXT(value: GLenum) -> GLuint; +} +extern "C" { + pub fn glIsVariantEnabledEXT(id: GLuint, cap: GLenum) -> GLboolean; +} +extern "C" { + pub fn glGetVariantBooleanvEXT(id: GLuint, value: GLenum, data: *mut GLboolean); +} +extern "C" { + pub fn glGetVariantIntegervEXT(id: GLuint, value: GLenum, data: *mut GLint); +} +extern "C" { + pub fn glGetVariantFloatvEXT(id: GLuint, value: GLenum, data: *mut GLfloat); +} +extern "C" { + pub fn glGetVariantPointervEXT( + id: GLuint, + value: GLenum, + data: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetInvariantBooleanvEXT(id: GLuint, value: GLenum, data: *mut GLboolean); +} +extern "C" { + pub fn glGetInvariantIntegervEXT(id: GLuint, value: GLenum, data: *mut GLint); +} +extern "C" { + pub fn glGetInvariantFloatvEXT(id: GLuint, value: GLenum, data: *mut GLfloat); +} +extern "C" { + pub fn glGetLocalConstantBooleanvEXT(id: GLuint, value: GLenum, data: *mut GLboolean); +} +extern "C" { + pub fn glGetLocalConstantIntegervEXT(id: GLuint, value: GLenum, data: *mut GLint); +} +extern "C" { + pub fn glGetLocalConstantFloatvEXT(id: GLuint, value: GLenum, data: *mut GLfloat); +} +pub type PFNGLVERTEXWEIGHTFEXTPROC = ::std::option::Option; +pub type PFNGLVERTEXWEIGHTFVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXWEIGHTPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glVertexWeightfEXT(weight: GLfloat); +} +extern "C" { + pub fn glVertexWeightfvEXT(weight: *const GLfloat); +} +extern "C" { + pub fn glVertexWeightPointerEXT( + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC = ::std::option::Option< + unsafe extern "C" fn(memory: GLuint, key: GLuint64, timeout: GLuint) -> GLboolean, +>; +pub type PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glAcquireKeyedMutexWin32EXT(memory: GLuint, key: GLuint64, timeout: GLuint) + -> GLboolean; +} +extern "C" { + pub fn glReleaseKeyedMutexWin32EXT(memory: GLuint, key: GLuint64) -> GLboolean; +} +pub type PFNGLWINDOWRECTANGLESEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glWindowRectanglesEXT(mode: GLenum, count: GLsizei, box_: *const GLint); +} +pub type PFNGLIMPORTSYNCEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + external_sync_type: GLenum, + external_sync: GLintptr, + flags: GLbitfield, + ) -> GLsync, +>; +extern "C" { + pub fn glImportSyncEXT( + external_sync_type: GLenum, + external_sync: GLintptr, + flags: GLbitfield, + ) -> GLsync; +} +pub type PFNGLFRAMETERMINATORGREMEDYPROC = ::std::option::Option; +extern "C" { + pub fn glFrameTerminatorGREMEDY(); +} +pub type PFNGLSTRINGMARKERGREMEDYPROC = ::std::option::Option< + unsafe extern "C" fn(len: GLsizei, string: *const ::std::os::raw::c_void), +>; +extern "C" { + pub fn glStringMarkerGREMEDY(len: GLsizei, string: *const ::std::os::raw::c_void); +} +pub type PFNGLIMAGETRANSFORMPARAMETERIHPPROC = + ::std::option::Option; +pub type PFNGLIMAGETRANSFORMPARAMETERFHPPROC = + ::std::option::Option; +pub type PFNGLIMAGETRANSFORMPARAMETERIVHPPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLIMAGETRANSFORMPARAMETERFVHPPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC = + ::std::option::Option; +pub type PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +extern "C" { + pub fn glImageTransformParameteriHP(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glImageTransformParameterfHP(target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glImageTransformParameterivHP(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glImageTransformParameterfvHP(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glGetImageTransformParameterivHP(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetImageTransformParameterfvHP(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +pub type PFNGLMULTIMODEDRAWARRAYSIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: *const GLenum, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + modestride: GLint, + ), +>; +pub type PFNGLMULTIMODEDRAWELEMENTSIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: *const GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + primcount: GLsizei, + modestride: GLint, + ), +>; +extern "C" { + pub fn glMultiModeDrawArraysIBM( + mode: *const GLenum, + first: *const GLint, + count: *const GLsizei, + primcount: GLsizei, + modestride: GLint, + ); +} +extern "C" { + pub fn glMultiModeDrawElementsIBM( + mode: *const GLenum, + count: *const GLsizei, + type_: GLenum, + indices: *const *const ::std::os::raw::c_void, + primcount: GLsizei, + modestride: GLint, + ); +} +pub type PFNGLFLUSHSTATICDATAIBMPROC = ::std::option::Option; +extern "C" { + pub fn glFlushStaticDataIBM(target: GLenum); +} +pub type PFNGLCOLORPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +pub type PFNGLSECONDARYCOLORPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +pub type PFNGLEDGEFLAGPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn(stride: GLint, pointer: *mut *const GLboolean, ptrstride: GLint), +>; +pub type PFNGLFOGCOORDPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +pub type PFNGLINDEXPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +pub type PFNGLNORMALPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +pub type PFNGLTEXCOORDPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +pub type PFNGLVERTEXPOINTERLISTIBMPROC = ::std::option::Option< + unsafe extern "C" fn( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ), +>; +extern "C" { + pub fn glColorPointerListIBM( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glSecondaryColorPointerListIBM( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glEdgeFlagPointerListIBM( + stride: GLint, + pointer: *mut *const GLboolean, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glFogCoordPointerListIBM( + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glIndexPointerListIBM( + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glNormalPointerListIBM( + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glTexCoordPointerListIBM( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +extern "C" { + pub fn glVertexPointerListIBM( + size: GLint, + type_: GLenum, + stride: GLint, + pointer: *mut *const ::std::os::raw::c_void, + ptrstride: GLint, + ); +} +pub type PFNGLBLENDFUNCSEPARATEINGRPROC = ::std::option::Option< + unsafe extern "C" fn( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ), +>; +extern "C" { + pub fn glBlendFuncSeparateINGR( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ); +} +pub type PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC = + ::std::option::Option; +extern "C" { + pub fn glApplyFramebufferAttachmentCMAAINTEL(); +} +pub type PFNGLSYNCTEXTUREINTELPROC = ::std::option::Option; +pub type PFNGLUNMAPTEXTURE2DINTELPROC = + ::std::option::Option; +pub type PFNGLMAPTEXTURE2DINTELPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + access: GLbitfield, + stride: *mut GLint, + layout: *mut GLenum, + ) -> *mut ::std::os::raw::c_void, +>; +extern "C" { + pub fn glSyncTextureINTEL(texture: GLuint); +} +extern "C" { + pub fn glUnmapTexture2DINTEL(texture: GLuint, level: GLint); +} +extern "C" { + pub fn glMapTexture2DINTEL( + texture: GLuint, + level: GLint, + access: GLbitfield, + stride: *mut GLint, + layout: *mut GLenum, + ) -> *mut ::std::os::raw::c_void; +} +pub type PFNGLVERTEXPOINTERVINTELPROC = ::std::option::Option< + unsafe extern "C" fn(size: GLint, type_: GLenum, pointer: *mut *const ::std::os::raw::c_void), +>; +pub type PFNGLNORMALPOINTERVINTELPROC = ::std::option::Option< + unsafe extern "C" fn(type_: GLenum, pointer: *mut *const ::std::os::raw::c_void), +>; +pub type PFNGLCOLORPOINTERVINTELPROC = ::std::option::Option< + unsafe extern "C" fn(size: GLint, type_: GLenum, pointer: *mut *const ::std::os::raw::c_void), +>; +pub type PFNGLTEXCOORDPOINTERVINTELPROC = ::std::option::Option< + unsafe extern "C" fn(size: GLint, type_: GLenum, pointer: *mut *const ::std::os::raw::c_void), +>; +extern "C" { + pub fn glVertexPointervINTEL( + size: GLint, + type_: GLenum, + pointer: *mut *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glNormalPointervINTEL(type_: GLenum, pointer: *mut *const ::std::os::raw::c_void); +} +extern "C" { + pub fn glColorPointervINTEL( + size: GLint, + type_: GLenum, + pointer: *mut *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexCoordPointervINTEL( + size: GLint, + type_: GLenum, + pointer: *mut *const ::std::os::raw::c_void, + ); +} +pub type PFNGLBEGINPERFQUERYINTELPROC = + ::std::option::Option; +pub type PFNGLCREATEPERFQUERYINTELPROC = + ::std::option::Option; +pub type PFNGLDELETEPERFQUERYINTELPROC = + ::std::option::Option; +pub type PFNGLENDPERFQUERYINTELPROC = + ::std::option::Option; +pub type PFNGLGETFIRSTPERFQUERYIDINTELPROC = + ::std::option::Option; +pub type PFNGLGETNEXTPERFQUERYIDINTELPROC = + ::std::option::Option; +pub type PFNGLGETPERFCOUNTERINFOINTELPROC = ::std::option::Option< + unsafe extern "C" fn( + queryId: GLuint, + counterId: GLuint, + counterNameLength: GLuint, + counterName: *mut GLchar, + counterDescLength: GLuint, + counterDesc: *mut GLchar, + counterOffset: *mut GLuint, + counterDataSize: *mut GLuint, + counterTypeEnum: *mut GLuint, + counterDataTypeEnum: *mut GLuint, + rawCounterMaxValue: *mut GLuint64, + ), +>; +pub type PFNGLGETPERFQUERYDATAINTELPROC = ::std::option::Option< + unsafe extern "C" fn( + queryHandle: GLuint, + flags: GLuint, + dataSize: GLsizei, + data: *mut ::std::os::raw::c_void, + bytesWritten: *mut GLuint, + ), +>; +pub type PFNGLGETPERFQUERYIDBYNAMEINTELPROC = + ::std::option::Option; +pub type PFNGLGETPERFQUERYINFOINTELPROC = ::std::option::Option< + unsafe extern "C" fn( + queryId: GLuint, + queryNameLength: GLuint, + queryName: *mut GLchar, + dataSize: *mut GLuint, + noCounters: *mut GLuint, + noInstances: *mut GLuint, + capsMask: *mut GLuint, + ), +>; +extern "C" { + pub fn glBeginPerfQueryINTEL(queryHandle: GLuint); +} +extern "C" { + pub fn glCreatePerfQueryINTEL(queryId: GLuint, queryHandle: *mut GLuint); +} +extern "C" { + pub fn glDeletePerfQueryINTEL(queryHandle: GLuint); +} +extern "C" { + pub fn glEndPerfQueryINTEL(queryHandle: GLuint); +} +extern "C" { + pub fn glGetFirstPerfQueryIdINTEL(queryId: *mut GLuint); +} +extern "C" { + pub fn glGetNextPerfQueryIdINTEL(queryId: GLuint, nextQueryId: *mut GLuint); +} +extern "C" { + pub fn glGetPerfCounterInfoINTEL( + queryId: GLuint, + counterId: GLuint, + counterNameLength: GLuint, + counterName: *mut GLchar, + counterDescLength: GLuint, + counterDesc: *mut GLchar, + counterOffset: *mut GLuint, + counterDataSize: *mut GLuint, + counterTypeEnum: *mut GLuint, + counterDataTypeEnum: *mut GLuint, + rawCounterMaxValue: *mut GLuint64, + ); +} +extern "C" { + pub fn glGetPerfQueryDataINTEL( + queryHandle: GLuint, + flags: GLuint, + dataSize: GLsizei, + data: *mut ::std::os::raw::c_void, + bytesWritten: *mut GLuint, + ); +} +extern "C" { + pub fn glGetPerfQueryIdByNameINTEL(queryName: *mut GLchar, queryId: *mut GLuint); +} +extern "C" { + pub fn glGetPerfQueryInfoINTEL( + queryId: GLuint, + queryNameLength: GLuint, + queryName: *mut GLchar, + dataSize: *mut GLuint, + noCounters: *mut GLuint, + noInstances: *mut GLuint, + capsMask: *mut GLuint, + ); +} +pub type PFNGLFRAMEBUFFERPARAMETERIMESAPROC = + ::std::option::Option; +pub type PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC = + ::std::option::Option; +extern "C" { + pub fn glFramebufferParameteriMESA(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glGetFramebufferParameterivMESA(target: GLenum, pname: GLenum, params: *mut GLint); +} +pub type PFNGLRESIZEBUFFERSMESAPROC = ::std::option::Option; +extern "C" { + pub fn glResizeBuffersMESA(); +} +pub type PFNGLWINDOWPOS2DMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2DVMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2FMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2FVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2IMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2IVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS2SMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS2SVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3DMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3DVMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3FMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3FVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3IMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3IVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS3SMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS3SVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS4DMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS4DVMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS4FMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS4FVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS4IMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS4IVMESAPROC = ::std::option::Option; +pub type PFNGLWINDOWPOS4SMESAPROC = + ::std::option::Option; +pub type PFNGLWINDOWPOS4SVMESAPROC = ::std::option::Option; +extern "C" { + pub fn glWindowPos2dMESA(x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glWindowPos2dvMESA(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos2fMESA(x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glWindowPos2fvMESA(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos2iMESA(x: GLint, y: GLint); +} +extern "C" { + pub fn glWindowPos2ivMESA(v: *const GLint); +} +extern "C" { + pub fn glWindowPos2sMESA(x: GLshort, y: GLshort); +} +extern "C" { + pub fn glWindowPos2svMESA(v: *const GLshort); +} +extern "C" { + pub fn glWindowPos3dMESA(x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glWindowPos3dvMESA(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos3fMESA(x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glWindowPos3fvMESA(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos3iMESA(x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glWindowPos3ivMESA(v: *const GLint); +} +extern "C" { + pub fn glWindowPos3sMESA(x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glWindowPos3svMESA(v: *const GLshort); +} +extern "C" { + pub fn glWindowPos4dMESA(x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glWindowPos4dvMESA(v: *const GLdouble); +} +extern "C" { + pub fn glWindowPos4fMESA(x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glWindowPos4fvMESA(v: *const GLfloat); +} +extern "C" { + pub fn glWindowPos4iMESA(x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glWindowPos4ivMESA(v: *const GLint); +} +extern "C" { + pub fn glWindowPos4sMESA(x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glWindowPos4svMESA(v: *const GLshort); +} +pub type PFNGLBEGINCONDITIONALRENDERNVXPROC = + ::std::option::Option; +pub type PFNGLENDCONDITIONALRENDERNVXPROC = ::std::option::Option; +extern "C" { + pub fn glBeginConditionalRenderNVX(id: GLuint); +} +extern "C" { + pub fn glEndConditionalRenderNVX(); +} +pub type PFNGLUPLOADGPUMASKNVXPROC = ::std::option::Option; +pub type PFNGLMULTICASTVIEWPORTARRAYVNVXPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, first: GLuint, count: GLsizei, v: *const GLfloat), +>; +pub type PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, index: GLuint, xcoeff: GLfloat, ycoeff: GLfloat), +>; +pub type PFNGLMULTICASTSCISSORARRAYVNVXPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, first: GLuint, count: GLsizei, v: *const GLint), +>; +pub type PFNGLASYNCCOPYBUFFERSUBDATANVXPROC = ::std::option::Option< + unsafe extern "C" fn( + waitSemaphoreCount: GLsizei, + waitSemaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + readGpu: GLuint, + writeGpuMask: GLbitfield, + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + signalSemaphoreCount: GLsizei, + signalSemaphoreArray: *const GLuint, + signalValueArray: *const GLuint64, + ) -> GLuint, +>; +pub type PFNGLASYNCCOPYIMAGESUBDATANVXPROC = ::std::option::Option< + unsafe extern "C" fn( + waitSemaphoreCount: GLsizei, + waitSemaphoreArray: *const GLuint, + waitValueArray: *const GLuint64, + srcGpu: GLuint, + dstGpuMask: GLbitfield, + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + srcWidth: GLsizei, + srcHeight: GLsizei, + srcDepth: GLsizei, + signalSemaphoreCount: GLsizei, + signalSemaphoreArray: *const GLuint, + signalValueArray: *const GLuint64, + ) -> GLuint, +>; +extern "C" { + pub fn glUploadGpuMaskNVX(mask: GLbitfield); +} +extern "C" { + pub fn glMulticastViewportArrayvNVX( + gpu: GLuint, + first: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glMulticastViewportPositionWScaleNVX( + gpu: GLuint, + index: GLuint, + xcoeff: GLfloat, + ycoeff: GLfloat, + ); +} +extern "C" { + pub fn glMulticastScissorArrayvNVX(gpu: GLuint, first: GLuint, count: GLsizei, v: *const GLint); +} +extern "C" { + pub fn glAsyncCopyBufferSubDataNVX( + waitSemaphoreCount: GLsizei, + waitSemaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + readGpu: GLuint, + writeGpuMask: GLbitfield, + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + signalSemaphoreCount: GLsizei, + signalSemaphoreArray: *const GLuint, + signalValueArray: *const GLuint64, + ) -> GLuint; +} +extern "C" { + pub fn glAsyncCopyImageSubDataNVX( + waitSemaphoreCount: GLsizei, + waitSemaphoreArray: *const GLuint, + waitValueArray: *const GLuint64, + srcGpu: GLuint, + dstGpuMask: GLbitfield, + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + srcWidth: GLsizei, + srcHeight: GLsizei, + srcDepth: GLsizei, + signalSemaphoreCount: GLsizei, + signalSemaphoreArray: *const GLuint, + signalValueArray: *const GLuint64, + ) -> GLuint; +} +pub type PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC = ::std::option::Option< + unsafe extern "C" fn( + gpuMask: GLbitfield, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLLGPUCOPYIMAGESUBDATANVXPROC = ::std::option::Option< + unsafe extern "C" fn( + sourceGpu: GLuint, + destinationGpuMask: GLbitfield, + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srxY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ), +>; +pub type PFNGLLGPUINTERLOCKNVXPROC = ::std::option::Option; +extern "C" { + pub fn glLGPUNamedBufferSubDataNVX( + gpuMask: GLbitfield, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glLGPUCopyImageSubDataNVX( + sourceGpu: GLuint, + destinationGpuMask: GLbitfield, + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srxY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +extern "C" { + pub fn glLGPUInterlockNVX(); +} +pub type PFNGLCREATEPROGRESSFENCENVXPROC = ::std::option::Option GLuint>; +pub type PFNGLSIGNALSEMAPHOREUI64NVXPROC = ::std::option::Option< + unsafe extern "C" fn( + signalGpu: GLuint, + fenceObjectCount: GLsizei, + semaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + ), +>; +pub type PFNGLWAITSEMAPHOREUI64NVXPROC = ::std::option::Option< + unsafe extern "C" fn( + waitGpu: GLuint, + fenceObjectCount: GLsizei, + semaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + ), +>; +pub type PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC = ::std::option::Option< + unsafe extern "C" fn( + fenceObjectCount: GLsizei, + semaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + ), +>; +extern "C" { + pub fn glCreateProgressFenceNVX() -> GLuint; +} +extern "C" { + pub fn glSignalSemaphoreui64NVX( + signalGpu: GLuint, + fenceObjectCount: GLsizei, + semaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + ); +} +extern "C" { + pub fn glWaitSemaphoreui64NVX( + waitGpu: GLuint, + fenceObjectCount: GLsizei, + semaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + ); +} +extern "C" { + pub fn glClientWaitSemaphoreui64NVX( + fenceObjectCount: GLsizei, + semaphoreArray: *const GLuint, + fenceValueArray: *const GLuint64, + ); +} +pub type PFNGLALPHATOCOVERAGEDITHERCONTROLNVPROC = + ::std::option::Option; +extern "C" { + pub fn glAlphaToCoverageDitherControlNV(mode: GLenum); +} +pub type PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ), +>; +extern "C" { + pub fn glMultiDrawArraysIndirectBindlessNV( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ); +} +extern "C" { + pub fn glMultiDrawElementsIndirectBindlessNV( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ); +} +pub type PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + maxDrawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ), +>; +pub type PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + maxDrawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ), +>; +extern "C" { + pub fn glMultiDrawArraysIndirectBindlessCountNV( + mode: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + maxDrawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ); +} +extern "C" { + pub fn glMultiDrawElementsIndirectBindlessCountNV( + mode: GLenum, + type_: GLenum, + indirect: *const ::std::os::raw::c_void, + drawCount: GLsizei, + maxDrawCount: GLsizei, + stride: GLsizei, + vertexBufferCount: GLint, + ); +} +pub type PFNGLGETTEXTUREHANDLENVPROC = + ::std::option::Option GLuint64>; +pub type PFNGLGETTEXTURESAMPLERHANDLENVPROC = + ::std::option::Option GLuint64>; +pub type PFNGLMAKETEXTUREHANDLERESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLGETIMAGEHANDLENVPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + format: GLenum, + ) -> GLuint64, +>; +pub type PFNGLMAKEIMAGEHANDLERESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLUNIFORMHANDLEUI64NVPROC = + ::std::option::Option; +pub type PFNGLUNIFORMHANDLEUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64), +>; +pub type PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC = + ::std::option::Option; +pub type PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, count: GLsizei, values: *const GLuint64), +>; +pub type PFNGLISTEXTUREHANDLERESIDENTNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLISIMAGEHANDLERESIDENTNVPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glGetTextureHandleNV(texture: GLuint) -> GLuint64; +} +extern "C" { + pub fn glGetTextureSamplerHandleNV(texture: GLuint, sampler: GLuint) -> GLuint64; +} +extern "C" { + pub fn glMakeTextureHandleResidentNV(handle: GLuint64); +} +extern "C" { + pub fn glMakeTextureHandleNonResidentNV(handle: GLuint64); +} +extern "C" { + pub fn glGetImageHandleNV( + texture: GLuint, + level: GLint, + layered: GLboolean, + layer: GLint, + format: GLenum, + ) -> GLuint64; +} +extern "C" { + pub fn glMakeImageHandleResidentNV(handle: GLuint64, access: GLenum); +} +extern "C" { + pub fn glMakeImageHandleNonResidentNV(handle: GLuint64); +} +extern "C" { + pub fn glUniformHandleui64NV(location: GLint, value: GLuint64); +} +extern "C" { + pub fn glUniformHandleui64vNV(location: GLint, count: GLsizei, value: *const GLuint64); +} +extern "C" { + pub fn glProgramUniformHandleui64NV(program: GLuint, location: GLint, value: GLuint64); +} +extern "C" { + pub fn glProgramUniformHandleui64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + values: *const GLuint64, + ); +} +extern "C" { + pub fn glIsTextureHandleResidentNV(handle: GLuint64) -> GLboolean; +} +extern "C" { + pub fn glIsImageHandleResidentNV(handle: GLuint64) -> GLboolean; +} +pub type PFNGLBLENDPARAMETERINVPROC = + ::std::option::Option; +pub type PFNGLBLENDBARRIERNVPROC = ::std::option::Option; +extern "C" { + pub fn glBlendParameteriNV(pname: GLenum, value: GLint); +} +extern "C" { + pub fn glBlendBarrierNV(); +} +pub type PFNGLVIEWPORTPOSITIONWSCALENVPROC = + ::std::option::Option; +extern "C" { + pub fn glViewportPositionWScaleNV(index: GLuint, xcoeff: GLfloat, ycoeff: GLfloat); +} +pub type PFNGLCREATESTATESNVPROC = + ::std::option::Option; +pub type PFNGLDELETESTATESNVPROC = + ::std::option::Option; +pub type PFNGLISSTATENVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLSTATECAPTURENVPROC = + ::std::option::Option; +pub type PFNGLGETCOMMANDHEADERNVPROC = + ::std::option::Option GLuint>; +pub type PFNGLGETSTAGEINDEXNVPROC = + ::std::option::Option GLushort>; +pub type PFNGLDRAWCOMMANDSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + primitiveMode: GLenum, + buffer: GLuint, + indirects: *const GLintptr, + sizes: *const GLsizei, + count: GLuint, + ), +>; +pub type PFNGLDRAWCOMMANDSADDRESSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + primitiveMode: GLenum, + indirects: *const GLuint64, + sizes: *const GLsizei, + count: GLuint, + ), +>; +pub type PFNGLDRAWCOMMANDSSTATESNVPROC = ::std::option::Option< + unsafe extern "C" fn( + buffer: GLuint, + indirects: *const GLintptr, + sizes: *const GLsizei, + states: *const GLuint, + fbos: *const GLuint, + count: GLuint, + ), +>; +pub type PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + indirects: *const GLuint64, + sizes: *const GLsizei, + states: *const GLuint, + fbos: *const GLuint, + count: GLuint, + ), +>; +pub type PFNGLCREATECOMMANDLISTSNVPROC = + ::std::option::Option; +pub type PFNGLDELETECOMMANDLISTSNVPROC = + ::std::option::Option; +pub type PFNGLISCOMMANDLISTNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + list: GLuint, + segment: GLuint, + indirects: *mut *const ::std::os::raw::c_void, + sizes: *const GLsizei, + states: *const GLuint, + fbos: *const GLuint, + count: GLuint, + ), +>; +pub type PFNGLCOMMANDLISTSEGMENTSNVPROC = + ::std::option::Option; +pub type PFNGLCOMPILECOMMANDLISTNVPROC = ::std::option::Option; +pub type PFNGLCALLCOMMANDLISTNVPROC = ::std::option::Option; +extern "C" { + pub fn glCreateStatesNV(n: GLsizei, states: *mut GLuint); +} +extern "C" { + pub fn glDeleteStatesNV(n: GLsizei, states: *const GLuint); +} +extern "C" { + pub fn glIsStateNV(state: GLuint) -> GLboolean; +} +extern "C" { + pub fn glStateCaptureNV(state: GLuint, mode: GLenum); +} +extern "C" { + pub fn glGetCommandHeaderNV(tokenID: GLenum, size: GLuint) -> GLuint; +} +extern "C" { + pub fn glGetStageIndexNV(shadertype: GLenum) -> GLushort; +} +extern "C" { + pub fn glDrawCommandsNV( + primitiveMode: GLenum, + buffer: GLuint, + indirects: *const GLintptr, + sizes: *const GLsizei, + count: GLuint, + ); +} +extern "C" { + pub fn glDrawCommandsAddressNV( + primitiveMode: GLenum, + indirects: *const GLuint64, + sizes: *const GLsizei, + count: GLuint, + ); +} +extern "C" { + pub fn glDrawCommandsStatesNV( + buffer: GLuint, + indirects: *const GLintptr, + sizes: *const GLsizei, + states: *const GLuint, + fbos: *const GLuint, + count: GLuint, + ); +} +extern "C" { + pub fn glDrawCommandsStatesAddressNV( + indirects: *const GLuint64, + sizes: *const GLsizei, + states: *const GLuint, + fbos: *const GLuint, + count: GLuint, + ); +} +extern "C" { + pub fn glCreateCommandListsNV(n: GLsizei, lists: *mut GLuint); +} +extern "C" { + pub fn glDeleteCommandListsNV(n: GLsizei, lists: *const GLuint); +} +extern "C" { + pub fn glIsCommandListNV(list: GLuint) -> GLboolean; +} +extern "C" { + pub fn glListDrawCommandsStatesClientNV( + list: GLuint, + segment: GLuint, + indirects: *mut *const ::std::os::raw::c_void, + sizes: *const GLsizei, + states: *const GLuint, + fbos: *const GLuint, + count: GLuint, + ); +} +extern "C" { + pub fn glCommandListSegmentsNV(list: GLuint, segments: GLuint); +} +extern "C" { + pub fn glCompileCommandListNV(list: GLuint); +} +extern "C" { + pub fn glCallCommandListNV(list: GLuint); +} +pub type PFNGLBEGINCONDITIONALRENDERNVPROC = + ::std::option::Option; +pub type PFNGLENDCONDITIONALRENDERNVPROC = ::std::option::Option; +extern "C" { + pub fn glBeginConditionalRenderNV(id: GLuint, mode: GLenum); +} +extern "C" { + pub fn glEndConditionalRenderNV(); +} +pub type PFNGLSUBPIXELPRECISIONBIASNVPROC = + ::std::option::Option; +extern "C" { + pub fn glSubpixelPrecisionBiasNV(xbits: GLuint, ybits: GLuint); +} +pub type PFNGLCONSERVATIVERASTERPARAMETERFNVPROC = + ::std::option::Option; +extern "C" { + pub fn glConservativeRasterParameterfNV(pname: GLenum, value: GLfloat); +} +pub type PFNGLCONSERVATIVERASTERPARAMETERINVPROC = + ::std::option::Option; +extern "C" { + pub fn glConservativeRasterParameteriNV(pname: GLenum, param: GLint); +} +pub type PFNGLCOPYIMAGESUBDATANVPROC = ::std::option::Option< + unsafe extern "C" fn( + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ), +>; +extern "C" { + pub fn glCopyImageSubDataNV( + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +pub type PFNGLDEPTHRANGEDNVPROC = + ::std::option::Option; +pub type PFNGLCLEARDEPTHDNVPROC = ::std::option::Option; +pub type PFNGLDEPTHBOUNDSDNVPROC = + ::std::option::Option; +extern "C" { + pub fn glDepthRangedNV(zNear: GLdouble, zFar: GLdouble); +} +extern "C" { + pub fn glClearDepthdNV(depth: GLdouble); +} +extern "C" { + pub fn glDepthBoundsdNV(zmin: GLdouble, zmax: GLdouble); +} +pub type PFNGLDRAWTEXTURENVPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + sampler: GLuint, + x0: GLfloat, + y0: GLfloat, + x1: GLfloat, + y1: GLfloat, + z: GLfloat, + s0: GLfloat, + t0: GLfloat, + s1: GLfloat, + t1: GLfloat, + ), +>; +extern "C" { + pub fn glDrawTextureNV( + texture: GLuint, + sampler: GLuint, + x0: GLfloat, + y0: GLfloat, + x1: GLfloat, + y1: GLfloat, + z: GLfloat, + s0: GLfloat, + t0: GLfloat, + s1: GLfloat, + t1: GLfloat, + ); +} +pub type GLVULKANPROCNV = ::std::option::Option; +pub type PFNGLDRAWVKIMAGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + vkImage: GLuint64, + sampler: GLuint, + x0: GLfloat, + y0: GLfloat, + x1: GLfloat, + y1: GLfloat, + z: GLfloat, + s0: GLfloat, + t0: GLfloat, + s1: GLfloat, + t1: GLfloat, + ), +>; +pub type PFNGLGETVKPROCADDRNVPROC = + ::std::option::Option GLVULKANPROCNV>; +pub type PFNGLWAITVKSEMAPHORENVPROC = + ::std::option::Option; +pub type PFNGLSIGNALVKSEMAPHORENVPROC = + ::std::option::Option; +pub type PFNGLSIGNALVKFENCENVPROC = ::std::option::Option; +extern "C" { + pub fn glDrawVkImageNV( + vkImage: GLuint64, + sampler: GLuint, + x0: GLfloat, + y0: GLfloat, + x1: GLfloat, + y1: GLfloat, + z: GLfloat, + s0: GLfloat, + t0: GLfloat, + s1: GLfloat, + t1: GLfloat, + ); +} +extern "C" { + pub fn glGetVkProcAddrNV(name: *const GLchar) -> GLVULKANPROCNV; +} +extern "C" { + pub fn glWaitVkSemaphoreNV(vkSemaphore: GLuint64); +} +extern "C" { + pub fn glSignalVkSemaphoreNV(vkSemaphore: GLuint64); +} +extern "C" { + pub fn glSignalVkFenceNV(vkFence: GLuint64); +} +pub type PFNGLMAPCONTROLPOINTSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + type_: GLenum, + ustride: GLsizei, + vstride: GLsizei, + uorder: GLint, + vorder: GLint, + packed: GLboolean, + points: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMAPPARAMETERIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLMAPPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLGETMAPCONTROLPOINTSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + type_: GLenum, + ustride: GLsizei, + vstride: GLsizei, + packed: GLboolean, + points: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETMAPPARAMETERIVNVPROC = + ::std::option::Option; +pub type PFNGLGETMAPPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETMAPATTRIBPARAMETERIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETMAPATTRIBPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLEVALMAPSNVPROC = + ::std::option::Option; +extern "C" { + pub fn glMapControlPointsNV( + target: GLenum, + index: GLuint, + type_: GLenum, + ustride: GLsizei, + vstride: GLsizei, + uorder: GLint, + vorder: GLint, + packed: GLboolean, + points: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMapParameterivNV(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glMapParameterfvNV(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glGetMapControlPointsNV( + target: GLenum, + index: GLuint, + type_: GLenum, + ustride: GLsizei, + vstride: GLsizei, + packed: GLboolean, + points: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetMapParameterivNV(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetMapParameterfvNV(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetMapAttribParameterivNV( + target: GLenum, + index: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetMapAttribParameterfvNV( + target: GLenum, + index: GLuint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glEvalMapsNV(target: GLenum, mode: GLenum); +} +pub type PFNGLGETMULTISAMPLEFVNVPROC = + ::std::option::Option; +pub type PFNGLSAMPLEMASKINDEXEDNVPROC = + ::std::option::Option; +pub type PFNGLTEXRENDERBUFFERNVPROC = + ::std::option::Option; +extern "C" { + pub fn glGetMultisamplefvNV(pname: GLenum, index: GLuint, val: *mut GLfloat); +} +extern "C" { + pub fn glSampleMaskIndexedNV(index: GLuint, mask: GLbitfield); +} +extern "C" { + pub fn glTexRenderbufferNV(target: GLenum, renderbuffer: GLuint); +} +pub type PFNGLDELETEFENCESNVPROC = + ::std::option::Option; +pub type PFNGLGENFENCESNVPROC = + ::std::option::Option; +pub type PFNGLISFENCENVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLTESTFENCENVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETFENCEIVNVPROC = + ::std::option::Option; +pub type PFNGLFINISHFENCENVPROC = ::std::option::Option; +pub type PFNGLSETFENCENVPROC = + ::std::option::Option; +extern "C" { + pub fn glDeleteFencesNV(n: GLsizei, fences: *const GLuint); +} +extern "C" { + pub fn glGenFencesNV(n: GLsizei, fences: *mut GLuint); +} +extern "C" { + pub fn glIsFenceNV(fence: GLuint) -> GLboolean; +} +extern "C" { + pub fn glTestFenceNV(fence: GLuint) -> GLboolean; +} +extern "C" { + pub fn glGetFenceivNV(fence: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glFinishFenceNV(fence: GLuint); +} +extern "C" { + pub fn glSetFenceNV(fence: GLuint, condition: GLenum); +} +pub type PFNGLFRAGMENTCOVERAGECOLORNVPROC = + ::std::option::Option; +extern "C" { + pub fn glFragmentCoverageColorNV(color: GLuint); +} +pub type PFNGLPROGRAMNAMEDPARAMETER4FNVPROC = ::std::option::Option< + unsafe extern "C" fn( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, len: GLsizei, name: *const GLubyte, v: *const GLfloat), +>; +pub type PFNGLPROGRAMNAMEDPARAMETER4DNVPROC = ::std::option::Option< + unsafe extern "C" fn( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ), +>; +pub type PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, len: GLsizei, name: *const GLubyte, v: *const GLdouble), +>; +pub type PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, len: GLsizei, name: *const GLubyte, params: *mut GLfloat), +>; +pub type PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC = ::std::option::Option< + unsafe extern "C" fn(id: GLuint, len: GLsizei, name: *const GLubyte, params: *mut GLdouble), +>; +extern "C" { + pub fn glProgramNamedParameter4fNV( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glProgramNamedParameter4fvNV( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramNamedParameter4dNV( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ); +} +extern "C" { + pub fn glProgramNamedParameter4dvNV( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + v: *const GLdouble, + ); +} +extern "C" { + pub fn glGetProgramNamedParameterfvNV( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetProgramNamedParameterdvNV( + id: GLuint, + len: GLsizei, + name: *const GLubyte, + params: *mut GLdouble, + ); +} +pub type PFNGLCOVERAGEMODULATIONTABLENVPROC = + ::std::option::Option; +pub type PFNGLGETCOVERAGEMODULATIONTABLENVPROC = + ::std::option::Option; +pub type PFNGLCOVERAGEMODULATIONNVPROC = + ::std::option::Option; +extern "C" { + pub fn glCoverageModulationTableNV(n: GLsizei, v: *const GLfloat); +} +extern "C" { + pub fn glGetCoverageModulationTableNV(bufsize: GLsizei, v: *mut GLfloat); +} +extern "C" { + pub fn glCoverageModulationNV(components: GLenum); +} +pub type PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +extern "C" { + pub fn glRenderbufferStorageMultisampleCoverageNV( + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +pub type PFNGLPROGRAMVERTEXLIMITNVPROC = + ::std::option::Option; +pub type PFNGLFRAMEBUFFERTEXTUREEXTPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, attachment: GLenum, texture: GLuint, level: GLint), +>; +pub type PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + face: GLenum, + ), +>; +extern "C" { + pub fn glProgramVertexLimitNV(target: GLenum, limit: GLint); +} +extern "C" { + pub fn glFramebufferTextureEXT( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFramebufferTextureFaceEXT( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + face: GLenum, + ); +} +pub type PFNGLRENDERGPUMASKNVPROC = ::std::option::Option; +pub type PFNGLMULTICASTBUFFERSUBDATANVPROC = ::std::option::Option< + unsafe extern "C" fn( + gpuMask: GLbitfield, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC = ::std::option::Option< + unsafe extern "C" fn( + readGpu: GLuint, + writeGpuMask: GLbitfield, + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLMULTICASTCOPYIMAGESUBDATANVPROC = ::std::option::Option< + unsafe extern "C" fn( + srcGpu: GLuint, + dstGpuMask: GLbitfield, + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + srcWidth: GLsizei, + srcHeight: GLsizei, + srcDepth: GLsizei, + ), +>; +pub type PFNGLMULTICASTBLITFRAMEBUFFERNVPROC = ::std::option::Option< + unsafe extern "C" fn( + srcGpu: GLuint, + dstGpu: GLuint, + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ), +>; +pub type PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + gpu: GLuint, + framebuffer: GLuint, + start: GLuint, + count: GLsizei, + v: *const GLfloat, + ), +>; +pub type PFNGLMULTICASTBARRIERNVPROC = ::std::option::Option; +pub type PFNGLMULTICASTWAITSYNCNVPROC = + ::std::option::Option; +pub type PFNGLMULTICASTGETQUERYOBJECTIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, id: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, id: GLuint, pname: GLenum, params: *mut GLuint), +>; +pub type PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, id: GLuint, pname: GLenum, params: *mut GLint64), +>; +pub type PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(gpu: GLuint, id: GLuint, pname: GLenum, params: *mut GLuint64), +>; +extern "C" { + pub fn glRenderGpuMaskNV(mask: GLbitfield); +} +extern "C" { + pub fn glMulticastBufferSubDataNV( + gpuMask: GLbitfield, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glMulticastCopyBufferSubDataNV( + readGpu: GLuint, + writeGpuMask: GLbitfield, + readBuffer: GLuint, + writeBuffer: GLuint, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glMulticastCopyImageSubDataNV( + srcGpu: GLuint, + dstGpuMask: GLbitfield, + srcName: GLuint, + srcTarget: GLenum, + srcLevel: GLint, + srcX: GLint, + srcY: GLint, + srcZ: GLint, + dstName: GLuint, + dstTarget: GLenum, + dstLevel: GLint, + dstX: GLint, + dstY: GLint, + dstZ: GLint, + srcWidth: GLsizei, + srcHeight: GLsizei, + srcDepth: GLsizei, + ); +} +extern "C" { + pub fn glMulticastBlitFramebufferNV( + srcGpu: GLuint, + dstGpu: GLuint, + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ); +} +extern "C" { + pub fn glMulticastFramebufferSampleLocationsfvNV( + gpu: GLuint, + framebuffer: GLuint, + start: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glMulticastBarrierNV(); +} +extern "C" { + pub fn glMulticastWaitSyncNV(signalGpu: GLuint, waitGpuMask: GLbitfield); +} +extern "C" { + pub fn glMulticastGetQueryObjectivNV( + gpu: GLuint, + id: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glMulticastGetQueryObjectuivNV( + gpu: GLuint, + id: GLuint, + pname: GLenum, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glMulticastGetQueryObjecti64vNV( + gpu: GLuint, + id: GLuint, + pname: GLenum, + params: *mut GLint64, + ); +} +extern "C" { + pub fn glMulticastGetQueryObjectui64vNV( + gpu: GLuint, + id: GLuint, + pname: GLenum, + params: *mut GLuint64, + ); +} +pub type PFNGLPROGRAMLOCALPARAMETERI4INVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint), +>; +pub type PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLint), +>; +pub type PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, params: *const GLint), +>; +pub type PFNGLPROGRAMLOCALPARAMETERI4UINVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint), +>; +pub type PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLuint), +>; +pub type PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, params: *const GLuint), +>; +pub type PFNGLPROGRAMENVPARAMETERI4INVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint), +>; +pub type PFNGLPROGRAMENVPARAMETERI4IVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLint), +>; +pub type PFNGLPROGRAMENVPARAMETERSI4IVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, params: *const GLint), +>; +pub type PFNGLPROGRAMENVPARAMETERI4UINVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint), +>; +pub type PFNGLPROGRAMENVPARAMETERI4UIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, params: *const GLuint), +>; +pub type PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, params: *const GLuint), +>; +pub type PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMENVPARAMETERIIVNVPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glProgramLocalParameterI4iNV( + target: GLenum, + index: GLuint, + x: GLint, + y: GLint, + z: GLint, + w: GLint, + ); +} +extern "C" { + pub fn glProgramLocalParameterI4ivNV(target: GLenum, index: GLuint, params: *const GLint); +} +extern "C" { + pub fn glProgramLocalParametersI4ivNV( + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLint, + ); +} +extern "C" { + pub fn glProgramLocalParameterI4uiNV( + target: GLenum, + index: GLuint, + x: GLuint, + y: GLuint, + z: GLuint, + w: GLuint, + ); +} +extern "C" { + pub fn glProgramLocalParameterI4uivNV(target: GLenum, index: GLuint, params: *const GLuint); +} +extern "C" { + pub fn glProgramLocalParametersI4uivNV( + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLuint, + ); +} +extern "C" { + pub fn glProgramEnvParameterI4iNV( + target: GLenum, + index: GLuint, + x: GLint, + y: GLint, + z: GLint, + w: GLint, + ); +} +extern "C" { + pub fn glProgramEnvParameterI4ivNV(target: GLenum, index: GLuint, params: *const GLint); +} +extern "C" { + pub fn glProgramEnvParametersI4ivNV( + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLint, + ); +} +extern "C" { + pub fn glProgramEnvParameterI4uiNV( + target: GLenum, + index: GLuint, + x: GLuint, + y: GLuint, + z: GLuint, + w: GLuint, + ); +} +extern "C" { + pub fn glProgramEnvParameterI4uivNV(target: GLenum, index: GLuint, params: *const GLuint); +} +extern "C" { + pub fn glProgramEnvParametersI4uivNV( + target: GLenum, + index: GLuint, + count: GLsizei, + params: *const GLuint, + ); +} +extern "C" { + pub fn glGetProgramLocalParameterIivNV(target: GLenum, index: GLuint, params: *mut GLint); +} +extern "C" { + pub fn glGetProgramLocalParameterIuivNV(target: GLenum, index: GLuint, params: *mut GLuint); +} +extern "C" { + pub fn glGetProgramEnvParameterIivNV(target: GLenum, index: GLuint, params: *mut GLint); +} +extern "C" { + pub fn glGetProgramEnvParameterIuivNV(target: GLenum, index: GLuint, params: *mut GLuint); +} +pub type PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, count: GLsizei, params: *const GLuint), +>; +pub type PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glProgramSubroutineParametersuivNV( + target: GLenum, + count: GLsizei, + params: *const GLuint, + ); +} +extern "C" { + pub fn glGetProgramSubroutineParameteruivNV(target: GLenum, index: GLuint, param: *mut GLuint); +} +pub type GLhalfNV = ::std::os::raw::c_ushort; +pub type PFNGLVERTEX2HNVPROC = + ::std::option::Option; +pub type PFNGLVERTEX2HVNVPROC = ::std::option::Option; +pub type PFNGLVERTEX3HNVPROC = + ::std::option::Option; +pub type PFNGLVERTEX3HVNVPROC = ::std::option::Option; +pub type PFNGLVERTEX4HNVPROC = + ::std::option::Option; +pub type PFNGLVERTEX4HVNVPROC = ::std::option::Option; +pub type PFNGLNORMAL3HNVPROC = + ::std::option::Option; +pub type PFNGLNORMAL3HVNVPROC = ::std::option::Option; +pub type PFNGLCOLOR3HNVPROC = + ::std::option::Option; +pub type PFNGLCOLOR3HVNVPROC = ::std::option::Option; +pub type PFNGLCOLOR4HNVPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV, alpha: GLhalfNV), +>; +pub type PFNGLCOLOR4HVNVPROC = ::std::option::Option; +pub type PFNGLTEXCOORD1HNVPROC = ::std::option::Option; +pub type PFNGLTEXCOORD1HVNVPROC = ::std::option::Option; +pub type PFNGLTEXCOORD2HNVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD2HVNVPROC = ::std::option::Option; +pub type PFNGLTEXCOORD3HNVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD3HVNVPROC = ::std::option::Option; +pub type PFNGLTEXCOORD4HNVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD4HVNVPROC = ::std::option::Option; +pub type PFNGLMULTITEXCOORD1HNVPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD1HVNVPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2HNVPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD2HVNVPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD3HNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLhalfNV, t: GLhalfNV, r: GLhalfNV), +>; +pub type PFNGLMULTITEXCOORD3HVNVPROC = + ::std::option::Option; +pub type PFNGLMULTITEXCOORD4HNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, s: GLhalfNV, t: GLhalfNV, r: GLhalfNV, q: GLhalfNV), +>; +pub type PFNGLMULTITEXCOORD4HVNVPROC = + ::std::option::Option; +pub type PFNGLFOGCOORDHNVPROC = ::std::option::Option; +pub type PFNGLFOGCOORDHVNVPROC = ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3HNVPROC = + ::std::option::Option; +pub type PFNGLSECONDARYCOLOR3HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXWEIGHTHNVPROC = ::std::option::Option; +pub type PFNGLVERTEXWEIGHTHVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1HNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2HNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3HNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLhalfNV, y: GLhalfNV, z: GLhalfNV), +>; +pub type PFNGLVERTEXATTRIB3HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4HNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLhalfNV, y: GLhalfNV, z: GLhalfNV, w: GLhalfNV), +>; +pub type PFNGLVERTEXATTRIB4HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS1HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS2HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS3HVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS4HVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glVertex2hNV(x: GLhalfNV, y: GLhalfNV); +} +extern "C" { + pub fn glVertex2hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glVertex3hNV(x: GLhalfNV, y: GLhalfNV, z: GLhalfNV); +} +extern "C" { + pub fn glVertex3hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glVertex4hNV(x: GLhalfNV, y: GLhalfNV, z: GLhalfNV, w: GLhalfNV); +} +extern "C" { + pub fn glVertex4hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glNormal3hNV(nx: GLhalfNV, ny: GLhalfNV, nz: GLhalfNV); +} +extern "C" { + pub fn glNormal3hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glColor3hNV(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV); +} +extern "C" { + pub fn glColor3hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glColor4hNV(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV, alpha: GLhalfNV); +} +extern "C" { + pub fn glColor4hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glTexCoord1hNV(s: GLhalfNV); +} +extern "C" { + pub fn glTexCoord1hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glTexCoord2hNV(s: GLhalfNV, t: GLhalfNV); +} +extern "C" { + pub fn glTexCoord2hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glTexCoord3hNV(s: GLhalfNV, t: GLhalfNV, r: GLhalfNV); +} +extern "C" { + pub fn glTexCoord3hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glTexCoord4hNV(s: GLhalfNV, t: GLhalfNV, r: GLhalfNV, q: GLhalfNV); +} +extern "C" { + pub fn glTexCoord4hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord1hNV(target: GLenum, s: GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord1hvNV(target: GLenum, v: *const GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord2hNV(target: GLenum, s: GLhalfNV, t: GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord2hvNV(target: GLenum, v: *const GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord3hNV(target: GLenum, s: GLhalfNV, t: GLhalfNV, r: GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord3hvNV(target: GLenum, v: *const GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord4hNV(target: GLenum, s: GLhalfNV, t: GLhalfNV, r: GLhalfNV, q: GLhalfNV); +} +extern "C" { + pub fn glMultiTexCoord4hvNV(target: GLenum, v: *const GLhalfNV); +} +extern "C" { + pub fn glFogCoordhNV(fog: GLhalfNV); +} +extern "C" { + pub fn glFogCoordhvNV(fog: *const GLhalfNV); +} +extern "C" { + pub fn glSecondaryColor3hNV(red: GLhalfNV, green: GLhalfNV, blue: GLhalfNV); +} +extern "C" { + pub fn glSecondaryColor3hvNV(v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexWeighthNV(weight: GLhalfNV); +} +extern "C" { + pub fn glVertexWeighthvNV(weight: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib1hNV(index: GLuint, x: GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib1hvNV(index: GLuint, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib2hNV(index: GLuint, x: GLhalfNV, y: GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib2hvNV(index: GLuint, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib3hNV(index: GLuint, x: GLhalfNV, y: GLhalfNV, z: GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib3hvNV(index: GLuint, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib4hNV(index: GLuint, x: GLhalfNV, y: GLhalfNV, z: GLhalfNV, w: GLhalfNV); +} +extern "C" { + pub fn glVertexAttrib4hvNV(index: GLuint, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttribs1hvNV(index: GLuint, n: GLsizei, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttribs2hvNV(index: GLuint, n: GLsizei, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttribs3hvNV(index: GLuint, n: GLsizei, v: *const GLhalfNV); +} +extern "C" { + pub fn glVertexAttribs4hvNV(index: GLuint, n: GLsizei, v: *const GLhalfNV); +} +pub type PFNGLGETINTERNALFORMATSAMPLEIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + samples: GLsizei, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint, + ), +>; +extern "C" { + pub fn glGetInternalformatSampleivNV( + target: GLenum, + internalformat: GLenum, + samples: GLsizei, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint, + ); +} +pub type PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + memory: GLuint, + pname: GLenum, + first: GLint, + count: GLsizei, + params: *mut GLuint, + ), +>; +pub type PFNGLRESETMEMORYOBJECTPARAMETERNVPROC = + ::std::option::Option; +pub type PFNGLTEXATTACHMEMORYNVPROC = + ::std::option::Option; +pub type PFNGLBUFFERATTACHMEMORYNVPROC = + ::std::option::Option; +pub type PFNGLTEXTUREATTACHMEMORYNVPROC = + ::std::option::Option; +pub type PFNGLNAMEDBUFFERATTACHMEMORYNVPROC = + ::std::option::Option; +extern "C" { + pub fn glGetMemoryObjectDetachedResourcesuivNV( + memory: GLuint, + pname: GLenum, + first: GLint, + count: GLsizei, + params: *mut GLuint, + ); +} +extern "C" { + pub fn glResetMemoryObjectParameterNV(memory: GLuint, pname: GLenum); +} +extern "C" { + pub fn glTexAttachMemoryNV(target: GLenum, memory: GLuint, offset: GLuint64); +} +extern "C" { + pub fn glBufferAttachMemoryNV(target: GLenum, memory: GLuint, offset: GLuint64); +} +extern "C" { + pub fn glTextureAttachMemoryNV(texture: GLuint, memory: GLuint, offset: GLuint64); +} +extern "C" { + pub fn glNamedBufferAttachMemoryNV(buffer: GLuint, memory: GLuint, offset: GLuint64); +} +pub type PFNGLDRAWMESHTASKSNVPROC = + ::std::option::Option; +pub type PFNGLDRAWMESHTASKSINDIRECTNVPROC = + ::std::option::Option; +pub type PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC = ::std::option::Option< + unsafe extern "C" fn(indirect: GLintptr, drawcount: GLsizei, stride: GLsizei), +>; +pub type PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + indirect: GLintptr, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ), +>; +extern "C" { + pub fn glDrawMeshTasksNV(first: GLuint, count: GLuint); +} +extern "C" { + pub fn glDrawMeshTasksIndirectNV(indirect: GLintptr); +} +extern "C" { + pub fn glMultiDrawMeshTasksIndirectNV(indirect: GLintptr, drawcount: GLsizei, stride: GLsizei); +} +extern "C" { + pub fn glMultiDrawMeshTasksIndirectCountNV( + indirect: GLintptr, + drawcount: GLintptr, + maxdrawcount: GLsizei, + stride: GLsizei, + ); +} +pub type PFNGLGENOCCLUSIONQUERIESNVPROC = + ::std::option::Option; +pub type PFNGLDELETEOCCLUSIONQUERIESNVPROC = + ::std::option::Option; +pub type PFNGLISOCCLUSIONQUERYNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLBEGINOCCLUSIONQUERYNVPROC = ::std::option::Option; +pub type PFNGLENDOCCLUSIONQUERYNVPROC = ::std::option::Option; +pub type PFNGLGETOCCLUSIONQUERYIVNVPROC = + ::std::option::Option; +pub type PFNGLGETOCCLUSIONQUERYUIVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glGenOcclusionQueriesNV(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glDeleteOcclusionQueriesNV(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glIsOcclusionQueryNV(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBeginOcclusionQueryNV(id: GLuint); +} +extern "C" { + pub fn glEndOcclusionQueryNV(); +} +extern "C" { + pub fn glGetOcclusionQueryivNV(id: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetOcclusionQueryuivNV(id: GLuint, pname: GLenum, params: *mut GLuint); +} +pub type PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + bindingIndex: GLuint, + wordIndex: GLuint, + count: GLsizei, + params: *const GLfloat, + ), +>; +pub type PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + bindingIndex: GLuint, + wordIndex: GLuint, + count: GLsizei, + params: *const GLint, + ), +>; +pub type PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + bindingIndex: GLuint, + wordIndex: GLuint, + count: GLsizei, + params: *const GLuint, + ), +>; +extern "C" { + pub fn glProgramBufferParametersfvNV( + target: GLenum, + bindingIndex: GLuint, + wordIndex: GLuint, + count: GLsizei, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glProgramBufferParametersIivNV( + target: GLenum, + bindingIndex: GLuint, + wordIndex: GLuint, + count: GLsizei, + params: *const GLint, + ); +} +extern "C" { + pub fn glProgramBufferParametersIuivNV( + target: GLenum, + bindingIndex: GLuint, + wordIndex: GLuint, + count: GLsizei, + params: *const GLuint, + ); +} +pub type PFNGLGENPATHSNVPROC = + ::std::option::Option GLuint>; +pub type PFNGLDELETEPATHSNVPROC = + ::std::option::Option; +pub type PFNGLISPATHNVPROC = ::std::option::Option GLboolean>; +pub type PFNGLPATHCOMMANDSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + path: GLuint, + numCommands: GLsizei, + commands: *const GLubyte, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLPATHCOORDSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + path: GLuint, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLPATHSUBCOMMANDSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + path: GLuint, + commandStart: GLsizei, + commandsToDelete: GLsizei, + numCommands: GLsizei, + commands: *const GLubyte, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLPATHSUBCOORDSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + path: GLuint, + coordStart: GLsizei, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLPATHSTRINGNVPROC = ::std::option::Option< + unsafe extern "C" fn( + path: GLuint, + format: GLenum, + length: GLsizei, + pathString: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLPATHGLYPHSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + firstPathName: GLuint, + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + numGlyphs: GLsizei, + type_: GLenum, + charcodes: *const ::std::os::raw::c_void, + handleMissingGlyphs: GLenum, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ), +>; +pub type PFNGLPATHGLYPHRANGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + firstPathName: GLuint, + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + firstGlyph: GLuint, + numGlyphs: GLsizei, + handleMissingGlyphs: GLenum, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ), +>; +pub type PFNGLWEIGHTPATHSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + resultPath: GLuint, + numPaths: GLsizei, + paths: *const GLuint, + weights: *const GLfloat, + ), +>; +pub type PFNGLCOPYPATHNVPROC = + ::std::option::Option; +pub type PFNGLINTERPOLATEPATHSNVPROC = ::std::option::Option< + unsafe extern "C" fn(resultPath: GLuint, pathA: GLuint, pathB: GLuint, weight: GLfloat), +>; +pub type PFNGLTRANSFORMPATHNVPROC = ::std::option::Option< + unsafe extern "C" fn( + resultPath: GLuint, + srcPath: GLuint, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLPATHPARAMETERIVNVPROC = + ::std::option::Option; +pub type PFNGLPATHPARAMETERINVPROC = + ::std::option::Option; +pub type PFNGLPATHPARAMETERFVNVPROC = + ::std::option::Option; +pub type PFNGLPATHPARAMETERFNVPROC = + ::std::option::Option; +pub type PFNGLPATHDASHARRAYNVPROC = ::std::option::Option< + unsafe extern "C" fn(path: GLuint, dashCount: GLsizei, dashArray: *const GLfloat), +>; +pub type PFNGLPATHSTENCILFUNCNVPROC = + ::std::option::Option; +pub type PFNGLPATHSTENCILDEPTHOFFSETNVPROC = + ::std::option::Option; +pub type PFNGLSTENCILFILLPATHNVPROC = + ::std::option::Option; +pub type PFNGLSTENCILSTROKEPATHNVPROC = + ::std::option::Option; +pub type PFNGLSTENCILFILLPATHINSTANCEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + fillMode: GLenum, + mask: GLuint, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + reference: GLint, + mask: GLuint, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLPATHCOVERDEPTHFUNCNVPROC = ::std::option::Option; +pub type PFNGLCOVERFILLPATHNVPROC = + ::std::option::Option; +pub type PFNGLCOVERSTROKEPATHNVPROC = + ::std::option::Option; +pub type PFNGLCOVERFILLPATHINSTANCEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLCOVERSTROKEPATHINSTANCEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLGETPATHPARAMETERIVNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHPARAMETERFVNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHCOMMANDSNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHCOORDSNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHDASHARRAYNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHMETRICSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + metricQueryMask: GLbitfield, + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + stride: GLsizei, + metrics: *mut GLfloat, + ), +>; +pub type PFNGLGETPATHMETRICRANGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + metricQueryMask: GLbitfield, + firstPathName: GLuint, + numPaths: GLsizei, + stride: GLsizei, + metrics: *mut GLfloat, + ), +>; +pub type PFNGLGETPATHSPACINGNVPROC = ::std::option::Option< + unsafe extern "C" fn( + pathListMode: GLenum, + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + advanceScale: GLfloat, + kerningScale: GLfloat, + transformType: GLenum, + returnedSpacing: *mut GLfloat, + ), +>; +pub type PFNGLISPOINTINFILLPATHNVPROC = ::std::option::Option< + unsafe extern "C" fn(path: GLuint, mask: GLuint, x: GLfloat, y: GLfloat) -> GLboolean, +>; +pub type PFNGLISPOINTINSTROKEPATHNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETPATHLENGTHNVPROC = ::std::option::Option< + unsafe extern "C" fn(path: GLuint, startSegment: GLsizei, numSegments: GLsizei) -> GLfloat, +>; +pub type PFNGLPOINTALONGPATHNVPROC = ::std::option::Option< + unsafe extern "C" fn( + path: GLuint, + startSegment: GLsizei, + numSegments: GLsizei, + distance: GLfloat, + x: *mut GLfloat, + y: *mut GLfloat, + tangentX: *mut GLfloat, + tangentY: *mut GLfloat, + ) -> GLboolean, +>; +pub type PFNGLMATRIXLOAD3X2FNVPROC = + ::std::option::Option; +pub type PFNGLMATRIXLOAD3X3FNVPROC = + ::std::option::Option; +pub type PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULT3X2FNVPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULT3X3FNVPROC = + ::std::option::Option; +pub type PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC = + ::std::option::Option; +pub type PFNGLSTENCILTHENCOVERFILLPATHNVPROC = ::std::option::Option< + unsafe extern "C" fn(path: GLuint, fillMode: GLenum, mask: GLuint, coverMode: GLenum), +>; +pub type PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC = ::std::option::Option< + unsafe extern "C" fn(path: GLuint, reference: GLint, mask: GLuint, coverMode: GLenum), +>; +pub type PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + fillMode: GLenum, + mask: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + reference: GLint, + mask: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ), +>; +pub type PFNGLPATHGLYPHINDEXRANGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + pathParameterTemplate: GLuint, + emScale: GLfloat, + baseAndCount: *mut GLuint, + ) -> GLenum, +>; +pub type PFNGLPATHGLYPHINDEXARRAYNVPROC = ::std::option::Option< + unsafe extern "C" fn( + firstPathName: GLuint, + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + firstGlyphIndex: GLuint, + numGlyphs: GLsizei, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ) -> GLenum, +>; +pub type PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC = ::std::option::Option< + unsafe extern "C" fn( + firstPathName: GLuint, + fontTarget: GLenum, + fontSize: GLsizeiptr, + fontData: *const ::std::os::raw::c_void, + faceIndex: GLsizei, + firstGlyphIndex: GLuint, + numGlyphs: GLsizei, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ) -> GLenum, +>; +pub type PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + genMode: GLenum, + components: GLint, + coeffs: *const GLfloat, + ), +>; +pub type PFNGLGETPROGRAMRESOURCEFVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + programInterface: GLenum, + index: GLuint, + propCount: GLsizei, + props: *const GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + params: *mut GLfloat, + ), +>; +pub type PFNGLPATHCOLORGENNVPROC = ::std::option::Option< + unsafe extern "C" fn( + color: GLenum, + genMode: GLenum, + colorFormat: GLenum, + coeffs: *const GLfloat, + ), +>; +pub type PFNGLPATHTEXGENNVPROC = ::std::option::Option< + unsafe extern "C" fn( + texCoordSet: GLenum, + genMode: GLenum, + components: GLint, + coeffs: *const GLfloat, + ), +>; +pub type PFNGLPATHFOGGENNVPROC = ::std::option::Option; +pub type PFNGLGETPATHCOLORGENIVNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHCOLORGENFVNVPROC = + ::std::option::Option; +pub type PFNGLGETPATHTEXGENIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(texCoordSet: GLenum, pname: GLenum, value: *mut GLint), +>; +pub type PFNGLGETPATHTEXGENFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(texCoordSet: GLenum, pname: GLenum, value: *mut GLfloat), +>; +extern "C" { + pub fn glGenPathsNV(range: GLsizei) -> GLuint; +} +extern "C" { + pub fn glDeletePathsNV(path: GLuint, range: GLsizei); +} +extern "C" { + pub fn glIsPathNV(path: GLuint) -> GLboolean; +} +extern "C" { + pub fn glPathCommandsNV( + path: GLuint, + numCommands: GLsizei, + commands: *const GLubyte, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glPathCoordsNV( + path: GLuint, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glPathSubCommandsNV( + path: GLuint, + commandStart: GLsizei, + commandsToDelete: GLsizei, + numCommands: GLsizei, + commands: *const GLubyte, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glPathSubCoordsNV( + path: GLuint, + coordStart: GLsizei, + numCoords: GLsizei, + coordType: GLenum, + coords: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glPathStringNV( + path: GLuint, + format: GLenum, + length: GLsizei, + pathString: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glPathGlyphsNV( + firstPathName: GLuint, + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + numGlyphs: GLsizei, + type_: GLenum, + charcodes: *const ::std::os::raw::c_void, + handleMissingGlyphs: GLenum, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ); +} +extern "C" { + pub fn glPathGlyphRangeNV( + firstPathName: GLuint, + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + firstGlyph: GLuint, + numGlyphs: GLsizei, + handleMissingGlyphs: GLenum, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ); +} +extern "C" { + pub fn glWeightPathsNV( + resultPath: GLuint, + numPaths: GLsizei, + paths: *const GLuint, + weights: *const GLfloat, + ); +} +extern "C" { + pub fn glCopyPathNV(resultPath: GLuint, srcPath: GLuint); +} +extern "C" { + pub fn glInterpolatePathsNV(resultPath: GLuint, pathA: GLuint, pathB: GLuint, weight: GLfloat); +} +extern "C" { + pub fn glTransformPathNV( + resultPath: GLuint, + srcPath: GLuint, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glPathParameterivNV(path: GLuint, pname: GLenum, value: *const GLint); +} +extern "C" { + pub fn glPathParameteriNV(path: GLuint, pname: GLenum, value: GLint); +} +extern "C" { + pub fn glPathParameterfvNV(path: GLuint, pname: GLenum, value: *const GLfloat); +} +extern "C" { + pub fn glPathParameterfNV(path: GLuint, pname: GLenum, value: GLfloat); +} +extern "C" { + pub fn glPathDashArrayNV(path: GLuint, dashCount: GLsizei, dashArray: *const GLfloat); +} +extern "C" { + pub fn glPathStencilFuncNV(func: GLenum, ref_: GLint, mask: GLuint); +} +extern "C" { + pub fn glPathStencilDepthOffsetNV(factor: GLfloat, units: GLfloat); +} +extern "C" { + pub fn glStencilFillPathNV(path: GLuint, fillMode: GLenum, mask: GLuint); +} +extern "C" { + pub fn glStencilStrokePathNV(path: GLuint, reference: GLint, mask: GLuint); +} +extern "C" { + pub fn glStencilFillPathInstancedNV( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + fillMode: GLenum, + mask: GLuint, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glStencilStrokePathInstancedNV( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + reference: GLint, + mask: GLuint, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glPathCoverDepthFuncNV(func: GLenum); +} +extern "C" { + pub fn glCoverFillPathNV(path: GLuint, coverMode: GLenum); +} +extern "C" { + pub fn glCoverStrokePathNV(path: GLuint, coverMode: GLenum); +} +extern "C" { + pub fn glCoverFillPathInstancedNV( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glCoverStrokePathInstancedNV( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glGetPathParameterivNV(path: GLuint, pname: GLenum, value: *mut GLint); +} +extern "C" { + pub fn glGetPathParameterfvNV(path: GLuint, pname: GLenum, value: *mut GLfloat); +} +extern "C" { + pub fn glGetPathCommandsNV(path: GLuint, commands: *mut GLubyte); +} +extern "C" { + pub fn glGetPathCoordsNV(path: GLuint, coords: *mut GLfloat); +} +extern "C" { + pub fn glGetPathDashArrayNV(path: GLuint, dashArray: *mut GLfloat); +} +extern "C" { + pub fn glGetPathMetricsNV( + metricQueryMask: GLbitfield, + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + stride: GLsizei, + metrics: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetPathMetricRangeNV( + metricQueryMask: GLbitfield, + firstPathName: GLuint, + numPaths: GLsizei, + stride: GLsizei, + metrics: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetPathSpacingNV( + pathListMode: GLenum, + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + advanceScale: GLfloat, + kerningScale: GLfloat, + transformType: GLenum, + returnedSpacing: *mut GLfloat, + ); +} +extern "C" { + pub fn glIsPointInFillPathNV(path: GLuint, mask: GLuint, x: GLfloat, y: GLfloat) -> GLboolean; +} +extern "C" { + pub fn glIsPointInStrokePathNV(path: GLuint, x: GLfloat, y: GLfloat) -> GLboolean; +} +extern "C" { + pub fn glGetPathLengthNV(path: GLuint, startSegment: GLsizei, numSegments: GLsizei) -> GLfloat; +} +extern "C" { + pub fn glPointAlongPathNV( + path: GLuint, + startSegment: GLsizei, + numSegments: GLsizei, + distance: GLfloat, + x: *mut GLfloat, + y: *mut GLfloat, + tangentX: *mut GLfloat, + tangentY: *mut GLfloat, + ) -> GLboolean; +} +extern "C" { + pub fn glMatrixLoad3x2fNV(matrixMode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixLoad3x3fNV(matrixMode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixLoadTranspose3x3fNV(matrixMode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixMult3x2fNV(matrixMode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixMult3x3fNV(matrixMode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glMatrixMultTranspose3x3fNV(matrixMode: GLenum, m: *const GLfloat); +} +extern "C" { + pub fn glStencilThenCoverFillPathNV( + path: GLuint, + fillMode: GLenum, + mask: GLuint, + coverMode: GLenum, + ); +} +extern "C" { + pub fn glStencilThenCoverStrokePathNV( + path: GLuint, + reference: GLint, + mask: GLuint, + coverMode: GLenum, + ); +} +extern "C" { + pub fn glStencilThenCoverFillPathInstancedNV( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + fillMode: GLenum, + mask: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glStencilThenCoverStrokePathInstancedNV( + numPaths: GLsizei, + pathNameType: GLenum, + paths: *const ::std::os::raw::c_void, + pathBase: GLuint, + reference: GLint, + mask: GLuint, + coverMode: GLenum, + transformType: GLenum, + transformValues: *const GLfloat, + ); +} +extern "C" { + pub fn glPathGlyphIndexRangeNV( + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + pathParameterTemplate: GLuint, + emScale: GLfloat, + baseAndCount: *mut GLuint, + ) -> GLenum; +} +extern "C" { + pub fn glPathGlyphIndexArrayNV( + firstPathName: GLuint, + fontTarget: GLenum, + fontName: *const ::std::os::raw::c_void, + fontStyle: GLbitfield, + firstGlyphIndex: GLuint, + numGlyphs: GLsizei, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ) -> GLenum; +} +extern "C" { + pub fn glPathMemoryGlyphIndexArrayNV( + firstPathName: GLuint, + fontTarget: GLenum, + fontSize: GLsizeiptr, + fontData: *const ::std::os::raw::c_void, + faceIndex: GLsizei, + firstGlyphIndex: GLuint, + numGlyphs: GLsizei, + pathParameterTemplate: GLuint, + emScale: GLfloat, + ) -> GLenum; +} +extern "C" { + pub fn glProgramPathFragmentInputGenNV( + program: GLuint, + location: GLint, + genMode: GLenum, + components: GLint, + coeffs: *const GLfloat, + ); +} +extern "C" { + pub fn glGetProgramResourcefvNV( + program: GLuint, + programInterface: GLenum, + index: GLuint, + propCount: GLsizei, + props: *const GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glPathColorGenNV( + color: GLenum, + genMode: GLenum, + colorFormat: GLenum, + coeffs: *const GLfloat, + ); +} +extern "C" { + pub fn glPathTexGenNV( + texCoordSet: GLenum, + genMode: GLenum, + components: GLint, + coeffs: *const GLfloat, + ); +} +extern "C" { + pub fn glPathFogGenNV(genMode: GLenum); +} +extern "C" { + pub fn glGetPathColorGenivNV(color: GLenum, pname: GLenum, value: *mut GLint); +} +extern "C" { + pub fn glGetPathColorGenfvNV(color: GLenum, pname: GLenum, value: *mut GLfloat); +} +extern "C" { + pub fn glGetPathTexGenivNV(texCoordSet: GLenum, pname: GLenum, value: *mut GLint); +} +extern "C" { + pub fn glGetPathTexGenfvNV(texCoordSet: GLenum, pname: GLenum, value: *mut GLfloat); +} +pub type PFNGLPIXELDATARANGENVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, length: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +pub type PFNGLFLUSHPIXELDATARANGENVPROC = + ::std::option::Option; +extern "C" { + pub fn glPixelDataRangeNV( + target: GLenum, + length: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glFlushPixelDataRangeNV(target: GLenum); +} +pub type PFNGLPOINTPARAMETERINVPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERIVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glPointParameteriNV(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPointParameterivNV(pname: GLenum, params: *const GLint); +} +pub type PFNGLPRESENTFRAMEKEYEDNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_slot: GLuint, + minPresentTime: GLuint64EXT, + beginPresentTimeId: GLuint, + presentDurationId: GLuint, + type_: GLenum, + target0: GLenum, + fill0: GLuint, + key0: GLuint, + target1: GLenum, + fill1: GLuint, + key1: GLuint, + ), +>; +pub type PFNGLPRESENTFRAMEDUALFILLNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_slot: GLuint, + minPresentTime: GLuint64EXT, + beginPresentTimeId: GLuint, + presentDurationId: GLuint, + type_: GLenum, + target0: GLenum, + fill0: GLuint, + target1: GLenum, + fill1: GLuint, + target2: GLenum, + fill2: GLuint, + target3: GLenum, + fill3: GLuint, + ), +>; +pub type PFNGLGETVIDEOIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(video_slot: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETVIDEOUIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(video_slot: GLuint, pname: GLenum, params: *mut GLuint), +>; +pub type PFNGLGETVIDEOI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(video_slot: GLuint, pname: GLenum, params: *mut GLint64EXT), +>; +pub type PFNGLGETVIDEOUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(video_slot: GLuint, pname: GLenum, params: *mut GLuint64EXT), +>; +extern "C" { + pub fn glPresentFrameKeyedNV( + video_slot: GLuint, + minPresentTime: GLuint64EXT, + beginPresentTimeId: GLuint, + presentDurationId: GLuint, + type_: GLenum, + target0: GLenum, + fill0: GLuint, + key0: GLuint, + target1: GLenum, + fill1: GLuint, + key1: GLuint, + ); +} +extern "C" { + pub fn glPresentFrameDualFillNV( + video_slot: GLuint, + minPresentTime: GLuint64EXT, + beginPresentTimeId: GLuint, + presentDurationId: GLuint, + type_: GLenum, + target0: GLenum, + fill0: GLuint, + target1: GLenum, + fill1: GLuint, + target2: GLenum, + fill2: GLuint, + target3: GLenum, + fill3: GLuint, + ); +} +extern "C" { + pub fn glGetVideoivNV(video_slot: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVideouivNV(video_slot: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glGetVideoi64vNV(video_slot: GLuint, pname: GLenum, params: *mut GLint64EXT); +} +extern "C" { + pub fn glGetVideoui64vNV(video_slot: GLuint, pname: GLenum, params: *mut GLuint64EXT); +} +pub type PFNGLPRIMITIVERESTARTNVPROC = ::std::option::Option; +pub type PFNGLPRIMITIVERESTARTINDEXNVPROC = + ::std::option::Option; +extern "C" { + pub fn glPrimitiveRestartNV(); +} +extern "C" { + pub fn glPrimitiveRestartIndexNV(index: GLuint); +} +pub type PFNGLQUERYRESOURCENVPROC = ::std::option::Option< + unsafe extern "C" fn( + queryType: GLenum, + tagId: GLint, + bufSize: GLuint, + buffer: *mut GLint, + ) -> GLint, +>; +extern "C" { + pub fn glQueryResourceNV( + queryType: GLenum, + tagId: GLint, + bufSize: GLuint, + buffer: *mut GLint, + ) -> GLint; +} +pub type PFNGLGENQUERYRESOURCETAGNVPROC = + ::std::option::Option; +pub type PFNGLDELETEQUERYRESOURCETAGNVPROC = + ::std::option::Option; +pub type PFNGLQUERYRESOURCETAGNVPROC = + ::std::option::Option; +extern "C" { + pub fn glGenQueryResourceTagNV(n: GLsizei, tagIds: *mut GLint); +} +extern "C" { + pub fn glDeleteQueryResourceTagNV(n: GLsizei, tagIds: *const GLint); +} +extern "C" { + pub fn glQueryResourceTagNV(tagId: GLint, tagString: *const GLchar); +} +pub type PFNGLCOMBINERPARAMETERFVNVPROC = + ::std::option::Option; +pub type PFNGLCOMBINERPARAMETERFNVPROC = + ::std::option::Option; +pub type PFNGLCOMBINERPARAMETERIVNVPROC = + ::std::option::Option; +pub type PFNGLCOMBINERPARAMETERINVPROC = + ::std::option::Option; +pub type PFNGLCOMBINERINPUTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + stage: GLenum, + portion: GLenum, + variable: GLenum, + input: GLenum, + mapping: GLenum, + componentUsage: GLenum, + ), +>; +pub type PFNGLCOMBINEROUTPUTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + stage: GLenum, + portion: GLenum, + abOutput: GLenum, + cdOutput: GLenum, + sumOutput: GLenum, + scale: GLenum, + bias: GLenum, + abDotProduct: GLboolean, + cdDotProduct: GLboolean, + muxSum: GLboolean, + ), +>; +pub type PFNGLFINALCOMBINERINPUTNVPROC = ::std::option::Option< + unsafe extern "C" fn(variable: GLenum, input: GLenum, mapping: GLenum, componentUsage: GLenum), +>; +pub type PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + stage: GLenum, + portion: GLenum, + variable: GLenum, + pname: GLenum, + params: *mut GLfloat, + ), +>; +pub type PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + stage: GLenum, + portion: GLenum, + variable: GLenum, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(stage: GLenum, portion: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(stage: GLenum, portion: GLenum, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(variable: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(variable: GLenum, pname: GLenum, params: *mut GLint), +>; +extern "C" { + pub fn glCombinerParameterfvNV(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glCombinerParameterfNV(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glCombinerParameterivNV(pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glCombinerParameteriNV(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glCombinerInputNV( + stage: GLenum, + portion: GLenum, + variable: GLenum, + input: GLenum, + mapping: GLenum, + componentUsage: GLenum, + ); +} +extern "C" { + pub fn glCombinerOutputNV( + stage: GLenum, + portion: GLenum, + abOutput: GLenum, + cdOutput: GLenum, + sumOutput: GLenum, + scale: GLenum, + bias: GLenum, + abDotProduct: GLboolean, + cdDotProduct: GLboolean, + muxSum: GLboolean, + ); +} +extern "C" { + pub fn glFinalCombinerInputNV( + variable: GLenum, + input: GLenum, + mapping: GLenum, + componentUsage: GLenum, + ); +} +extern "C" { + pub fn glGetCombinerInputParameterfvNV( + stage: GLenum, + portion: GLenum, + variable: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetCombinerInputParameterivNV( + stage: GLenum, + portion: GLenum, + variable: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetCombinerOutputParameterfvNV( + stage: GLenum, + portion: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetCombinerOutputParameterivNV( + stage: GLenum, + portion: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetFinalCombinerInputParameterfvNV( + variable: GLenum, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetFinalCombinerInputParameterivNV( + variable: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +pub type PFNGLCOMBINERSTAGEPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(stage: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glCombinerStageParameterfvNV(stage: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glGetCombinerStageParameterfvNV(stage: GLenum, pname: GLenum, params: *mut GLfloat); +} +pub type PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, start: GLuint, count: GLsizei, v: *const GLfloat), +>; +pub type PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(framebuffer: GLuint, start: GLuint, count: GLsizei, v: *const GLfloat), +>; +pub type PFNGLRESOLVEDEPTHVALUESNVPROC = ::std::option::Option; +extern "C" { + pub fn glFramebufferSampleLocationsfvNV( + target: GLenum, + start: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glNamedFramebufferSampleLocationsfvNV( + framebuffer: GLuint, + start: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glResolveDepthValuesNV(); +} +pub type PFNGLSCISSOREXCLUSIVENVPROC = ::std::option::Option< + unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), +>; +pub type PFNGLSCISSOREXCLUSIVEARRAYVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glScissorExclusiveNV(x: GLint, y: GLint, width: GLsizei, height: GLsizei); +} +extern "C" { + pub fn glScissorExclusiveArrayvNV(first: GLuint, count: GLsizei, v: *const GLint); +} +pub type PFNGLMAKEBUFFERRESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLMAKEBUFFERNONRESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLISBUFFERRESIDENTNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLMAKENAMEDBUFFERRESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC = + ::std::option::Option; +pub type PFNGLISNAMEDBUFFERRESIDENTNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLGETBUFFERPARAMETERUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLuint64EXT), +>; +pub type PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(buffer: GLuint, pname: GLenum, params: *mut GLuint64EXT), +>; +pub type PFNGLGETINTEGERUI64VNVPROC = + ::std::option::Option; +pub type PFNGLUNIFORMUI64NVPROC = + ::std::option::Option; +pub type PFNGLUNIFORMUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLuint64EXT), +>; +pub type PFNGLPROGRAMUNIFORMUI64NVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, location: GLint, value: GLuint64EXT), +>; +pub type PFNGLPROGRAMUNIFORMUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ), +>; +extern "C" { + pub fn glMakeBufferResidentNV(target: GLenum, access: GLenum); +} +extern "C" { + pub fn glMakeBufferNonResidentNV(target: GLenum); +} +extern "C" { + pub fn glIsBufferResidentNV(target: GLenum) -> GLboolean; +} +extern "C" { + pub fn glMakeNamedBufferResidentNV(buffer: GLuint, access: GLenum); +} +extern "C" { + pub fn glMakeNamedBufferNonResidentNV(buffer: GLuint); +} +extern "C" { + pub fn glIsNamedBufferResidentNV(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glGetBufferParameterui64vNV(target: GLenum, pname: GLenum, params: *mut GLuint64EXT); +} +extern "C" { + pub fn glGetNamedBufferParameterui64vNV( + buffer: GLuint, + pname: GLenum, + params: *mut GLuint64EXT, + ); +} +extern "C" { + pub fn glGetIntegerui64vNV(value: GLenum, result: *mut GLuint64EXT); +} +extern "C" { + pub fn glUniformui64NV(location: GLint, value: GLuint64EXT); +} +extern "C" { + pub fn glUniformui64vNV(location: GLint, count: GLsizei, value: *const GLuint64EXT); +} +extern "C" { + pub fn glProgramUniformui64NV(program: GLuint, location: GLint, value: GLuint64EXT); +} +extern "C" { + pub fn glProgramUniformui64vNV( + program: GLuint, + location: GLint, + count: GLsizei, + value: *const GLuint64EXT, + ); +} +pub type PFNGLBINDSHADINGRATEIMAGENVPROC = + ::std::option::Option; +pub type PFNGLGETSHADINGRATEIMAGEPALETTENVPROC = + ::std::option::Option; +pub type PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(rate: GLenum, samples: GLuint, index: GLuint, location: *mut GLint), +>; +pub type PFNGLSHADINGRATEIMAGEBARRIERNVPROC = + ::std::option::Option; +pub type PFNGLSHADINGRATEIMAGEPALETTENVPROC = ::std::option::Option< + unsafe extern "C" fn(viewport: GLuint, first: GLuint, count: GLsizei, rates: *const GLenum), +>; +pub type PFNGLSHADINGRATESAMPLEORDERNVPROC = + ::std::option::Option; +pub type PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC = ::std::option::Option< + unsafe extern "C" fn(rate: GLenum, samples: GLuint, locations: *const GLint), +>; +extern "C" { + pub fn glBindShadingRateImageNV(texture: GLuint); +} +extern "C" { + pub fn glGetShadingRateImagePaletteNV(viewport: GLuint, entry: GLuint, rate: *mut GLenum); +} +extern "C" { + pub fn glGetShadingRateSampleLocationivNV( + rate: GLenum, + samples: GLuint, + index: GLuint, + location: *mut GLint, + ); +} +extern "C" { + pub fn glShadingRateImageBarrierNV(synchronize: GLboolean); +} +extern "C" { + pub fn glShadingRateImagePaletteNV( + viewport: GLuint, + first: GLuint, + count: GLsizei, + rates: *const GLenum, + ); +} +extern "C" { + pub fn glShadingRateSampleOrderNV(order: GLenum); +} +extern "C" { + pub fn glShadingRateSampleOrderCustomNV(rate: GLenum, samples: GLuint, locations: *const GLint); +} +pub type PFNGLTEXTUREBARRIERNVPROC = ::std::option::Option; +extern "C" { + pub fn glTextureBarrierNV(); +} +pub type PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + ), +>; +pub type PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + ), +>; +pub type PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + ), +>; +pub type PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + ), +>; +pub type PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + ), +>; +pub type PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + texture: GLuint, + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + ), +>; +extern "C" { + pub fn glTexImage2DMultisampleCoverageNV( + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + ); +} +extern "C" { + pub fn glTexImage3DMultisampleCoverageNV( + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureImage2DMultisampleNV( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureImage3DMultisampleNV( + texture: GLuint, + target: GLenum, + samples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureImage2DMultisampleCoverageNV( + texture: GLuint, + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + fixedSampleLocations: GLboolean, + ); +} +extern "C" { + pub fn glTextureImage3DMultisampleCoverageNV( + texture: GLuint, + target: GLenum, + coverageSamples: GLsizei, + colorSamples: GLsizei, + internalFormat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + fixedSampleLocations: GLboolean, + ); +} +pub type PFNGLBEGINTRANSFORMFEEDBACKNVPROC = + ::std::option::Option; +pub type PFNGLENDTRANSFORMFEEDBACKNVPROC = ::std::option::Option; +pub type PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC = ::std::option::Option< + unsafe extern "C" fn(count: GLsizei, attribs: *const GLint, bufferMode: GLenum), +>; +pub type PFNGLBINDBUFFERRANGENVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ), +>; +pub type PFNGLBINDBUFFEROFFSETNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr), +>; +pub type PFNGLBINDBUFFERBASENVPROC = + ::std::option::Option; +pub type PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + count: GLsizei, + locations: *const GLint, + bufferMode: GLenum, + ), +>; +pub type PFNGLACTIVEVARYINGNVPROC = + ::std::option::Option; +pub type PFNGLGETVARYINGLOCATIONNVPROC = + ::std::option::Option GLint>; +pub type PFNGLGETACTIVEVARYINGNVPROC = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ), +>; +pub type PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC = ::std::option::Option< + unsafe extern "C" fn(program: GLuint, index: GLuint, location: *mut GLint), +>; +pub type PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC = ::std::option::Option< + unsafe extern "C" fn( + count: GLsizei, + attribs: *const GLint, + nbuffers: GLsizei, + bufstreams: *const GLint, + bufferMode: GLenum, + ), +>; +extern "C" { + pub fn glBeginTransformFeedbackNV(primitiveMode: GLenum); +} +extern "C" { + pub fn glEndTransformFeedbackNV(); +} +extern "C" { + pub fn glTransformFeedbackAttribsNV(count: GLsizei, attribs: *const GLint, bufferMode: GLenum); +} +extern "C" { + pub fn glBindBufferRangeNV( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glBindBufferOffsetNV(target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr); +} +extern "C" { + pub fn glBindBufferBaseNV(target: GLenum, index: GLuint, buffer: GLuint); +} +extern "C" { + pub fn glTransformFeedbackVaryingsNV( + program: GLuint, + count: GLsizei, + locations: *const GLint, + bufferMode: GLenum, + ); +} +extern "C" { + pub fn glActiveVaryingNV(program: GLuint, name: *const GLchar); +} +extern "C" { + pub fn glGetVaryingLocationNV(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glGetActiveVaryingNV( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetTransformFeedbackVaryingNV(program: GLuint, index: GLuint, location: *mut GLint); +} +extern "C" { + pub fn glTransformFeedbackStreamAttribsNV( + count: GLsizei, + attribs: *const GLint, + nbuffers: GLsizei, + bufstreams: *const GLint, + bufferMode: GLenum, + ); +} +pub type PFNGLBINDTRANSFORMFEEDBACKNVPROC = + ::std::option::Option; +pub type PFNGLDELETETRANSFORMFEEDBACKSNVPROC = + ::std::option::Option; +pub type PFNGLGENTRANSFORMFEEDBACKSNVPROC = + ::std::option::Option; +pub type PFNGLISTRANSFORMFEEDBACKNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLPAUSETRANSFORMFEEDBACKNVPROC = ::std::option::Option; +pub type PFNGLRESUMETRANSFORMFEEDBACKNVPROC = ::std::option::Option; +pub type PFNGLDRAWTRANSFORMFEEDBACKNVPROC = + ::std::option::Option; +extern "C" { + pub fn glBindTransformFeedbackNV(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glDeleteTransformFeedbacksNV(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glGenTransformFeedbacksNV(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glIsTransformFeedbackNV(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glPauseTransformFeedbackNV(); +} +extern "C" { + pub fn glResumeTransformFeedbackNV(); +} +extern "C" { + pub fn glDrawTransformFeedbackNV(mode: GLenum, id: GLuint); +} +pub type GLvdpauSurfaceNV = GLintptr; +pub type PFNGLVDPAUINITNVPROC = ::std::option::Option< + unsafe extern "C" fn( + vdpDevice: *const ::std::os::raw::c_void, + getProcAddress: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLVDPAUFININVPROC = ::std::option::Option; +pub type PFNGLVDPAUREGISTERVIDEOSURFACENVPROC = ::std::option::Option< + unsafe extern "C" fn( + vdpSurface: *const ::std::os::raw::c_void, + target: GLenum, + numTextureNames: GLsizei, + textureNames: *const GLuint, + ) -> GLvdpauSurfaceNV, +>; +pub type PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC = ::std::option::Option< + unsafe extern "C" fn( + vdpSurface: *const ::std::os::raw::c_void, + target: GLenum, + numTextureNames: GLsizei, + textureNames: *const GLuint, + ) -> GLvdpauSurfaceNV, +>; +pub type PFNGLVDPAUISSURFACENVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLVDPAUUNREGISTERSURFACENVPROC = + ::std::option::Option; +pub type PFNGLVDPAUGETSURFACEIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + surface: GLvdpauSurfaceNV, + pname: GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + values: *mut GLint, + ), +>; +pub type PFNGLVDPAUSURFACEACCESSNVPROC = + ::std::option::Option; +pub type PFNGLVDPAUMAPSURFACESNVPROC = ::std::option::Option< + unsafe extern "C" fn(numSurfaces: GLsizei, surfaces: *const GLvdpauSurfaceNV), +>; +pub type PFNGLVDPAUUNMAPSURFACESNVPROC = ::std::option::Option< + unsafe extern "C" fn(numSurface: GLsizei, surfaces: *const GLvdpauSurfaceNV), +>; +extern "C" { + pub fn glVDPAUInitNV( + vdpDevice: *const ::std::os::raw::c_void, + getProcAddress: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glVDPAUFiniNV(); +} +extern "C" { + pub fn glVDPAURegisterVideoSurfaceNV( + vdpSurface: *const ::std::os::raw::c_void, + target: GLenum, + numTextureNames: GLsizei, + textureNames: *const GLuint, + ) -> GLvdpauSurfaceNV; +} +extern "C" { + pub fn glVDPAURegisterOutputSurfaceNV( + vdpSurface: *const ::std::os::raw::c_void, + target: GLenum, + numTextureNames: GLsizei, + textureNames: *const GLuint, + ) -> GLvdpauSurfaceNV; +} +extern "C" { + pub fn glVDPAUIsSurfaceNV(surface: GLvdpauSurfaceNV) -> GLboolean; +} +extern "C" { + pub fn glVDPAUUnregisterSurfaceNV(surface: GLvdpauSurfaceNV); +} +extern "C" { + pub fn glVDPAUGetSurfaceivNV( + surface: GLvdpauSurfaceNV, + pname: GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + values: *mut GLint, + ); +} +extern "C" { + pub fn glVDPAUSurfaceAccessNV(surface: GLvdpauSurfaceNV, access: GLenum); +} +extern "C" { + pub fn glVDPAUMapSurfacesNV(numSurfaces: GLsizei, surfaces: *const GLvdpauSurfaceNV); +} +extern "C" { + pub fn glVDPAUUnmapSurfacesNV(numSurface: GLsizei, surfaces: *const GLvdpauSurfaceNV); +} +pub type PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC = ::std::option::Option< + unsafe extern "C" fn( + vdpSurface: *const ::std::os::raw::c_void, + target: GLenum, + numTextureNames: GLsizei, + textureNames: *const GLuint, + isFrameStructure: GLboolean, + ) -> GLvdpauSurfaceNV, +>; +extern "C" { + pub fn glVDPAURegisterVideoSurfaceWithPictureStructureNV( + vdpSurface: *const ::std::os::raw::c_void, + target: GLenum, + numTextureNames: GLsizei, + textureNames: *const GLuint, + isFrameStructure: GLboolean, + ) -> GLvdpauSurfaceNV; +} +pub type PFNGLFLUSHVERTEXARRAYRANGENVPROC = ::std::option::Option; +pub type PFNGLVERTEXARRAYRANGENVPROC = ::std::option::Option< + unsafe extern "C" fn(length: GLsizei, pointer: *const ::std::os::raw::c_void), +>; +extern "C" { + pub fn glFlushVertexArrayRangeNV(); +} +extern "C" { + pub fn glVertexArrayRangeNV(length: GLsizei, pointer: *const ::std::os::raw::c_void); +} +pub type PFNGLVERTEXATTRIBL1I64NVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2I64NVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3I64NVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLint64EXT, y: GLint64EXT, z: GLint64EXT), +>; +pub type PFNGLVERTEXATTRIBL4I64NVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLint64EXT, y: GLint64EXT, z: GLint64EXT, w: GLint64EXT), +>; +pub type PFNGLVERTEXATTRIBL1I64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2I64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3I64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL4I64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL1UI64NVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2UI64NVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLuint64EXT, y: GLuint64EXT, z: GLuint64EXT), +>; +pub type PFNGLVERTEXATTRIBL4UI64NVPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + w: GLuint64EXT, + ), +>; +pub type PFNGLVERTEXATTRIBL1UI64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL2UI64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL3UI64VNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBL4UI64VNVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBLI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLint64EXT), +>; +pub type PFNGLGETVERTEXATTRIBLUI64VNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLuint64EXT), +>; +pub type PFNGLVERTEXATTRIBLFORMATNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, size: GLint, type_: GLenum, stride: GLsizei), +>; +extern "C" { + pub fn glVertexAttribL1i64NV(index: GLuint, x: GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL2i64NV(index: GLuint, x: GLint64EXT, y: GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL3i64NV(index: GLuint, x: GLint64EXT, y: GLint64EXT, z: GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL4i64NV( + index: GLuint, + x: GLint64EXT, + y: GLint64EXT, + z: GLint64EXT, + w: GLint64EXT, + ); +} +extern "C" { + pub fn glVertexAttribL1i64vNV(index: GLuint, v: *const GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL2i64vNV(index: GLuint, v: *const GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL3i64vNV(index: GLuint, v: *const GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL4i64vNV(index: GLuint, v: *const GLint64EXT); +} +extern "C" { + pub fn glVertexAttribL1ui64NV(index: GLuint, x: GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL2ui64NV(index: GLuint, x: GLuint64EXT, y: GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL3ui64NV(index: GLuint, x: GLuint64EXT, y: GLuint64EXT, z: GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL4ui64NV( + index: GLuint, + x: GLuint64EXT, + y: GLuint64EXT, + z: GLuint64EXT, + w: GLuint64EXT, + ); +} +extern "C" { + pub fn glVertexAttribL1ui64vNV(index: GLuint, v: *const GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL2ui64vNV(index: GLuint, v: *const GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL3ui64vNV(index: GLuint, v: *const GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribL4ui64vNV(index: GLuint, v: *const GLuint64EXT); +} +extern "C" { + pub fn glGetVertexAttribLi64vNV(index: GLuint, pname: GLenum, params: *mut GLint64EXT); +} +extern "C" { + pub fn glGetVertexAttribLui64vNV(index: GLuint, pname: GLenum, params: *mut GLuint64EXT); +} +extern "C" { + pub fn glVertexAttribLFormatNV(index: GLuint, size: GLint, type_: GLenum, stride: GLsizei); +} +pub type PFNGLBUFFERADDRESSRANGENVPROC = ::std::option::Option< + unsafe extern "C" fn(pname: GLenum, index: GLuint, address: GLuint64EXT, length: GLsizeiptr), +>; +pub type PFNGLVERTEXFORMATNVPROC = + ::std::option::Option; +pub type PFNGLNORMALFORMATNVPROC = + ::std::option::Option; +pub type PFNGLCOLORFORMATNVPROC = + ::std::option::Option; +pub type PFNGLINDEXFORMATNVPROC = + ::std::option::Option; +pub type PFNGLTEXCOORDFORMATNVPROC = + ::std::option::Option; +pub type PFNGLEDGEFLAGFORMATNVPROC = ::std::option::Option; +pub type PFNGLSECONDARYCOLORFORMATNVPROC = + ::std::option::Option; +pub type PFNGLFOGCOORDFORMATNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBFORMATNVPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + ), +>; +pub type PFNGLVERTEXATTRIBIFORMATNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, size: GLint, type_: GLenum, stride: GLsizei), +>; +pub type PFNGLGETINTEGERUI64I_VNVPROC = ::std::option::Option< + unsafe extern "C" fn(value: GLenum, index: GLuint, result: *mut GLuint64EXT), +>; +extern "C" { + pub fn glBufferAddressRangeNV( + pname: GLenum, + index: GLuint, + address: GLuint64EXT, + length: GLsizeiptr, + ); +} +extern "C" { + pub fn glVertexFormatNV(size: GLint, type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glNormalFormatNV(type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glColorFormatNV(size: GLint, type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glIndexFormatNV(type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glTexCoordFormatNV(size: GLint, type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glEdgeFlagFormatNV(stride: GLsizei); +} +extern "C" { + pub fn glSecondaryColorFormatNV(size: GLint, type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glFogCoordFormatNV(type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glVertexAttribFormatNV( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + ); +} +extern "C" { + pub fn glVertexAttribIFormatNV(index: GLuint, size: GLint, type_: GLenum, stride: GLsizei); +} +extern "C" { + pub fn glGetIntegerui64i_vNV(value: GLenum, index: GLuint, result: *mut GLuint64EXT); +} +pub type PFNGLAREPROGRAMSRESIDENTNVPROC = ::std::option::Option< + unsafe extern "C" fn( + n: GLsizei, + programs: *const GLuint, + residences: *mut GLboolean, + ) -> GLboolean, +>; +pub type PFNGLBINDPROGRAMNVPROC = + ::std::option::Option; +pub type PFNGLDELETEPROGRAMSNVPROC = + ::std::option::Option; +pub type PFNGLEXECUTEPROGRAMNVPROC = + ::std::option::Option; +pub type PFNGLGENPROGRAMSNVPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMPARAMETERDVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, pname: GLenum, params: *mut GLdouble), +>; +pub type PFNGLGETPROGRAMPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETPROGRAMIVNVPROC = + ::std::option::Option; +pub type PFNGLGETPROGRAMSTRINGNVPROC = + ::std::option::Option; +pub type PFNGLGETTRACKMATRIXIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, address: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETVERTEXATTRIBDVNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, params: *mut GLdouble), +>; +pub type PFNGLGETVERTEXATTRIBFVNVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBIVNVPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBPOINTERVNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, pname: GLenum, pointer: *mut *mut ::std::os::raw::c_void), +>; +pub type PFNGLISPROGRAMNVPROC = + ::std::option::Option GLboolean>; +pub type PFNGLLOADPROGRAMNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, id: GLuint, len: GLsizei, program: *const GLubyte), +>; +pub type PFNGLPROGRAMPARAMETER4DNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ), +>; +pub type PFNGLPROGRAMPARAMETER4DVNVPROC = + ::std::option::Option; +pub type PFNGLPROGRAMPARAMETER4FNVPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLPROGRAMPARAMETER4FVNVPROC = + ::std::option::Option; +pub type PFNGLPROGRAMPARAMETERS4DVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, v: *const GLdouble), +>; +pub type PFNGLPROGRAMPARAMETERS4FVNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, index: GLuint, count: GLsizei, v: *const GLfloat), +>; +pub type PFNGLREQUESTRESIDENTPROGRAMSNVPROC = + ::std::option::Option; +pub type PFNGLTRACKMATRIXNVPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, address: GLuint, matrix: GLenum, transform: GLenum), +>; +pub type PFNGLVERTEXATTRIBPOINTERNVPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + fsize: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLVERTEXATTRIB1DNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1FNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1SNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB1SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2DNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2FNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2SNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB2SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3DNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble), +>; +pub type PFNGLVERTEXATTRIB3DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3FNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3SNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB3SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4DNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble), +>; +pub type PFNGLVERTEXATTRIB4DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4FNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat), +>; +pub type PFNGLVERTEXATTRIB4FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4SNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort), +>; +pub type PFNGLVERTEXATTRIB4SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIB4UBNVPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte), +>; +pub type PFNGLVERTEXATTRIB4UBVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS1DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS1FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS1SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS2DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS2FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS2SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS3DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS3FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS3SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS4DVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS4FVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS4SVNVPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBS4UBVNVPROC = + ::std::option::Option; +extern "C" { + pub fn glAreProgramsResidentNV( + n: GLsizei, + programs: *const GLuint, + residences: *mut GLboolean, + ) -> GLboolean; +} +extern "C" { + pub fn glBindProgramNV(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glDeleteProgramsNV(n: GLsizei, programs: *const GLuint); +} +extern "C" { + pub fn glExecuteProgramNV(target: GLenum, id: GLuint, params: *const GLfloat); +} +extern "C" { + pub fn glGenProgramsNV(n: GLsizei, programs: *mut GLuint); +} +extern "C" { + pub fn glGetProgramParameterdvNV( + target: GLenum, + index: GLuint, + pname: GLenum, + params: *mut GLdouble, + ); +} +extern "C" { + pub fn glGetProgramParameterfvNV( + target: GLenum, + index: GLuint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetProgramivNV(id: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetProgramStringNV(id: GLuint, pname: GLenum, program: *mut GLubyte); +} +extern "C" { + pub fn glGetTrackMatrixivNV(target: GLenum, address: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribdvNV(index: GLuint, pname: GLenum, params: *mut GLdouble); +} +extern "C" { + pub fn glGetVertexAttribfvNV(index: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetVertexAttribivNV(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribPointervNV( + index: GLuint, + pname: GLenum, + pointer: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glIsProgramNV(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glLoadProgramNV(target: GLenum, id: GLuint, len: GLsizei, program: *const GLubyte); +} +extern "C" { + pub fn glProgramParameter4dNV( + target: GLenum, + index: GLuint, + x: GLdouble, + y: GLdouble, + z: GLdouble, + w: GLdouble, + ); +} +extern "C" { + pub fn glProgramParameter4dvNV(target: GLenum, index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glProgramParameter4fNV( + target: GLenum, + index: GLuint, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glProgramParameter4fvNV(target: GLenum, index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glProgramParameters4dvNV( + target: GLenum, + index: GLuint, + count: GLsizei, + v: *const GLdouble, + ); +} +extern "C" { + pub fn glProgramParameters4fvNV( + target: GLenum, + index: GLuint, + count: GLsizei, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glRequestResidentProgramsNV(n: GLsizei, programs: *const GLuint); +} +extern "C" { + pub fn glTrackMatrixNV(target: GLenum, address: GLuint, matrix: GLenum, transform: GLenum); +} +extern "C" { + pub fn glVertexAttribPointerNV( + index: GLuint, + fsize: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glVertexAttrib1dNV(index: GLuint, x: GLdouble); +} +extern "C" { + pub fn glVertexAttrib1dvNV(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib1fNV(index: GLuint, x: GLfloat); +} +extern "C" { + pub fn glVertexAttrib1fvNV(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib1sNV(index: GLuint, x: GLshort); +} +extern "C" { + pub fn glVertexAttrib1svNV(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib2dNV(index: GLuint, x: GLdouble, y: GLdouble); +} +extern "C" { + pub fn glVertexAttrib2dvNV(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib2fNV(index: GLuint, x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glVertexAttrib2fvNV(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib2sNV(index: GLuint, x: GLshort, y: GLshort); +} +extern "C" { + pub fn glVertexAttrib2svNV(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib3dNV(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble); +} +extern "C" { + pub fn glVertexAttrib3dvNV(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib3fNV(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glVertexAttrib3fvNV(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib3sNV(index: GLuint, x: GLshort, y: GLshort, z: GLshort); +} +extern "C" { + pub fn glVertexAttrib3svNV(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4dNV(index: GLuint, x: GLdouble, y: GLdouble, z: GLdouble, w: GLdouble); +} +extern "C" { + pub fn glVertexAttrib4dvNV(index: GLuint, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttrib4fNV(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glVertexAttrib4fvNV(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib4sNV(index: GLuint, x: GLshort, y: GLshort, z: GLshort, w: GLshort); +} +extern "C" { + pub fn glVertexAttrib4svNV(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttrib4ubNV(index: GLuint, x: GLubyte, y: GLubyte, z: GLubyte, w: GLubyte); +} +extern "C" { + pub fn glVertexAttrib4ubvNV(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttribs1dvNV(index: GLuint, count: GLsizei, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribs1fvNV(index: GLuint, count: GLsizei, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttribs1svNV(index: GLuint, count: GLsizei, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttribs2dvNV(index: GLuint, count: GLsizei, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribs2fvNV(index: GLuint, count: GLsizei, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttribs2svNV(index: GLuint, count: GLsizei, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttribs3dvNV(index: GLuint, count: GLsizei, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribs3fvNV(index: GLuint, count: GLsizei, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttribs3svNV(index: GLuint, count: GLsizei, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttribs4dvNV(index: GLuint, count: GLsizei, v: *const GLdouble); +} +extern "C" { + pub fn glVertexAttribs4fvNV(index: GLuint, count: GLsizei, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttribs4svNV(index: GLuint, count: GLsizei, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttribs4ubvNV(index: GLuint, count: GLsizei, v: *const GLubyte); +} +pub type PFNGLVERTEXATTRIBI1IEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2IEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3IEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4IEXTPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint), +>; +pub type PFNGLVERTEXATTRIBI1UIEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2UIEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3UIEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4UIEXTPROC = ::std::option::Option< + unsafe extern "C" fn(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint), +>; +pub type PFNGLVERTEXATTRIBI1IVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2IVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3IVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4IVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI1UIVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI2UIVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI3UIVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4UIVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4BVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4SVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4UBVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBI4USVEXTPROC = + ::std::option::Option; +pub type PFNGLVERTEXATTRIBIPOINTEREXTPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETVERTEXATTRIBIIVEXTPROC = + ::std::option::Option; +pub type PFNGLGETVERTEXATTRIBIUIVEXTPROC = + ::std::option::Option; +extern "C" { + pub fn glVertexAttribI1iEXT(index: GLuint, x: GLint); +} +extern "C" { + pub fn glVertexAttribI2iEXT(index: GLuint, x: GLint, y: GLint); +} +extern "C" { + pub fn glVertexAttribI3iEXT(index: GLuint, x: GLint, y: GLint, z: GLint); +} +extern "C" { + pub fn glVertexAttribI4iEXT(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glVertexAttribI1uiEXT(index: GLuint, x: GLuint); +} +extern "C" { + pub fn glVertexAttribI2uiEXT(index: GLuint, x: GLuint, y: GLuint); +} +extern "C" { + pub fn glVertexAttribI3uiEXT(index: GLuint, x: GLuint, y: GLuint, z: GLuint); +} +extern "C" { + pub fn glVertexAttribI4uiEXT(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint); +} +extern "C" { + pub fn glVertexAttribI1ivEXT(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI2ivEXT(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI3ivEXT(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI4ivEXT(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI1uivEXT(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI2uivEXT(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI3uivEXT(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI4uivEXT(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glVertexAttribI4bvEXT(index: GLuint, v: *const GLbyte); +} +extern "C" { + pub fn glVertexAttribI4svEXT(index: GLuint, v: *const GLshort); +} +extern "C" { + pub fn glVertexAttribI4ubvEXT(index: GLuint, v: *const GLubyte); +} +extern "C" { + pub fn glVertexAttribI4usvEXT(index: GLuint, v: *const GLushort); +} +extern "C" { + pub fn glVertexAttribIPointerEXT( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetVertexAttribIivEXT(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribIuivEXT(index: GLuint, pname: GLenum, params: *mut GLuint); +} +pub type PFNGLBEGINVIDEOCAPTURENVPROC = + ::std::option::Option; +pub type PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + frame_region: GLenum, + offset: GLintptrARB, + ), +>; +pub type PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + frame_region: GLenum, + target: GLenum, + texture: GLuint, + ), +>; +pub type PFNGLENDVIDEOCAPTURENVPROC = + ::std::option::Option; +pub type PFNGLGETVIDEOCAPTUREIVNVPROC = ::std::option::Option< + unsafe extern "C" fn(video_capture_slot: GLuint, pname: GLenum, params: *mut GLint), +>; +pub type PFNGLGETVIDEOCAPTURESTREAMIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *mut GLint, + ), +>; +pub type PFNGLGETVIDEOCAPTURESTREAMFVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *mut GLfloat, + ), +>; +pub type PFNGLGETVIDEOCAPTURESTREAMDVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *mut GLdouble, + ), +>; +pub type PFNGLVIDEOCAPTURENVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + sequence_num: *mut GLuint, + capture_time: *mut GLuint64EXT, + ) -> GLenum, +>; +pub type PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *const GLint, + ), +>; +pub type PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *const GLfloat, + ), +>; +pub type PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC = ::std::option::Option< + unsafe extern "C" fn( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *const GLdouble, + ), +>; +extern "C" { + pub fn glBeginVideoCaptureNV(video_capture_slot: GLuint); +} +extern "C" { + pub fn glBindVideoCaptureStreamBufferNV( + video_capture_slot: GLuint, + stream: GLuint, + frame_region: GLenum, + offset: GLintptrARB, + ); +} +extern "C" { + pub fn glBindVideoCaptureStreamTextureNV( + video_capture_slot: GLuint, + stream: GLuint, + frame_region: GLenum, + target: GLenum, + texture: GLuint, + ); +} +extern "C" { + pub fn glEndVideoCaptureNV(video_capture_slot: GLuint); +} +extern "C" { + pub fn glGetVideoCaptureivNV(video_capture_slot: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVideoCaptureStreamivNV( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetVideoCaptureStreamfvNV( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *mut GLfloat, + ); +} +extern "C" { + pub fn glGetVideoCaptureStreamdvNV( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *mut GLdouble, + ); +} +extern "C" { + pub fn glVideoCaptureNV( + video_capture_slot: GLuint, + sequence_num: *mut GLuint, + capture_time: *mut GLuint64EXT, + ) -> GLenum; +} +extern "C" { + pub fn glVideoCaptureStreamParameterivNV( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *const GLint, + ); +} +extern "C" { + pub fn glVideoCaptureStreamParameterfvNV( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *const GLfloat, + ); +} +extern "C" { + pub fn glVideoCaptureStreamParameterdvNV( + video_capture_slot: GLuint, + stream: GLuint, + pname: GLenum, + params: *const GLdouble, + ); +} +pub type PFNGLVIEWPORTSWIZZLENVPROC = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + swizzlex: GLenum, + swizzley: GLenum, + swizzlez: GLenum, + swizzlew: GLenum, + ), +>; +extern "C" { + pub fn glViewportSwizzleNV( + index: GLuint, + swizzlex: GLenum, + swizzley: GLenum, + swizzlez: GLenum, + swizzlew: GLenum, + ); +} +pub type PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + baseViewIndex: GLint, + numViews: GLsizei, + ), +>; +extern "C" { + pub fn glFramebufferTextureMultiviewOVR( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + baseViewIndex: GLint, + numViews: GLsizei, + ); +} +pub type PFNGLHINTPGIPROC = + ::std::option::Option; +extern "C" { + pub fn glHintPGI(target: GLenum, mode: GLint); +} +pub type PFNGLDETAILTEXFUNCSGISPROC = + ::std::option::Option; +pub type PFNGLGETDETAILTEXFUNCSGISPROC = + ::std::option::Option; +extern "C" { + pub fn glDetailTexFuncSGIS(target: GLenum, n: GLsizei, points: *const GLfloat); +} +extern "C" { + pub fn glGetDetailTexFuncSGIS(target: GLenum, points: *mut GLfloat); +} +pub type PFNGLFOGFUNCSGISPROC = + ::std::option::Option; +pub type PFNGLGETFOGFUNCSGISPROC = + ::std::option::Option; +extern "C" { + pub fn glFogFuncSGIS(n: GLsizei, points: *const GLfloat); +} +extern "C" { + pub fn glGetFogFuncSGIS(points: *mut GLfloat); +} +pub type PFNGLSAMPLEMASKSGISPROC = + ::std::option::Option; +pub type PFNGLSAMPLEPATTERNSGISPROC = ::std::option::Option; +extern "C" { + pub fn glSampleMaskSGIS(value: GLclampf, invert: GLboolean); +} +extern "C" { + pub fn glSamplePatternSGIS(pattern: GLenum); +} +pub type PFNGLPIXELTEXGENPARAMETERISGISPROC = + ::std::option::Option; +pub type PFNGLPIXELTEXGENPARAMETERIVSGISPROC = + ::std::option::Option; +pub type PFNGLPIXELTEXGENPARAMETERFSGISPROC = + ::std::option::Option; +pub type PFNGLPIXELTEXGENPARAMETERFVSGISPROC = + ::std::option::Option; +pub type PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC = + ::std::option::Option; +pub type PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC = + ::std::option::Option; +extern "C" { + pub fn glPixelTexGenParameteriSGIS(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPixelTexGenParameterivSGIS(pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glPixelTexGenParameterfSGIS(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPixelTexGenParameterfvSGIS(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glGetPixelTexGenParameterivSGIS(pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetPixelTexGenParameterfvSGIS(pname: GLenum, params: *mut GLfloat); +} +pub type PFNGLPOINTPARAMETERFSGISPROC = + ::std::option::Option; +pub type PFNGLPOINTPARAMETERFVSGISPROC = + ::std::option::Option; +extern "C" { + pub fn glPointParameterfSGIS(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glPointParameterfvSGIS(pname: GLenum, params: *const GLfloat); +} +pub type PFNGLSHARPENTEXFUNCSGISPROC = + ::std::option::Option; +pub type PFNGLGETSHARPENTEXFUNCSGISPROC = + ::std::option::Option; +extern "C" { + pub fn glSharpenTexFuncSGIS(target: GLenum, n: GLsizei, points: *const GLfloat); +} +extern "C" { + pub fn glGetSharpenTexFuncSGIS(target: GLenum, points: *mut GLfloat); +} +pub type PFNGLTEXIMAGE4DSGISPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + size4d: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLTEXSUBIMAGE4DSGISPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + woffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + size4d: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glTexImage4DSGIS( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + size4d: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexSubImage4DSGIS( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + woffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + size4d: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +pub type PFNGLTEXTURECOLORMASKSGISPROC = ::std::option::Option< + unsafe extern "C" fn(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean), +>; +extern "C" { + pub fn glTextureColorMaskSGIS( + red: GLboolean, + green: GLboolean, + blue: GLboolean, + alpha: GLboolean, + ); +} +pub type PFNGLGETTEXFILTERFUNCSGISPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, filter: GLenum, weights: *mut GLfloat), +>; +pub type PFNGLTEXFILTERFUNCSGISPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, filter: GLenum, n: GLsizei, weights: *const GLfloat), +>; +extern "C" { + pub fn glGetTexFilterFuncSGIS(target: GLenum, filter: GLenum, weights: *mut GLfloat); +} +extern "C" { + pub fn glTexFilterFuncSGIS(target: GLenum, filter: GLenum, n: GLsizei, weights: *const GLfloat); +} +pub type PFNGLASYNCMARKERSGIXPROC = ::std::option::Option; +pub type PFNGLFINISHASYNCSGIXPROC = + ::std::option::Option GLint>; +pub type PFNGLPOLLASYNCSGIXPROC = + ::std::option::Option GLint>; +pub type PFNGLGENASYNCMARKERSSGIXPROC = + ::std::option::Option GLuint>; +pub type PFNGLDELETEASYNCMARKERSSGIXPROC = + ::std::option::Option; +pub type PFNGLISASYNCMARKERSGIXPROC = + ::std::option::Option GLboolean>; +extern "C" { + pub fn glAsyncMarkerSGIX(marker: GLuint); +} +extern "C" { + pub fn glFinishAsyncSGIX(markerp: *mut GLuint) -> GLint; +} +extern "C" { + pub fn glPollAsyncSGIX(markerp: *mut GLuint) -> GLint; +} +extern "C" { + pub fn glGenAsyncMarkersSGIX(range: GLsizei) -> GLuint; +} +extern "C" { + pub fn glDeleteAsyncMarkersSGIX(marker: GLuint, range: GLsizei); +} +extern "C" { + pub fn glIsAsyncMarkerSGIX(marker: GLuint) -> GLboolean; +} +pub type PFNGLFLUSHRASTERSGIXPROC = ::std::option::Option; +extern "C" { + pub fn glFlushRasterSGIX(); +} +pub type PFNGLFRAGMENTCOLORMATERIALSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTFSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTFVSGIXPROC = ::std::option::Option< + unsafe extern "C" fn(light: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLFRAGMENTLIGHTISGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTIVSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTMODELFSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTMODELFVSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTMODELISGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTLIGHTMODELIVSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTMATERIALFSGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTMATERIALFVSGIXPROC = ::std::option::Option< + unsafe extern "C" fn(face: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLFRAGMENTMATERIALISGIXPROC = + ::std::option::Option; +pub type PFNGLFRAGMENTMATERIALIVSGIXPROC = + ::std::option::Option; +pub type PFNGLGETFRAGMENTLIGHTFVSGIXPROC = + ::std::option::Option; +pub type PFNGLGETFRAGMENTLIGHTIVSGIXPROC = + ::std::option::Option; +pub type PFNGLGETFRAGMENTMATERIALFVSGIXPROC = + ::std::option::Option; +pub type PFNGLGETFRAGMENTMATERIALIVSGIXPROC = + ::std::option::Option; +pub type PFNGLLIGHTENVISGIXPROC = + ::std::option::Option; +extern "C" { + pub fn glFragmentColorMaterialSGIX(face: GLenum, mode: GLenum); +} +extern "C" { + pub fn glFragmentLightfSGIX(light: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glFragmentLightfvSGIX(light: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glFragmentLightiSGIX(light: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glFragmentLightivSGIX(light: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glFragmentLightModelfSGIX(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glFragmentLightModelfvSGIX(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glFragmentLightModeliSGIX(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glFragmentLightModelivSGIX(pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glFragmentMaterialfSGIX(face: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glFragmentMaterialfvSGIX(face: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glFragmentMaterialiSGIX(face: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glFragmentMaterialivSGIX(face: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glGetFragmentLightfvSGIX(light: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetFragmentLightivSGIX(light: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetFragmentMaterialfvSGIX(face: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetFragmentMaterialivSGIX(face: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glLightEnviSGIX(pname: GLenum, param: GLint); +} +pub type PFNGLFRAMEZOOMSGIXPROC = ::std::option::Option; +extern "C" { + pub fn glFrameZoomSGIX(factor: GLint); +} +pub type PFNGLIGLOOINTERFACESGIXPROC = ::std::option::Option< + unsafe extern "C" fn(pname: GLenum, params: *const ::std::os::raw::c_void), +>; +extern "C" { + pub fn glIglooInterfaceSGIX(pname: GLenum, params: *const ::std::os::raw::c_void); +} +pub type PFNGLGETINSTRUMENTSSGIXPROC = ::std::option::Option GLint>; +pub type PFNGLINSTRUMENTSBUFFERSGIXPROC = + ::std::option::Option; +pub type PFNGLPOLLINSTRUMENTSSGIXPROC = + ::std::option::Option GLint>; +pub type PFNGLREADINSTRUMENTSSGIXPROC = ::std::option::Option; +pub type PFNGLSTARTINSTRUMENTSSGIXPROC = ::std::option::Option; +pub type PFNGLSTOPINSTRUMENTSSGIXPROC = ::std::option::Option; +extern "C" { + pub fn glGetInstrumentsSGIX() -> GLint; +} +extern "C" { + pub fn glInstrumentsBufferSGIX(size: GLsizei, buffer: *mut GLint); +} +extern "C" { + pub fn glPollInstrumentsSGIX(marker_p: *mut GLint) -> GLint; +} +extern "C" { + pub fn glReadInstrumentsSGIX(marker: GLint); +} +extern "C" { + pub fn glStartInstrumentsSGIX(); +} +extern "C" { + pub fn glStopInstrumentsSGIX(marker: GLint); +} +pub type PFNGLGETLISTPARAMETERFVSGIXPROC = + ::std::option::Option; +pub type PFNGLGETLISTPARAMETERIVSGIXPROC = + ::std::option::Option; +pub type PFNGLLISTPARAMETERFSGIXPROC = + ::std::option::Option; +pub type PFNGLLISTPARAMETERFVSGIXPROC = ::std::option::Option< + unsafe extern "C" fn(list: GLuint, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLLISTPARAMETERISGIXPROC = + ::std::option::Option; +pub type PFNGLLISTPARAMETERIVSGIXPROC = + ::std::option::Option; +extern "C" { + pub fn glGetListParameterfvSGIX(list: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetListParameterivSGIX(list: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glListParameterfSGIX(list: GLuint, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glListParameterfvSGIX(list: GLuint, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glListParameteriSGIX(list: GLuint, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glListParameterivSGIX(list: GLuint, pname: GLenum, params: *const GLint); +} +pub type PFNGLPIXELTEXGENSGIXPROC = ::std::option::Option; +extern "C" { + pub fn glPixelTexGenSGIX(mode: GLenum); +} +pub type PFNGLDEFORMATIONMAP3DSGIXPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + u1: GLdouble, + u2: GLdouble, + ustride: GLint, + uorder: GLint, + v1: GLdouble, + v2: GLdouble, + vstride: GLint, + vorder: GLint, + w1: GLdouble, + w2: GLdouble, + wstride: GLint, + worder: GLint, + points: *const GLdouble, + ), +>; +pub type PFNGLDEFORMATIONMAP3FSGIXPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + u1: GLfloat, + u2: GLfloat, + ustride: GLint, + uorder: GLint, + v1: GLfloat, + v2: GLfloat, + vstride: GLint, + vorder: GLint, + w1: GLfloat, + w2: GLfloat, + wstride: GLint, + worder: GLint, + points: *const GLfloat, + ), +>; +pub type PFNGLDEFORMSGIXPROC = ::std::option::Option; +pub type PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC = + ::std::option::Option; +extern "C" { + pub fn glDeformationMap3dSGIX( + target: GLenum, + u1: GLdouble, + u2: GLdouble, + ustride: GLint, + uorder: GLint, + v1: GLdouble, + v2: GLdouble, + vstride: GLint, + vorder: GLint, + w1: GLdouble, + w2: GLdouble, + wstride: GLint, + worder: GLint, + points: *const GLdouble, + ); +} +extern "C" { + pub fn glDeformationMap3fSGIX( + target: GLenum, + u1: GLfloat, + u2: GLfloat, + ustride: GLint, + uorder: GLint, + v1: GLfloat, + v2: GLfloat, + vstride: GLint, + vorder: GLint, + w1: GLfloat, + w2: GLfloat, + wstride: GLint, + worder: GLint, + points: *const GLfloat, + ); +} +extern "C" { + pub fn glDeformSGIX(mask: GLbitfield); +} +extern "C" { + pub fn glLoadIdentityDeformationMapSGIX(mask: GLbitfield); +} +pub type PFNGLREFERENCEPLANESGIXPROC = + ::std::option::Option; +extern "C" { + pub fn glReferencePlaneSGIX(equation: *const GLdouble); +} +pub type PFNGLSPRITEPARAMETERFSGIXPROC = + ::std::option::Option; +pub type PFNGLSPRITEPARAMETERFVSGIXPROC = + ::std::option::Option; +pub type PFNGLSPRITEPARAMETERISGIXPROC = + ::std::option::Option; +pub type PFNGLSPRITEPARAMETERIVSGIXPROC = + ::std::option::Option; +extern "C" { + pub fn glSpriteParameterfSGIX(pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glSpriteParameterfvSGIX(pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glSpriteParameteriSGIX(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glSpriteParameterivSGIX(pname: GLenum, params: *const GLint); +} +pub type PFNGLTAGSAMPLEBUFFERSGIXPROC = ::std::option::Option; +extern "C" { + pub fn glTagSampleBufferSGIX(); +} +pub type PFNGLCOLORTABLESGIPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + table: *const ::std::os::raw::c_void, + ), +>; +pub type PFNGLCOLORTABLEPARAMETERFVSGIPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLfloat), +>; +pub type PFNGLCOLORTABLEPARAMETERIVSGIPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *const GLint), +>; +pub type PFNGLCOPYCOLORTABLESGIPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + ), +>; +pub type PFNGLGETCOLORTABLESGIPROC = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + format: GLenum, + type_: GLenum, + table: *mut ::std::os::raw::c_void, + ), +>; +pub type PFNGLGETCOLORTABLEPARAMETERFVSGIPROC = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +pub type PFNGLGETCOLORTABLEPARAMETERIVSGIPROC = + ::std::option::Option; +extern "C" { + pub fn glColorTableSGI( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + format: GLenum, + type_: GLenum, + table: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glColorTableParameterfvSGI(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glColorTableParameterivSGI(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glCopyColorTableSGI( + target: GLenum, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + ); +} +extern "C" { + pub fn glGetColorTableSGI( + target: GLenum, + format: GLenum, + type_: GLenum, + table: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetColorTableParameterfvSGI(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetColorTableParameterivSGI(target: GLenum, pname: GLenum, params: *mut GLint); +} +pub type PFNGLFINISHTEXTURESUNXPROC = ::std::option::Option; +extern "C" { + pub fn glFinishTextureSUNX(); +} +pub type PFNGLGLOBALALPHAFACTORBSUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORSSUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORISUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORFSUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORDSUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORUBSUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORUSSUNPROC = + ::std::option::Option; +pub type PFNGLGLOBALALPHAFACTORUISUNPROC = + ::std::option::Option; +extern "C" { + pub fn glGlobalAlphaFactorbSUN(factor: GLbyte); +} +extern "C" { + pub fn glGlobalAlphaFactorsSUN(factor: GLshort); +} +extern "C" { + pub fn glGlobalAlphaFactoriSUN(factor: GLint); +} +extern "C" { + pub fn glGlobalAlphaFactorfSUN(factor: GLfloat); +} +extern "C" { + pub fn glGlobalAlphaFactordSUN(factor: GLdouble); +} +extern "C" { + pub fn glGlobalAlphaFactorubSUN(factor: GLubyte); +} +extern "C" { + pub fn glGlobalAlphaFactorusSUN(factor: GLushort); +} +extern "C" { + pub fn glGlobalAlphaFactoruiSUN(factor: GLuint); +} +pub type PFNGLDRAWMESHARRAYSSUNPROC = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, first: GLint, count: GLsizei, width: GLsizei), +>; +extern "C" { + pub fn glDrawMeshArraysSUN(mode: GLenum, first: GLint, count: GLsizei, width: GLsizei); +} +pub type PFNGLREPLACEMENTCODEUISUNPROC = ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUSSUNPROC = + ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUBSUNPROC = ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUIVSUNPROC = + ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUSVSUNPROC = + ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUBVSUNPROC = + ::std::option::Option; +pub type PFNGLREPLACEMENTCODEPOINTERSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + type_: GLenum, + stride: GLsizei, + pointer: *mut *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub fn glReplacementCodeuiSUN(code: GLuint); +} +extern "C" { + pub fn glReplacementCodeusSUN(code: GLushort); +} +extern "C" { + pub fn glReplacementCodeubSUN(code: GLubyte); +} +extern "C" { + pub fn glReplacementCodeuivSUN(code: *const GLuint); +} +extern "C" { + pub fn glReplacementCodeusvSUN(code: *const GLushort); +} +extern "C" { + pub fn glReplacementCodeubvSUN(code: *const GLubyte); +} +extern "C" { + pub fn glReplacementCodePointerSUN( + type_: GLenum, + stride: GLsizei, + pointer: *mut *const ::std::os::raw::c_void, + ); +} +pub type PFNGLCOLOR4UBVERTEX2FSUNPROC = ::std::option::Option< + unsafe extern "C" fn(r: GLubyte, g: GLubyte, b: GLubyte, a: GLubyte, x: GLfloat, y: GLfloat), +>; +pub type PFNGLCOLOR4UBVERTEX2FVSUNPROC = + ::std::option::Option; +pub type PFNGLCOLOR4UBVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLCOLOR4UBVERTEX3FVSUNPROC = + ::std::option::Option; +pub type PFNGLCOLOR3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn(r: GLfloat, g: GLfloat, b: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat), +>; +pub type PFNGLCOLOR3FVERTEX3FVSUNPROC = + ::std::option::Option; +pub type PFNGLNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn(nx: GLfloat, ny: GLfloat, nz: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat), +>; +pub type PFNGLNORMAL3FVERTEX3FVSUNPROC = + ::std::option::Option; +pub type PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(c: *const GLfloat, n: *const GLfloat, v: *const GLfloat), +>; +pub type PFNGLTEXCOORD2FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn(s: GLfloat, t: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat), +>; +pub type PFNGLTEXCOORD2FVERTEX3FVSUNPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD4FVERTEX4FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + s: GLfloat, + t: GLfloat, + p: GLfloat, + q: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLTEXCOORD4FVERTEX4FVSUNPROC = + ::std::option::Option; +pub type PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + s: GLfloat, + t: GLfloat, + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(tc: *const GLfloat, c: *const GLubyte, v: *const GLfloat), +>; +pub type PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + s: GLfloat, + t: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(tc: *const GLfloat, c: *const GLfloat, v: *const GLfloat), +>; +pub type PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + s: GLfloat, + t: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(tc: *const GLfloat, n: *const GLfloat, v: *const GLfloat), +>; +pub type PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + s: GLfloat, + t: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + tc: *const GLfloat, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ), +>; +pub type PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + s: GLfloat, + t: GLfloat, + p: GLfloat, + q: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ), +>; +pub type PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + tc: *const GLfloat, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC = + ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC = + ::std::option::Option; +pub type PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: GLuint, + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(rc: *const GLuint, c: *const GLubyte, v: *const GLfloat), +>; +pub type PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: GLuint, + r: GLfloat, + g: GLfloat, + b: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(rc: *const GLuint, c: *const GLfloat, v: *const GLfloat), +>; +pub type PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: GLuint, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(rc: *const GLuint, n: *const GLfloat, v: *const GLfloat), +>; +pub type PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: GLuint, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: *const GLuint, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn(rc: GLuint, s: GLfloat, t: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat), +>; +pub type PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn(rc: *const GLuint, tc: *const GLfloat, v: *const GLfloat), +>; +pub type PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: GLuint, + s: GLfloat, + t: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: *const GLuint, + tc: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: GLuint, + s: GLfloat, + t: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ), +>; +pub type PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC = ::std::option::Option< + unsafe extern "C" fn( + rc: *const GLuint, + tc: *const GLfloat, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ), +>; +extern "C" { + pub fn glColor4ubVertex2fSUN( + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + ); +} +extern "C" { + pub fn glColor4ubVertex2fvSUN(c: *const GLubyte, v: *const GLfloat); +} +extern "C" { + pub fn glColor4ubVertex3fSUN( + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glColor4ubVertex3fvSUN(c: *const GLubyte, v: *const GLfloat); +} +extern "C" { + pub fn glColor3fVertex3fSUN( + r: GLfloat, + g: GLfloat, + b: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glColor3fVertex3fvSUN(c: *const GLfloat, v: *const GLfloat); +} +extern "C" { + pub fn glNormal3fVertex3fSUN( + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glNormal3fVertex3fvSUN(n: *const GLfloat, v: *const GLfloat); +} +extern "C" { + pub fn glColor4fNormal3fVertex3fSUN( + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glColor4fNormal3fVertex3fvSUN(c: *const GLfloat, n: *const GLfloat, v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord2fVertex3fSUN(s: GLfloat, t: GLfloat, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glTexCoord2fVertex3fvSUN(tc: *const GLfloat, v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord4fVertex4fSUN( + s: GLfloat, + t: GLfloat, + p: GLfloat, + q: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glTexCoord4fVertex4fvSUN(tc: *const GLfloat, v: *const GLfloat); +} +extern "C" { + pub fn glTexCoord2fColor4ubVertex3fSUN( + s: GLfloat, + t: GLfloat, + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fColor4ubVertex3fvSUN( + tc: *const GLfloat, + c: *const GLubyte, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fColor3fVertex3fSUN( + s: GLfloat, + t: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fColor3fVertex3fvSUN( + tc: *const GLfloat, + c: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fNormal3fVertex3fSUN( + s: GLfloat, + t: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fNormal3fVertex3fvSUN( + tc: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fColor4fNormal3fVertex3fSUN( + s: GLfloat, + t: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glTexCoord2fColor4fNormal3fVertex3fvSUN( + tc: *const GLfloat, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glTexCoord4fColor4fNormal3fVertex4fSUN( + s: GLfloat, + t: GLfloat, + p: GLfloat, + q: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + w: GLfloat, + ); +} +extern "C" { + pub fn glTexCoord4fColor4fNormal3fVertex4fvSUN( + tc: *const GLfloat, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiVertex3fSUN(rc: GLuint, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glReplacementCodeuiVertex3fvSUN(rc: *const GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glReplacementCodeuiColor4ubVertex3fSUN( + rc: GLuint, + r: GLubyte, + g: GLubyte, + b: GLubyte, + a: GLubyte, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiColor4ubVertex3fvSUN( + rc: *const GLuint, + c: *const GLubyte, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiColor3fVertex3fSUN( + rc: GLuint, + r: GLfloat, + g: GLfloat, + b: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiColor3fVertex3fvSUN( + rc: *const GLuint, + c: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiNormal3fVertex3fSUN( + rc: GLuint, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiNormal3fVertex3fvSUN( + rc: *const GLuint, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiColor4fNormal3fVertex3fSUN( + rc: GLuint, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiColor4fNormal3fVertex3fvSUN( + rc: *const GLuint, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiTexCoord2fVertex3fSUN( + rc: GLuint, + s: GLfloat, + t: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiTexCoord2fVertex3fvSUN( + rc: *const GLuint, + tc: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN( + rc: GLuint, + s: GLfloat, + t: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN( + rc: *const GLuint, + tc: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN( + rc: GLuint, + s: GLfloat, + t: GLfloat, + r: GLfloat, + g: GLfloat, + b: GLfloat, + a: GLfloat, + nx: GLfloat, + ny: GLfloat, + nz: GLfloat, + x: GLfloat, + y: GLfloat, + z: GLfloat, + ); +} +extern "C" { + pub fn glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN( + rc: *const GLuint, + tc: *const GLfloat, + c: *const GLfloat, + n: *const GLfloat, + v: *const GLfloat, + ); +} +extern "C" { + pub fn glBlendEquationSeparateATI(modeRGB: GLenum, modeA: GLenum); +} +pub type PFNGLBLENDEQUATIONSEPARATEATIPROC = + ::std::option::Option; +extern "C" { + pub fn glEGLImageTargetTexture2DOES(target: GLenum, image: GLeglImageOES); +} +extern "C" { + pub fn glEGLImageTargetRenderbufferStorageOES(target: GLenum, image: GLeglImageOES); +} +pub type PFNGLEGLIMAGETARGETTEXTURE2DOESPROC = + ::std::option::Option; +pub type PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC = + ::std::option::Option; +extern "C" { + pub fn dlopen( + __file: *const ::std::os::raw::c_char, + __mode: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn dlclose(__handle: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn dlsym( + __handle: *mut ::std::os::raw::c_void, + __name: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn dlerror() -> *mut ::std::os::raw::c_char; +} +pub type GLXWindow = XID; +pub type GLXDrawable = XID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __GLXFBConfig { + _unused: [u8; 0], +} +pub type GLXFBConfig = *mut __GLXFBConfig; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __GLXcontext { + _unused: [u8; 0], +} +pub type GLXContext = *mut __GLXcontext; +pub type __GLXextproc = ::std::option::Option; +pub type PFNGLXGETFBCONFIGATTRIBPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: GLXFBConfig, + arg3: ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, +>; +pub type PFNGLXGETCLIENTSTRINGPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char, +>; +pub type PFNGLXQUERYEXTENSIONPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, +>; +pub type PFNGLXQUERYVERSIONPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: *mut ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, +>; +pub type PFNGLXDESTROYCONTEXTPROC = + ::std::option::Option; +pub type PFNGLXMAKECURRENTPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: GLXDrawable, + arg3: GLXContext, + ) -> ::std::os::raw::c_int, +>; +pub type PFNGLXSWAPBUFFERSPROC = + ::std::option::Option; +pub type PFNGLXQUERYEXTENSIONSSTRINGPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + ) -> *const ::std::os::raw::c_char, +>; +pub type PFNGLXGETFBCONFIGSPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + ) -> *mut GLXFBConfig, +>; +pub type PFNGLXCREATENEWCONTEXTPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: GLXFBConfig, + arg3: ::std::os::raw::c_int, + arg4: GLXContext, + arg5: ::std::os::raw::c_int, + ) -> GLXContext, +>; +pub type PFNGLXGETPROCADDRESSPROC = + ::std::option::Option __GLXextproc>; +pub type PFNGLXSWAPINTERVALEXTPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: *mut Display, arg2: GLXDrawable, arg3: ::std::os::raw::c_int), +>; +pub type PFNGLXGETVISUALFROMFBCONFIGPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: *mut Display, arg2: GLXFBConfig) -> *mut XVisualInfo, +>; +pub type PFNGLXCREATEWINDOWPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: GLXFBConfig, + arg3: Window, + arg4: *const ::std::os::raw::c_int, + ) -> GLXWindow, +>; +pub type PFNGLXDESTROYWINDOWPROC = + ::std::option::Option; +pub type PFNGLXSWAPINTERVALMESAPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int, +>; +pub type PFNGLXCREATECONTEXTATTRIBSARBPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut Display, + arg2: GLXFBConfig, + arg3: GLXContext, + arg4: ::std::os::raw::c_int, + arg5: *const ::std::os::raw::c_int, + ) -> GLXContext, +>; +extern "C" { + pub static mut _sapp_x11_display: *mut Display; +} +extern "C" { + pub static mut _sapp_x11_screen: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _sapp_x11_root: Window; +} +extern "C" { + pub static mut _sapp_x11_colormap: Colormap; +} +extern "C" { + pub static mut _sapp_x11_window: Window; +} +extern "C" { + pub static mut _sapp_x11_dpi: f32; +} +extern "C" { + pub static mut _sapp_x11_window_state: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _sapp_x11_error_code: ::std::os::raw::c_uchar; +} +extern "C" { + pub static mut _sapp_glx_libgl: *mut ::std::os::raw::c_void; +} +extern "C" { + pub static mut _sapp_glx_major: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _sapp_glx_minor: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _sapp_glx_eventbase: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _sapp_glx_errorbase: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _sapp_glx_ctx: GLXContext; +} +extern "C" { + pub static mut _sapp_glx_window: GLXWindow; +} +extern "C" { + pub static mut _sapp_x11_UTF8_STRING: Atom; +} +extern "C" { + pub static mut _sapp_x11_WM_PROTOCOLS: Atom; +} +extern "C" { + pub static mut _sapp_x11_WM_DELETE_WINDOW: Atom; +} +extern "C" { + pub static mut _sapp_x11_WM_STATE: Atom; +} +extern "C" { + pub static mut _sapp_x11_NET_WM_NAME: Atom; +} +extern "C" { + pub static mut _sapp_x11_NET_WM_ICON_NAME: Atom; +} +extern "C" { + pub static mut _sapp_glx_GetFBConfigs: PFNGLXGETFBCONFIGSPROC; +} +extern "C" { + pub static mut _sapp_glx_GetFBConfigAttrib: PFNGLXGETFBCONFIGATTRIBPROC; +} +extern "C" { + pub static mut _sapp_glx_GetClientString: PFNGLXGETCLIENTSTRINGPROC; +} +extern "C" { + pub static mut _sapp_glx_QueryExtension: PFNGLXQUERYEXTENSIONPROC; +} +extern "C" { + pub static mut _sapp_glx_QueryVersion: PFNGLXQUERYVERSIONPROC; +} +extern "C" { + pub static mut _sapp_glx_DestroyContext: PFNGLXDESTROYCONTEXTPROC; +} +extern "C" { + pub static mut _sapp_glx_MakeCurrent: PFNGLXMAKECURRENTPROC; +} +extern "C" { + pub static mut _sapp_glx_SwapBuffers: PFNGLXSWAPBUFFERSPROC; +} +extern "C" { + pub static mut _sapp_glx_QueryExtensionsString: PFNGLXQUERYEXTENSIONSSTRINGPROC; +} +extern "C" { + pub static mut _sapp_glx_CreateNewContext: PFNGLXCREATENEWCONTEXTPROC; +} +extern "C" { + pub static mut _sapp_glx_GetVisualFromFBConfig: PFNGLXGETVISUALFROMFBCONFIGPROC; +} +extern "C" { + pub static mut _sapp_glx_CreateWindow: PFNGLXCREATEWINDOWPROC; +} +extern "C" { + pub static mut _sapp_glx_DestroyWindow: PFNGLXDESTROYWINDOWPROC; +} +extern "C" { + pub static mut _sapp_glx_GetProcAddress: PFNGLXGETPROCADDRESSPROC; +} +extern "C" { + pub static mut _sapp_glx_GetProcAddressARB: PFNGLXGETPROCADDRESSPROC; +} +extern "C" { + pub static mut _sapp_glx_SwapIntervalEXT: PFNGLXSWAPINTERVALEXTPROC; +} +extern "C" { + pub static mut _sapp_glx_SwapIntervalMESA: PFNGLXSWAPINTERVALMESAPROC; +} +extern "C" { + pub static mut _sapp_glx_CreateContextAttribsARB: PFNGLXCREATECONTEXTATTRIBSARBPROC; +} +extern "C" { + pub static mut _sapp_glx_EXT_swap_control: bool; +} +extern "C" { + pub static mut _sapp_glx_MESA_swap_control: bool; +} +extern "C" { + pub static mut _sapp_glx_ARB_multisample: bool; +} +extern "C" { + pub static mut _sapp_glx_ARB_framebuffer_sRGB: bool; +} +extern "C" { + pub static mut _sapp_glx_EXT_framebuffer_sRGB: bool; +} +extern "C" { + pub static mut _sapp_glx_ARB_create_context: bool; +} +extern "C" { + pub static mut _sapp_glx_ARB_create_context_profile: bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _sapp_x11_codepair { + pub keysym: u16, + pub ucs: u16, +} +extern "C" { + pub static mut _sapp_x11_keysymtab: [_sapp_x11_codepair; 828usize]; +} +extern "C" { + pub static mut _sapp_x11_keycodes: [bool; 256usize]; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __locale_data { + pub _address: u8, +} +pub type __builtin_va_list = [__va_list_tag; 1usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __va_list_tag { + pub gp_offset: ::std::os::raw::c_uint, + pub fp_offset: ::std::os::raw::c_uint, + pub overflow_arg_area: *mut ::std::os::raw::c_void, + pub reg_save_area: *mut ::std::os::raw::c_void, +} diff --git a/sokol-app-sys/src/sokol_app_wasm.rs b/sokol-app-sys/src/sokol_app_wasm.rs new file mode 100644 index 00000000..e1bd34d8 --- /dev/null +++ b/sokol-app-sys/src/sokol_app_wasm.rs @@ -0,0 +1,2182 @@ +pub const GL_GLES_PROTOTYPES: u32 = 1; +pub const GL_ES_VERSION_2_0: u32 = 1; +pub const GL_DEPTH_BUFFER_BIT: u32 = 256; +pub const GL_STENCIL_BUFFER_BIT: u32 = 1024; +pub const GL_COLOR_BUFFER_BIT: u32 = 16384; +pub const GL_FALSE: u32 = 0; +pub const GL_TRUE: u32 = 1; +pub const GL_POINTS: u32 = 0; +pub const GL_LINES: u32 = 1; +pub const GL_LINE_LOOP: u32 = 2; +pub const GL_LINE_STRIP: u32 = 3; +pub const GL_TRIANGLES: u32 = 4; +pub const GL_TRIANGLE_STRIP: u32 = 5; +pub const GL_TRIANGLE_FAN: u32 = 6; +pub const GL_ZERO: u32 = 0; +pub const GL_ONE: u32 = 1; +pub const GL_SRC_COLOR: u32 = 768; +pub const GL_ONE_MINUS_SRC_COLOR: u32 = 769; +pub const GL_SRC_ALPHA: u32 = 770; +pub const GL_ONE_MINUS_SRC_ALPHA: u32 = 771; +pub const GL_DST_ALPHA: u32 = 772; +pub const GL_ONE_MINUS_DST_ALPHA: u32 = 773; +pub const GL_DST_COLOR: u32 = 774; +pub const GL_ONE_MINUS_DST_COLOR: u32 = 775; +pub const GL_SRC_ALPHA_SATURATE: u32 = 776; +pub const GL_FUNC_ADD: u32 = 32774; +pub const GL_BLEND_EQUATION: u32 = 32777; +pub const GL_BLEND_EQUATION_RGB: u32 = 32777; +pub const GL_BLEND_EQUATION_ALPHA: u32 = 34877; +pub const GL_FUNC_SUBTRACT: u32 = 32778; +pub const GL_FUNC_REVERSE_SUBTRACT: u32 = 32779; +pub const GL_BLEND_DST_RGB: u32 = 32968; +pub const GL_BLEND_SRC_RGB: u32 = 32969; +pub const GL_BLEND_DST_ALPHA: u32 = 32970; +pub const GL_BLEND_SRC_ALPHA: u32 = 32971; +pub const GL_CONSTANT_COLOR: u32 = 32769; +pub const GL_ONE_MINUS_CONSTANT_COLOR: u32 = 32770; +pub const GL_CONSTANT_ALPHA: u32 = 32771; +pub const GL_ONE_MINUS_CONSTANT_ALPHA: u32 = 32772; +pub const GL_BLEND_COLOR: u32 = 32773; +pub const GL_ARRAY_BUFFER: u32 = 34962; +pub const GL_ELEMENT_ARRAY_BUFFER: u32 = 34963; +pub const GL_ARRAY_BUFFER_BINDING: u32 = 34964; +pub const GL_ELEMENT_ARRAY_BUFFER_BINDING: u32 = 34965; +pub const GL_STREAM_DRAW: u32 = 35040; +pub const GL_STATIC_DRAW: u32 = 35044; +pub const GL_DYNAMIC_DRAW: u32 = 35048; +pub const GL_BUFFER_SIZE: u32 = 34660; +pub const GL_BUFFER_USAGE: u32 = 34661; +pub const GL_CURRENT_VERTEX_ATTRIB: u32 = 34342; +pub const GL_FRONT: u32 = 1028; +pub const GL_BACK: u32 = 1029; +pub const GL_FRONT_AND_BACK: u32 = 1032; +pub const GL_TEXTURE_2D: u32 = 3553; +pub const GL_CULL_FACE: u32 = 2884; +pub const GL_BLEND: u32 = 3042; +pub const GL_DITHER: u32 = 3024; +pub const GL_STENCIL_TEST: u32 = 2960; +pub const GL_DEPTH_TEST: u32 = 2929; +pub const GL_SCISSOR_TEST: u32 = 3089; +pub const GL_POLYGON_OFFSET_FILL: u32 = 32823; +pub const GL_SAMPLE_ALPHA_TO_COVERAGE: u32 = 32926; +pub const GL_SAMPLE_COVERAGE: u32 = 32928; +pub const GL_NO_ERROR: u32 = 0; +pub const GL_INVALID_ENUM: u32 = 1280; +pub const GL_INVALID_VALUE: u32 = 1281; +pub const GL_INVALID_OPERATION: u32 = 1282; +pub const GL_OUT_OF_MEMORY: u32 = 1285; +pub const GL_CW: u32 = 2304; +pub const GL_CCW: u32 = 2305; +pub const GL_LINE_WIDTH: u32 = 2849; +pub const GL_ALIASED_POINT_SIZE_RANGE: u32 = 33901; +pub const GL_ALIASED_LINE_WIDTH_RANGE: u32 = 33902; +pub const GL_CULL_FACE_MODE: u32 = 2885; +pub const GL_FRONT_FACE: u32 = 2886; +pub const GL_DEPTH_RANGE: u32 = 2928; +pub const GL_DEPTH_WRITEMASK: u32 = 2930; +pub const GL_DEPTH_CLEAR_VALUE: u32 = 2931; +pub const GL_DEPTH_FUNC: u32 = 2932; +pub const GL_STENCIL_CLEAR_VALUE: u32 = 2961; +pub const GL_STENCIL_FUNC: u32 = 2962; +pub const GL_STENCIL_FAIL: u32 = 2964; +pub const GL_STENCIL_PASS_DEPTH_FAIL: u32 = 2965; +pub const GL_STENCIL_PASS_DEPTH_PASS: u32 = 2966; +pub const GL_STENCIL_REF: u32 = 2967; +pub const GL_STENCIL_VALUE_MASK: u32 = 2963; +pub const GL_STENCIL_WRITEMASK: u32 = 2968; +pub const GL_STENCIL_BACK_FUNC: u32 = 34816; +pub const GL_STENCIL_BACK_FAIL: u32 = 34817; +pub const GL_STENCIL_BACK_PASS_DEPTH_FAIL: u32 = 34818; +pub const GL_STENCIL_BACK_PASS_DEPTH_PASS: u32 = 34819; +pub const GL_STENCIL_BACK_REF: u32 = 36003; +pub const GL_STENCIL_BACK_VALUE_MASK: u32 = 36004; +pub const GL_STENCIL_BACK_WRITEMASK: u32 = 36005; +pub const GL_VIEWPORT: u32 = 2978; +pub const GL_SCISSOR_BOX: u32 = 3088; +pub const GL_COLOR_CLEAR_VALUE: u32 = 3106; +pub const GL_COLOR_WRITEMASK: u32 = 3107; +pub const GL_UNPACK_ALIGNMENT: u32 = 3317; +pub const GL_PACK_ALIGNMENT: u32 = 3333; +pub const GL_MAX_TEXTURE_SIZE: u32 = 3379; +pub const GL_MAX_VIEWPORT_DIMS: u32 = 3386; +pub const GL_SUBPIXEL_BITS: u32 = 3408; +pub const GL_RED_BITS: u32 = 3410; +pub const GL_GREEN_BITS: u32 = 3411; +pub const GL_BLUE_BITS: u32 = 3412; +pub const GL_ALPHA_BITS: u32 = 3413; +pub const GL_DEPTH_BITS: u32 = 3414; +pub const GL_STENCIL_BITS: u32 = 3415; +pub const GL_POLYGON_OFFSET_UNITS: u32 = 10752; +pub const GL_POLYGON_OFFSET_FACTOR: u32 = 32824; +pub const GL_TEXTURE_BINDING_2D: u32 = 32873; +pub const GL_SAMPLE_BUFFERS: u32 = 32936; +pub const GL_SAMPLES: u32 = 32937; +pub const GL_SAMPLE_COVERAGE_VALUE: u32 = 32938; +pub const GL_SAMPLE_COVERAGE_INVERT: u32 = 32939; +pub const GL_NUM_COMPRESSED_TEXTURE_FORMATS: u32 = 34466; +pub const GL_COMPRESSED_TEXTURE_FORMATS: u32 = 34467; +pub const GL_DONT_CARE: u32 = 4352; +pub const GL_FASTEST: u32 = 4353; +pub const GL_NICEST: u32 = 4354; +pub const GL_GENERATE_MIPMAP_HINT: u32 = 33170; +pub const GL_BYTE: u32 = 5120; +pub const GL_UNSIGNED_BYTE: u32 = 5121; +pub const GL_SHORT: u32 = 5122; +pub const GL_UNSIGNED_SHORT: u32 = 5123; +pub const GL_INT: u32 = 5124; +pub const GL_UNSIGNED_INT: u32 = 5125; +pub const GL_FLOAT: u32 = 5126; +pub const GL_FIXED: u32 = 5132; +pub const GL_DEPTH_COMPONENT: u32 = 6402; +pub const GL_ALPHA: u32 = 6406; +pub const GL_RGB: u32 = 6407; +pub const GL_RGBA: u32 = 6408; +pub const GL_LUMINANCE: u32 = 6409; +pub const GL_LUMINANCE_ALPHA: u32 = 6410; +pub const GL_UNSIGNED_SHORT_4_4_4_4: u32 = 32819; +pub const GL_UNSIGNED_SHORT_5_5_5_1: u32 = 32820; +pub const GL_UNSIGNED_SHORT_5_6_5: u32 = 33635; +pub const GL_FRAGMENT_SHADER: u32 = 35632; +pub const GL_VERTEX_SHADER: u32 = 35633; +pub const GL_MAX_VERTEX_ATTRIBS: u32 = 34921; +pub const GL_MAX_VERTEX_UNIFORM_VECTORS: u32 = 36347; +pub const GL_MAX_VARYING_VECTORS: u32 = 36348; +pub const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: u32 = 35661; +pub const GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: u32 = 35660; +pub const GL_MAX_TEXTURE_IMAGE_UNITS: u32 = 34930; +pub const GL_MAX_FRAGMENT_UNIFORM_VECTORS: u32 = 36349; +pub const GL_SHADER_TYPE: u32 = 35663; +pub const GL_DELETE_STATUS: u32 = 35712; +pub const GL_LINK_STATUS: u32 = 35714; +pub const GL_VALIDATE_STATUS: u32 = 35715; +pub const GL_ATTACHED_SHADERS: u32 = 35717; +pub const GL_ACTIVE_UNIFORMS: u32 = 35718; +pub const GL_ACTIVE_UNIFORM_MAX_LENGTH: u32 = 35719; +pub const GL_ACTIVE_ATTRIBUTES: u32 = 35721; +pub const GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: u32 = 35722; +pub const GL_SHADING_LANGUAGE_VERSION: u32 = 35724; +pub const GL_CURRENT_PROGRAM: u32 = 35725; +pub const GL_NEVER: u32 = 512; +pub const GL_LESS: u32 = 513; +pub const GL_EQUAL: u32 = 514; +pub const GL_LEQUAL: u32 = 515; +pub const GL_GREATER: u32 = 516; +pub const GL_NOTEQUAL: u32 = 517; +pub const GL_GEQUAL: u32 = 518; +pub const GL_ALWAYS: u32 = 519; +pub const GL_KEEP: u32 = 7680; +pub const GL_REPLACE: u32 = 7681; +pub const GL_INCR: u32 = 7682; +pub const GL_DECR: u32 = 7683; +pub const GL_INVERT: u32 = 5386; +pub const GL_INCR_WRAP: u32 = 34055; +pub const GL_DECR_WRAP: u32 = 34056; +pub const GL_VENDOR: u32 = 7936; +pub const GL_RENDERER: u32 = 7937; +pub const GL_VERSION: u32 = 7938; +pub const GL_EXTENSIONS: u32 = 7939; +pub const GL_NEAREST: u32 = 9728; +pub const GL_LINEAR: u32 = 9729; +pub const GL_NEAREST_MIPMAP_NEAREST: u32 = 9984; +pub const GL_LINEAR_MIPMAP_NEAREST: u32 = 9985; +pub const GL_NEAREST_MIPMAP_LINEAR: u32 = 9986; +pub const GL_LINEAR_MIPMAP_LINEAR: u32 = 9987; +pub const GL_TEXTURE_MAG_FILTER: u32 = 10240; +pub const GL_TEXTURE_MIN_FILTER: u32 = 10241; +pub const GL_TEXTURE_WRAP_S: u32 = 10242; +pub const GL_TEXTURE_WRAP_T: u32 = 10243; +pub const GL_TEXTURE: u32 = 5890; +pub const GL_TEXTURE_CUBE_MAP: u32 = 34067; +pub const GL_TEXTURE_BINDING_CUBE_MAP: u32 = 34068; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X: u32 = 34069; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X: u32 = 34070; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y: u32 = 34071; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: u32 = 34072; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z: u32 = 34073; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: u32 = 34074; +pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE: u32 = 34076; +pub const GL_TEXTURE0: u32 = 33984; +pub const GL_TEXTURE1: u32 = 33985; +pub const GL_TEXTURE2: u32 = 33986; +pub const GL_TEXTURE3: u32 = 33987; +pub const GL_TEXTURE4: u32 = 33988; +pub const GL_TEXTURE5: u32 = 33989; +pub const GL_TEXTURE6: u32 = 33990; +pub const GL_TEXTURE7: u32 = 33991; +pub const GL_TEXTURE8: u32 = 33992; +pub const GL_TEXTURE9: u32 = 33993; +pub const GL_TEXTURE10: u32 = 33994; +pub const GL_TEXTURE11: u32 = 33995; +pub const GL_TEXTURE12: u32 = 33996; +pub const GL_TEXTURE13: u32 = 33997; +pub const GL_TEXTURE14: u32 = 33998; +pub const GL_TEXTURE15: u32 = 33999; +pub const GL_TEXTURE16: u32 = 34000; +pub const GL_TEXTURE17: u32 = 34001; +pub const GL_TEXTURE18: u32 = 34002; +pub const GL_TEXTURE19: u32 = 34003; +pub const GL_TEXTURE20: u32 = 34004; +pub const GL_TEXTURE21: u32 = 34005; +pub const GL_TEXTURE22: u32 = 34006; +pub const GL_TEXTURE23: u32 = 34007; +pub const GL_TEXTURE24: u32 = 34008; +pub const GL_TEXTURE25: u32 = 34009; +pub const GL_TEXTURE26: u32 = 34010; +pub const GL_TEXTURE27: u32 = 34011; +pub const GL_TEXTURE28: u32 = 34012; +pub const GL_TEXTURE29: u32 = 34013; +pub const GL_TEXTURE30: u32 = 34014; +pub const GL_TEXTURE31: u32 = 34015; +pub const GL_ACTIVE_TEXTURE: u32 = 34016; +pub const GL_REPEAT: u32 = 10497; +pub const GL_CLAMP_TO_EDGE: u32 = 33071; +pub const GL_MIRRORED_REPEAT: u32 = 33648; +pub const GL_FLOAT_VEC2: u32 = 35664; +pub const GL_FLOAT_VEC3: u32 = 35665; +pub const GL_FLOAT_VEC4: u32 = 35666; +pub const GL_INT_VEC2: u32 = 35667; +pub const GL_INT_VEC3: u32 = 35668; +pub const GL_INT_VEC4: u32 = 35669; +pub const GL_BOOL: u32 = 35670; +pub const GL_BOOL_VEC2: u32 = 35671; +pub const GL_BOOL_VEC3: u32 = 35672; +pub const GL_BOOL_VEC4: u32 = 35673; +pub const GL_FLOAT_MAT2: u32 = 35674; +pub const GL_FLOAT_MAT3: u32 = 35675; +pub const GL_FLOAT_MAT4: u32 = 35676; +pub const GL_SAMPLER_2D: u32 = 35678; +pub const GL_SAMPLER_CUBE: u32 = 35680; +pub const GL_VERTEX_ATTRIB_ARRAY_ENABLED: u32 = 34338; +pub const GL_VERTEX_ATTRIB_ARRAY_SIZE: u32 = 34339; +pub const GL_VERTEX_ATTRIB_ARRAY_STRIDE: u32 = 34340; +pub const GL_VERTEX_ATTRIB_ARRAY_TYPE: u32 = 34341; +pub const GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: u32 = 34922; +pub const GL_VERTEX_ATTRIB_ARRAY_POINTER: u32 = 34373; +pub const GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: u32 = 34975; +pub const GL_IMPLEMENTATION_COLOR_READ_TYPE: u32 = 35738; +pub const GL_IMPLEMENTATION_COLOR_READ_FORMAT: u32 = 35739; +pub const GL_COMPILE_STATUS: u32 = 35713; +pub const GL_INFO_LOG_LENGTH: u32 = 35716; +pub const GL_SHADER_SOURCE_LENGTH: u32 = 35720; +pub const GL_SHADER_COMPILER: u32 = 36346; +pub const GL_SHADER_BINARY_FORMATS: u32 = 36344; +pub const GL_NUM_SHADER_BINARY_FORMATS: u32 = 36345; +pub const GL_LOW_FLOAT: u32 = 36336; +pub const GL_MEDIUM_FLOAT: u32 = 36337; +pub const GL_HIGH_FLOAT: u32 = 36338; +pub const GL_LOW_INT: u32 = 36339; +pub const GL_MEDIUM_INT: u32 = 36340; +pub const GL_HIGH_INT: u32 = 36341; +pub const GL_FRAMEBUFFER: u32 = 36160; +pub const GL_RENDERBUFFER: u32 = 36161; +pub const GL_RGBA4: u32 = 32854; +pub const GL_RGB5_A1: u32 = 32855; +pub const GL_RGB565: u32 = 36194; +pub const GL_DEPTH_COMPONENT16: u32 = 33189; +pub const GL_STENCIL_INDEX8: u32 = 36168; +pub const GL_RENDERBUFFER_WIDTH: u32 = 36162; +pub const GL_RENDERBUFFER_HEIGHT: u32 = 36163; +pub const GL_RENDERBUFFER_INTERNAL_FORMAT: u32 = 36164; +pub const GL_RENDERBUFFER_RED_SIZE: u32 = 36176; +pub const GL_RENDERBUFFER_GREEN_SIZE: u32 = 36177; +pub const GL_RENDERBUFFER_BLUE_SIZE: u32 = 36178; +pub const GL_RENDERBUFFER_ALPHA_SIZE: u32 = 36179; +pub const GL_RENDERBUFFER_DEPTH_SIZE: u32 = 36180; +pub const GL_RENDERBUFFER_STENCIL_SIZE: u32 = 36181; +pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: u32 = 36048; +pub const GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: u32 = 36049; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: u32 = 36050; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: u32 = 36051; +pub const GL_COLOR_ATTACHMENT0: u32 = 36064; +pub const GL_DEPTH_ATTACHMENT: u32 = 36096; +pub const GL_STENCIL_ATTACHMENT: u32 = 36128; +pub const GL_NONE: u32 = 0; +pub const GL_FRAMEBUFFER_COMPLETE: u32 = 36053; +pub const GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: u32 = 36054; +pub const GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: u32 = 36055; +pub const GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: u32 = 36057; +pub const GL_FRAMEBUFFER_UNSUPPORTED: u32 = 36061; +pub const GL_FRAMEBUFFER_BINDING: u32 = 36006; +pub const GL_RENDERBUFFER_BINDING: u32 = 36007; +pub const GL_MAX_RENDERBUFFER_SIZE: u32 = 34024; +pub const GL_INVALID_FRAMEBUFFER_OPERATION: u32 = 1286; +pub const GL_ES_VERSION_3_0: u32 = 1; +pub const GL_READ_BUFFER: u32 = 3074; +pub const GL_UNPACK_ROW_LENGTH: u32 = 3314; +pub const GL_UNPACK_SKIP_ROWS: u32 = 3315; +pub const GL_UNPACK_SKIP_PIXELS: u32 = 3316; +pub const GL_PACK_ROW_LENGTH: u32 = 3330; +pub const GL_PACK_SKIP_ROWS: u32 = 3331; +pub const GL_PACK_SKIP_PIXELS: u32 = 3332; +pub const GL_COLOR: u32 = 6144; +pub const GL_DEPTH: u32 = 6145; +pub const GL_STENCIL: u32 = 6146; +pub const GL_RED: u32 = 6403; +pub const GL_RGB8: u32 = 32849; +pub const GL_RGBA8: u32 = 32856; +pub const GL_RGB10_A2: u32 = 32857; +pub const GL_TEXTURE_BINDING_3D: u32 = 32874; +pub const GL_UNPACK_SKIP_IMAGES: u32 = 32877; +pub const GL_UNPACK_IMAGE_HEIGHT: u32 = 32878; +pub const GL_TEXTURE_3D: u32 = 32879; +pub const GL_TEXTURE_WRAP_R: u32 = 32882; +pub const GL_MAX_3D_TEXTURE_SIZE: u32 = 32883; +pub const GL_UNSIGNED_INT_2_10_10_10_REV: u32 = 33640; +pub const GL_MAX_ELEMENTS_VERTICES: u32 = 33000; +pub const GL_MAX_ELEMENTS_INDICES: u32 = 33001; +pub const GL_TEXTURE_MIN_LOD: u32 = 33082; +pub const GL_TEXTURE_MAX_LOD: u32 = 33083; +pub const GL_TEXTURE_BASE_LEVEL: u32 = 33084; +pub const GL_TEXTURE_MAX_LEVEL: u32 = 33085; +pub const GL_MIN: u32 = 32775; +pub const GL_MAX: u32 = 32776; +pub const GL_DEPTH_COMPONENT24: u32 = 33190; +pub const GL_MAX_TEXTURE_LOD_BIAS: u32 = 34045; +pub const GL_TEXTURE_COMPARE_MODE: u32 = 34892; +pub const GL_TEXTURE_COMPARE_FUNC: u32 = 34893; +pub const GL_CURRENT_QUERY: u32 = 34917; +pub const GL_QUERY_RESULT: u32 = 34918; +pub const GL_QUERY_RESULT_AVAILABLE: u32 = 34919; +pub const GL_BUFFER_MAPPED: u32 = 35004; +pub const GL_BUFFER_MAP_POINTER: u32 = 35005; +pub const GL_STREAM_READ: u32 = 35041; +pub const GL_STREAM_COPY: u32 = 35042; +pub const GL_STATIC_READ: u32 = 35045; +pub const GL_STATIC_COPY: u32 = 35046; +pub const GL_DYNAMIC_READ: u32 = 35049; +pub const GL_DYNAMIC_COPY: u32 = 35050; +pub const GL_MAX_DRAW_BUFFERS: u32 = 34852; +pub const GL_DRAW_BUFFER0: u32 = 34853; +pub const GL_DRAW_BUFFER1: u32 = 34854; +pub const GL_DRAW_BUFFER2: u32 = 34855; +pub const GL_DRAW_BUFFER3: u32 = 34856; +pub const GL_DRAW_BUFFER4: u32 = 34857; +pub const GL_DRAW_BUFFER5: u32 = 34858; +pub const GL_DRAW_BUFFER6: u32 = 34859; +pub const GL_DRAW_BUFFER7: u32 = 34860; +pub const GL_DRAW_BUFFER8: u32 = 34861; +pub const GL_DRAW_BUFFER9: u32 = 34862; +pub const GL_DRAW_BUFFER10: u32 = 34863; +pub const GL_DRAW_BUFFER11: u32 = 34864; +pub const GL_DRAW_BUFFER12: u32 = 34865; +pub const GL_DRAW_BUFFER13: u32 = 34866; +pub const GL_DRAW_BUFFER14: u32 = 34867; +pub const GL_DRAW_BUFFER15: u32 = 34868; +pub const GL_MAX_FRAGMENT_UNIFORM_COMPONENTS: u32 = 35657; +pub const GL_MAX_VERTEX_UNIFORM_COMPONENTS: u32 = 35658; +pub const GL_SAMPLER_3D: u32 = 35679; +pub const GL_SAMPLER_2D_SHADOW: u32 = 35682; +pub const GL_FRAGMENT_SHADER_DERIVATIVE_HINT: u32 = 35723; +pub const GL_PIXEL_PACK_BUFFER: u32 = 35051; +pub const GL_PIXEL_UNPACK_BUFFER: u32 = 35052; +pub const GL_PIXEL_PACK_BUFFER_BINDING: u32 = 35053; +pub const GL_PIXEL_UNPACK_BUFFER_BINDING: u32 = 35055; +pub const GL_FLOAT_MAT2x3: u32 = 35685; +pub const GL_FLOAT_MAT2x4: u32 = 35686; +pub const GL_FLOAT_MAT3x2: u32 = 35687; +pub const GL_FLOAT_MAT3x4: u32 = 35688; +pub const GL_FLOAT_MAT4x2: u32 = 35689; +pub const GL_FLOAT_MAT4x3: u32 = 35690; +pub const GL_SRGB: u32 = 35904; +pub const GL_SRGB8: u32 = 35905; +pub const GL_SRGB8_ALPHA8: u32 = 35907; +pub const GL_COMPARE_REF_TO_TEXTURE: u32 = 34894; +pub const GL_MAJOR_VERSION: u32 = 33307; +pub const GL_MINOR_VERSION: u32 = 33308; +pub const GL_NUM_EXTENSIONS: u32 = 33309; +pub const GL_RGBA32F: u32 = 34836; +pub const GL_RGB32F: u32 = 34837; +pub const GL_RGBA16F: u32 = 34842; +pub const GL_RGB16F: u32 = 34843; +pub const GL_VERTEX_ATTRIB_ARRAY_INTEGER: u32 = 35069; +pub const GL_MAX_ARRAY_TEXTURE_LAYERS: u32 = 35071; +pub const GL_MIN_PROGRAM_TEXEL_OFFSET: u32 = 35076; +pub const GL_MAX_PROGRAM_TEXEL_OFFSET: u32 = 35077; +pub const GL_MAX_VARYING_COMPONENTS: u32 = 35659; +pub const GL_TEXTURE_2D_ARRAY: u32 = 35866; +pub const GL_TEXTURE_BINDING_2D_ARRAY: u32 = 35869; +pub const GL_R11F_G11F_B10F: u32 = 35898; +pub const GL_UNSIGNED_INT_10F_11F_11F_REV: u32 = 35899; +pub const GL_RGB9_E5: u32 = 35901; +pub const GL_UNSIGNED_INT_5_9_9_9_REV: u32 = 35902; +pub const GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: u32 = 35958; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_MODE: u32 = 35967; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: u32 = 35968; +pub const GL_TRANSFORM_FEEDBACK_VARYINGS: u32 = 35971; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_START: u32 = 35972; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_SIZE: u32 = 35973; +pub const GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: u32 = 35976; +pub const GL_RASTERIZER_DISCARD: u32 = 35977; +pub const GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: u32 = 35978; +pub const GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: u32 = 35979; +pub const GL_INTERLEAVED_ATTRIBS: u32 = 35980; +pub const GL_SEPARATE_ATTRIBS: u32 = 35981; +pub const GL_TRANSFORM_FEEDBACK_BUFFER: u32 = 35982; +pub const GL_TRANSFORM_FEEDBACK_BUFFER_BINDING: u32 = 35983; +pub const GL_RGBA32UI: u32 = 36208; +pub const GL_RGB32UI: u32 = 36209; +pub const GL_RGBA16UI: u32 = 36214; +pub const GL_RGB16UI: u32 = 36215; +pub const GL_RGBA8UI: u32 = 36220; +pub const GL_RGB8UI: u32 = 36221; +pub const GL_RGBA32I: u32 = 36226; +pub const GL_RGB32I: u32 = 36227; +pub const GL_RGBA16I: u32 = 36232; +pub const GL_RGB16I: u32 = 36233; +pub const GL_RGBA8I: u32 = 36238; +pub const GL_RGB8I: u32 = 36239; +pub const GL_RED_INTEGER: u32 = 36244; +pub const GL_RGB_INTEGER: u32 = 36248; +pub const GL_RGBA_INTEGER: u32 = 36249; +pub const GL_SAMPLER_2D_ARRAY: u32 = 36289; +pub const GL_SAMPLER_2D_ARRAY_SHADOW: u32 = 36292; +pub const GL_SAMPLER_CUBE_SHADOW: u32 = 36293; +pub const GL_UNSIGNED_INT_VEC2: u32 = 36294; +pub const GL_UNSIGNED_INT_VEC3: u32 = 36295; +pub const GL_UNSIGNED_INT_VEC4: u32 = 36296; +pub const GL_INT_SAMPLER_2D: u32 = 36298; +pub const GL_INT_SAMPLER_3D: u32 = 36299; +pub const GL_INT_SAMPLER_CUBE: u32 = 36300; +pub const GL_INT_SAMPLER_2D_ARRAY: u32 = 36303; +pub const GL_UNSIGNED_INT_SAMPLER_2D: u32 = 36306; +pub const GL_UNSIGNED_INT_SAMPLER_3D: u32 = 36307; +pub const GL_UNSIGNED_INT_SAMPLER_CUBE: u32 = 36308; +pub const GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: u32 = 36311; +pub const GL_BUFFER_ACCESS_FLAGS: u32 = 37151; +pub const GL_BUFFER_MAP_LENGTH: u32 = 37152; +pub const GL_BUFFER_MAP_OFFSET: u32 = 37153; +pub const GL_DEPTH_COMPONENT32F: u32 = 36012; +pub const GL_DEPTH32F_STENCIL8: u32 = 36013; +pub const GL_FLOAT_32_UNSIGNED_INT_24_8_REV: u32 = 36269; +pub const GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: u32 = 33296; +pub const GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: u32 = 33297; +pub const GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: u32 = 33298; +pub const GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: u32 = 33299; +pub const GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: u32 = 33300; +pub const GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: u32 = 33301; +pub const GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: u32 = 33302; +pub const GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: u32 = 33303; +pub const GL_FRAMEBUFFER_DEFAULT: u32 = 33304; +pub const GL_FRAMEBUFFER_UNDEFINED: u32 = 33305; +pub const GL_DEPTH_STENCIL_ATTACHMENT: u32 = 33306; +pub const GL_DEPTH_STENCIL: u32 = 34041; +pub const GL_UNSIGNED_INT_24_8: u32 = 34042; +pub const GL_DEPTH24_STENCIL8: u32 = 35056; +pub const GL_UNSIGNED_NORMALIZED: u32 = 35863; +pub const GL_DRAW_FRAMEBUFFER_BINDING: u32 = 36006; +pub const GL_READ_FRAMEBUFFER: u32 = 36008; +pub const GL_DRAW_FRAMEBUFFER: u32 = 36009; +pub const GL_READ_FRAMEBUFFER_BINDING: u32 = 36010; +pub const GL_RENDERBUFFER_SAMPLES: u32 = 36011; +pub const GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: u32 = 36052; +pub const GL_MAX_COLOR_ATTACHMENTS: u32 = 36063; +pub const GL_COLOR_ATTACHMENT1: u32 = 36065; +pub const GL_COLOR_ATTACHMENT2: u32 = 36066; +pub const GL_COLOR_ATTACHMENT3: u32 = 36067; +pub const GL_COLOR_ATTACHMENT4: u32 = 36068; +pub const GL_COLOR_ATTACHMENT5: u32 = 36069; +pub const GL_COLOR_ATTACHMENT6: u32 = 36070; +pub const GL_COLOR_ATTACHMENT7: u32 = 36071; +pub const GL_COLOR_ATTACHMENT8: u32 = 36072; +pub const GL_COLOR_ATTACHMENT9: u32 = 36073; +pub const GL_COLOR_ATTACHMENT10: u32 = 36074; +pub const GL_COLOR_ATTACHMENT11: u32 = 36075; +pub const GL_COLOR_ATTACHMENT12: u32 = 36076; +pub const GL_COLOR_ATTACHMENT13: u32 = 36077; +pub const GL_COLOR_ATTACHMENT14: u32 = 36078; +pub const GL_COLOR_ATTACHMENT15: u32 = 36079; +pub const GL_COLOR_ATTACHMENT16: u32 = 36080; +pub const GL_COLOR_ATTACHMENT17: u32 = 36081; +pub const GL_COLOR_ATTACHMENT18: u32 = 36082; +pub const GL_COLOR_ATTACHMENT19: u32 = 36083; +pub const GL_COLOR_ATTACHMENT20: u32 = 36084; +pub const GL_COLOR_ATTACHMENT21: u32 = 36085; +pub const GL_COLOR_ATTACHMENT22: u32 = 36086; +pub const GL_COLOR_ATTACHMENT23: u32 = 36087; +pub const GL_COLOR_ATTACHMENT24: u32 = 36088; +pub const GL_COLOR_ATTACHMENT25: u32 = 36089; +pub const GL_COLOR_ATTACHMENT26: u32 = 36090; +pub const GL_COLOR_ATTACHMENT27: u32 = 36091; +pub const GL_COLOR_ATTACHMENT28: u32 = 36092; +pub const GL_COLOR_ATTACHMENT29: u32 = 36093; +pub const GL_COLOR_ATTACHMENT30: u32 = 36094; +pub const GL_COLOR_ATTACHMENT31: u32 = 36095; +pub const GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: u32 = 36182; +pub const GL_MAX_SAMPLES: u32 = 36183; +pub const GL_HALF_FLOAT: u32 = 5131; +pub const GL_MAP_READ_BIT: u32 = 1; +pub const GL_MAP_WRITE_BIT: u32 = 2; +pub const GL_MAP_INVALIDATE_RANGE_BIT: u32 = 4; +pub const GL_MAP_INVALIDATE_BUFFER_BIT: u32 = 8; +pub const GL_MAP_FLUSH_EXPLICIT_BIT: u32 = 16; +pub const GL_MAP_UNSYNCHRONIZED_BIT: u32 = 32; +pub const GL_RG: u32 = 33319; +pub const GL_RG_INTEGER: u32 = 33320; +pub const GL_R8: u32 = 33321; +pub const GL_RG8: u32 = 33323; +pub const GL_R16F: u32 = 33325; +pub const GL_R32F: u32 = 33326; +pub const GL_RG16F: u32 = 33327; +pub const GL_RG32F: u32 = 33328; +pub const GL_R8I: u32 = 33329; +pub const GL_R8UI: u32 = 33330; +pub const GL_R16I: u32 = 33331; +pub const GL_R16UI: u32 = 33332; +pub const GL_R32I: u32 = 33333; +pub const GL_R32UI: u32 = 33334; +pub const GL_RG8I: u32 = 33335; +pub const GL_RG8UI: u32 = 33336; +pub const GL_RG16I: u32 = 33337; +pub const GL_RG16UI: u32 = 33338; +pub const GL_RG32I: u32 = 33339; +pub const GL_RG32UI: u32 = 33340; +pub const GL_VERTEX_ARRAY_BINDING: u32 = 34229; +pub const GL_R8_SNORM: u32 = 36756; +pub const GL_RG8_SNORM: u32 = 36757; +pub const GL_RGB8_SNORM: u32 = 36758; +pub const GL_RGBA8_SNORM: u32 = 36759; +pub const GL_SIGNED_NORMALIZED: u32 = 36764; +pub const GL_PRIMITIVE_RESTART_FIXED_INDEX: u32 = 36201; +pub const GL_COPY_READ_BUFFER: u32 = 36662; +pub const GL_COPY_WRITE_BUFFER: u32 = 36663; +pub const GL_COPY_READ_BUFFER_BINDING: u32 = 36662; +pub const GL_COPY_WRITE_BUFFER_BINDING: u32 = 36663; +pub const GL_UNIFORM_BUFFER: u32 = 35345; +pub const GL_UNIFORM_BUFFER_BINDING: u32 = 35368; +pub const GL_UNIFORM_BUFFER_START: u32 = 35369; +pub const GL_UNIFORM_BUFFER_SIZE: u32 = 35370; +pub const GL_MAX_VERTEX_UNIFORM_BLOCKS: u32 = 35371; +pub const GL_MAX_FRAGMENT_UNIFORM_BLOCKS: u32 = 35373; +pub const GL_MAX_COMBINED_UNIFORM_BLOCKS: u32 = 35374; +pub const GL_MAX_UNIFORM_BUFFER_BINDINGS: u32 = 35375; +pub const GL_MAX_UNIFORM_BLOCK_SIZE: u32 = 35376; +pub const GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: u32 = 35377; +pub const GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: u32 = 35379; +pub const GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: u32 = 35380; +pub const GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: u32 = 35381; +pub const GL_ACTIVE_UNIFORM_BLOCKS: u32 = 35382; +pub const GL_UNIFORM_TYPE: u32 = 35383; +pub const GL_UNIFORM_SIZE: u32 = 35384; +pub const GL_UNIFORM_NAME_LENGTH: u32 = 35385; +pub const GL_UNIFORM_BLOCK_INDEX: u32 = 35386; +pub const GL_UNIFORM_OFFSET: u32 = 35387; +pub const GL_UNIFORM_ARRAY_STRIDE: u32 = 35388; +pub const GL_UNIFORM_MATRIX_STRIDE: u32 = 35389; +pub const GL_UNIFORM_IS_ROW_MAJOR: u32 = 35390; +pub const GL_UNIFORM_BLOCK_BINDING: u32 = 35391; +pub const GL_UNIFORM_BLOCK_DATA_SIZE: u32 = 35392; +pub const GL_UNIFORM_BLOCK_NAME_LENGTH: u32 = 35393; +pub const GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: u32 = 35394; +pub const GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: u32 = 35395; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: u32 = 35396; +pub const GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: u32 = 35398; +pub const GL_INVALID_INDEX: u32 = 4294967295; +pub const GL_MAX_VERTEX_OUTPUT_COMPONENTS: u32 = 37154; +pub const GL_MAX_FRAGMENT_INPUT_COMPONENTS: u32 = 37157; +pub const GL_MAX_SERVER_WAIT_TIMEOUT: u32 = 37137; +pub const GL_OBJECT_TYPE: u32 = 37138; +pub const GL_SYNC_CONDITION: u32 = 37139; +pub const GL_SYNC_STATUS: u32 = 37140; +pub const GL_SYNC_FLAGS: u32 = 37141; +pub const GL_SYNC_FENCE: u32 = 37142; +pub const GL_SYNC_GPU_COMMANDS_COMPLETE: u32 = 37143; +pub const GL_UNSIGNALED: u32 = 37144; +pub const GL_SIGNALED: u32 = 37145; +pub const GL_ALREADY_SIGNALED: u32 = 37146; +pub const GL_TIMEOUT_EXPIRED: u32 = 37147; +pub const GL_CONDITION_SATISFIED: u32 = 37148; +pub const GL_WAIT_FAILED: u32 = 37149; +pub const GL_SYNC_FLUSH_COMMANDS_BIT: u32 = 1; +pub const GL_TIMEOUT_IGNORED: i32 = -1; +pub const GL_VERTEX_ATTRIB_ARRAY_DIVISOR: u32 = 35070; +pub const GL_ANY_SAMPLES_PASSED: u32 = 35887; +pub const GL_ANY_SAMPLES_PASSED_CONSERVATIVE: u32 = 36202; +pub const GL_SAMPLER_BINDING: u32 = 35097; +pub const GL_RGB10_A2UI: u32 = 36975; +pub const GL_TEXTURE_SWIZZLE_R: u32 = 36418; +pub const GL_TEXTURE_SWIZZLE_G: u32 = 36419; +pub const GL_TEXTURE_SWIZZLE_B: u32 = 36420; +pub const GL_TEXTURE_SWIZZLE_A: u32 = 36421; +pub const GL_GREEN: u32 = 6404; +pub const GL_BLUE: u32 = 6405; +pub const GL_INT_2_10_10_10_REV: u32 = 36255; +pub const GL_TRANSFORM_FEEDBACK: u32 = 36386; +pub const GL_TRANSFORM_FEEDBACK_PAUSED: u32 = 36387; +pub const GL_TRANSFORM_FEEDBACK_ACTIVE: u32 = 36388; +pub const GL_TRANSFORM_FEEDBACK_BINDING: u32 = 36389; +pub const GL_PROGRAM_BINARY_RETRIEVABLE_HINT: u32 = 33367; +pub const GL_PROGRAM_BINARY_LENGTH: u32 = 34625; +pub const GL_NUM_PROGRAM_BINARY_FORMATS: u32 = 34814; +pub const GL_PROGRAM_BINARY_FORMATS: u32 = 34815; +pub const GL_COMPRESSED_R11_EAC: u32 = 37488; +pub const GL_COMPRESSED_SIGNED_R11_EAC: u32 = 37489; +pub const GL_COMPRESSED_RG11_EAC: u32 = 37490; +pub const GL_COMPRESSED_SIGNED_RG11_EAC: u32 = 37491; +pub const GL_COMPRESSED_RGB8_ETC2: u32 = 37492; +pub const GL_COMPRESSED_SRGB8_ETC2: u32 = 37493; +pub const GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: u32 = 37494; +pub const GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: u32 = 37495; +pub const GL_COMPRESSED_RGBA8_ETC2_EAC: u32 = 37496; +pub const GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: u32 = 37497; +pub const GL_TEXTURE_IMMUTABLE_FORMAT: u32 = 37167; +pub const GL_MAX_ELEMENT_INDEX: u32 = 36203; +pub const GL_NUM_SAMPLE_COUNTS: u32 = 37760; +pub const GL_TEXTURE_IMMUTABLE_LEVELS: u32 = 33503; + +pub type khronos_int32_t = i32; +pub type khronos_uint32_t = u32; +pub type khronos_int64_t = i64; +pub type khronos_uint64_t = u64; +pub type khronos_int8_t = ::std::os::raw::c_schar; +pub type khronos_uint8_t = ::std::os::raw::c_uchar; +pub type khronos_int16_t = ::std::os::raw::c_short; +pub type khronos_uint16_t = ::std::os::raw::c_ushort; +pub type khronos_intptr_t = ::std::os::raw::c_long; +pub type khronos_uintptr_t = ::std::os::raw::c_ulong; +pub type khronos_ssize_t = ::std::os::raw::c_long; +pub type khronos_usize_t = ::std::os::raw::c_ulong; +pub type khronos_float_t = f32; +pub type khronos_utime_nanoseconds_t = khronos_uint64_t; +pub type khronos_stime_nanoseconds_t = khronos_int64_t; + +pub type GLbyte = khronos_int8_t; +pub type GLclampf = khronos_float_t; +pub type GLfixed = khronos_int32_t; +pub type GLshort = ::std::os::raw::c_short; +pub type GLushort = ::std::os::raw::c_ushort; +pub type GLvoid = ::std::os::raw::c_void; + +pub type GLint64 = khronos_int64_t; +pub type GLuint64 = khronos_uint64_t; +pub type GLenum = ::std::os::raw::c_uint; +pub type GLuint = ::std::os::raw::c_uint; +pub type GLchar = ::std::os::raw::c_char; +pub type GLfloat = khronos_float_t; +pub type GLsizeiptr = khronos_ssize_t; +pub type GLintptr = khronos_intptr_t; +pub type GLbitfield = ::std::os::raw::c_uint; +pub type GLint = ::std::os::raw::c_int; +pub type GLboolean = ::std::os::raw::c_uchar; +pub type GLsizei = ::std::os::raw::c_int; +pub type GLubyte = khronos_uint8_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __GLsync { + _unused: [u8; 0], +} +pub type GLsync = *mut __GLsync; + +extern "C" { + pub fn glActiveTexture(texture: GLenum); +} +extern "C" { + pub fn glAttachShader(program: GLuint, shader: GLuint); +} +extern "C" { + pub fn glBindAttribLocation(program: GLuint, index: GLuint, name: *const GLchar); +} +extern "C" { + pub fn glBindBuffer(target: GLenum, buffer: GLuint); +} +extern "C" { + pub fn glBindFramebuffer(target: GLenum, framebuffer: GLuint); +} +extern "C" { + pub fn glBindRenderbuffer(target: GLenum, renderbuffer: GLuint); +} +extern "C" { + pub fn glBindTexture(target: GLenum, texture: GLuint); +} +extern "C" { + pub fn glBlendColor(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat); +} +extern "C" { + pub fn glBlendEquation(mode: GLenum); +} +extern "C" { + pub fn glBlendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum); +} +extern "C" { + pub fn glBlendFunc(sfactor: GLenum, dfactor: GLenum); +} +extern "C" { + pub fn glBlendFuncSeparate( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ); +} +extern "C" { + pub fn glBufferData( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ); +} +extern "C" { + pub fn glBufferSubData( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCheckFramebufferStatus(target: GLenum) -> GLenum; +} +extern "C" { + pub fn glClear(mask: GLbitfield); +} +extern "C" { + pub fn glClearColor(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat); +} +extern "C" { + pub fn glClearDepthf(d: GLfloat); +} +extern "C" { + pub fn glClearStencil(s: GLint); +} +extern "C" { + pub fn glColorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean); +} +extern "C" { + pub fn glCompileShader(shader: GLuint); +} +extern "C" { + pub fn glCompressedTexImage2D( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexSubImage2D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyTexImage2D( + target: GLenum, + level: GLint, + internalformat: GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + ); +} +extern "C" { + pub fn glCopyTexSubImage2D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glCreateProgram() -> GLuint; +} +extern "C" { + pub fn glCreateShader(type_: GLenum) -> GLuint; +} +extern "C" { + pub fn glCullFace(mode: GLenum); +} +extern "C" { + pub fn glDeleteBuffers(n: GLsizei, buffers: *const GLuint); +} +extern "C" { + pub fn glDeleteFramebuffers(n: GLsizei, framebuffers: *const GLuint); +} +extern "C" { + pub fn glDeleteProgram(program: GLuint); +} +extern "C" { + pub fn glDeleteRenderbuffers(n: GLsizei, renderbuffers: *const GLuint); +} +extern "C" { + pub fn glDeleteShader(shader: GLuint); +} +extern "C" { + pub fn glDeleteTextures(n: GLsizei, textures: *const GLuint); +} +extern "C" { + pub fn glDepthFunc(func: GLenum); +} +extern "C" { + pub fn glDepthMask(flag: GLboolean); +} +extern "C" { + pub fn glDepthRangef(n: GLfloat, f: GLfloat); +} +extern "C" { + pub fn glDetachShader(program: GLuint, shader: GLuint); +} +extern "C" { + pub fn glDisable(cap: GLenum); +} +extern "C" { + pub fn glDisableVertexAttribArray(index: GLuint); +} +extern "C" { + pub fn glDrawArrays(mode: GLenum, first: GLint, count: GLsizei); +} +extern "C" { + pub fn glDrawElements( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glEnable(cap: GLenum); +} +extern "C" { + pub fn glEnableVertexAttribArray(index: GLuint); +} +extern "C" { + pub fn glFinish(); +} +extern "C" { + pub fn glFlush(); +} +extern "C" { + pub fn glFramebufferRenderbuffer( + target: GLenum, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ); +} +extern "C" { + pub fn glFramebufferTexture2D( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +extern "C" { + pub fn glFrontFace(mode: GLenum); +} +extern "C" { + pub fn glGenBuffers(n: GLsizei, buffers: *mut GLuint); +} +extern "C" { + pub fn glGenerateMipmap(target: GLenum); +} +extern "C" { + pub fn glGenFramebuffers(n: GLsizei, framebuffers: *mut GLuint); +} +extern "C" { + pub fn glGenRenderbuffers(n: GLsizei, renderbuffers: *mut GLuint); +} +extern "C" { + pub fn glGenTextures(n: GLsizei, textures: *mut GLuint); +} +extern "C" { + pub fn glGetActiveAttrib( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetActiveUniform( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLint, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glGetAttachedShaders( + program: GLuint, + maxCount: GLsizei, + count: *mut GLsizei, + shaders: *mut GLuint, + ); +} +extern "C" { + pub fn glGetAttribLocation(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glGetBooleanv(pname: GLenum, data: *mut GLboolean); +} +extern "C" { + pub fn glGetBufferParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetError() -> GLenum; +} +extern "C" { + pub fn glGetFloatv(pname: GLenum, data: *mut GLfloat); +} +extern "C" { + pub fn glGetFramebufferAttachmentParameteriv( + target: GLenum, + attachment: GLenum, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetIntegerv(pname: GLenum, data: *mut GLint); +} +extern "C" { + pub fn glGetProgramiv(program: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetProgramInfoLog( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +extern "C" { + pub fn glGetRenderbufferParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetShaderiv(shader: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetShaderInfoLog( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +extern "C" { + pub fn glGetShaderPrecisionFormat( + shadertype: GLenum, + precisiontype: GLenum, + range: *mut GLint, + precision: *mut GLint, + ); +} +extern "C" { + pub fn glGetShaderSource( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + source: *mut GLchar, + ); +} +extern "C" { + pub fn glGetString(name: GLenum) -> *const GLubyte; +} +extern "C" { + pub fn glGetTexParameterfv(target: GLenum, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetTexParameteriv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetUniformfv(program: GLuint, location: GLint, params: *mut GLfloat); +} +extern "C" { + pub fn glGetUniformiv(program: GLuint, location: GLint, params: *mut GLint); +} +extern "C" { + pub fn glGetUniformLocation(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glGetVertexAttribfv(index: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glGetVertexAttribiv(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribPointerv( + index: GLuint, + pname: GLenum, + pointer: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glHint(target: GLenum, mode: GLenum); +} +extern "C" { + pub fn glIsBuffer(buffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glIsEnabled(cap: GLenum) -> GLboolean; +} +extern "C" { + pub fn glIsFramebuffer(framebuffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glIsProgram(program: GLuint) -> GLboolean; +} +extern "C" { + pub fn glIsRenderbuffer(renderbuffer: GLuint) -> GLboolean; +} +extern "C" { + pub fn glIsShader(shader: GLuint) -> GLboolean; +} +extern "C" { + pub fn glIsTexture(texture: GLuint) -> GLboolean; +} +extern "C" { + pub fn glLineWidth(width: GLfloat); +} +extern "C" { + pub fn glLinkProgram(program: GLuint); +} +extern "C" { + pub fn glPixelStorei(pname: GLenum, param: GLint); +} +extern "C" { + pub fn glPolygonOffset(factor: GLfloat, units: GLfloat); +} +extern "C" { + pub fn glReadPixels( + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glReleaseShaderCompiler(); +} +extern "C" { + pub fn glRenderbufferStorage( + target: GLenum, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glSampleCoverage(value: GLfloat, invert: GLboolean); +} +extern "C" { + pub fn glScissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei); +} +extern "C" { + pub fn glShaderBinary( + count: GLsizei, + shaders: *const GLuint, + binaryformat: GLenum, + binary: *const ::std::os::raw::c_void, + length: GLsizei, + ); +} +extern "C" { + pub fn glShaderSource( + shader: GLuint, + count: GLsizei, + string: *const *const GLchar, + length: *const GLint, + ); +} +extern "C" { + pub fn glStencilFunc(func: GLenum, ref_: GLint, mask: GLuint); +} +extern "C" { + pub fn glStencilFuncSeparate(face: GLenum, func: GLenum, ref_: GLint, mask: GLuint); +} +extern "C" { + pub fn glStencilMask(mask: GLuint); +} +extern "C" { + pub fn glStencilMaskSeparate(face: GLenum, mask: GLuint); +} +extern "C" { + pub fn glStencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum); +} +extern "C" { + pub fn glStencilOpSeparate(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum); +} +extern "C" { + pub fn glTexImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexParameterf(target: GLenum, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glTexParameterfv(target: GLenum, pname: GLenum, params: *const GLfloat); +} +extern "C" { + pub fn glTexParameteri(target: GLenum, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glTexParameteriv(target: GLenum, pname: GLenum, params: *const GLint); +} +extern "C" { + pub fn glTexSubImage2D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glUniform1f(location: GLint, v0: GLfloat); +} +extern "C" { + pub fn glUniform1fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform1i(location: GLint, v0: GLint); +} +extern "C" { + pub fn glUniform1iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform2f(location: GLint, v0: GLfloat, v1: GLfloat); +} +extern "C" { + pub fn glUniform2fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform2i(location: GLint, v0: GLint, v1: GLint); +} +extern "C" { + pub fn glUniform2iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform3f(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat); +} +extern "C" { + pub fn glUniform3fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform3i(location: GLint, v0: GLint, v1: GLint, v2: GLint); +} +extern "C" { + pub fn glUniform3iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniform4f(location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat); +} +extern "C" { + pub fn glUniform4fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +extern "C" { + pub fn glUniform4i(location: GLint, v0: GLint, v1: GLint, v2: GLint, v3: GLint); +} +extern "C" { + pub fn glUniform4iv(location: GLint, count: GLsizei, value: *const GLint); +} +extern "C" { + pub fn glUniformMatrix2fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUseProgram(program: GLuint); +} +extern "C" { + pub fn glValidateProgram(program: GLuint); +} +extern "C" { + pub fn glVertexAttrib1f(index: GLuint, x: GLfloat); +} +extern "C" { + pub fn glVertexAttrib1fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat); +} +extern "C" { + pub fn glVertexAttrib2fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat); +} +extern "C" { + pub fn glVertexAttrib3fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat); +} +extern "C" { + pub fn glVertexAttrib4fv(index: GLuint, v: *const GLfloat); +} +extern "C" { + pub fn glVertexAttribPointer( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glViewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei); +} +extern "C" { + pub fn glReadBuffer(src: GLenum); +} +extern "C" { + pub fn glDrawRangeElements( + mode: GLenum, + start: GLuint, + end: GLuint, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexImage3D( + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glTexSubImage3D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCopyTexSubImage3D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glCompressedTexImage3D( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glCompressedTexSubImage3D( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGenQueries(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glDeleteQueries(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glIsQuery(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBeginQuery(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glEndQuery(target: GLenum); +} +extern "C" { + pub fn glGetQueryiv(target: GLenum, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetQueryObjectuiv(id: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glUnmapBuffer(target: GLenum) -> GLboolean; +} +extern "C" { + pub fn glGetBufferPointerv( + target: GLenum, + pname: GLenum, + params: *mut *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glDrawBuffers(n: GLsizei, bufs: *const GLenum); +} +extern "C" { + pub fn glUniformMatrix2x3fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3x2fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix2x4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4x2fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix3x4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glUniformMatrix4x3fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +extern "C" { + pub fn glBlitFramebuffer( + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ); +} +extern "C" { + pub fn glRenderbufferStorageMultisample( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glFramebufferTextureLayer( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ); +} +extern "C" { + pub fn glMapBufferRange( + target: GLenum, + offset: GLintptr, + length: GLsizeiptr, + access: GLbitfield, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn glFlushMappedBufferRange(target: GLenum, offset: GLintptr, length: GLsizeiptr); +} +extern "C" { + pub fn glBindVertexArray(array: GLuint); +} +extern "C" { + pub fn glDeleteVertexArrays(n: GLsizei, arrays: *const GLuint); +} +extern "C" { + pub fn glGenVertexArrays(n: GLsizei, arrays: *mut GLuint); +} +extern "C" { + pub fn glIsVertexArray(array: GLuint) -> GLboolean; +} +extern "C" { + pub fn glGetIntegeri_v(target: GLenum, index: GLuint, data: *mut GLint); +} +extern "C" { + pub fn glBeginTransformFeedback(primitiveMode: GLenum); +} +extern "C" { + pub fn glEndTransformFeedback(); +} +extern "C" { + pub fn glBindBufferRange( + target: GLenum, + index: GLuint, + buffer: GLuint, + offset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glBindBufferBase(target: GLenum, index: GLuint, buffer: GLuint); +} +extern "C" { + pub fn glTransformFeedbackVaryings( + program: GLuint, + count: GLsizei, + varyings: *const *const GLchar, + bufferMode: GLenum, + ); +} +extern "C" { + pub fn glGetTransformFeedbackVarying( + program: GLuint, + index: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + size: *mut GLsizei, + type_: *mut GLenum, + name: *mut GLchar, + ); +} +extern "C" { + pub fn glVertexAttribIPointer( + index: GLuint, + size: GLint, + type_: GLenum, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glGetVertexAttribIiv(index: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetVertexAttribIuiv(index: GLuint, pname: GLenum, params: *mut GLuint); +} +extern "C" { + pub fn glVertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint); +} +extern "C" { + pub fn glVertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint); +} +extern "C" { + pub fn glVertexAttribI4iv(index: GLuint, v: *const GLint); +} +extern "C" { + pub fn glVertexAttribI4uiv(index: GLuint, v: *const GLuint); +} +extern "C" { + pub fn glGetUniformuiv(program: GLuint, location: GLint, params: *mut GLuint); +} +extern "C" { + pub fn glGetFragDataLocation(program: GLuint, name: *const GLchar) -> GLint; +} +extern "C" { + pub fn glUniform1ui(location: GLint, v0: GLuint); +} +extern "C" { + pub fn glUniform2ui(location: GLint, v0: GLuint, v1: GLuint); +} +extern "C" { + pub fn glUniform3ui(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint); +} +extern "C" { + pub fn glUniform4ui(location: GLint, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint); +} +extern "C" { + pub fn glUniform1uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform2uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform3uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glUniform4uiv(location: GLint, count: GLsizei, value: *const GLuint); +} +extern "C" { + pub fn glClearBufferiv(buffer: GLenum, drawbuffer: GLint, value: *const GLint); +} +extern "C" { + pub fn glClearBufferuiv(buffer: GLenum, drawbuffer: GLint, value: *const GLuint); +} +extern "C" { + pub fn glClearBufferfv(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat); +} +extern "C" { + pub fn glClearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint); +} +extern "C" { + pub fn glGetStringi(name: GLenum, index: GLuint) -> *const GLubyte; +} +extern "C" { + pub fn glCopyBufferSubData( + readTarget: GLenum, + writeTarget: GLenum, + readOffset: GLintptr, + writeOffset: GLintptr, + size: GLsizeiptr, + ); +} +extern "C" { + pub fn glGetUniformIndices( + program: GLuint, + uniformCount: GLsizei, + uniformNames: *const *const GLchar, + uniformIndices: *mut GLuint, + ); +} +extern "C" { + pub fn glGetActiveUniformsiv( + program: GLuint, + uniformCount: GLsizei, + uniformIndices: *const GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetUniformBlockIndex(program: GLuint, uniformBlockName: *const GLchar) -> GLuint; +} +extern "C" { + pub fn glGetActiveUniformBlockiv( + program: GLuint, + uniformBlockIndex: GLuint, + pname: GLenum, + params: *mut GLint, + ); +} +extern "C" { + pub fn glGetActiveUniformBlockName( + program: GLuint, + uniformBlockIndex: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + uniformBlockName: *mut GLchar, + ); +} +extern "C" { + pub fn glUniformBlockBinding( + program: GLuint, + uniformBlockIndex: GLuint, + uniformBlockBinding: GLuint, + ); +} +extern "C" { + pub fn glDrawArraysInstanced( + mode: GLenum, + first: GLint, + count: GLsizei, + instancecount: GLsizei, + ); +} +extern "C" { + pub fn glDrawElementsInstanced( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + ); +} +extern "C" { + pub fn glFenceSync(condition: GLenum, flags: GLbitfield) -> GLsync; +} +extern "C" { + pub fn glIsSync(sync: GLsync) -> GLboolean; +} +extern "C" { + pub fn glDeleteSync(sync: GLsync); +} +extern "C" { + pub fn glClientWaitSync(sync: GLsync, flags: GLbitfield, timeout: GLuint64) -> GLenum; +} +extern "C" { + pub fn glWaitSync(sync: GLsync, flags: GLbitfield, timeout: GLuint64); +} +extern "C" { + pub fn glGetInteger64v(pname: GLenum, data: *mut GLint64); +} +extern "C" { + pub fn glGetSynciv( + sync: GLsync, + pname: GLenum, + bufSize: GLsizei, + length: *mut GLsizei, + values: *mut GLint, + ); +} +extern "C" { + pub fn glGetInteger64i_v(target: GLenum, index: GLuint, data: *mut GLint64); +} +extern "C" { + pub fn glGetBufferParameteri64v(target: GLenum, pname: GLenum, params: *mut GLint64); +} +extern "C" { + pub fn glGenSamplers(count: GLsizei, samplers: *mut GLuint); +} +extern "C" { + pub fn glDeleteSamplers(count: GLsizei, samplers: *const GLuint); +} +extern "C" { + pub fn glIsSampler(sampler: GLuint) -> GLboolean; +} +extern "C" { + pub fn glBindSampler(unit: GLuint, sampler: GLuint); +} +extern "C" { + pub fn glSamplerParameteri(sampler: GLuint, pname: GLenum, param: GLint); +} +extern "C" { + pub fn glSamplerParameteriv(sampler: GLuint, pname: GLenum, param: *const GLint); +} +extern "C" { + pub fn glSamplerParameterf(sampler: GLuint, pname: GLenum, param: GLfloat); +} +extern "C" { + pub fn glSamplerParameterfv(sampler: GLuint, pname: GLenum, param: *const GLfloat); +} +extern "C" { + pub fn glGetSamplerParameteriv(sampler: GLuint, pname: GLenum, params: *mut GLint); +} +extern "C" { + pub fn glGetSamplerParameterfv(sampler: GLuint, pname: GLenum, params: *mut GLfloat); +} +extern "C" { + pub fn glVertexAttribDivisor(index: GLuint, divisor: GLuint); +} +extern "C" { + pub fn glBindTransformFeedback(target: GLenum, id: GLuint); +} +extern "C" { + pub fn glDeleteTransformFeedbacks(n: GLsizei, ids: *const GLuint); +} +extern "C" { + pub fn glGenTransformFeedbacks(n: GLsizei, ids: *mut GLuint); +} +extern "C" { + pub fn glIsTransformFeedback(id: GLuint) -> GLboolean; +} +extern "C" { + pub fn glPauseTransformFeedback(); +} +extern "C" { + pub fn glResumeTransformFeedback(); +} +extern "C" { + pub fn glGetProgramBinary( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + binaryFormat: *mut GLenum, + binary: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn glProgramBinary( + program: GLuint, + binaryFormat: GLenum, + binary: *const ::std::os::raw::c_void, + length: GLsizei, + ); +} +extern "C" { + pub fn glProgramParameteri(program: GLuint, pname: GLenum, value: GLint); +} +extern "C" { + pub fn glInvalidateFramebuffer( + target: GLenum, + numAttachments: GLsizei, + attachments: *const GLenum, + ); +} +extern "C" { + pub fn glInvalidateSubFramebuffer( + target: GLenum, + numAttachments: GLsizei, + attachments: *const GLenum, + x: GLint, + y: GLint, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glTexStorage2D( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ); +} +extern "C" { + pub fn glTexStorage3D( + target: GLenum, + levels: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + ); +} +extern "C" { + pub fn glGetInternalformativ( + target: GLenum, + internalformat: GLenum, + pname: GLenum, + bufSize: GLsizei, + params: *mut GLint, + ); +} + +pub const RAND_MAX: u32 = 2147483647; +extern "C" { + pub fn rand() -> ::std::os::raw::c_int; + pub fn time() -> f32; +} + +pub type sapp_event_type = u32; +pub type sapp_mousebutton = i32; +pub type sapp_keycode = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_touchpoint { + pub identifier: usize, + pub pos_x: f32, + pub pos_y: f32, + pub changed: bool, +} + +pub const sapp_event_type_SAPP_EVENTTYPE_INVALID: sapp_event_type = 0; +pub const sapp_event_type_SAPP_EVENTTYPE_KEY_DOWN: sapp_event_type = 1; +pub const sapp_event_type_SAPP_EVENTTYPE_KEY_UP: sapp_event_type = 2; +pub const sapp_event_type_SAPP_EVENTTYPE_CHAR: sapp_event_type = 3; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_DOWN: sapp_event_type = 4; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_UP: sapp_event_type = 5; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_SCROLL: sapp_event_type = 6; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_MOVE: sapp_event_type = 7; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_ENTER: sapp_event_type = 8; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_LEAVE: sapp_event_type = 9; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_BEGAN: sapp_event_type = 10; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_MOVED: sapp_event_type = 11; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_ENDED: sapp_event_type = 12; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_CANCELLED: sapp_event_type = 13; +pub const sapp_event_type_SAPP_EVENTTYPE_RESIZED: sapp_event_type = 14; +pub const sapp_event_type_SAPP_EVENTTYPE_ICONIFIED: sapp_event_type = 15; +pub const sapp_event_type_SAPP_EVENTTYPE_RESTORED: sapp_event_type = 16; +pub const sapp_event_type_SAPP_EVENTTYPE_SUSPENDED: sapp_event_type = 17; +pub const sapp_event_type_SAPP_EVENTTYPE_RESUMED: sapp_event_type = 18; +pub const sapp_event_type_SAPP_EVENTTYPE_UPDATE_CURSOR: sapp_event_type = 19; +pub const sapp_event_type_SAPP_EVENTTYPE_QUIT_REQUESTED: sapp_event_type = 20; +pub const sapp_event_type__SAPP_EVENTTYPE_NUM: sapp_event_type = 21; +pub const sapp_event_type__SAPP_EVENTTYPE_FORCE_U32: sapp_event_type = 2147483647; + +pub const sapp_keycode_SAPP_KEYCODE_INVALID: sapp_keycode = 0; +pub const sapp_keycode_SAPP_KEYCODE_SPACE: sapp_keycode = 32; +pub const sapp_keycode_SAPP_KEYCODE_APOSTROPHE: sapp_keycode = 39; +pub const sapp_keycode_SAPP_KEYCODE_COMMA: sapp_keycode = 44; +pub const sapp_keycode_SAPP_KEYCODE_MINUS: sapp_keycode = 45; +pub const sapp_keycode_SAPP_KEYCODE_PERIOD: sapp_keycode = 46; +pub const sapp_keycode_SAPP_KEYCODE_SLASH: sapp_keycode = 47; +pub const sapp_keycode_SAPP_KEYCODE_0: sapp_keycode = 48; +pub const sapp_keycode_SAPP_KEYCODE_1: sapp_keycode = 49; +pub const sapp_keycode_SAPP_KEYCODE_2: sapp_keycode = 50; +pub const sapp_keycode_SAPP_KEYCODE_3: sapp_keycode = 51; +pub const sapp_keycode_SAPP_KEYCODE_4: sapp_keycode = 52; +pub const sapp_keycode_SAPP_KEYCODE_5: sapp_keycode = 53; +pub const sapp_keycode_SAPP_KEYCODE_6: sapp_keycode = 54; +pub const sapp_keycode_SAPP_KEYCODE_7: sapp_keycode = 55; +pub const sapp_keycode_SAPP_KEYCODE_8: sapp_keycode = 56; +pub const sapp_keycode_SAPP_KEYCODE_9: sapp_keycode = 57; +pub const sapp_keycode_SAPP_KEYCODE_SEMICOLON: sapp_keycode = 59; +pub const sapp_keycode_SAPP_KEYCODE_EQUAL: sapp_keycode = 61; +pub const sapp_keycode_SAPP_KEYCODE_A: sapp_keycode = 65; +pub const sapp_keycode_SAPP_KEYCODE_B: sapp_keycode = 66; +pub const sapp_keycode_SAPP_KEYCODE_C: sapp_keycode = 67; +pub const sapp_keycode_SAPP_KEYCODE_D: sapp_keycode = 68; +pub const sapp_keycode_SAPP_KEYCODE_E: sapp_keycode = 69; +pub const sapp_keycode_SAPP_KEYCODE_F: sapp_keycode = 70; +pub const sapp_keycode_SAPP_KEYCODE_G: sapp_keycode = 71; +pub const sapp_keycode_SAPP_KEYCODE_H: sapp_keycode = 72; +pub const sapp_keycode_SAPP_KEYCODE_I: sapp_keycode = 73; +pub const sapp_keycode_SAPP_KEYCODE_J: sapp_keycode = 74; +pub const sapp_keycode_SAPP_KEYCODE_K: sapp_keycode = 75; +pub const sapp_keycode_SAPP_KEYCODE_L: sapp_keycode = 76; +pub const sapp_keycode_SAPP_KEYCODE_M: sapp_keycode = 77; +pub const sapp_keycode_SAPP_KEYCODE_N: sapp_keycode = 78; +pub const sapp_keycode_SAPP_KEYCODE_O: sapp_keycode = 79; +pub const sapp_keycode_SAPP_KEYCODE_P: sapp_keycode = 80; +pub const sapp_keycode_SAPP_KEYCODE_Q: sapp_keycode = 81; +pub const sapp_keycode_SAPP_KEYCODE_R: sapp_keycode = 82; +pub const sapp_keycode_SAPP_KEYCODE_S: sapp_keycode = 83; +pub const sapp_keycode_SAPP_KEYCODE_T: sapp_keycode = 84; +pub const sapp_keycode_SAPP_KEYCODE_U: sapp_keycode = 85; +pub const sapp_keycode_SAPP_KEYCODE_V: sapp_keycode = 86; +pub const sapp_keycode_SAPP_KEYCODE_W: sapp_keycode = 87; +pub const sapp_keycode_SAPP_KEYCODE_X: sapp_keycode = 88; +pub const sapp_keycode_SAPP_KEYCODE_Y: sapp_keycode = 89; +pub const sapp_keycode_SAPP_KEYCODE_Z: sapp_keycode = 90; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_BRACKET: sapp_keycode = 91; +pub const sapp_keycode_SAPP_KEYCODE_BACKSLASH: sapp_keycode = 92; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_BRACKET: sapp_keycode = 93; +pub const sapp_keycode_SAPP_KEYCODE_GRAVE_ACCENT: sapp_keycode = 96; +pub const sapp_keycode_SAPP_KEYCODE_WORLD_1: sapp_keycode = 161; +pub const sapp_keycode_SAPP_KEYCODE_WORLD_2: sapp_keycode = 162; +pub const sapp_keycode_SAPP_KEYCODE_ESCAPE: sapp_keycode = 256; +pub const sapp_keycode_SAPP_KEYCODE_ENTER: sapp_keycode = 257; +pub const sapp_keycode_SAPP_KEYCODE_TAB: sapp_keycode = 258; +pub const sapp_keycode_SAPP_KEYCODE_BACKSPACE: sapp_keycode = 259; +pub const sapp_keycode_SAPP_KEYCODE_INSERT: sapp_keycode = 260; +pub const sapp_keycode_SAPP_KEYCODE_DELETE: sapp_keycode = 261; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT: sapp_keycode = 262; +pub const sapp_keycode_SAPP_KEYCODE_LEFT: sapp_keycode = 263; +pub const sapp_keycode_SAPP_KEYCODE_DOWN: sapp_keycode = 264; +pub const sapp_keycode_SAPP_KEYCODE_UP: sapp_keycode = 265; +pub const sapp_keycode_SAPP_KEYCODE_PAGE_UP: sapp_keycode = 266; +pub const sapp_keycode_SAPP_KEYCODE_PAGE_DOWN: sapp_keycode = 267; +pub const sapp_keycode_SAPP_KEYCODE_HOME: sapp_keycode = 268; +pub const sapp_keycode_SAPP_KEYCODE_END: sapp_keycode = 269; +pub const sapp_keycode_SAPP_KEYCODE_CAPS_LOCK: sapp_keycode = 280; +pub const sapp_keycode_SAPP_KEYCODE_SCROLL_LOCK: sapp_keycode = 281; +pub const sapp_keycode_SAPP_KEYCODE_NUM_LOCK: sapp_keycode = 282; +pub const sapp_keycode_SAPP_KEYCODE_PRINT_SCREEN: sapp_keycode = 283; +pub const sapp_keycode_SAPP_KEYCODE_PAUSE: sapp_keycode = 284; +pub const sapp_keycode_SAPP_KEYCODE_F1: sapp_keycode = 290; +pub const sapp_keycode_SAPP_KEYCODE_F2: sapp_keycode = 291; +pub const sapp_keycode_SAPP_KEYCODE_F3: sapp_keycode = 292; +pub const sapp_keycode_SAPP_KEYCODE_F4: sapp_keycode = 293; +pub const sapp_keycode_SAPP_KEYCODE_F5: sapp_keycode = 294; +pub const sapp_keycode_SAPP_KEYCODE_F6: sapp_keycode = 295; +pub const sapp_keycode_SAPP_KEYCODE_F7: sapp_keycode = 296; +pub const sapp_keycode_SAPP_KEYCODE_F8: sapp_keycode = 297; +pub const sapp_keycode_SAPP_KEYCODE_F9: sapp_keycode = 298; +pub const sapp_keycode_SAPP_KEYCODE_F10: sapp_keycode = 299; +pub const sapp_keycode_SAPP_KEYCODE_F11: sapp_keycode = 300; +pub const sapp_keycode_SAPP_KEYCODE_F12: sapp_keycode = 301; +pub const sapp_keycode_SAPP_KEYCODE_F13: sapp_keycode = 302; +pub const sapp_keycode_SAPP_KEYCODE_F14: sapp_keycode = 303; +pub const sapp_keycode_SAPP_KEYCODE_F15: sapp_keycode = 304; +pub const sapp_keycode_SAPP_KEYCODE_F16: sapp_keycode = 305; +pub const sapp_keycode_SAPP_KEYCODE_F17: sapp_keycode = 306; +pub const sapp_keycode_SAPP_KEYCODE_F18: sapp_keycode = 307; +pub const sapp_keycode_SAPP_KEYCODE_F19: sapp_keycode = 308; +pub const sapp_keycode_SAPP_KEYCODE_F20: sapp_keycode = 309; +pub const sapp_keycode_SAPP_KEYCODE_F21: sapp_keycode = 310; +pub const sapp_keycode_SAPP_KEYCODE_F22: sapp_keycode = 311; +pub const sapp_keycode_SAPP_KEYCODE_F23: sapp_keycode = 312; +pub const sapp_keycode_SAPP_KEYCODE_F24: sapp_keycode = 313; +pub const sapp_keycode_SAPP_KEYCODE_F25: sapp_keycode = 314; +pub const sapp_keycode_SAPP_KEYCODE_KP_0: sapp_keycode = 320; +pub const sapp_keycode_SAPP_KEYCODE_KP_1: sapp_keycode = 321; +pub const sapp_keycode_SAPP_KEYCODE_KP_2: sapp_keycode = 322; +pub const sapp_keycode_SAPP_KEYCODE_KP_3: sapp_keycode = 323; +pub const sapp_keycode_SAPP_KEYCODE_KP_4: sapp_keycode = 324; +pub const sapp_keycode_SAPP_KEYCODE_KP_5: sapp_keycode = 325; +pub const sapp_keycode_SAPP_KEYCODE_KP_6: sapp_keycode = 326; +pub const sapp_keycode_SAPP_KEYCODE_KP_7: sapp_keycode = 327; +pub const sapp_keycode_SAPP_KEYCODE_KP_8: sapp_keycode = 328; +pub const sapp_keycode_SAPP_KEYCODE_KP_9: sapp_keycode = 329; +pub const sapp_keycode_SAPP_KEYCODE_KP_DECIMAL: sapp_keycode = 330; +pub const sapp_keycode_SAPP_KEYCODE_KP_DIVIDE: sapp_keycode = 331; +pub const sapp_keycode_SAPP_KEYCODE_KP_MULTIPLY: sapp_keycode = 332; +pub const sapp_keycode_SAPP_KEYCODE_KP_SUBTRACT: sapp_keycode = 333; +pub const sapp_keycode_SAPP_KEYCODE_KP_ADD: sapp_keycode = 334; +pub const sapp_keycode_SAPP_KEYCODE_KP_ENTER: sapp_keycode = 335; +pub const sapp_keycode_SAPP_KEYCODE_KP_EQUAL: sapp_keycode = 336; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_SHIFT: sapp_keycode = 340; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_CONTROL: sapp_keycode = 341; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_ALT: sapp_keycode = 342; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_SUPER: sapp_keycode = 343; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_SHIFT: sapp_keycode = 344; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_CONTROL: sapp_keycode = 345; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_ALT: sapp_keycode = 346; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_SUPER: sapp_keycode = 347; +pub const sapp_keycode_SAPP_KEYCODE_MENU: sapp_keycode = 348; + +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_INVALID: sapp_mousebutton = -1; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_LEFT: sapp_mousebutton = 0; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_RIGHT: sapp_mousebutton = 1; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_MIDDLE: sapp_mousebutton = 2; + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_event { + pub frame_count: u64, + pub type_: sapp_event_type, + pub key_code: sapp_keycode, + pub char_code: u32, + pub key_repeat: bool, + pub modifiers: u32, + pub mouse_button: sapp_mousebutton, + pub mouse_x: f32, + pub mouse_y: f32, + pub scroll_x: f32, + pub scroll_y: f32, + pub num_touches: ::std::os::raw::c_int, + pub touches: [sapp_touchpoint; 8usize], + pub window_width: ::std::os::raw::c_int, + pub window_height: ::std::os::raw::c_int, + pub framebuffer_width: ::std::os::raw::c_int, + pub framebuffer_height: ::std::os::raw::c_int, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_desc { + pub init_cb: ::std::option::Option, + pub frame_cb: ::std::option::Option, + pub cleanup_cb: ::std::option::Option, + pub event_cb: ::std::option::Option, + pub fail_cb: ::std::option::Option, + pub user_data: *mut ::std::os::raw::c_void, + pub init_userdata_cb: + ::std::option::Option, + pub frame_userdata_cb: + ::std::option::Option, + pub cleanup_userdata_cb: + ::std::option::Option, + pub event_userdata_cb: ::std::option::Option< + unsafe extern "C" fn(arg1: *const sapp_event, arg2: *mut ::std::os::raw::c_void), + >, + pub fail_userdata_cb: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_void, + ), + >, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub sample_count: ::std::os::raw::c_int, + pub swap_interval: ::std::os::raw::c_int, + pub high_dpi: bool, + pub fullscreen: bool, + pub alpha: bool, + pub window_title: *const ::std::os::raw::c_char, + pub user_cursor: bool, + pub html5_canvas_name: *const ::std::os::raw::c_char, + pub html5_canvas_resize: bool, + pub html5_preserve_drawing_buffer: bool, + pub html5_premultiplied_alpha: bool, + pub html5_ask_leave_site: bool, + pub ios_keyboard_resizes_canvas: bool, + pub gl_force_gles2: bool, +} + +static mut SAPP_DESC: Option = None; +static mut USER_DATA: *mut ::std::os::raw::c_void = std::ptr::null_mut(); + +pub unsafe fn sapp_run(desc: *const sapp_desc) -> ::std::os::raw::c_int { + { + use std::panic; + use std::ffi::CString; + + panic::set_hook(Box::new(|info| { + let msg = CString::new(format!("{:?}", info)).unwrap_or_else(|_| + CString::new(format!("MALFORMED ERROR MESSAGE {:?}", info.location())).unwrap()); + test_log(msg.as_ptr()); + })); + } + + init_opengl(); + + USER_DATA = (&*desc).user_data; + + SAPP_DESC = Some(*desc); + SAPP_DESC.unwrap_or_else(|| panic!()).init_userdata_cb.unwrap_or_else(|| panic!())(USER_DATA); + + 0 +} + +pub unsafe fn sapp_width() -> ::std::os::raw::c_int { + canvas_width() +} +pub unsafe fn sapp_height() -> ::std::os::raw::c_int { + canvas_height() +} + +extern "C" { + pub fn init_opengl(); + pub fn canvas_width() -> i32; + pub fn canvas_height() -> i32; + pub fn test_log(msg: * const ::std::os::raw::c_char); +} + +pub fn console_log(msg: &str) { + use std::ffi::CString; + + let string = CString::new(msg).unwrap(); + unsafe { test_log(string.as_ptr()); } +} +#[no_mangle] +pub extern "C" fn frame() { + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .frame_userdata_cb.unwrap_or_else(|| panic!())(USER_DATA); } +} + +#[no_mangle] +pub extern "C" fn mouse_move(x: i32, y: i32) { + let mut event: sapp_event = unsafe { std::mem::zeroed() }; + + event.type_ = sapp_event_type_SAPP_EVENTTYPE_MOUSE_MOVE; + event.mouse_x = x as f32; + event.mouse_y = y as f32; + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .event_userdata_cb.unwrap_or_else(|| panic!())(&event as *const _, USER_DATA); } +} + +#[no_mangle] +pub extern "C" fn mouse_down(x: i32, y: i32, _btn: i32) { + let mut event: sapp_event = unsafe { std::mem::zeroed() }; + + event.type_ = sapp_event_type_SAPP_EVENTTYPE_MOUSE_DOWN; + event.mouse_x = x as f32; + event.mouse_y = y as f32; + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .event_userdata_cb.unwrap_or_else(|| panic!())(&event as *const _, USER_DATA); } +} + +#[no_mangle] +pub extern "C" fn mouse_up(x: i32, y: i32, _btn: i32) { + let mut event: sapp_event = unsafe { std::mem::zeroed() }; + + event.type_ = sapp_event_type_SAPP_EVENTTYPE_MOUSE_UP; + event.mouse_x = x as f32; + event.mouse_y = y as f32; + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .event_userdata_cb.unwrap_or_else(|| panic!())(&event as *const _, USER_DATA); } +} + + +#[no_mangle] +pub extern "C" fn key_down(key: u32) { + let mut event: sapp_event = unsafe { std::mem::zeroed() }; + + event.type_ = sapp_event_type_SAPP_EVENTTYPE_KEY_DOWN; + event.key_code = key; + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .event_userdata_cb.unwrap_or_else(|| panic!())(&event as *const _, USER_DATA); } +} + +#[no_mangle] +pub extern "C" fn key_up(key: u32) { + let mut event: sapp_event = unsafe { std::mem::zeroed() }; + + event.type_ = sapp_event_type_SAPP_EVENTTYPE_KEY_UP; + event.key_code = key; + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .event_userdata_cb.unwrap_or_else(|| panic!())(&event as *const _, USER_DATA); } +} + + + +#[no_mangle] +pub extern "C" fn resize(width: i32, height: i32) { + let mut event: sapp_event = unsafe { std::mem::zeroed() }; + + event.type_ = sapp_event_type_SAPP_EVENTTYPE_RESIZED; + event.window_width = width; + event.window_height = height; + unsafe { SAPP_DESC.unwrap_or_else(|| panic!()) + .event_userdata_cb.unwrap_or_else(|| panic!())(&event as *const _, USER_DATA); } +} diff --git a/sokol-app-sys/src/sokol_app_win.rs b/sokol-app-sys/src/sokol_app_win.rs new file mode 100644 index 00000000..270e46e9 --- /dev/null +++ b/sokol-app-sys/src/sokol_app_win.rs @@ -0,0 +1,42738 @@ +/* automatically generated by rust-bindgen */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit { + storage: Storage, + align: [Align; 0], +} +impl __BindgenBitfieldUnit { + #[inline] + pub const fn new(storage: Storage) -> Self { + Self { storage, align: [] } + } +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + *byte |= mask; + } else { + *byte &= !mask; + } + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } +} +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub unsafe fn as_ptr(&self) -> *const T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +impl ::std::clone::Clone for __IncompleteArrayField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +pub const SOKOL_APP_INCLUDED: u32 = 1; +pub const __MINGW64_VERSION_MAJOR: u32 = 7; +pub const __MINGW64_VERSION_MINOR: u32 = 0; +pub const __MINGW64_VERSION_BUGFIX: u32 = 0; +pub const __MINGW64_VERSION_RC: u32 = 0; +pub const __MINGW64_VERSION_STATE: &'static [u8; 6usize] = b"alpha\0"; +pub const __MINGW32_MAJOR_VERSION: u32 = 3; +pub const __MINGW32_MINOR_VERSION: u32 = 11; +pub const _M_AMD64: u32 = 100; +pub const _M_X64: u32 = 100; +pub const __: u32 = 1; +pub const __MINGW_USE_UNDERSCORE_PREFIX: u32 = 0; +pub const __MINGW_HAVE_ANSI_C99_PRINTF: u32 = 1; +pub const __MINGW_HAVE_WIDE_C99_PRINTF: u32 = 1; +pub const __MINGW_HAVE_ANSI_C99_SCANF: u32 = 1; +pub const __MINGW_HAVE_WIDE_C99_SCANF: u32 = 1; +pub const __MINGW_SEC_WARN_STR : & 'static [ u8 ; 92usize ] = b"This function or variable may be unsafe, use _CRT_SECURE_NO_WARNINGS to disable deprecation\0" ; +pub const __MINGW_MSVC2005_DEPREC_STR : & 'static [ u8 ; 117usize ] = b"This POSIX function is deprecated beginning in Visual C++ 2005, use _CRT_NONSTDC_NO_DEPRECATE to disable deprecation\0" ; +pub const __MINGW_FORTIFY_LEVEL: u32 = 0; +pub const __MINGW_FORTIFY_VA_ARG: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT: u32 = 0; +pub const _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY: u32 = 0; +pub const __USE_CRTIMP: u32 = 1; +pub const USE___UUIDOF: u32 = 0; +pub const __CRT__NO_INLINE: u32 = 1; +pub const __MSVCRT_VERSION__: u32 = 1792; +pub const _WIN32_WINNT: u32 = 1282; +pub const MINGW_HAS_SECURE_API: u32 = 1; +pub const __STDC_SECURE_LIB__: u32 = 200411; +pub const __GOT_SECURE_LIB__: u32 = 200411; +pub const __MINGW_HAS_DXSDK: u32 = 1; +pub const MINGW_HAS_DDRAW_H: u32 = 1; +pub const MINGW_DDRAW_VERSION: u32 = 7; +pub const MINGW_HAS_DDK_H: u32 = 1; +pub const _CRT_PACKING: u32 = 8; +pub const _SECURECRT_FILL_BUFFER_PATTERN: u32 = 253; +pub const _ARGMAX: u32 = 100; +pub const __USE_MINGW_ANSI_STDIO: u32 = 0; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT64_MIN: i64 = -9223372036854775808; +pub const INT8_MAX: u32 = 127; +pub const INT16_MAX: u32 = 32767; +pub const INT32_MAX: u32 = 2147483647; +pub const INT64_MAX: u64 = 9223372036854775807; +pub const UINT8_MAX: u32 = 255; +pub const UINT16_MAX: u32 = 65535; +pub const UINT32_MAX: u32 = 4294967295; +pub const UINT64_MAX: i32 = -1; +pub const INT_LEAST8_MIN: i32 = -128; +pub const INT_LEAST16_MIN: i32 = -32768; +pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST64_MIN: i64 = -9223372036854775808; +pub const INT_LEAST8_MAX: u32 = 127; +pub const INT_LEAST16_MAX: u32 = 32767; +pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const INT_LEAST64_MAX: u64 = 9223372036854775807; +pub const UINT_LEAST8_MAX: u32 = 255; +pub const UINT_LEAST16_MAX: u32 = 65535; +pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const UINT_LEAST64_MAX: i32 = -1; +pub const INT_FAST8_MIN: i32 = -128; +pub const INT_FAST16_MIN: i32 = -32768; +pub const INT_FAST32_MIN: i32 = -2147483648; +pub const INT_FAST64_MIN: i64 = -9223372036854775808; +pub const INT_FAST8_MAX: u32 = 127; +pub const INT_FAST16_MAX: u32 = 32767; +pub const INT_FAST32_MAX: u32 = 2147483647; +pub const INT_FAST64_MAX: u64 = 9223372036854775807; +pub const UINT_FAST8_MAX: u32 = 255; +pub const UINT_FAST16_MAX: u32 = 65535; +pub const UINT_FAST32_MAX: u32 = 4294967295; +pub const UINT_FAST64_MAX: i32 = -1; +pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const UINTPTR_MAX: i32 = -1; +pub const INTMAX_MIN: i64 = -9223372036854775808; +pub const INTMAX_MAX: u64 = 9223372036854775807; +pub const UINTMAX_MAX: i32 = -1; +pub const PTRDIFF_MIN: i64 = -9223372036854775808; +pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIG_ATOMIC_MIN: i32 = -2147483648; +pub const SIG_ATOMIC_MAX: u32 = 2147483647; +pub const SIZE_MAX: i32 = -1; +pub const WCHAR_MIN: u32 = 0; +pub const WCHAR_MAX: u32 = 65535; +pub const WINT_MIN: u32 = 0; +pub const WINT_MAX: u32 = 65535; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const SOKOL_APP_IMPL_INCLUDED: u32 = 1; +pub const _NLSCMPERROR: u32 = 2147483647; +pub const SOKOL_DEBUG: u32 = 1; +pub const PATH_MAX: u32 = 260; +pub const CHAR_BIT: u32 = 8; +pub const SCHAR_MIN: i32 = -128; +pub const SCHAR_MAX: u32 = 127; +pub const UCHAR_MAX: u32 = 255; +pub const CHAR_MIN: i32 = -128; +pub const CHAR_MAX: u32 = 127; +pub const MB_LEN_MAX: u32 = 5; +pub const SHRT_MIN: i32 = -32768; +pub const SHRT_MAX: u32 = 32767; +pub const USHRT_MAX: u32 = 65535; +pub const INT_MIN: i32 = -2147483648; +pub const INT_MAX: u32 = 2147483647; +pub const UINT_MAX: u32 = 4294967295; +pub const LONG_MIN: i32 = -2147483648; +pub const LONG_MAX: u32 = 2147483647; +pub const ULONG_MAX: u32 = 4294967295; +pub const LLONG_MAX: u64 = 9223372036854775807; +pub const LLONG_MIN: i64 = -9223372036854775808; +pub const ULLONG_MAX: i32 = -1; +pub const _I8_MIN: i32 = -128; +pub const _I8_MAX: u32 = 127; +pub const _UI8_MAX: u32 = 255; +pub const _I16_MIN: i32 = -32768; +pub const _I16_MAX: u32 = 32767; +pub const _UI16_MAX: u32 = 65535; +pub const _I32_MIN: i32 = -2147483648; +pub const _I32_MAX: u32 = 2147483647; +pub const _UI32_MAX: u32 = 4294967295; +pub const LONG_LONG_MAX: u64 = 9223372036854775807; +pub const LONG_LONG_MIN: i64 = -9223372036854775808; +pub const ULONG_LONG_MAX: i32 = -1; +pub const _I64_MIN: i64 = -9223372036854775808; +pub const _I64_MAX: u64 = 9223372036854775807; +pub const _UI64_MAX: i32 = -1; +pub const SSIZE_MAX: u64 = 9223372036854775807; +pub const EXIT_SUCCESS: u32 = 0; +pub const EXIT_FAILURE: u32 = 1; +pub const RAND_MAX: u32 = 32767; +pub const _MAX_PATH: u32 = 260; +pub const _MAX_DRIVE: u32 = 3; +pub const _MAX_DIR: u32 = 256; +pub const _MAX_FNAME: u32 = 256; +pub const _MAX_EXT: u32 = 256; +pub const _OUT_TO_DEFAULT: u32 = 0; +pub const _OUT_TO_STDERR: u32 = 1; +pub const _OUT_TO_MSGBOX: u32 = 2; +pub const _REPORT_ERRMODE: u32 = 3; +pub const _WRITE_ABORT_MSG: u32 = 1; +pub const _CALL_REPORTFAULT: u32 = 2; +pub const _MAX_ENV: u32 = 32767; +pub const _CVTBUFSIZE: u32 = 349; +pub const _HEAP_MAXREQ: i32 = -32; +pub const _HEAPEMPTY: i32 = -1; +pub const _HEAPOK: i32 = -2; +pub const _HEAPBADBEGIN: i32 = -3; +pub const _HEAPBADNODE: i32 = -4; +pub const _HEAPEND: i32 = -5; +pub const _HEAPBADPTR: i32 = -6; +pub const _FREEENTRY: u32 = 0; +pub const _USEDENTRY: u32 = 1; +pub const _MAX_WAIT_MALLOC_CRT: u32 = 60000; +pub const _ALLOCA_S_THRESHOLD: u32 = 1024; +pub const _ALLOCA_S_STACK_MARKER: u32 = 52428; +pub const _ALLOCA_S_HEAP_MARKER: u32 = 56797; +pub const _ALLOCA_S_MARKER_SIZE: u32 = 16; +pub const BUFSIZ: u32 = 512; +pub const _NSTREAM_: u32 = 512; +pub const _IOB_ENTRIES: u32 = 20; +pub const EOF: i32 = -1; +pub const _P_tmpdir: &'static [u8; 2usize] = b"\\\0"; +pub const _wP_tmpdir: &'static [u8; 2usize] = b"\\\0"; +pub const SEEK_CUR: u32 = 1; +pub const SEEK_END: u32 = 2; +pub const SEEK_SET: u32 = 0; +pub const STDIN_FILENO: u32 = 0; +pub const STDOUT_FILENO: u32 = 1; +pub const STDERR_FILENO: u32 = 2; +pub const FILENAME_MAX: u32 = 260; +pub const FOPEN_MAX: u32 = 20; +pub const _SYS_OPEN: u32 = 20; +pub const TMP_MAX: u32 = 32767; +pub const _IOREAD: u32 = 1; +pub const _IOWRT: u32 = 2; +pub const _IOFBF: u32 = 0; +pub const _IOLBF: u32 = 64; +pub const _IONBF: u32 = 4; +pub const _IOMYBUF: u32 = 8; +pub const _IOEOF: u32 = 16; +pub const _IOERR: u32 = 32; +pub const _IOSTRG: u32 = 64; +pub const _IORW: u32 = 128; +pub const _TWO_DIGIT_EXPONENT: u32 = 1; +pub const P_tmpdir: &'static [u8; 2usize] = b"\\\0"; +pub const SYS_OPEN: u32 = 20; +pub const _P_WAIT: u32 = 0; +pub const _P_NOWAIT: u32 = 1; +pub const _OLD_P_OVERLAY: u32 = 2; +pub const _P_NOWAITO: u32 = 3; +pub const _P_DETACH: u32 = 4; +pub const _P_OVERLAY: u32 = 2; +pub const _WAIT_CHILD: u32 = 0; +pub const _WAIT_GRANDCHILD: u32 = 1; +pub const _WIN32_WINNT_NT4: u32 = 1024; +pub const _WIN32_WINNT_WIN2K: u32 = 1280; +pub const _WIN32_WINNT_WINXP: u32 = 1281; +pub const _WIN32_WINNT_WS03: u32 = 1282; +pub const _WIN32_WINNT_WIN6: u32 = 1536; +pub const _WIN32_WINNT_VISTA: u32 = 1536; +pub const _WIN32_WINNT_WS08: u32 = 1536; +pub const _WIN32_WINNT_LONGHORN: u32 = 1536; +pub const _WIN32_WINNT_WIN7: u32 = 1537; +pub const _WIN32_WINNT_WIN8: u32 = 1538; +pub const _WIN32_WINNT_WINBLUE: u32 = 1539; +pub const _WIN32_WINNT_WINTHRESHOLD: u32 = 2560; +pub const _WIN32_WINNT_WIN10: u32 = 2560; +pub const _WIN32_IE_IE20: u32 = 512; +pub const _WIN32_IE_IE30: u32 = 768; +pub const _WIN32_IE_IE302: u32 = 770; +pub const _WIN32_IE_IE40: u32 = 1024; +pub const _WIN32_IE_IE401: u32 = 1025; +pub const _WIN32_IE_IE50: u32 = 1280; +pub const _WIN32_IE_IE501: u32 = 1281; +pub const _WIN32_IE_IE55: u32 = 1360; +pub const _WIN32_IE_IE60: u32 = 1536; +pub const _WIN32_IE_IE60SP1: u32 = 1537; +pub const _WIN32_IE_IE60SP2: u32 = 1539; +pub const _WIN32_IE_IE70: u32 = 1792; +pub const _WIN32_IE_IE80: u32 = 2048; +pub const _WIN32_IE_IE90: u32 = 2304; +pub const _WIN32_IE_IE100: u32 = 2560; +pub const _WIN32_IE_IE110: u32 = 2560; +pub const _WIN32_IE_NT4: u32 = 512; +pub const _WIN32_IE_NT4SP1: u32 = 512; +pub const _WIN32_IE_NT4SP2: u32 = 512; +pub const _WIN32_IE_NT4SP3: u32 = 770; +pub const _WIN32_IE_NT4SP4: u32 = 1025; +pub const _WIN32_IE_NT4SP5: u32 = 1025; +pub const _WIN32_IE_NT4SP6: u32 = 1280; +pub const _WIN32_IE_WIN98: u32 = 1025; +pub const _WIN32_IE_WIN98SE: u32 = 1280; +pub const _WIN32_IE_WINME: u32 = 1360; +pub const _WIN32_IE_WIN2K: u32 = 1281; +pub const _WIN32_IE_WIN2KSP1: u32 = 1281; +pub const _WIN32_IE_WIN2KSP2: u32 = 1281; +pub const _WIN32_IE_WIN2KSP3: u32 = 1281; +pub const _WIN32_IE_WIN2KSP4: u32 = 1281; +pub const _WIN32_IE_XP: u32 = 1536; +pub const _WIN32_IE_XPSP1: u32 = 1537; +pub const _WIN32_IE_XPSP2: u32 = 1539; +pub const _WIN32_IE_WS03: u32 = 1538; +pub const _WIN32_IE_WS03SP1: u32 = 1539; +pub const _WIN32_IE_WIN6: u32 = 1792; +pub const _WIN32_IE_LONGHORN: u32 = 1792; +pub const _WIN32_IE_WIN7: u32 = 2048; +pub const _WIN32_IE_WIN8: u32 = 2560; +pub const _WIN32_IE_WINBLUE: u32 = 2560; +pub const _WIN32_IE_WINTHRESHOLD: u32 = 2560; +pub const _WIN32_IE_WIN10: u32 = 2560; +pub const NTDDI_WIN2K: u32 = 83886080; +pub const NTDDI_WIN2KSP1: u32 = 83886336; +pub const NTDDI_WIN2KSP2: u32 = 83886592; +pub const NTDDI_WIN2KSP3: u32 = 83886848; +pub const NTDDI_WIN2KSP4: u32 = 83887104; +pub const NTDDI_WINXP: u32 = 83951616; +pub const NTDDI_WINXPSP1: u32 = 83951872; +pub const NTDDI_WINXPSP2: u32 = 83952128; +pub const NTDDI_WINXPSP3: u32 = 83952384; +pub const NTDDI_WINXPSP4: u32 = 83952640; +pub const NTDDI_WS03: u32 = 84017152; +pub const NTDDI_WS03SP1: u32 = 84017408; +pub const NTDDI_WS03SP2: u32 = 84017664; +pub const NTDDI_WS03SP3: u32 = 84017920; +pub const NTDDI_WS03SP4: u32 = 84018176; +pub const NTDDI_WIN6: u32 = 100663296; +pub const NTDDI_WIN6SP1: u32 = 100663552; +pub const NTDDI_WIN6SP2: u32 = 100663808; +pub const NTDDI_WIN6SP3: u32 = 100664064; +pub const NTDDI_WIN6SP4: u32 = 100664320; +pub const NTDDI_VISTA: u32 = 100663296; +pub const NTDDI_VISTASP1: u32 = 100663552; +pub const NTDDI_VISTASP2: u32 = 100663808; +pub const NTDDI_VISTASP3: u32 = 100664064; +pub const NTDDI_VISTASP4: u32 = 100664320; +pub const NTDDI_LONGHORN: u32 = 100663296; +pub const NTDDI_WS08: u32 = 100663552; +pub const NTDDI_WS08SP2: u32 = 100663808; +pub const NTDDI_WS08SP3: u32 = 100664064; +pub const NTDDI_WS08SP4: u32 = 100664320; +pub const NTDDI_WIN7: u32 = 100728832; +pub const NTDDI_WIN8: u32 = 100794368; +pub const NTDDI_WINBLUE: u32 = 100859904; +pub const NTDDI_WINTHRESHOLD: u32 = 167772160; +pub const NTDDI_WIN10: u32 = 167772160; +pub const NTDDI_WIN10_TH2: u32 = 167772161; +pub const NTDDI_WIN10_RS1: u32 = 167772162; +pub const NTDDI_WIN10_RS2: u32 = 167772163; +pub const NTDDI_WIN10_RS3: u32 = 167772164; +pub const NTDDI_WIN10_RS4: u32 = 167772165; +pub const NTDDI_WIN10_RS5: u32 = 167772166; +pub const NTDDI_WIN10_19H1: u32 = 167772167; +pub const OSVERSION_MASK: u32 = 4294901760; +pub const SPVERSION_MASK: u32 = 65280; +pub const SUBVERSION_MASK: u32 = 255; +pub const WINVER: u32 = 1282; +pub const _WIN32_IE: u32 = 1538; +pub const ExceptionContinueExecution: u32 = 0; +pub const ExceptionContinueSearch: u32 = 1; +pub const ExceptionNestedException: u32 = 2; +pub const ExceptionCollidedUnwind: u32 = 3; +pub const ExceptionExecuteHandler: u32 = 4; +pub const EXCEPTION_EXECUTE_HANDLER: u32 = 1; +pub const EXCEPTION_CONTINUE_SEARCH: u32 = 0; +pub const EXCEPTION_CONTINUE_EXECUTION: i32 = -1; +pub const WINAPI_PARTITION_DESKTOP: u32 = 1; +pub const WINAPI_PARTITION_APP: u32 = 2; +pub const WINAPI_FAMILY_APP: u32 = 2; +pub const WINAPI_FAMILY_DESKTOP_APP: u32 = 3; +pub const WINAPI_FAMILY: u32 = 3; +pub const __STDC_WANT_SECURE_LIB__: u32 = 0; +pub const STRICT: u32 = 1; +pub const MAX_PATH: u32 = 260; +pub const FALSE: u32 = 0; +pub const TRUE: u32 = 1; +pub const _INC_CRT_UNICODE_MACROS: u32 = 2; +pub const __MINGW_PROCNAMEEXT_AW: &'static [u8; 2usize] = b"A\0"; +pub const _UPPER: u32 = 1; +pub const _LOWER: u32 = 2; +pub const _DIGIT: u32 = 4; +pub const _SPACE: u32 = 8; +pub const _PUNCT: u32 = 16; +pub const _CONTROL: u32 = 32; +pub const _BLANK: u32 = 64; +pub const _HEX: u32 = 128; +pub const _LEADBYTE: u32 = 32768; +pub const _ALPHA: u32 = 259; +pub const API_SET_PREFIX_NAME_A: &'static [u8; 5usize] = b"API-\0"; +pub const API_SET_PREFIX_NAME_U: &'static [u8; 5usize] = b"API-\0"; +pub const API_SET_EXTENSION_NAME_A: &'static [u8; 5usize] = b"EXT-\0"; +pub const API_SET_EXTENSION_NAME_U: &'static [u8; 5usize] = b"EXT-\0"; +pub const API_SET_SECTION_NAME: &'static [u8; 8usize] = b".apiset\0"; +pub const API_SET_SCHEMA_SUFFIX: &'static [u8; 5usize] = b".sys\0"; +pub const API_SET_LOAD_SCHEMA_ORDINAL: u32 = 1; +pub const API_SET_LOOKUP_ORDINAL: u32 = 2; +pub const API_SET_RELEASE_SCHEMA_ORDINAL: u32 = 3; +pub const ANYSIZE_ARRAY: u32 = 1; +pub const __FLAGCONSTRAINT: &'static [u8; 6usize] = b"=@ccc\0"; +pub const MEMORY_ALLOCATION_ALIGNMENT: u32 = 16; +pub const ADDRESS_TAG_BIT: u64 = 4398046511104; +pub const SYSTEM_CACHE_ALIGNMENT_SIZE: u32 = 64; +pub const PRAGMA_DEPRECATED_DDK: u32 = 0; +pub const APPLICATION_ERROR_MASK: u32 = 536870912; +pub const ERROR_SEVERITY_SUCCESS: u32 = 0; +pub const ERROR_SEVERITY_INFORMATIONAL: u32 = 1073741824; +pub const ERROR_SEVERITY_WARNING: u32 = 2147483648; +pub const ERROR_SEVERITY_ERROR: u32 = 3221225472; +pub const MAXLONGLONG: u64 = 9223372036854775807; +pub const UNICODE_STRING_MAX_CHARS: u32 = 32767; +pub const MINCHAR: u32 = 128; +pub const MAXCHAR: u32 = 127; +pub const MINSHORT: u32 = 32768; +pub const MAXSHORT: u32 = 32767; +pub const MINLONG: u32 = 2147483648; +pub const MAXLONG: u32 = 2147483647; +pub const MAXBYTE: u32 = 255; +pub const MAXWORD: u32 = 65535; +pub const MAXDWORD: u32 = 4294967295; +pub const VER_WORKSTATION_NT: u32 = 1073741824; +pub const VER_SERVER_NT: u32 = 2147483648; +pub const VER_SUITE_SMALLBUSINESS: u32 = 1; +pub const VER_SUITE_ENTERPRISE: u32 = 2; +pub const VER_SUITE_BACKOFFICE: u32 = 4; +pub const VER_SUITE_COMMUNICATIONS: u32 = 8; +pub const VER_SUITE_TERMINAL: u32 = 16; +pub const VER_SUITE_SMALLBUSINESS_RESTRICTED: u32 = 32; +pub const VER_SUITE_EMBEDDEDNT: u32 = 64; +pub const VER_SUITE_DATACENTER: u32 = 128; +pub const VER_SUITE_SINGLEUSERTS: u32 = 256; +pub const VER_SUITE_PERSONAL: u32 = 512; +pub const VER_SUITE_BLADE: u32 = 1024; +pub const VER_SUITE_EMBEDDED_RESTRICTED: u32 = 2048; +pub const VER_SUITE_SECURITY_APPLIANCE: u32 = 4096; +pub const VER_SUITE_STORAGE_SERVER: u32 = 8192; +pub const VER_SUITE_COMPUTE_SERVER: u32 = 16384; +pub const VER_SUITE_WH_SERVER: u32 = 32768; +pub const PRODUCT_UNDEFINED: u32 = 0; +pub const PRODUCT_ULTIMATE: u32 = 1; +pub const PRODUCT_HOME_BASIC: u32 = 2; +pub const PRODUCT_HOME_PREMIUM: u32 = 3; +pub const PRODUCT_ENTERPRISE: u32 = 4; +pub const PRODUCT_HOME_BASIC_N: u32 = 5; +pub const PRODUCT_BUSINESS: u32 = 6; +pub const PRODUCT_STANDARD_SERVER: u32 = 7; +pub const PRODUCT_DATACENTER_SERVER: u32 = 8; +pub const PRODUCT_SMALLBUSINESS_SERVER: u32 = 9; +pub const PRODUCT_ENTERPRISE_SERVER: u32 = 10; +pub const PRODUCT_STARTER: u32 = 11; +pub const PRODUCT_DATACENTER_SERVER_CORE: u32 = 12; +pub const PRODUCT_STANDARD_SERVER_CORE: u32 = 13; +pub const PRODUCT_ENTERPRISE_SERVER_CORE: u32 = 14; +pub const PRODUCT_ENTERPRISE_SERVER_IA64: u32 = 15; +pub const PRODUCT_BUSINESS_N: u32 = 16; +pub const PRODUCT_WEB_SERVER: u32 = 17; +pub const PRODUCT_CLUSTER_SERVER: u32 = 18; +pub const PRODUCT_HOME_SERVER: u32 = 19; +pub const PRODUCT_STORAGE_EXPRESS_SERVER: u32 = 20; +pub const PRODUCT_STORAGE_STANDARD_SERVER: u32 = 21; +pub const PRODUCT_STORAGE_WORKGROUP_SERVER: u32 = 22; +pub const PRODUCT_STORAGE_ENTERPRISE_SERVER: u32 = 23; +pub const PRODUCT_SERVER_FOR_SMALLBUSINESS: u32 = 24; +pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: u32 = 25; +pub const PRODUCT_HOME_PREMIUM_N: u32 = 26; +pub const PRODUCT_ENTERPRISE_N: u32 = 27; +pub const PRODUCT_ULTIMATE_N: u32 = 28; +pub const PRODUCT_WEB_SERVER_CORE: u32 = 29; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT: u32 = 30; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY: u32 = 31; +pub const PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING: u32 = 32; +pub const PRODUCT_SERVER_FOUNDATION: u32 = 33; +pub const PRODUCT_HOME_PREMIUM_SERVER: u32 = 34; +pub const PRODUCT_SERVER_FOR_SMALLBUSINESS_V: u32 = 35; +pub const PRODUCT_STANDARD_SERVER_V: u32 = 36; +pub const PRODUCT_DATACENTER_SERVER_V: u32 = 37; +pub const PRODUCT_SERVER_V: u32 = 37; +pub const PRODUCT_ENTERPRISE_SERVER_V: u32 = 38; +pub const PRODUCT_DATACENTER_SERVER_CORE_V: u32 = 39; +pub const PRODUCT_STANDARD_SERVER_CORE_V: u32 = 40; +pub const PRODUCT_ENTERPRISE_SERVER_CORE_V: u32 = 41; +pub const PRODUCT_HYPERV: u32 = 42; +pub const PRODUCT_STORAGE_EXPRESS_SERVER_CORE: u32 = 43; +pub const PRODUCT_STORAGE_STANDARD_SERVER_CORE: u32 = 44; +pub const PRODUCT_STORAGE_WORKGROUP_SERVER_CORE: u32 = 45; +pub const PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE: u32 = 46; +pub const PRODUCT_STARTER_N: u32 = 47; +pub const PRODUCT_PROFESSIONAL: u32 = 48; +pub const PRODUCT_PROFESSIONAL_N: u32 = 49; +pub const PRODUCT_SB_SOLUTION_SERVER: u32 = 50; +pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS: u32 = 51; +pub const PRODUCT_STANDARD_SERVER_SOLUTIONS: u32 = 52; +pub const PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE: u32 = 53; +pub const PRODUCT_SB_SOLUTION_SERVER_EM: u32 = 54; +pub const PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM: u32 = 55; +pub const PRODUCT_SOLUTION_EMBEDDEDSERVER: u32 = 56; +pub const PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE: u32 = 57; +pub const PRODUCT_PROFESSIONAL_EMBEDDED: u32 = 58; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT: u32 = 59; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL: u32 = 60; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC: u32 = 61; +pub const PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC: u32 = 62; +pub const PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE: u32 = 63; +pub const PRODUCT_CLUSTER_SERVER_V: u32 = 64; +pub const PRODUCT_EMBEDDED: u32 = 65; +pub const PRODUCT_STARTER_E: u32 = 66; +pub const PRODUCT_HOME_BASIC_E: u32 = 67; +pub const PRODUCT_HOME_PREMIUM_E: u32 = 68; +pub const PRODUCT_PROFESSIONAL_E: u32 = 69; +pub const PRODUCT_ENTERPRISE_E: u32 = 70; +pub const PRODUCT_ULTIMATE_E: u32 = 71; +pub const PRODUCT_ENTERPRISE_EVALUATION: u32 = 72; +pub const PRODUCT_MULTIPOINT_STANDARD_SERVER: u32 = 76; +pub const PRODUCT_MULTIPOINT_PREMIUM_SERVER: u32 = 77; +pub const PRODUCT_STANDARD_EVALUATION_SERVER: u32 = 79; +pub const PRODUCT_DATACENTER_EVALUATION_SERVER: u32 = 80; +pub const PRODUCT_ENTERPRISE_N_EVALUATION: u32 = 84; +pub const PRODUCT_EMBEDDED_AUTOMOTIVE: u32 = 85; +pub const PRODUCT_EMBEDDED_INDUSTRY_A: u32 = 86; +pub const PRODUCT_THINPC: u32 = 87; +pub const PRODUCT_EMBEDDED_A: u32 = 88; +pub const PRODUCT_EMBEDDED_INDUSTRY: u32 = 89; +pub const PRODUCT_EMBEDDED_E: u32 = 90; +pub const PRODUCT_EMBEDDED_INDUSTRY_E: u32 = 91; +pub const PRODUCT_EMBEDDED_INDUSTRY_A_E: u32 = 92; +pub const PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER: u32 = 95; +pub const PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER: u32 = 96; +pub const PRODUCT_CORE_ARM: u32 = 97; +pub const PRODUCT_CORE_N: u32 = 98; +pub const PRODUCT_CORE_COUNTRYSPECIFIC: u32 = 99; +pub const PRODUCT_CORE_SINGLELANGUAGE: u32 = 100; +pub const PRODUCT_CORE_LANGUAGESPECIFIC: u32 = 100; +pub const PRODUCT_CORE: u32 = 101; +pub const PRODUCT_PROFESSIONAL_WMC: u32 = 103; +pub const PRODUCT_MOBILE_CORE: u32 = 104; +pub const PRODUCT_EMBEDDED_INDUSTRY_EVAL: u32 = 105; +pub const PRODUCT_EMBEDDED_INDUSTRY_E_EVAL: u32 = 106; +pub const PRODUCT_EMBEDDED_EVAL: u32 = 107; +pub const PRODUCT_EMBEDDED_E_EVAL: u32 = 108; +pub const PRODUCT_NANO_SERVER: u32 = 109; +pub const PRODUCT_CLOUD_STORAGE_SERVER: u32 = 110; +pub const PRODUCT_CORE_CONNECTED: u32 = 111; +pub const PRODUCT_PROFESSIONAL_STUDENT: u32 = 112; +pub const PRODUCT_CORE_CONNECTED_N: u32 = 113; +pub const PRODUCT_PROFESSIONAL_STUDENT_N: u32 = 114; +pub const PRODUCT_CORE_CONNECTED_SINGLELANGUAGE: u32 = 115; +pub const PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC: u32 = 116; +pub const PRODUCT_CONNECTED_CAR: u32 = 117; +pub const PRODUCT_INDUSTRY_HANDHELD: u32 = 118; +pub const PRODUCT_PPI_PRO: u32 = 119; +pub const PRODUCT_ARM64_SERVER: u32 = 120; +pub const PRODUCT_EDUCATION: u32 = 121; +pub const PRODUCT_EDUCATION_N: u32 = 122; +pub const PRODUCT_IOTUAP: u32 = 123; +pub const PRODUCT_CLOUD_HOST_INFRASTRUCTURE_SERVER: u32 = 124; +pub const PRODUCT_ENTERPRISE_S: u32 = 125; +pub const PRODUCT_ENTERPRISE_S_N: u32 = 126; +pub const PRODUCT_PROFESSIONAL_S: u32 = 127; +pub const PRODUCT_PROFESSIONAL_S_N: u32 = 128; +pub const PRODUCT_ENTERPRISE_S_EVALUATION: u32 = 129; +pub const PRODUCT_ENTERPRISE_S_N_EVALUATION: u32 = 130; +pub const PRODUCT_MOBILE_ENTERPRISE: u32 = 133; +pub const PRODUCT_UNLICENSED: u32 = 2882382797; +pub const LANG_NEUTRAL: u32 = 0; +pub const LANG_INVARIANT: u32 = 127; +pub const LANG_AFRIKAANS: u32 = 54; +pub const LANG_ALBANIAN: u32 = 28; +pub const LANG_ALSATIAN: u32 = 132; +pub const LANG_AMHARIC: u32 = 94; +pub const LANG_ARABIC: u32 = 1; +pub const LANG_ARMENIAN: u32 = 43; +pub const LANG_ASSAMESE: u32 = 77; +pub const LANG_AZERI: u32 = 44; +pub const LANG_AZERBAIJANI: u32 = 44; +pub const LANG_BANGLA: u32 = 69; +pub const LANG_BASHKIR: u32 = 109; +pub const LANG_BASQUE: u32 = 45; +pub const LANG_BELARUSIAN: u32 = 35; +pub const LANG_BENGALI: u32 = 69; +pub const LANG_BRETON: u32 = 126; +pub const LANG_BOSNIAN: u32 = 26; +pub const LANG_BOSNIAN_NEUTRAL: u32 = 30746; +pub const LANG_BULGARIAN: u32 = 2; +pub const LANG_CATALAN: u32 = 3; +pub const LANG_CENTRAL_KURDISH: u32 = 146; +pub const LANG_CHEROKEE: u32 = 92; +pub const LANG_CHINESE: u32 = 4; +pub const LANG_CHINESE_SIMPLIFIED: u32 = 4; +pub const LANG_CHINESE_TRADITIONAL: u32 = 31748; +pub const LANG_CORSICAN: u32 = 131; +pub const LANG_CROATIAN: u32 = 26; +pub const LANG_CZECH: u32 = 5; +pub const LANG_DANISH: u32 = 6; +pub const LANG_DARI: u32 = 140; +pub const LANG_DIVEHI: u32 = 101; +pub const LANG_DUTCH: u32 = 19; +pub const LANG_ENGLISH: u32 = 9; +pub const LANG_ESTONIAN: u32 = 37; +pub const LANG_FAEROESE: u32 = 56; +pub const LANG_FARSI: u32 = 41; +pub const LANG_FILIPINO: u32 = 100; +pub const LANG_FINNISH: u32 = 11; +pub const LANG_FRENCH: u32 = 12; +pub const LANG_FRISIAN: u32 = 98; +pub const LANG_FULAH: u32 = 103; +pub const LANG_GALICIAN: u32 = 86; +pub const LANG_GEORGIAN: u32 = 55; +pub const LANG_GERMAN: u32 = 7; +pub const LANG_GREEK: u32 = 8; +pub const LANG_GREENLANDIC: u32 = 111; +pub const LANG_GUJARATI: u32 = 71; +pub const LANG_HAUSA: u32 = 104; +pub const LANG_HEBREW: u32 = 13; +pub const LANG_HINDI: u32 = 57; +pub const LANG_HUNGARIAN: u32 = 14; +pub const LANG_ICELANDIC: u32 = 15; +pub const LANG_IGBO: u32 = 112; +pub const LANG_INDONESIAN: u32 = 33; +pub const LANG_INUKTITUT: u32 = 93; +pub const LANG_IRISH: u32 = 60; +pub const LANG_ITALIAN: u32 = 16; +pub const LANG_JAPANESE: u32 = 17; +pub const LANG_KANNADA: u32 = 75; +pub const LANG_KASHMIRI: u32 = 96; +pub const LANG_KAZAK: u32 = 63; +pub const LANG_KHMER: u32 = 83; +pub const LANG_KICHE: u32 = 134; +pub const LANG_KINYARWANDA: u32 = 135; +pub const LANG_KONKANI: u32 = 87; +pub const LANG_KOREAN: u32 = 18; +pub const LANG_KYRGYZ: u32 = 64; +pub const LANG_LAO: u32 = 84; +pub const LANG_LATVIAN: u32 = 38; +pub const LANG_LITHUANIAN: u32 = 39; +pub const LANG_LOWER_SORBIAN: u32 = 46; +pub const LANG_LUXEMBOURGISH: u32 = 110; +pub const LANG_MACEDONIAN: u32 = 47; +pub const LANG_MALAY: u32 = 62; +pub const LANG_MALAYALAM: u32 = 76; +pub const LANG_MALTESE: u32 = 58; +pub const LANG_MANIPURI: u32 = 88; +pub const LANG_MAORI: u32 = 129; +pub const LANG_MAPUDUNGUN: u32 = 122; +pub const LANG_MARATHI: u32 = 78; +pub const LANG_MOHAWK: u32 = 124; +pub const LANG_MONGOLIAN: u32 = 80; +pub const LANG_NEPALI: u32 = 97; +pub const LANG_NORWEGIAN: u32 = 20; +pub const LANG_OCCITAN: u32 = 130; +pub const LANG_ODIA: u32 = 72; +pub const LANG_ORIYA: u32 = 72; +pub const LANG_PASHTO: u32 = 99; +pub const LANG_PERSIAN: u32 = 41; +pub const LANG_POLISH: u32 = 21; +pub const LANG_PORTUGUESE: u32 = 22; +pub const LANG_PULAR: u32 = 103; +pub const LANG_PUNJABI: u32 = 70; +pub const LANG_QUECHUA: u32 = 107; +pub const LANG_ROMANIAN: u32 = 24; +pub const LANG_ROMANSH: u32 = 23; +pub const LANG_RUSSIAN: u32 = 25; +pub const LANG_SAKHA: u32 = 133; +pub const LANG_SAMI: u32 = 59; +pub const LANG_SANSKRIT: u32 = 79; +pub const LANG_SCOTTISH_GAELIC: u32 = 145; +pub const LANG_SERBIAN: u32 = 26; +pub const LANG_SERBIAN_NEUTRAL: u32 = 31770; +pub const LANG_SINDHI: u32 = 89; +pub const LANG_SINHALESE: u32 = 91; +pub const LANG_SLOVAK: u32 = 27; +pub const LANG_SLOVENIAN: u32 = 36; +pub const LANG_SOTHO: u32 = 108; +pub const LANG_SPANISH: u32 = 10; +pub const LANG_SWAHILI: u32 = 65; +pub const LANG_SWEDISH: u32 = 29; +pub const LANG_SYRIAC: u32 = 90; +pub const LANG_TAJIK: u32 = 40; +pub const LANG_TAMAZIGHT: u32 = 95; +pub const LANG_TAMIL: u32 = 73; +pub const LANG_TATAR: u32 = 68; +pub const LANG_TELUGU: u32 = 74; +pub const LANG_THAI: u32 = 30; +pub const LANG_TIBETAN: u32 = 81; +pub const LANG_TIGRIGNA: u32 = 115; +pub const LANG_TIGRINYA: u32 = 115; +pub const LANG_TSWANA: u32 = 50; +pub const LANG_TURKISH: u32 = 31; +pub const LANG_TURKMEN: u32 = 66; +pub const LANG_UIGHUR: u32 = 128; +pub const LANG_UKRAINIAN: u32 = 34; +pub const LANG_UPPER_SORBIAN: u32 = 46; +pub const LANG_URDU: u32 = 32; +pub const LANG_UZBEK: u32 = 67; +pub const LANG_VALENCIAN: u32 = 3; +pub const LANG_VIETNAMESE: u32 = 42; +pub const LANG_WELSH: u32 = 82; +pub const LANG_WOLOF: u32 = 136; +pub const LANG_XHOSA: u32 = 52; +pub const LANG_YAKUT: u32 = 133; +pub const LANG_YI: u32 = 120; +pub const LANG_YORUBA: u32 = 106; +pub const LANG_ZULU: u32 = 53; +pub const SUBLANG_NEUTRAL: u32 = 0; +pub const SUBLANG_DEFAULT: u32 = 1; +pub const SUBLANG_SYS_DEFAULT: u32 = 2; +pub const SUBLANG_CUSTOM_DEFAULT: u32 = 3; +pub const SUBLANG_CUSTOM_UNSPECIFIED: u32 = 4; +pub const SUBLANG_UI_CUSTOM_DEFAULT: u32 = 5; +pub const SUBLANG_AFRIKAANS_SOUTH_AFRICA: u32 = 1; +pub const SUBLANG_ALBANIAN_ALBANIA: u32 = 1; +pub const SUBLANG_ALSATIAN_FRANCE: u32 = 1; +pub const SUBLANG_AMHARIC_ETHIOPIA: u32 = 1; +pub const SUBLANG_ARABIC_SAUDI_ARABIA: u32 = 1; +pub const SUBLANG_ARABIC_IRAQ: u32 = 2; +pub const SUBLANG_ARABIC_EGYPT: u32 = 3; +pub const SUBLANG_ARABIC_LIBYA: u32 = 4; +pub const SUBLANG_ARABIC_ALGERIA: u32 = 5; +pub const SUBLANG_ARABIC_MOROCCO: u32 = 6; +pub const SUBLANG_ARABIC_TUNISIA: u32 = 7; +pub const SUBLANG_ARABIC_OMAN: u32 = 8; +pub const SUBLANG_ARABIC_YEMEN: u32 = 9; +pub const SUBLANG_ARABIC_SYRIA: u32 = 10; +pub const SUBLANG_ARABIC_JORDAN: u32 = 11; +pub const SUBLANG_ARABIC_LEBANON: u32 = 12; +pub const SUBLANG_ARABIC_KUWAIT: u32 = 13; +pub const SUBLANG_ARABIC_UAE: u32 = 14; +pub const SUBLANG_ARABIC_BAHRAIN: u32 = 15; +pub const SUBLANG_ARABIC_QATAR: u32 = 16; +pub const SUBLANG_ARMENIAN_ARMENIA: u32 = 1; +pub const SUBLANG_ASSAMESE_INDIA: u32 = 1; +pub const SUBLANG_AZERI_LATIN: u32 = 1; +pub const SUBLANG_AZERI_CYRILLIC: u32 = 2; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN: u32 = 1; +pub const SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC: u32 = 2; +pub const SUBLANG_BANGLA_INDIA: u32 = 1; +pub const SUBLANG_BANGLA_BANGLADESH: u32 = 2; +pub const SUBLANG_BASHKIR_RUSSIA: u32 = 1; +pub const SUBLANG_BASQUE_BASQUE: u32 = 1; +pub const SUBLANG_BELARUSIAN_BELARUS: u32 = 1; +pub const SUBLANG_BENGALI_INDIA: u32 = 1; +pub const SUBLANG_BENGALI_BANGLADESH: u32 = 2; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN: u32 = 5; +pub const SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC: u32 = 8; +pub const SUBLANG_BRETON_FRANCE: u32 = 1; +pub const SUBLANG_BULGARIAN_BULGARIA: u32 = 1; +pub const SUBLANG_CATALAN_CATALAN: u32 = 1; +pub const SUBLANG_CENTRAL_KURDISH_IRAQ: u32 = 1; +pub const SUBLANG_CHEROKEE_CHEROKEE: u32 = 1; +pub const SUBLANG_CHINESE_TRADITIONAL: u32 = 1; +pub const SUBLANG_CHINESE_SIMPLIFIED: u32 = 2; +pub const SUBLANG_CHINESE_HONGKONG: u32 = 3; +pub const SUBLANG_CHINESE_SINGAPORE: u32 = 4; +pub const SUBLANG_CHINESE_MACAU: u32 = 5; +pub const SUBLANG_CORSICAN_FRANCE: u32 = 1; +pub const SUBLANG_CZECH_CZECH_REPUBLIC: u32 = 1; +pub const SUBLANG_CROATIAN_CROATIA: u32 = 1; +pub const SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN: u32 = 4; +pub const SUBLANG_DANISH_DENMARK: u32 = 1; +pub const SUBLANG_DARI_AFGHANISTAN: u32 = 1; +pub const SUBLANG_DIVEHI_MALDIVES: u32 = 1; +pub const SUBLANG_DUTCH: u32 = 1; +pub const SUBLANG_DUTCH_BELGIAN: u32 = 2; +pub const SUBLANG_ENGLISH_US: u32 = 1; +pub const SUBLANG_ENGLISH_UK: u32 = 2; +pub const SUBLANG_ENGLISH_AUS: u32 = 3; +pub const SUBLANG_ENGLISH_CAN: u32 = 4; +pub const SUBLANG_ENGLISH_NZ: u32 = 5; +pub const SUBLANG_ENGLISH_IRELAND: u32 = 6; +pub const SUBLANG_ENGLISH_EIRE: u32 = 6; +pub const SUBLANG_ENGLISH_SOUTH_AFRICA: u32 = 7; +pub const SUBLANG_ENGLISH_JAMAICA: u32 = 8; +pub const SUBLANG_ENGLISH_CARIBBEAN: u32 = 9; +pub const SUBLANG_ENGLISH_BELIZE: u32 = 10; +pub const SUBLANG_ENGLISH_TRINIDAD: u32 = 11; +pub const SUBLANG_ENGLISH_ZIMBABWE: u32 = 12; +pub const SUBLANG_ENGLISH_PHILIPPINES: u32 = 13; +pub const SUBLANG_ENGLISH_INDIA: u32 = 16; +pub const SUBLANG_ENGLISH_MALAYSIA: u32 = 17; +pub const SUBLANG_ENGLISH_SINGAPORE: u32 = 18; +pub const SUBLANG_ESTONIAN_ESTONIA: u32 = 1; +pub const SUBLANG_FAEROESE_FAROE_ISLANDS: u32 = 1; +pub const SUBLANG_FILIPINO_PHILIPPINES: u32 = 1; +pub const SUBLANG_FINNISH_FINLAND: u32 = 1; +pub const SUBLANG_FRENCH: u32 = 1; +pub const SUBLANG_FRENCH_BELGIAN: u32 = 2; +pub const SUBLANG_FRENCH_CANADIAN: u32 = 3; +pub const SUBLANG_FRENCH_SWISS: u32 = 4; +pub const SUBLANG_FRENCH_LUXEMBOURG: u32 = 5; +pub const SUBLANG_FRENCH_MONACO: u32 = 6; +pub const SUBLANG_FRISIAN_NETHERLANDS: u32 = 1; +pub const SUBLANG_FULAH_SENEGAL: u32 = 2; +pub const SUBLANG_GALICIAN_GALICIAN: u32 = 1; +pub const SUBLANG_GEORGIAN_GEORGIA: u32 = 1; +pub const SUBLANG_GERMAN: u32 = 1; +pub const SUBLANG_GERMAN_SWISS: u32 = 2; +pub const SUBLANG_GERMAN_AUSTRIAN: u32 = 3; +pub const SUBLANG_GERMAN_LUXEMBOURG: u32 = 4; +pub const SUBLANG_GERMAN_LIECHTENSTEIN: u32 = 5; +pub const SUBLANG_GREEK_GREECE: u32 = 1; +pub const SUBLANG_GREENLANDIC_GREENLAND: u32 = 1; +pub const SUBLANG_GUJARATI_INDIA: u32 = 1; +pub const SUBLANG_HAUSA_NIGERIA_LATIN: u32 = 1; +pub const SUBLANG_HAUSA_NIGERIA: u32 = 1; +pub const SUBLANG_HAWAIIAN_US: u32 = 1; +pub const SUBLANG_HEBREW_ISRAEL: u32 = 1; +pub const SUBLANG_HINDI_INDIA: u32 = 1; +pub const SUBLANG_HUNGARIAN_HUNGARY: u32 = 1; +pub const SUBLANG_ICELANDIC_ICELAND: u32 = 1; +pub const SUBLANG_IGBO_NIGERIA: u32 = 1; +pub const SUBLANG_INDONESIAN_INDONESIA: u32 = 1; +pub const SUBLANG_INUKTITUT_CANADA: u32 = 1; +pub const SUBLANG_INUKTITUT_CANADA_LATIN: u32 = 2; +pub const SUBLANG_IRISH_IRELAND: u32 = 2; +pub const SUBLANG_ITALIAN: u32 = 1; +pub const SUBLANG_ITALIAN_SWISS: u32 = 2; +pub const SUBLANG_JAPANESE_JAPAN: u32 = 1; +pub const SUBLANG_KANNADA_INDIA: u32 = 1; +pub const SUBLANG_KASHMIRI_INDIA: u32 = 2; +pub const SUBLANG_KASHMIRI_SASIA: u32 = 2; +pub const SUBLANG_KAZAK_KAZAKHSTAN: u32 = 1; +pub const SUBLANG_KHMER_CAMBODIA: u32 = 1; +pub const SUBLANG_KICHE_GUATEMALA: u32 = 1; +pub const SUBLANG_KINYARWANDA_RWANDA: u32 = 1; +pub const SUBLANG_KONKANI_INDIA: u32 = 1; +pub const SUBLANG_KOREAN: u32 = 1; +pub const SUBLANG_KYRGYZ_KYRGYZSTAN: u32 = 1; +pub const SUBLANG_LAO_LAO: u32 = 1; +pub const SUBLANG_LAO_LAO_PDR: u32 = 1; +pub const SUBLANG_LATVIAN_LATVIA: u32 = 1; +pub const SUBLANG_LITHUANIAN: u32 = 1; +pub const SUBLANG_LOWER_SORBIAN_GERMANY: u32 = 2; +pub const SUBLANG_LUXEMBOURGISH_LUXEMBOURG: u32 = 1; +pub const SUBLANG_MACEDONIAN_MACEDONIA: u32 = 1; +pub const SUBLANG_MALAY_MALAYSIA: u32 = 1; +pub const SUBLANG_MALAY_BRUNEI_DARUSSALAM: u32 = 2; +pub const SUBLANG_MALAYALAM_INDIA: u32 = 1; +pub const SUBLANG_MALTESE_MALTA: u32 = 1; +pub const SUBLANG_MAORI_NEW_ZEALAND: u32 = 1; +pub const SUBLANG_MAPUDUNGUN_CHILE: u32 = 1; +pub const SUBLANG_MARATHI_INDIA: u32 = 1; +pub const SUBLANG_MOHAWK_MOHAWK: u32 = 1; +pub const SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA: u32 = 1; +pub const SUBLANG_MONGOLIAN_PRC: u32 = 2; +pub const SUBLANG_NEPALI_NEPAL: u32 = 1; +pub const SUBLANG_NEPALI_INDIA: u32 = 2; +pub const SUBLANG_NORWEGIAN_BOKMAL: u32 = 1; +pub const SUBLANG_NORWEGIAN_NYNORSK: u32 = 2; +pub const SUBLANG_OCCITAN_FRANCE: u32 = 1; +pub const SUBLANG_ORIYA_INDIA: u32 = 1; +pub const SUBLANG_PASHTO_AFGHANISTAN: u32 = 1; +pub const SUBLANG_PERSIAN_IRAN: u32 = 1; +pub const SUBLANG_POLISH_POLAND: u32 = 1; +pub const SUBLANG_PORTUGUESE_BRAZILIAN: u32 = 1; +pub const SUBLANG_PORTUGUESE: u32 = 2; +pub const SUBLANG_PULAR_SENEGAL: u32 = 2; +pub const SUBLANG_PUNJABI_INDIA: u32 = 1; +pub const SUBLANG_PUNJABI_PAKISTAN: u32 = 2; +pub const SUBLANG_QUECHUA_BOLIVIA: u32 = 1; +pub const SUBLANG_QUECHUA_ECUADOR: u32 = 2; +pub const SUBLANG_QUECHUA_PERU: u32 = 3; +pub const SUBLANG_ROMANIAN_ROMANIA: u32 = 1; +pub const SUBLANG_ROMANSH_SWITZERLAND: u32 = 1; +pub const SUBLANG_RUSSIAN_RUSSIA: u32 = 1; +pub const SUBLANG_SAKHA_RUSSIA: u32 = 1; +pub const SUBLANG_SAMI_NORTHERN_NORWAY: u32 = 1; +pub const SUBLANG_SAMI_NORTHERN_SWEDEN: u32 = 2; +pub const SUBLANG_SAMI_NORTHERN_FINLAND: u32 = 3; +pub const SUBLANG_SAMI_LULE_NORWAY: u32 = 4; +pub const SUBLANG_SAMI_LULE_SWEDEN: u32 = 5; +pub const SUBLANG_SAMI_SOUTHERN_NORWAY: u32 = 6; +pub const SUBLANG_SAMI_SOUTHERN_SWEDEN: u32 = 7; +pub const SUBLANG_SAMI_SKOLT_FINLAND: u32 = 8; +pub const SUBLANG_SAMI_INARI_FINLAND: u32 = 9; +pub const SUBLANG_SANSKRIT_INDIA: u32 = 1; +pub const SUBLANG_SCOTTISH_GAELIC: u32 = 1; +pub const SUBLANG_SERBIAN_LATIN: u32 = 2; +pub const SUBLANG_SERBIAN_CYRILLIC: u32 = 3; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN: u32 = 6; +pub const SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC: u32 = 7; +pub const SUBLANG_SERBIAN_MONTENEGRO_LATIN: u32 = 11; +pub const SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC: u32 = 12; +pub const SUBLANG_SERBIAN_SERBIA_LATIN: u32 = 9; +pub const SUBLANG_SERBIAN_SERBIA_CYRILLIC: u32 = 10; +pub const SUBLANG_SINDHI_INDIA: u32 = 1; +pub const SUBLANG_SINDHI_AFGHANISTAN: u32 = 2; +pub const SUBLANG_SINDHI_PAKISTAN: u32 = 2; +pub const SUBLANG_SINHALESE_SRI_LANKA: u32 = 1; +pub const SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA: u32 = 1; +pub const SUBLANG_SLOVAK_SLOVAKIA: u32 = 1; +pub const SUBLANG_SLOVENIAN_SLOVENIA: u32 = 1; +pub const SUBLANG_SPANISH: u32 = 1; +pub const SUBLANG_SPANISH_MEXICAN: u32 = 2; +pub const SUBLANG_SPANISH_MODERN: u32 = 3; +pub const SUBLANG_SPANISH_GUATEMALA: u32 = 4; +pub const SUBLANG_SPANISH_COSTA_RICA: u32 = 5; +pub const SUBLANG_SPANISH_PANAMA: u32 = 6; +pub const SUBLANG_SPANISH_DOMINICAN_REPUBLIC: u32 = 7; +pub const SUBLANG_SPANISH_VENEZUELA: u32 = 8; +pub const SUBLANG_SPANISH_COLOMBIA: u32 = 9; +pub const SUBLANG_SPANISH_PERU: u32 = 10; +pub const SUBLANG_SPANISH_ARGENTINA: u32 = 11; +pub const SUBLANG_SPANISH_ECUADOR: u32 = 12; +pub const SUBLANG_SPANISH_CHILE: u32 = 13; +pub const SUBLANG_SPANISH_URUGUAY: u32 = 14; +pub const SUBLANG_SPANISH_PARAGUAY: u32 = 15; +pub const SUBLANG_SPANISH_BOLIVIA: u32 = 16; +pub const SUBLANG_SPANISH_EL_SALVADOR: u32 = 17; +pub const SUBLANG_SPANISH_HONDURAS: u32 = 18; +pub const SUBLANG_SPANISH_NICARAGUA: u32 = 19; +pub const SUBLANG_SPANISH_PUERTO_RICO: u32 = 20; +pub const SUBLANG_SPANISH_US: u32 = 21; +pub const SUBLANG_SWAHILI_KENYA: u32 = 1; +pub const SUBLANG_SWEDISH: u32 = 1; +pub const SUBLANG_SWEDISH_FINLAND: u32 = 2; +pub const SUBLANG_SYRIAC: u32 = 1; +pub const SUBLANG_SYRIAC_SYRIA: u32 = 1; +pub const SUBLANG_TAJIK_TAJIKISTAN: u32 = 1; +pub const SUBLANG_TAMAZIGHT_ALGERIA_LATIN: u32 = 2; +pub const SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH: u32 = 4; +pub const SUBLANG_TAMIL_INDIA: u32 = 1; +pub const SUBLANG_TAMIL_SRI_LANKA: u32 = 2; +pub const SUBLANG_TATAR_RUSSIA: u32 = 1; +pub const SUBLANG_TELUGU_INDIA: u32 = 1; +pub const SUBLANG_THAI_THAILAND: u32 = 1; +pub const SUBLANG_TIBETAN_PRC: u32 = 1; +pub const SUBLANG_TIBETAN_BHUTAN: u32 = 2; +pub const SUBLANG_TIGRIGNA_ERITREA: u32 = 2; +pub const SUBLANG_TIGRINYA_ERITREA: u32 = 2; +pub const SUBLANG_TIGRINYA_ETHIOPIA: u32 = 1; +pub const SUBLANG_TSWANA_BOTSWANA: u32 = 2; +pub const SUBLANG_TSWANA_SOUTH_AFRICA: u32 = 1; +pub const SUBLANG_TURKISH_TURKEY: u32 = 1; +pub const SUBLANG_TURKMEN_TURKMENISTAN: u32 = 1; +pub const SUBLANG_UIGHUR_PRC: u32 = 1; +pub const SUBLANG_UKRAINIAN_UKRAINE: u32 = 1; +pub const SUBLANG_UPPER_SORBIAN_GERMANY: u32 = 1; +pub const SUBLANG_URDU_PAKISTAN: u32 = 1; +pub const SUBLANG_URDU_INDIA: u32 = 2; +pub const SUBLANG_UZBEK_LATIN: u32 = 1; +pub const SUBLANG_UZBEK_CYRILLIC: u32 = 2; +pub const SUBLANG_VALENCIAN_VALENCIA: u32 = 2; +pub const SUBLANG_VIETNAMESE_VIETNAM: u32 = 1; +pub const SUBLANG_WELSH_UNITED_KINGDOM: u32 = 1; +pub const SUBLANG_WOLOF_SENEGAL: u32 = 1; +pub const SUBLANG_YORUBA_NIGERIA: u32 = 1; +pub const SUBLANG_XHOSA_SOUTH_AFRICA: u32 = 1; +pub const SUBLANG_YAKUT_RUSSIA: u32 = 1; +pub const SUBLANG_YI_PRC: u32 = 1; +pub const SUBLANG_ZULU_SOUTH_AFRICA: u32 = 1; +pub const SORT_DEFAULT: u32 = 0; +pub const SORT_INVARIANT_MATH: u32 = 1; +pub const SORT_JAPANESE_XJIS: u32 = 0; +pub const SORT_JAPANESE_UNICODE: u32 = 1; +pub const SORT_JAPANESE_RADICALSTROKE: u32 = 4; +pub const SORT_CHINESE_BIG5: u32 = 0; +pub const SORT_CHINESE_PRCP: u32 = 0; +pub const SORT_CHINESE_UNICODE: u32 = 1; +pub const SORT_CHINESE_PRC: u32 = 2; +pub const SORT_CHINESE_BOPOMOFO: u32 = 3; +pub const SORT_CHINESE_RADICALSTROKE: u32 = 4; +pub const SORT_KOREAN_KSC: u32 = 0; +pub const SORT_KOREAN_UNICODE: u32 = 1; +pub const SORT_GERMAN_PHONE_BOOK: u32 = 1; +pub const SORT_HUNGARIAN_DEFAULT: u32 = 0; +pub const SORT_HUNGARIAN_TECHNICAL: u32 = 1; +pub const SORT_GEORGIAN_TRADITIONAL: u32 = 0; +pub const SORT_GEORGIAN_MODERN: u32 = 1; +pub const NLS_VALID_LOCALE_MASK: u32 = 1048575; +pub const LOCALE_NAME_MAX_LENGTH: u32 = 85; +pub const MAXIMUM_WAIT_OBJECTS: u32 = 64; +pub const MAXIMUM_SUSPEND_COUNT: u32 = 127; +pub const _MM_HINT_ET0: u32 = 7; +pub const _MM_HINT_ET1: u32 = 6; +pub const _MM_HINT_T0: u32 = 3; +pub const _MM_HINT_T1: u32 = 2; +pub const _MM_HINT_T2: u32 = 1; +pub const _MM_HINT_NTA: u32 = 0; +pub const _MM_EXCEPT_INVALID: u32 = 1; +pub const _MM_EXCEPT_DENORM: u32 = 2; +pub const _MM_EXCEPT_DIV_ZERO: u32 = 4; +pub const _MM_EXCEPT_OVERFLOW: u32 = 8; +pub const _MM_EXCEPT_UNDERFLOW: u32 = 16; +pub const _MM_EXCEPT_INEXACT: u32 = 32; +pub const _MM_EXCEPT_MASK: u32 = 63; +pub const _MM_MASK_INVALID: u32 = 128; +pub const _MM_MASK_DENORM: u32 = 256; +pub const _MM_MASK_DIV_ZERO: u32 = 512; +pub const _MM_MASK_OVERFLOW: u32 = 1024; +pub const _MM_MASK_UNDERFLOW: u32 = 2048; +pub const _MM_MASK_INEXACT: u32 = 4096; +pub const _MM_MASK_MASK: u32 = 8064; +pub const _MM_ROUND_NEAREST: u32 = 0; +pub const _MM_ROUND_DOWN: u32 = 8192; +pub const _MM_ROUND_UP: u32 = 16384; +pub const _MM_ROUND_TOWARD_ZERO: u32 = 24576; +pub const _MM_ROUND_MASK: u32 = 24576; +pub const _MM_FLUSH_ZERO_MASK: u32 = 32768; +pub const _MM_FLUSH_ZERO_ON: u32 = 32768; +pub const _MM_FLUSH_ZERO_OFF: u32 = 0; +pub const _MM_DENORMALS_ZERO_ON: u32 = 64; +pub const _MM_DENORMALS_ZERO_OFF: u32 = 0; +pub const _MM_DENORMALS_ZERO_MASK: u32 = 64; +pub const _MM_FROUND_TO_NEAREST_INT: u32 = 0; +pub const _MM_FROUND_TO_NEG_INF: u32 = 1; +pub const _MM_FROUND_TO_POS_INF: u32 = 2; +pub const _MM_FROUND_TO_ZERO: u32 = 3; +pub const _MM_FROUND_CUR_DIRECTION: u32 = 4; +pub const _MM_FROUND_RAISE_EXC: u32 = 0; +pub const _MM_FROUND_NO_EXC: u32 = 8; +pub const _MM_FROUND_NINT: u32 = 0; +pub const _MM_FROUND_FLOOR: u32 = 1; +pub const _MM_FROUND_CEIL: u32 = 2; +pub const _MM_FROUND_TRUNC: u32 = 3; +pub const _MM_FROUND_RINT: u32 = 4; +pub const _MM_FROUND_NEARBYINT: u32 = 12; +pub const _SIDD_UBYTE_OPS: u32 = 0; +pub const _SIDD_UWORD_OPS: u32 = 1; +pub const _SIDD_SBYTE_OPS: u32 = 2; +pub const _SIDD_SWORD_OPS: u32 = 3; +pub const _SIDD_CMP_EQUAL_ANY: u32 = 0; +pub const _SIDD_CMP_RANGES: u32 = 4; +pub const _SIDD_CMP_EQUAL_EACH: u32 = 8; +pub const _SIDD_CMP_EQUAL_ORDERED: u32 = 12; +pub const _SIDD_POSITIVE_POLARITY: u32 = 0; +pub const _SIDD_NEGATIVE_POLARITY: u32 = 16; +pub const _SIDD_MASKED_POSITIVE_POLARITY: u32 = 32; +pub const _SIDD_MASKED_NEGATIVE_POLARITY: u32 = 48; +pub const _SIDD_LEAST_SIGNIFICANT: u32 = 0; +pub const _SIDD_MOST_SIGNIFICANT: u32 = 64; +pub const _SIDD_BIT_MASK: u32 = 0; +pub const _SIDD_UNIT_MASK: u32 = 64; +pub const _CMP_EQ_OQ: u32 = 0; +pub const _CMP_LT_OS: u32 = 1; +pub const _CMP_LE_OS: u32 = 2; +pub const _CMP_UNORD_Q: u32 = 3; +pub const _CMP_NEQ_UQ: u32 = 4; +pub const _CMP_NLT_US: u32 = 5; +pub const _CMP_NLE_US: u32 = 6; +pub const _CMP_ORD_Q: u32 = 7; +pub const _CMP_EQ_UQ: u32 = 8; +pub const _CMP_NGE_US: u32 = 9; +pub const _CMP_NGT_US: u32 = 10; +pub const _CMP_FALSE_OQ: u32 = 11; +pub const _CMP_NEQ_OQ: u32 = 12; +pub const _CMP_GE_OS: u32 = 13; +pub const _CMP_GT_OS: u32 = 14; +pub const _CMP_TRUE_UQ: u32 = 15; +pub const _CMP_EQ_OS: u32 = 16; +pub const _CMP_LT_OQ: u32 = 17; +pub const _CMP_LE_OQ: u32 = 18; +pub const _CMP_UNORD_S: u32 = 19; +pub const _CMP_NEQ_US: u32 = 20; +pub const _CMP_NLT_UQ: u32 = 21; +pub const _CMP_NLE_UQ: u32 = 22; +pub const _CMP_ORD_S: u32 = 23; +pub const _CMP_EQ_US: u32 = 24; +pub const _CMP_NGE_UQ: u32 = 25; +pub const _CMP_NGT_UQ: u32 = 26; +pub const _CMP_FALSE_OS: u32 = 27; +pub const _CMP_NEQ_OS: u32 = 28; +pub const _CMP_GE_OQ: u32 = 29; +pub const _CMP_GT_OQ: u32 = 30; +pub const _CMP_TRUE_US: u32 = 31; +pub const _XBEGIN_STARTED: i32 = -1; +pub const _XABORT_EXPLICIT: u32 = 1; +pub const _XABORT_RETRY: u32 = 2; +pub const _XABORT_CONFLICT: u32 = 4; +pub const _XABORT_CAPACITY: u32 = 8; +pub const _XABORT_DEBUG: u32 = 16; +pub const _XABORT_NESTED: u32 = 32; +pub const __PCONFIG_KEY_PROGRAM: u32 = 1; +pub const _MM_PCOMCTRL_LT: u32 = 0; +pub const _MM_PCOMCTRL_LE: u32 = 1; +pub const _MM_PCOMCTRL_GT: u32 = 2; +pub const _MM_PCOMCTRL_GE: u32 = 3; +pub const _MM_PCOMCTRL_EQ: u32 = 4; +pub const _MM_PCOMCTRL_NEQ: u32 = 5; +pub const _MM_PCOMCTRL_FALSE: u32 = 6; +pub const _MM_PCOMCTRL_TRUE: u32 = 7; +pub const PF_TEMPORAL_LEVEL_1: u32 = 3; +pub const PF_TEMPORAL_LEVEL_2: u32 = 2; +pub const PF_TEMPORAL_LEVEL_3: u32 = 1; +pub const PF_NON_TEMPORAL_LEVEL_ALL: u32 = 0; +pub const EXCEPTION_READ_FAULT: u32 = 0; +pub const EXCEPTION_WRITE_FAULT: u32 = 1; +pub const EXCEPTION_EXECUTE_FAULT: u32 = 8; +pub const CONTEXT_AMD64: u32 = 1048576; +pub const CONTEXT_EXCEPTION_ACTIVE: u32 = 134217728; +pub const CONTEXT_SERVICE_ACTIVE: u32 = 268435456; +pub const CONTEXT_EXCEPTION_REQUEST: u32 = 1073741824; +pub const CONTEXT_EXCEPTION_REPORTING: u32 = 2147483648; +pub const INITIAL_MXCSR: u32 = 8064; +pub const INITIAL_FPCSR: u32 = 639; +pub const RUNTIME_FUNCTION_INDIRECT: u32 = 1; +pub const OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME: &'static [u8; 34usize] = + b"OutOfProcessFunctionTableCallback\0"; +pub const UNW_FLAG_NHANDLER: u32 = 0; +pub const UNW_FLAG_EHANDLER: u32 = 1; +pub const UNW_FLAG_UHANDLER: u32 = 2; +pub const UNW_FLAG_CHAININFO: u32 = 4; +pub const EXCEPTION_NONCONTINUABLE: u32 = 1; +pub const EXCEPTION_UNWINDING: u32 = 2; +pub const EXCEPTION_EXIT_UNWIND: u32 = 4; +pub const EXCEPTION_STACK_INVALID: u32 = 8; +pub const EXCEPTION_NESTED_CALL: u32 = 16; +pub const EXCEPTION_TARGET_UNWIND: u32 = 32; +pub const EXCEPTION_COLLIDED_UNWIND: u32 = 64; +pub const EXCEPTION_UNWIND: u32 = 102; +pub const EXCEPTION_MAXIMUM_PARAMETERS: u32 = 15; +pub const UNWIND_HISTORY_TABLE_SIZE: u32 = 12; +pub const UNWIND_HISTORY_TABLE_NONE: u32 = 0; +pub const UNWIND_HISTORY_TABLE_GLOBAL: u32 = 1; +pub const UNWIND_HISTORY_TABLE_LOCAL: u32 = 2; +pub const SID_REVISION: u32 = 1; +pub const SID_MAX_SUB_AUTHORITIES: u32 = 15; +pub const SID_RECOMMENDED_SUB_AUTHORITIES: u32 = 1; +pub const SID_HASH_SIZE: u32 = 32; +pub const SECURITY_TRUSTED_INSTALLER_RID1: u32 = 956008885; +pub const SECURITY_TRUSTED_INSTALLER_RID2: u32 = 3418522649; +pub const SECURITY_TRUSTED_INSTALLER_RID3: u32 = 1831038044; +pub const SECURITY_TRUSTED_INSTALLER_RID4: u32 = 1853292631; +pub const SECURITY_TRUSTED_INSTALLER_RID5: u32 = 2271478464; +pub const ACL_REVISION: u32 = 2; +pub const ACL_REVISION_DS: u32 = 4; +pub const ACL_REVISION1: u32 = 1; +pub const ACL_REVISION2: u32 = 2; +pub const ACL_REVISION3: u32 = 3; +pub const ACL_REVISION4: u32 = 4; +pub const MAX_ACL_REVISION: u32 = 4; +pub const ACCESS_MIN_MS_ACE_TYPE: u32 = 0; +pub const ACCESS_ALLOWED_ACE_TYPE: u32 = 0; +pub const ACCESS_DENIED_ACE_TYPE: u32 = 1; +pub const SYSTEM_AUDIT_ACE_TYPE: u32 = 2; +pub const SYSTEM_ALARM_ACE_TYPE: u32 = 3; +pub const ACCESS_MAX_MS_V2_ACE_TYPE: u32 = 3; +pub const ACCESS_ALLOWED_COMPOUND_ACE_TYPE: u32 = 4; +pub const ACCESS_MAX_MS_V3_ACE_TYPE: u32 = 4; +pub const ACCESS_MIN_MS_OBJECT_ACE_TYPE: u32 = 5; +pub const ACCESS_ALLOWED_OBJECT_ACE_TYPE: u32 = 5; +pub const ACCESS_DENIED_OBJECT_ACE_TYPE: u32 = 6; +pub const SYSTEM_AUDIT_OBJECT_ACE_TYPE: u32 = 7; +pub const SYSTEM_ALARM_OBJECT_ACE_TYPE: u32 = 8; +pub const ACCESS_MAX_MS_OBJECT_ACE_TYPE: u32 = 8; +pub const ACCESS_MAX_MS_V4_ACE_TYPE: u32 = 8; +pub const ACCESS_MAX_MS_ACE_TYPE: u32 = 8; +pub const ACCESS_ALLOWED_CALLBACK_ACE_TYPE: u32 = 9; +pub const ACCESS_DENIED_CALLBACK_ACE_TYPE: u32 = 10; +pub const ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE: u32 = 11; +pub const ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE: u32 = 12; +pub const SYSTEM_AUDIT_CALLBACK_ACE_TYPE: u32 = 13; +pub const SYSTEM_ALARM_CALLBACK_ACE_TYPE: u32 = 14; +pub const SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE: u32 = 15; +pub const SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE: u32 = 16; +pub const SYSTEM_MANDATORY_LABEL_ACE_TYPE: u32 = 17; +pub const SYSTEM_RESOURCE_ATTRIBUTE_ACE_TYPE: u32 = 18; +pub const SYSTEM_SCOPED_POLICY_ID_ACE_TYPE: u32 = 19; +pub const ACCESS_MAX_MS_V5_ACE_TYPE: u32 = 19; +pub const OBJECT_INHERIT_ACE: u32 = 1; +pub const CONTAINER_INHERIT_ACE: u32 = 2; +pub const NO_PROPAGATE_INHERIT_ACE: u32 = 4; +pub const INHERIT_ONLY_ACE: u32 = 8; +pub const INHERITED_ACE: u32 = 16; +pub const VALID_INHERIT_FLAGS: u32 = 31; +pub const SUCCESSFUL_ACCESS_ACE_FLAG: u32 = 64; +pub const FAILED_ACCESS_ACE_FLAG: u32 = 128; +pub const SYSTEM_MANDATORY_LABEL_NO_WRITE_UP: u32 = 1; +pub const SYSTEM_MANDATORY_LABEL_NO_READ_UP: u32 = 2; +pub const SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP: u32 = 4; +pub const SYSTEM_MANDATORY_LABEL_VALID_MASK: u32 = 7; +pub const ACE_OBJECT_TYPE_PRESENT: u32 = 1; +pub const ACE_INHERITED_OBJECT_TYPE_PRESENT: u32 = 2; +pub const SECURITY_DESCRIPTOR_REVISION: u32 = 1; +pub const SECURITY_DESCRIPTOR_REVISION1: u32 = 1; +pub const SE_OWNER_DEFAULTED: u32 = 1; +pub const SE_GROUP_DEFAULTED: u32 = 2; +pub const SE_DACL_PRESENT: u32 = 4; +pub const SE_DACL_DEFAULTED: u32 = 8; +pub const SE_SACL_PRESENT: u32 = 16; +pub const SE_SACL_DEFAULTED: u32 = 32; +pub const SE_DACL_AUTO_INHERIT_REQ: u32 = 256; +pub const SE_SACL_AUTO_INHERIT_REQ: u32 = 512; +pub const SE_DACL_AUTO_INHERITED: u32 = 1024; +pub const SE_SACL_AUTO_INHERITED: u32 = 2048; +pub const SE_DACL_PROTECTED: u32 = 4096; +pub const SE_SACL_PROTECTED: u32 = 8192; +pub const SE_RM_CONTROL_VALID: u32 = 16384; +pub const SE_SELF_RELATIVE: u32 = 32768; +pub const ACCESS_OBJECT_GUID: u32 = 0; +pub const ACCESS_PROPERTY_SET_GUID: u32 = 1; +pub const ACCESS_PROPERTY_GUID: u32 = 2; +pub const ACCESS_MAX_LEVEL: u32 = 4; +pub const AUDIT_ALLOW_NO_PRIVILEGE: u32 = 1; +pub const ACCESS_DS_SOURCE_A: &'static [u8; 3usize] = b"DS\0"; +pub const ACCESS_DS_SOURCE_W: &'static [u8; 3usize] = b"DS\0"; +pub const ACCESS_DS_OBJECT_TYPE_NAME_A: &'static [u8; 25usize] = b"Directory Service Object\0"; +pub const ACCESS_DS_OBJECT_TYPE_NAME_W: &'static [u8; 25usize] = b"Directory Service Object\0"; +pub const SE_PRIVILEGE_REMOVED: u32 = 4; +pub const PRIVILEGE_SET_ALL_NECESSARY: u32 = 1; +pub const ACCESS_REASON_TYPE_MASK: u32 = 16711680; +pub const ACCESS_REASON_DATA_MASK: u32 = 65535; +pub const ACCESS_REASON_STAGING_MASK: u32 = 2147483648; +pub const ACCESS_REASON_EXDATA_MASK: u32 = 2130706432; +pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE: u32 = 1; +pub const SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE: u32 = 2; +pub const SE_SECURITY_DESCRIPTOR_VALID_FLAGS: u32 = 3; +pub const TOKEN_ASSIGN_PRIMARY: u32 = 1; +pub const TOKEN_DUPLICATE: u32 = 2; +pub const TOKEN_IMPERSONATE: u32 = 4; +pub const TOKEN_QUERY: u32 = 8; +pub const TOKEN_QUERY_SOURCE: u32 = 16; +pub const TOKEN_ADJUST_PRIVILEGES: u32 = 32; +pub const TOKEN_ADJUST_GROUPS: u32 = 64; +pub const TOKEN_ADJUST_DEFAULT: u32 = 128; +pub const TOKEN_ADJUST_SESSIONID: u32 = 256; +pub const TOKEN_MANDATORY_POLICY_OFF: u32 = 0; +pub const TOKEN_MANDATORY_POLICY_NO_WRITE_UP: u32 = 1; +pub const TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN: u32 = 2; +pub const TOKEN_MANDATORY_POLICY_VALID_MASK: u32 = 3; +pub const POLICY_AUDIT_SUBCATEGORY_COUNT: u32 = 56; +pub const TOKEN_SOURCE_LENGTH: u32 = 8; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_INVALID: u32 = 0; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_INT64: u32 = 1; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_UINT64: u32 = 2; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_STRING: u32 = 3; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_FQBN: u32 = 4; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_SID: u32 = 5; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_BOOLEAN: u32 = 6; +pub const CLAIM_SECURITY_ATTRIBUTE_TYPE_OCTET_STRING: u32 = 16; +pub const CLAIM_SECURITY_ATTRIBUTE_NON_INHERITABLE: u32 = 1; +pub const CLAIM_SECURITY_ATTRIBUTE_VALUE_CASE_SENSITIVE: u32 = 2; +pub const CLAIM_SECURITY_ATTRIBUTE_USE_FOR_DENY_ONLY: u32 = 4; +pub const CLAIM_SECURITY_ATTRIBUTE_DISABLED_BY_DEFAULT: u32 = 8; +pub const CLAIM_SECURITY_ATTRIBUTE_DISABLED: u32 = 16; +pub const CLAIM_SECURITY_ATTRIBUTE_MANDATORY: u32 = 32; +pub const CLAIM_SECURITY_ATTRIBUTE_VALID_FLAGS: u32 = 63; +pub const CLAIM_SECURITY_ATTRIBUTE_CUSTOM_FLAGS: u32 = 4294901760; +pub const CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION_V1: u32 = 1; +pub const CLAIM_SECURITY_ATTRIBUTES_INFORMATION_VERSION: u32 = 1; +pub const SECURITY_DYNAMIC_TRACKING: u32 = 1; +pub const SECURITY_STATIC_TRACKING: u32 = 0; +pub const DISABLE_MAX_PRIVILEGE: u32 = 1; +pub const SANDBOX_INERT: u32 = 2; +pub const LUA_TOKEN: u32 = 4; +pub const WRITE_RESTRICTED: u32 = 8; +pub const SE_LEARNING_MODE_FLAG_PERMISSIVE: u32 = 1; +pub const PROCESS_TERMINATE: u32 = 1; +pub const PROCESS_CREATE_THREAD: u32 = 2; +pub const PROCESS_SET_SESSIONID: u32 = 4; +pub const PROCESS_VM_OPERATION: u32 = 8; +pub const PROCESS_VM_READ: u32 = 16; +pub const PROCESS_VM_WRITE: u32 = 32; +pub const PROCESS_DUP_HANDLE: u32 = 64; +pub const PROCESS_CREATE_PROCESS: u32 = 128; +pub const PROCESS_SET_QUOTA: u32 = 256; +pub const PROCESS_SET_INFORMATION: u32 = 512; +pub const PROCESS_QUERY_INFORMATION: u32 = 1024; +pub const PROCESS_SUSPEND_RESUME: u32 = 2048; +pub const PROCESS_QUERY_LIMITED_INFORMATION: u32 = 4096; +pub const MAXIMUM_PROC_PER_GROUP: u32 = 64; +pub const MAXIMUM_PROCESSORS: u32 = 64; +pub const THREAD_TERMINATE: u32 = 1; +pub const THREAD_SUSPEND_RESUME: u32 = 2; +pub const THREAD_GET_CONTEXT: u32 = 8; +pub const THREAD_SET_CONTEXT: u32 = 16; +pub const THREAD_SET_INFORMATION: u32 = 32; +pub const THREAD_QUERY_INFORMATION: u32 = 64; +pub const THREAD_SET_THREAD_TOKEN: u32 = 128; +pub const THREAD_IMPERSONATE: u32 = 256; +pub const THREAD_DIRECT_IMPERSONATION: u32 = 512; +pub const THREAD_SET_LIMITED_INFORMATION: u32 = 1024; +pub const THREAD_QUERY_LIMITED_INFORMATION: u32 = 2048; +pub const JOB_OBJECT_ASSIGN_PROCESS: u32 = 1; +pub const JOB_OBJECT_SET_ATTRIBUTES: u32 = 2; +pub const JOB_OBJECT_QUERY: u32 = 4; +pub const JOB_OBJECT_TERMINATE: u32 = 8; +pub const JOB_OBJECT_SET_SECURITY_ATTRIBUTES: u32 = 16; +pub const FLS_MAXIMUM_AVAILABLE: u32 = 128; +pub const TLS_MINIMUM_AVAILABLE: u32 = 64; +pub const THREAD_BASE_PRIORITY_LOWRT: u32 = 15; +pub const THREAD_BASE_PRIORITY_MAX: u32 = 2; +pub const THREAD_BASE_PRIORITY_MIN: i32 = -2; +pub const THREAD_BASE_PRIORITY_IDLE: i32 = -15; +pub const QUOTA_LIMITS_HARDWS_MIN_ENABLE: u32 = 1; +pub const QUOTA_LIMITS_HARDWS_MIN_DISABLE: u32 = 2; +pub const QUOTA_LIMITS_HARDWS_MAX_ENABLE: u32 = 4; +pub const QUOTA_LIMITS_HARDWS_MAX_DISABLE: u32 = 8; +pub const QUOTA_LIMITS_USE_DEFAULT_LIMITS: u32 = 16; +pub const MAX_HW_COUNTERS: u32 = 16; +pub const THREAD_PROFILING_FLAG_DISPATCH: u32 = 1; +pub const JOB_OBJECT_TERMINATE_AT_END_OF_JOB: u32 = 0; +pub const JOB_OBJECT_POST_AT_END_OF_JOB: u32 = 1; +pub const JOB_OBJECT_MSG_END_OF_JOB_TIME: u32 = 1; +pub const JOB_OBJECT_MSG_END_OF_PROCESS_TIME: u32 = 2; +pub const JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT: u32 = 3; +pub const JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO: u32 = 4; +pub const JOB_OBJECT_MSG_NEW_PROCESS: u32 = 6; +pub const JOB_OBJECT_MSG_EXIT_PROCESS: u32 = 7; +pub const JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: u32 = 8; +pub const JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT: u32 = 9; +pub const JOB_OBJECT_MSG_JOB_MEMORY_LIMIT: u32 = 10; +pub const JOB_OBJECT_MSG_NOTIFICATION_LIMIT: u32 = 11; +pub const JOB_OBJECT_MSG_JOB_CYCLE_TIME_LIMIT: u32 = 12; +pub const JOB_OBJECT_MSG_MINIMUM: u32 = 1; +pub const JOB_OBJECT_MSG_MAXIMUM: u32 = 12; +pub const JOB_OBJECT_LIMIT_WORKINGSET: u32 = 1; +pub const JOB_OBJECT_LIMIT_PROCESS_TIME: u32 = 2; +pub const JOB_OBJECT_LIMIT_JOB_TIME: u32 = 4; +pub const JOB_OBJECT_LIMIT_ACTIVE_PROCESS: u32 = 8; +pub const JOB_OBJECT_LIMIT_AFFINITY: u32 = 16; +pub const JOB_OBJECT_LIMIT_PRIORITY_CLASS: u32 = 32; +pub const JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME: u32 = 64; +pub const JOB_OBJECT_LIMIT_SCHEDULING_CLASS: u32 = 128; +pub const JOB_OBJECT_LIMIT_PROCESS_MEMORY: u32 = 256; +pub const JOB_OBJECT_LIMIT_JOB_MEMORY: u32 = 512; +pub const JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION: u32 = 1024; +pub const JOB_OBJECT_LIMIT_BREAKAWAY_OK: u32 = 2048; +pub const JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK: u32 = 4096; +pub const JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE: u32 = 8192; +pub const JOB_OBJECT_LIMIT_SUBSET_AFFINITY: u32 = 16384; +pub const JOB_OBJECT_LIMIT_RESERVED3: u32 = 32768; +pub const JOB_OBJECT_LIMIT_JOB_READ_BYTES: u32 = 65536; +pub const JOB_OBJECT_LIMIT_JOB_WRITE_BYTES: u32 = 131072; +pub const JOB_OBJECT_LIMIT_RATE_CONTROL: u32 = 262144; +pub const JOB_OBJECT_LIMIT_RESERVED4: u32 = 65536; +pub const JOB_OBJECT_LIMIT_RESERVED5: u32 = 131072; +pub const JOB_OBJECT_LIMIT_RESERVED6: u32 = 262144; +pub const JOB_OBJECT_LIMIT_VALID_FLAGS: u32 = 524287; +pub const JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS: u32 = 255; +pub const JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS: u32 = 32767; +pub const JOB_OBJECT_RESERVED_LIMIT_VALID_FLAGS: u32 = 524287; +pub const JOB_OBJECT_NOTIFICATION_LIMIT_VALID_FLAGS: u32 = 459268; +pub const JOB_OBJECT_UILIMIT_NONE: u32 = 0; +pub const JOB_OBJECT_UILIMIT_HANDLES: u32 = 1; +pub const JOB_OBJECT_UILIMIT_READCLIPBOARD: u32 = 2; +pub const JOB_OBJECT_UILIMIT_WRITECLIPBOARD: u32 = 4; +pub const JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS: u32 = 8; +pub const JOB_OBJECT_UILIMIT_DISPLAYSETTINGS: u32 = 16; +pub const JOB_OBJECT_UILIMIT_GLOBALATOMS: u32 = 32; +pub const JOB_OBJECT_UILIMIT_DESKTOP: u32 = 64; +pub const JOB_OBJECT_UILIMIT_EXITWINDOWS: u32 = 128; +pub const JOB_OBJECT_UILIMIT_ALL: u32 = 255; +pub const JOB_OBJECT_UI_VALID_FLAGS: u32 = 255; +pub const JOB_OBJECT_SECURITY_NO_ADMIN: u32 = 1; +pub const JOB_OBJECT_SECURITY_RESTRICTED_TOKEN: u32 = 2; +pub const JOB_OBJECT_SECURITY_ONLY_TOKEN: u32 = 4; +pub const JOB_OBJECT_SECURITY_FILTER_TOKENS: u32 = 8; +pub const JOB_OBJECT_SECURITY_VALID_FLAGS: u32 = 15; +pub const JOB_OBJECT_CPU_RATE_CONTROL_ENABLE: u32 = 1; +pub const JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED: u32 = 2; +pub const JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP: u32 = 4; +pub const JOB_OBJECT_CPU_RATE_CONTROL_NOTIFY: u32 = 8; +pub const JOB_OBJECT_CPU_RATE_CONTROL_VALID_FLAGS: u32 = 15; +pub const EVENT_MODIFY_STATE: u32 = 2; +pub const MUTANT_QUERY_STATE: u32 = 1; +pub const SEMAPHORE_MODIFY_STATE: u32 = 2; +pub const TIMER_QUERY_STATE: u32 = 1; +pub const TIMER_MODIFY_STATE: u32 = 2; +pub const TIME_ZONE_ID_UNKNOWN: u32 = 0; +pub const TIME_ZONE_ID_STANDARD: u32 = 1; +pub const TIME_ZONE_ID_DAYLIGHT: u32 = 2; +pub const LTP_PC_SMT: u32 = 1; +pub const CACHE_FULLY_ASSOCIATIVE: u32 = 255; +pub const PROCESSOR_INTEL_386: u32 = 386; +pub const PROCESSOR_INTEL_486: u32 = 486; +pub const PROCESSOR_INTEL_PENTIUM: u32 = 586; +pub const PROCESSOR_INTEL_IA64: u32 = 2200; +pub const PROCESSOR_AMD_X8664: u32 = 8664; +pub const PROCESSOR_MIPS_R4000: u32 = 4000; +pub const PROCESSOR_ALPHA_21064: u32 = 21064; +pub const PROCESSOR_PPC_601: u32 = 601; +pub const PROCESSOR_PPC_603: u32 = 603; +pub const PROCESSOR_PPC_604: u32 = 604; +pub const PROCESSOR_PPC_620: u32 = 620; +pub const PROCESSOR_HITACHI_SH3: u32 = 10003; +pub const PROCESSOR_HITACHI_SH3E: u32 = 10004; +pub const PROCESSOR_HITACHI_SH4: u32 = 10005; +pub const PROCESSOR_MOTOROLA_821: u32 = 821; +pub const PROCESSOR_SHx_SH3: u32 = 103; +pub const PROCESSOR_SHx_SH4: u32 = 104; +pub const PROCESSOR_STRONGARM: u32 = 2577; +pub const PROCESSOR_ARM720: u32 = 1824; +pub const PROCESSOR_ARM820: u32 = 2080; +pub const PROCESSOR_ARM920: u32 = 2336; +pub const PROCESSOR_ARM_7TDMI: u32 = 70001; +pub const PROCESSOR_OPTIL: u32 = 18767; +pub const PROCESSOR_ARCHITECTURE_INTEL: u32 = 0; +pub const PROCESSOR_ARCHITECTURE_MIPS: u32 = 1; +pub const PROCESSOR_ARCHITECTURE_ALPHA: u32 = 2; +pub const PROCESSOR_ARCHITECTURE_PPC: u32 = 3; +pub const PROCESSOR_ARCHITECTURE_SHX: u32 = 4; +pub const PROCESSOR_ARCHITECTURE_ARM: u32 = 5; +pub const PROCESSOR_ARCHITECTURE_IA64: u32 = 6; +pub const PROCESSOR_ARCHITECTURE_ALPHA64: u32 = 7; +pub const PROCESSOR_ARCHITECTURE_MSIL: u32 = 8; +pub const PROCESSOR_ARCHITECTURE_AMD64: u32 = 9; +pub const PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: u32 = 10; +pub const PROCESSOR_ARCHITECTURE_NEUTRAL: u32 = 11; +pub const PROCESSOR_ARCHITECTURE_ARM64: u32 = 12; +pub const PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64: u32 = 13; +pub const PROCESSOR_ARCHITECTURE_IA32_ON_ARM64: u32 = 14; +pub const PROCESSOR_ARCHITECTURE_UNKNOWN: u32 = 65535; +pub const PF_FLOATING_POINT_PRECISION_ERRATA: u32 = 0; +pub const PF_FLOATING_POINT_EMULATED: u32 = 1; +pub const PF_COMPARE_EXCHANGE_DOUBLE: u32 = 2; +pub const PF_MMX_INSTRUCTIONS_AVAILABLE: u32 = 3; +pub const PF_PPC_MOVEMEM_64BIT_OK: u32 = 4; +pub const PF_ALPHA_BYTE_INSTRUCTIONS: u32 = 5; +pub const PF_XMMI_INSTRUCTIONS_AVAILABLE: u32 = 6; +pub const PF_3DNOW_INSTRUCTIONS_AVAILABLE: u32 = 7; +pub const PF_RDTSC_INSTRUCTION_AVAILABLE: u32 = 8; +pub const PF_PAE_ENABLED: u32 = 9; +pub const PF_XMMI64_INSTRUCTIONS_AVAILABLE: u32 = 10; +pub const PF_SSE_DAZ_MODE_AVAILABLE: u32 = 11; +pub const PF_NX_ENABLED: u32 = 12; +pub const PF_SSE3_INSTRUCTIONS_AVAILABLE: u32 = 13; +pub const PF_COMPARE_EXCHANGE128: u32 = 14; +pub const PF_COMPARE64_EXCHANGE128: u32 = 15; +pub const PF_CHANNELS_ENABLED: u32 = 16; +pub const PF_XSAVE_ENABLED: u32 = 17; +pub const PF_ARM_VFP_32_REGISTERS_AVAILABLE: u32 = 18; +pub const PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: u32 = 19; +pub const PF_SECOND_LEVEL_ADDRESS_TRANSLATION: u32 = 20; +pub const PF_VIRT_FIRMWARE_ENABLED: u32 = 21; +pub const PF_RDWRFSGSBASE_AVAILABLE: u32 = 22; +pub const PF_FASTFAIL_AVAILABLE: u32 = 23; +pub const PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE: u32 = 24; +pub const PF_ARM_64BIT_LOADSTORE_ATOMIC: u32 = 25; +pub const PF_ARM_EXTERNAL_CACHE_AVAILABLE: u32 = 26; +pub const PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE: u32 = 27; +pub const PF_RDRAND_INSTRUCTION_AVAILABLE: u32 = 28; +pub const PF_ARM_V8_INSTRUCTIONS_AVAILABLE: u32 = 29; +pub const PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE: u32 = 30; +pub const PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE: u32 = 31; +pub const PF_RDTSCP_INSTRUCTION_AVAILABLE: u32 = 32; +pub const PF_RDPID_INSTRUCTION_AVAILABLE: u32 = 33; +pub const XSTATE_LEGACY_FLOATING_POINT: u32 = 0; +pub const XSTATE_LEGACY_SSE: u32 = 1; +pub const XSTATE_GSSE: u32 = 2; +pub const XSTATE_AVX: u32 = 2; +pub const XSTATE_MASK_LEGACY_FLOATING_POINT: u32 = 1; +pub const XSTATE_MASK_LEGACY_SSE: u32 = 2; +pub const XSTATE_MASK_LEGACY: u32 = 3; +pub const XSTATE_MASK_GSSE: u32 = 4; +pub const XSTATE_MASK_AVX: u32 = 4; +pub const MAXIMUM_XSTATE_FEATURES: u32 = 64; +pub const SECTION_QUERY: u32 = 1; +pub const SECTION_MAP_WRITE: u32 = 2; +pub const SECTION_MAP_READ: u32 = 4; +pub const SECTION_MAP_EXECUTE: u32 = 8; +pub const SECTION_EXTEND_SIZE: u32 = 16; +pub const SECTION_MAP_EXECUTE_EXPLICIT: u32 = 32; +pub const SESSION_QUERY_ACCESS: u32 = 1; +pub const SESSION_MODIFY_ACCESS: u32 = 2; +pub const PAGE_NOACCESS: u32 = 1; +pub const PAGE_READONLY: u32 = 2; +pub const PAGE_READWRITE: u32 = 4; +pub const PAGE_WRITECOPY: u32 = 8; +pub const PAGE_EXECUTE: u32 = 16; +pub const PAGE_EXECUTE_READ: u32 = 32; +pub const PAGE_EXECUTE_READWRITE: u32 = 64; +pub const PAGE_EXECUTE_WRITECOPY: u32 = 128; +pub const PAGE_GUARD: u32 = 256; +pub const PAGE_NOCACHE: u32 = 512; +pub const PAGE_WRITECOMBINE: u32 = 1024; +pub const MEM_COMMIT: u32 = 4096; +pub const MEM_RESERVE: u32 = 8192; +pub const MEM_DECOMMIT: u32 = 16384; +pub const MEM_RELEASE: u32 = 32768; +pub const MEM_FREE: u32 = 65536; +pub const MEM_PRIVATE: u32 = 131072; +pub const MEM_MAPPED: u32 = 262144; +pub const MEM_RESET: u32 = 524288; +pub const MEM_TOP_DOWN: u32 = 1048576; +pub const MEM_WRITE_WATCH: u32 = 2097152; +pub const MEM_PHYSICAL: u32 = 4194304; +pub const MEM_ROTATE: u32 = 8388608; +pub const MEM_LARGE_PAGES: u32 = 536870912; +pub const MEM_4MB_PAGES: u32 = 2147483648; +pub const SEC_FILE: u32 = 8388608; +pub const SEC_IMAGE: u32 = 16777216; +pub const SEC_PROTECTED_IMAGE: u32 = 33554432; +pub const SEC_RESERVE: u32 = 67108864; +pub const SEC_COMMIT: u32 = 134217728; +pub const SEC_NOCACHE: u32 = 268435456; +pub const SEC_WRITECOMBINE: u32 = 1073741824; +pub const SEC_LARGE_PAGES: u32 = 2147483648; +pub const SEC_IMAGE_NO_EXECUTE: u32 = 285212672; +pub const MEM_IMAGE: u32 = 16777216; +pub const WRITE_WATCH_FLAG_RESET: u32 = 1; +pub const MEM_UNMAP_WITH_TRANSIENT_BOOST: u32 = 1; +pub const FILE_READ_DATA: u32 = 1; +pub const FILE_LIST_DIRECTORY: u32 = 1; +pub const FILE_WRITE_DATA: u32 = 2; +pub const FILE_ADD_FILE: u32 = 2; +pub const FILE_APPEND_DATA: u32 = 4; +pub const FILE_ADD_SUBDIRECTORY: u32 = 4; +pub const FILE_CREATE_PIPE_INSTANCE: u32 = 4; +pub const FILE_READ_EA: u32 = 8; +pub const FILE_WRITE_EA: u32 = 16; +pub const FILE_EXECUTE: u32 = 32; +pub const FILE_TRAVERSE: u32 = 32; +pub const FILE_DELETE_CHILD: u32 = 64; +pub const FILE_READ_ATTRIBUTES: u32 = 128; +pub const FILE_WRITE_ATTRIBUTES: u32 = 256; +pub const FILE_SUPERSEDE: u32 = 0; +pub const FILE_OPEN: u32 = 1; +pub const FILE_CREATE: u32 = 2; +pub const FILE_OPEN_IF: u32 = 3; +pub const FILE_OVERWRITE: u32 = 4; +pub const FILE_OVERWRITE_IF: u32 = 5; +pub const FILE_MAXIMUM_DISPOSITION: u32 = 5; +pub const FILE_DIRECTORY_FILE: u32 = 1; +pub const FILE_WRITE_THROUGH: u32 = 2; +pub const FILE_SEQUENTIAL_ONLY: u32 = 4; +pub const FILE_NO_INTERMEDIATE_BUFFERING: u32 = 8; +pub const FILE_SYNCHRONOUS_IO_ALERT: u32 = 16; +pub const FILE_SYNCHRONOUS_IO_NONALERT: u32 = 32; +pub const FILE_NON_DIRECTORY_FILE: u32 = 64; +pub const FILE_CREATE_TREE_CONNECTION: u32 = 128; +pub const FILE_COMPLETE_IF_OPLOCKED: u32 = 256; +pub const FILE_NO_EA_KNOWLEDGE: u32 = 512; +pub const FILE_OPEN_REMOTE_INSTANCE: u32 = 1024; +pub const FILE_RANDOM_ACCESS: u32 = 2048; +pub const FILE_DELETE_ON_CLOSE: u32 = 4096; +pub const FILE_OPEN_BY_FILE_ID: u32 = 8192; +pub const FILE_OPEN_FOR_BACKUP_INTENT: u32 = 16384; +pub const FILE_NO_COMPRESSION: u32 = 32768; +pub const FILE_RESERVE_OPFILTER: u32 = 1048576; +pub const FILE_OPEN_REPARSE_POINT: u32 = 2097152; +pub const FILE_OPEN_NO_RECALL: u32 = 4194304; +pub const FILE_OPEN_FOR_FREE_SPACE_QUERY: u32 = 8388608; +pub const FILE_SHARE_READ: u32 = 1; +pub const FILE_SHARE_WRITE: u32 = 2; +pub const FILE_SHARE_DELETE: u32 = 4; +pub const FILE_SHARE_VALID_FLAGS: u32 = 7; +pub const FILE_ATTRIBUTE_READONLY: u32 = 1; +pub const FILE_ATTRIBUTE_HIDDEN: u32 = 2; +pub const FILE_ATTRIBUTE_SYSTEM: u32 = 4; +pub const FILE_ATTRIBUTE_DIRECTORY: u32 = 16; +pub const FILE_ATTRIBUTE_ARCHIVE: u32 = 32; +pub const FILE_ATTRIBUTE_DEVICE: u32 = 64; +pub const FILE_ATTRIBUTE_NORMAL: u32 = 128; +pub const FILE_ATTRIBUTE_TEMPORARY: u32 = 256; +pub const FILE_ATTRIBUTE_SPARSE_FILE: u32 = 512; +pub const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 1024; +pub const FILE_ATTRIBUTE_COMPRESSED: u32 = 2048; +pub const FILE_ATTRIBUTE_OFFLINE: u32 = 4096; +pub const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: u32 = 8192; +pub const FILE_ATTRIBUTE_ENCRYPTED: u32 = 16384; +pub const FILE_ATTRIBUTE_VIRTUAL: u32 = 65536; +pub const FILE_NOTIFY_CHANGE_FILE_NAME: u32 = 1; +pub const FILE_NOTIFY_CHANGE_DIR_NAME: u32 = 2; +pub const FILE_NOTIFY_CHANGE_ATTRIBUTES: u32 = 4; +pub const FILE_NOTIFY_CHANGE_SIZE: u32 = 8; +pub const FILE_NOTIFY_CHANGE_LAST_WRITE: u32 = 16; +pub const FILE_NOTIFY_CHANGE_LAST_ACCESS: u32 = 32; +pub const FILE_NOTIFY_CHANGE_CREATION: u32 = 64; +pub const FILE_NOTIFY_CHANGE_SECURITY: u32 = 256; +pub const FILE_ACTION_ADDED: u32 = 1; +pub const FILE_ACTION_REMOVED: u32 = 2; +pub const FILE_ACTION_MODIFIED: u32 = 3; +pub const FILE_ACTION_RENAMED_OLD_NAME: u32 = 4; +pub const FILE_ACTION_RENAMED_NEW_NAME: u32 = 5; +pub const FILE_CASE_SENSITIVE_SEARCH: u32 = 1; +pub const FILE_CASE_PRESERVED_NAMES: u32 = 2; +pub const FILE_UNICODE_ON_DISK: u32 = 4; +pub const FILE_PERSISTENT_ACLS: u32 = 8; +pub const FILE_FILE_COMPRESSION: u32 = 16; +pub const FILE_VOLUME_QUOTAS: u32 = 32; +pub const FILE_SUPPORTS_SPARSE_FILES: u32 = 64; +pub const FILE_SUPPORTS_REPARSE_POINTS: u32 = 128; +pub const FILE_SUPPORTS_REMOTE_STORAGE: u32 = 256; +pub const FILE_VOLUME_IS_COMPRESSED: u32 = 32768; +pub const FILE_SUPPORTS_OBJECT_IDS: u32 = 65536; +pub const FILE_SUPPORTS_ENCRYPTION: u32 = 131072; +pub const FILE_NAMED_STREAMS: u32 = 262144; +pub const FILE_READ_ONLY_VOLUME: u32 = 524288; +pub const FILE_SEQUENTIAL_WRITE_ONCE: u32 = 1048576; +pub const FILE_SUPPORTS_TRANSACTIONS: u32 = 2097152; +pub const FILE_SUPPORTS_HARD_LINKS: u32 = 4194304; +pub const FILE_SUPPORTS_EXTENDED_ATTRIBUTES: u32 = 8388608; +pub const FILE_SUPPORTS_OPEN_BY_FILE_ID: u32 = 16777216; +pub const FILE_SUPPORTS_USN_JOURNAL: u32 = 33554432; +pub const FILE_SUPPORTS_INTEGRITY_STREAMS: u32 = 67108864; +pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: u32 = 16384; +pub const SYMLINK_FLAG_RELATIVE: u32 = 1; +pub const IO_REPARSE_TAG_RESERVED_ZERO: u32 = 0; +pub const IO_REPARSE_TAG_RESERVED_ONE: u32 = 1; +pub const IO_REPARSE_TAG_RESERVED_RANGE: u32 = 1; +pub const IO_COMPLETION_MODIFY_STATE: u32 = 2; +pub const DUPLICATE_CLOSE_SOURCE: u32 = 1; +pub const DUPLICATE_SAME_ACCESS: u32 = 2; +pub const POWERBUTTON_ACTION_INDEX_NOTHING: u32 = 0; +pub const POWERBUTTON_ACTION_INDEX_SLEEP: u32 = 1; +pub const POWERBUTTON_ACTION_INDEX_HIBERNATE: u32 = 2; +pub const POWERBUTTON_ACTION_INDEX_SHUTDOWN: u32 = 3; +pub const POWERBUTTON_ACTION_VALUE_NOTHING: u32 = 0; +pub const POWERBUTTON_ACTION_VALUE_SLEEP: u32 = 2; +pub const POWERBUTTON_ACTION_VALUE_HIBERNATE: u32 = 3; +pub const POWERBUTTON_ACTION_VALUE_SHUTDOWN: u32 = 6; +pub const PERFSTATE_POLICY_CHANGE_IDEAL: u32 = 0; +pub const PERFSTATE_POLICY_CHANGE_SINGLE: u32 = 1; +pub const PERFSTATE_POLICY_CHANGE_ROCKET: u32 = 2; +pub const PERFSTATE_POLICY_CHANGE_MAX: u32 = 2; +pub const PROCESSOR_PERF_BOOST_POLICY_DISABLED: u32 = 0; +pub const PROCESSOR_PERF_BOOST_POLICY_MAX: u32 = 100; +pub const PROCESSOR_PERF_BOOST_MODE_DISABLED: u32 = 0; +pub const PROCESSOR_PERF_BOOST_MODE_ENABLED: u32 = 1; +pub const PROCESSOR_PERF_BOOST_MODE_AGGRESSIVE: u32 = 2; +pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_ENABLED: u32 = 3; +pub const PROCESSOR_PERF_BOOST_MODE_EFFICIENT_AGGRESSIVE: u32 = 4; +pub const PROCESSOR_PERF_BOOST_MODE_MAX: u32 = 4; +pub const CORE_PARKING_POLICY_CHANGE_IDEAL: u32 = 0; +pub const CORE_PARKING_POLICY_CHANGE_SINGLE: u32 = 1; +pub const CORE_PARKING_POLICY_CHANGE_ROCKET: u32 = 2; +pub const CORE_PARKING_POLICY_CHANGE_MULTISTEP: u32 = 3; +pub const CORE_PARKING_POLICY_CHANGE_MAX: u32 = 3; +pub const POWER_DEVICE_IDLE_POLICY_PERFORMANCE: u32 = 0; +pub const POWER_DEVICE_IDLE_POLICY_CONSERVATIVE: u32 = 1; +pub const POWER_SYSTEM_MAXIMUM: u32 = 7; +pub const DIAGNOSTIC_REASON_VERSION: u32 = 0; +pub const POWER_REQUEST_CONTEXT_VERSION: u32 = 0; +pub const DIAGNOSTIC_REASON_SIMPLE_STRING: u32 = 1; +pub const DIAGNOSTIC_REASON_DETAILED_STRING: u32 = 2; +pub const DIAGNOSTIC_REASON_NOT_SPECIFIED: u32 = 2147483648; +pub const DIAGNOSTIC_REASON_INVALID_FLAGS: i64 = -2147483652; +pub const POWER_REQUEST_CONTEXT_SIMPLE_STRING: u32 = 1; +pub const POWER_REQUEST_CONTEXT_DETAILED_STRING: u32 = 2; +pub const PDCAP_D0_SUPPORTED: u32 = 1; +pub const PDCAP_D1_SUPPORTED: u32 = 2; +pub const PDCAP_D2_SUPPORTED: u32 = 4; +pub const PDCAP_D3_SUPPORTED: u32 = 8; +pub const PDCAP_WAKE_FROM_D0_SUPPORTED: u32 = 16; +pub const PDCAP_WAKE_FROM_D1_SUPPORTED: u32 = 32; +pub const PDCAP_WAKE_FROM_D2_SUPPORTED: u32 = 64; +pub const PDCAP_WAKE_FROM_D3_SUPPORTED: u32 = 128; +pub const PDCAP_WARM_EJECT_SUPPORTED: u32 = 256; +pub const POWER_SETTING_VALUE_VERSION: u32 = 1; +pub const POWER_PLATFORM_ROLE_V1: u32 = 1; +pub const POWER_PLATFORM_ROLE_V2: u32 = 2; +pub const POWER_PLATFORM_ROLE_VERSION: u32 = 1; +pub const PROC_IDLE_BUCKET_COUNT: u32 = 6; +pub const PROC_IDLE_BUCKET_COUNT_EX: u32 = 16; +pub const ACPI_PPM_SOFTWARE_ALL: u32 = 252; +pub const ACPI_PPM_SOFTWARE_ANY: u32 = 253; +pub const ACPI_PPM_HARDWARE_ALL: u32 = 254; +pub const MS_PPM_SOFTWARE_ALL: u32 = 1; +pub const PPM_FIRMWARE_ACPI1C2: u32 = 1; +pub const PPM_FIRMWARE_ACPI1C3: u32 = 2; +pub const PPM_FIRMWARE_ACPI1TSTATES: u32 = 4; +pub const PPM_FIRMWARE_CST: u32 = 8; +pub const PPM_FIRMWARE_CSD: u32 = 16; +pub const PPM_FIRMWARE_PCT: u32 = 32; +pub const PPM_FIRMWARE_PSS: u32 = 64; +pub const PPM_FIRMWARE_XPSS: u32 = 128; +pub const PPM_FIRMWARE_PPC: u32 = 256; +pub const PPM_FIRMWARE_PSD: u32 = 512; +pub const PPM_FIRMWARE_PTC: u32 = 1024; +pub const PPM_FIRMWARE_TSS: u32 = 2048; +pub const PPM_FIRMWARE_TPC: u32 = 4096; +pub const PPM_FIRMWARE_TSD: u32 = 8192; +pub const PPM_FIRMWARE_PCCH: u32 = 16384; +pub const PPM_FIRMWARE_PCCP: u32 = 32768; +pub const PPM_FIRMWARE_OSC: u32 = 65536; +pub const PPM_FIRMWARE_PDC: u32 = 131072; +pub const PPM_FIRMWARE_CPC: u32 = 262144; +pub const PPM_PERFORMANCE_IMPLEMENTATION_NONE: u32 = 0; +pub const PPM_PERFORMANCE_IMPLEMENTATION_PSTATES: u32 = 1; +pub const PPM_PERFORMANCE_IMPLEMENTATION_PCCV1: u32 = 2; +pub const PPM_PERFORMANCE_IMPLEMENTATION_CPPC: u32 = 3; +pub const PPM_PERFORMANCE_IMPLEMENTATION_PEP: u32 = 4; +pub const PPM_IDLE_IMPLEMENTATION_NONE: u32 = 0; +pub const PPM_IDLE_IMPLEMENTATION_CSTATES: u32 = 1; +pub const PPM_IDLE_IMPLEMENTATION_PEP: u32 = 2; +pub const POWER_ACTION_QUERY_ALLOWED: u32 = 1; +pub const POWER_ACTION_UI_ALLOWED: u32 = 2; +pub const POWER_ACTION_OVERRIDE_APPS: u32 = 4; +pub const POWER_ACTION_HIBERBOOT: u32 = 8; +pub const POWER_ACTION_PSEUDO_TRANSITION: u32 = 134217728; +pub const POWER_ACTION_LIGHTEST_FIRST: u32 = 268435456; +pub const POWER_ACTION_LOCK_CONSOLE: u32 = 536870912; +pub const POWER_ACTION_DISABLE_WAKES: u32 = 1073741824; +pub const POWER_ACTION_CRITICAL: u32 = 2147483648; +pub const POWER_LEVEL_USER_NOTIFY_TEXT: u32 = 1; +pub const POWER_LEVEL_USER_NOTIFY_SOUND: u32 = 2; +pub const POWER_LEVEL_USER_NOTIFY_EXEC: u32 = 4; +pub const POWER_USER_NOTIFY_BUTTON: u32 = 8; +pub const POWER_USER_NOTIFY_SHUTDOWN: u32 = 16; +pub const POWER_USER_NOTIFY_FORCED_SHUTDOWN: u32 = 32; +pub const POWER_FORCE_TRIGGER_RESET: u32 = 2147483648; +pub const BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK: u32 = 7; +pub const BATTERY_DISCHARGE_FLAGS_ENABLE: u32 = 2147483648; +pub const DISCHARGE_POLICY_CRITICAL: u32 = 0; +pub const DISCHARGE_POLICY_LOW: u32 = 1; +pub const NUM_DISCHARGE_POLICIES: u32 = 4; +pub const PROCESSOR_IDLESTATE_POLICY_COUNT: u32 = 3; +pub const PO_THROTTLE_NONE: u32 = 0; +pub const PO_THROTTLE_CONSTANT: u32 = 1; +pub const PO_THROTTLE_DEGRADE: u32 = 2; +pub const PO_THROTTLE_ADAPTIVE: u32 = 3; +pub const PO_THROTTLE_MAXIMUM: u32 = 4; +pub const IMAGE_DOS_SIGNATURE: u32 = 23117; +pub const IMAGE_OS2_SIGNATURE: u32 = 17742; +pub const IMAGE_OS2_SIGNATURE_LE: u32 = 17740; +pub const IMAGE_VXD_SIGNATURE: u32 = 17740; +pub const IMAGE_NT_SIGNATURE: u32 = 17744; +pub const IMAGE_SIZEOF_FILE_HEADER: u32 = 20; +pub const IMAGE_FILE_RELOCS_STRIPPED: u32 = 1; +pub const IMAGE_FILE_EXECUTABLE_IMAGE: u32 = 2; +pub const IMAGE_FILE_LINE_NUMS_STRIPPED: u32 = 4; +pub const IMAGE_FILE_LOCAL_SYMS_STRIPPED: u32 = 8; +pub const IMAGE_FILE_AGGRESIVE_WS_TRIM: u32 = 16; +pub const IMAGE_FILE_LARGE_ADDRESS_AWARE: u32 = 32; +pub const IMAGE_FILE_BYTES_REVERSED_LO: u32 = 128; +pub const IMAGE_FILE_32BIT_MACHINE: u32 = 256; +pub const IMAGE_FILE_DEBUG_STRIPPED: u32 = 512; +pub const IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP: u32 = 1024; +pub const IMAGE_FILE_NET_RUN_FROM_SWAP: u32 = 2048; +pub const IMAGE_FILE_SYSTEM: u32 = 4096; +pub const IMAGE_FILE_DLL: u32 = 8192; +pub const IMAGE_FILE_UP_SYSTEM_ONLY: u32 = 16384; +pub const IMAGE_FILE_BYTES_REVERSED_HI: u32 = 32768; +pub const IMAGE_FILE_MACHINE_UNKNOWN: u32 = 0; +pub const IMAGE_FILE_MACHINE_I386: u32 = 332; +pub const IMAGE_FILE_MACHINE_R3000: u32 = 354; +pub const IMAGE_FILE_MACHINE_R4000: u32 = 358; +pub const IMAGE_FILE_MACHINE_R10000: u32 = 360; +pub const IMAGE_FILE_MACHINE_WCEMIPSV2: u32 = 361; +pub const IMAGE_FILE_MACHINE_ALPHA: u32 = 388; +pub const IMAGE_FILE_MACHINE_SH3: u32 = 418; +pub const IMAGE_FILE_MACHINE_SH3DSP: u32 = 419; +pub const IMAGE_FILE_MACHINE_SH3E: u32 = 420; +pub const IMAGE_FILE_MACHINE_SH4: u32 = 422; +pub const IMAGE_FILE_MACHINE_SH5: u32 = 424; +pub const IMAGE_FILE_MACHINE_ARM: u32 = 448; +pub const IMAGE_FILE_MACHINE_ARMV7: u32 = 452; +pub const IMAGE_FILE_MACHINE_ARMNT: u32 = 452; +pub const IMAGE_FILE_MACHINE_ARM64: u32 = 43620; +pub const IMAGE_FILE_MACHINE_THUMB: u32 = 450; +pub const IMAGE_FILE_MACHINE_AM33: u32 = 467; +pub const IMAGE_FILE_MACHINE_POWERPC: u32 = 496; +pub const IMAGE_FILE_MACHINE_POWERPCFP: u32 = 497; +pub const IMAGE_FILE_MACHINE_IA64: u32 = 512; +pub const IMAGE_FILE_MACHINE_MIPS16: u32 = 614; +pub const IMAGE_FILE_MACHINE_ALPHA64: u32 = 644; +pub const IMAGE_FILE_MACHINE_MIPSFPU: u32 = 870; +pub const IMAGE_FILE_MACHINE_MIPSFPU16: u32 = 1126; +pub const IMAGE_FILE_MACHINE_AXP64: u32 = 644; +pub const IMAGE_FILE_MACHINE_TRICORE: u32 = 1312; +pub const IMAGE_FILE_MACHINE_CEF: u32 = 3311; +pub const IMAGE_FILE_MACHINE_EBC: u32 = 3772; +pub const IMAGE_FILE_MACHINE_AMD64: u32 = 34404; +pub const IMAGE_FILE_MACHINE_M32R: u32 = 36929; +pub const IMAGE_FILE_MACHINE_CEE: u32 = 49390; +pub const IMAGE_NUMBEROF_DIRECTORY_ENTRIES: u32 = 16; +pub const IMAGE_SIZEOF_ROM_OPTIONAL_HEADER: u32 = 56; +pub const IMAGE_SIZEOF_STD_OPTIONAL_HEADER: u32 = 28; +pub const IMAGE_SIZEOF_NT_OPTIONAL32_HEADER: u32 = 224; +pub const IMAGE_SIZEOF_NT_OPTIONAL64_HEADER: u32 = 240; +pub const IMAGE_NT_OPTIONAL_HDR32_MAGIC: u32 = 267; +pub const IMAGE_NT_OPTIONAL_HDR64_MAGIC: u32 = 523; +pub const IMAGE_ROM_OPTIONAL_HDR_MAGIC: u32 = 263; +pub const IMAGE_SIZEOF_NT_OPTIONAL_HEADER: u32 = 240; +pub const IMAGE_NT_OPTIONAL_HDR_MAGIC: u32 = 523; +pub const IMAGE_SUBSYSTEM_UNKNOWN: u32 = 0; +pub const IMAGE_SUBSYSTEM_NATIVE: u32 = 1; +pub const IMAGE_SUBSYSTEM_WINDOWS_GUI: u32 = 2; +pub const IMAGE_SUBSYSTEM_WINDOWS_CUI: u32 = 3; +pub const IMAGE_SUBSYSTEM_OS2_CUI: u32 = 5; +pub const IMAGE_SUBSYSTEM_POSIX_CUI: u32 = 7; +pub const IMAGE_SUBSYSTEM_NATIVE_WINDOWS: u32 = 8; +pub const IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: u32 = 9; +pub const IMAGE_SUBSYSTEM_EFI_APPLICATION: u32 = 10; +pub const IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: u32 = 11; +pub const IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: u32 = 12; +pub const IMAGE_SUBSYSTEM_EFI_ROM: u32 = 13; +pub const IMAGE_SUBSYSTEM_XBOX: u32 = 14; +pub const IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION: u32 = 16; +pub const IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA: u32 = 32; +pub const IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE: u32 = 64; +pub const IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY: u32 = 128; +pub const IMAGE_DLLCHARACTERISTICS_NX_COMPAT: u32 = 256; +pub const IMAGE_DLLCHARACTERISTICS_NO_ISOLATION: u32 = 512; +pub const IMAGE_DLLCHARACTERISTICS_NO_SEH: u32 = 1024; +pub const IMAGE_DLLCHARACTERISTICS_NO_BIND: u32 = 2048; +pub const IMAGE_DLLCHARACTERISTICS_APPCONTAINER: u32 = 4096; +pub const IMAGE_DLLCHARACTERISTICS_WDM_DRIVER: u32 = 8192; +pub const IMAGE_DLLCHARACTERISTICS_GUARD_CF: u32 = 16384; +pub const IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE: u32 = 32768; +pub const IMAGE_DIRECTORY_ENTRY_EXPORT: u32 = 0; +pub const IMAGE_DIRECTORY_ENTRY_IMPORT: u32 = 1; +pub const IMAGE_DIRECTORY_ENTRY_RESOURCE: u32 = 2; +pub const IMAGE_DIRECTORY_ENTRY_EXCEPTION: u32 = 3; +pub const IMAGE_DIRECTORY_ENTRY_SECURITY: u32 = 4; +pub const IMAGE_DIRECTORY_ENTRY_BASERELOC: u32 = 5; +pub const IMAGE_DIRECTORY_ENTRY_DEBUG: u32 = 6; +pub const IMAGE_DIRECTORY_ENTRY_ARCHITECTURE: u32 = 7; +pub const IMAGE_DIRECTORY_ENTRY_GLOBALPTR: u32 = 8; +pub const IMAGE_DIRECTORY_ENTRY_TLS: u32 = 9; +pub const IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG: u32 = 10; +pub const IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT: u32 = 11; +pub const IMAGE_DIRECTORY_ENTRY_IAT: u32 = 12; +pub const IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT: u32 = 13; +pub const IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR: u32 = 14; +pub const IMAGE_SIZEOF_SHORT_NAME: u32 = 8; +pub const IMAGE_SIZEOF_SECTION_HEADER: u32 = 40; +pub const IMAGE_SCN_TYPE_NO_PAD: u32 = 8; +pub const IMAGE_SCN_CNT_CODE: u32 = 32; +pub const IMAGE_SCN_CNT_INITIALIZED_DATA: u32 = 64; +pub const IMAGE_SCN_CNT_UNINITIALIZED_DATA: u32 = 128; +pub const IMAGE_SCN_LNK_OTHER: u32 = 256; +pub const IMAGE_SCN_LNK_INFO: u32 = 512; +pub const IMAGE_SCN_LNK_REMOVE: u32 = 2048; +pub const IMAGE_SCN_LNK_COMDAT: u32 = 4096; +pub const IMAGE_SCN_NO_DEFER_SPEC_EXC: u32 = 16384; +pub const IMAGE_SCN_GPREL: u32 = 32768; +pub const IMAGE_SCN_MEM_FARDATA: u32 = 32768; +pub const IMAGE_SCN_MEM_PURGEABLE: u32 = 131072; +pub const IMAGE_SCN_MEM_16BIT: u32 = 131072; +pub const IMAGE_SCN_MEM_LOCKED: u32 = 262144; +pub const IMAGE_SCN_MEM_PRELOAD: u32 = 524288; +pub const IMAGE_SCN_ALIGN_1BYTES: u32 = 1048576; +pub const IMAGE_SCN_ALIGN_2BYTES: u32 = 2097152; +pub const IMAGE_SCN_ALIGN_4BYTES: u32 = 3145728; +pub const IMAGE_SCN_ALIGN_8BYTES: u32 = 4194304; +pub const IMAGE_SCN_ALIGN_16BYTES: u32 = 5242880; +pub const IMAGE_SCN_ALIGN_32BYTES: u32 = 6291456; +pub const IMAGE_SCN_ALIGN_64BYTES: u32 = 7340032; +pub const IMAGE_SCN_ALIGN_128BYTES: u32 = 8388608; +pub const IMAGE_SCN_ALIGN_256BYTES: u32 = 9437184; +pub const IMAGE_SCN_ALIGN_512BYTES: u32 = 10485760; +pub const IMAGE_SCN_ALIGN_1024BYTES: u32 = 11534336; +pub const IMAGE_SCN_ALIGN_2048BYTES: u32 = 12582912; +pub const IMAGE_SCN_ALIGN_4096BYTES: u32 = 13631488; +pub const IMAGE_SCN_ALIGN_8192BYTES: u32 = 14680064; +pub const IMAGE_SCN_ALIGN_MASK: u32 = 15728640; +pub const IMAGE_SCN_LNK_NRELOC_OVFL: u32 = 16777216; +pub const IMAGE_SCN_MEM_DISCARDABLE: u32 = 33554432; +pub const IMAGE_SCN_MEM_NOT_CACHED: u32 = 67108864; +pub const IMAGE_SCN_MEM_NOT_PAGED: u32 = 134217728; +pub const IMAGE_SCN_MEM_SHARED: u32 = 268435456; +pub const IMAGE_SCN_MEM_EXECUTE: u32 = 536870912; +pub const IMAGE_SCN_MEM_READ: u32 = 1073741824; +pub const IMAGE_SCN_MEM_WRITE: u32 = 2147483648; +pub const IMAGE_SCN_SCALE_INDEX: u32 = 1; +pub const IMAGE_SIZEOF_SYMBOL: u32 = 18; +pub const IMAGE_SYM_SECTION_MAX: u32 = 65279; +pub const IMAGE_SYM_SECTION_MAX_EX: u32 = 2147483647; +pub const IMAGE_SYM_TYPE_NULL: u32 = 0; +pub const IMAGE_SYM_TYPE_VOID: u32 = 1; +pub const IMAGE_SYM_TYPE_CHAR: u32 = 2; +pub const IMAGE_SYM_TYPE_SHORT: u32 = 3; +pub const IMAGE_SYM_TYPE_INT: u32 = 4; +pub const IMAGE_SYM_TYPE_LONG: u32 = 5; +pub const IMAGE_SYM_TYPE_FLOAT: u32 = 6; +pub const IMAGE_SYM_TYPE_DOUBLE: u32 = 7; +pub const IMAGE_SYM_TYPE_STRUCT: u32 = 8; +pub const IMAGE_SYM_TYPE_UNION: u32 = 9; +pub const IMAGE_SYM_TYPE_ENUM: u32 = 10; +pub const IMAGE_SYM_TYPE_MOE: u32 = 11; +pub const IMAGE_SYM_TYPE_BYTE: u32 = 12; +pub const IMAGE_SYM_TYPE_WORD: u32 = 13; +pub const IMAGE_SYM_TYPE_UINT: u32 = 14; +pub const IMAGE_SYM_TYPE_DWORD: u32 = 15; +pub const IMAGE_SYM_TYPE_PCODE: u32 = 32768; +pub const IMAGE_SYM_DTYPE_NULL: u32 = 0; +pub const IMAGE_SYM_DTYPE_POINTER: u32 = 1; +pub const IMAGE_SYM_DTYPE_FUNCTION: u32 = 2; +pub const IMAGE_SYM_DTYPE_ARRAY: u32 = 3; +pub const IMAGE_SYM_CLASS_NULL: u32 = 0; +pub const IMAGE_SYM_CLASS_AUTOMATIC: u32 = 1; +pub const IMAGE_SYM_CLASS_EXTERNAL: u32 = 2; +pub const IMAGE_SYM_CLASS_STATIC: u32 = 3; +pub const IMAGE_SYM_CLASS_REGISTER: u32 = 4; +pub const IMAGE_SYM_CLASS_EXTERNAL_DEF: u32 = 5; +pub const IMAGE_SYM_CLASS_LABEL: u32 = 6; +pub const IMAGE_SYM_CLASS_UNDEFINED_LABEL: u32 = 7; +pub const IMAGE_SYM_CLASS_MEMBER_OF_STRUCT: u32 = 8; +pub const IMAGE_SYM_CLASS_ARGUMENT: u32 = 9; +pub const IMAGE_SYM_CLASS_STRUCT_TAG: u32 = 10; +pub const IMAGE_SYM_CLASS_MEMBER_OF_UNION: u32 = 11; +pub const IMAGE_SYM_CLASS_UNION_TAG: u32 = 12; +pub const IMAGE_SYM_CLASS_TYPE_DEFINITION: u32 = 13; +pub const IMAGE_SYM_CLASS_UNDEFINED_STATIC: u32 = 14; +pub const IMAGE_SYM_CLASS_ENUM_TAG: u32 = 15; +pub const IMAGE_SYM_CLASS_MEMBER_OF_ENUM: u32 = 16; +pub const IMAGE_SYM_CLASS_REGISTER_PARAM: u32 = 17; +pub const IMAGE_SYM_CLASS_BIT_FIELD: u32 = 18; +pub const IMAGE_SYM_CLASS_FAR_EXTERNAL: u32 = 68; +pub const IMAGE_SYM_CLASS_BLOCK: u32 = 100; +pub const IMAGE_SYM_CLASS_FUNCTION: u32 = 101; +pub const IMAGE_SYM_CLASS_END_OF_STRUCT: u32 = 102; +pub const IMAGE_SYM_CLASS_FILE: u32 = 103; +pub const IMAGE_SYM_CLASS_SECTION: u32 = 104; +pub const IMAGE_SYM_CLASS_WEAK_EXTERNAL: u32 = 105; +pub const IMAGE_SYM_CLASS_CLR_TOKEN: u32 = 107; +pub const N_BTMASK: u32 = 15; +pub const N_TMASK: u32 = 48; +pub const N_TMASK1: u32 = 192; +pub const N_TMASK2: u32 = 240; +pub const N_BTSHFT: u32 = 4; +pub const N_TSHIFT: u32 = 2; +pub const IMAGE_SIZEOF_AUX_SYMBOL: u32 = 18; +pub const IMAGE_COMDAT_SELECT_NODUPLICATES: u32 = 1; +pub const IMAGE_COMDAT_SELECT_ANY: u32 = 2; +pub const IMAGE_COMDAT_SELECT_SAME_SIZE: u32 = 3; +pub const IMAGE_COMDAT_SELECT_EXACT_MATCH: u32 = 4; +pub const IMAGE_COMDAT_SELECT_ASSOCIATIVE: u32 = 5; +pub const IMAGE_COMDAT_SELECT_LARGEST: u32 = 6; +pub const IMAGE_COMDAT_SELECT_NEWEST: u32 = 7; +pub const IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY: u32 = 1; +pub const IMAGE_WEAK_EXTERN_SEARCH_LIBRARY: u32 = 2; +pub const IMAGE_WEAK_EXTERN_SEARCH_ALIAS: u32 = 3; +pub const IMAGE_SIZEOF_RELOCATION: u32 = 10; +pub const IMAGE_REL_I386_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_I386_DIR16: u32 = 1; +pub const IMAGE_REL_I386_REL16: u32 = 2; +pub const IMAGE_REL_I386_DIR32: u32 = 6; +pub const IMAGE_REL_I386_DIR32NB: u32 = 7; +pub const IMAGE_REL_I386_SEG12: u32 = 9; +pub const IMAGE_REL_I386_SECTION: u32 = 10; +pub const IMAGE_REL_I386_SECREL: u32 = 11; +pub const IMAGE_REL_I386_TOKEN: u32 = 12; +pub const IMAGE_REL_I386_SECREL7: u32 = 13; +pub const IMAGE_REL_I386_REL32: u32 = 20; +pub const IMAGE_REL_MIPS_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_MIPS_REFHALF: u32 = 1; +pub const IMAGE_REL_MIPS_REFWORD: u32 = 2; +pub const IMAGE_REL_MIPS_JMPADDR: u32 = 3; +pub const IMAGE_REL_MIPS_REFHI: u32 = 4; +pub const IMAGE_REL_MIPS_REFLO: u32 = 5; +pub const IMAGE_REL_MIPS_GPREL: u32 = 6; +pub const IMAGE_REL_MIPS_LITERAL: u32 = 7; +pub const IMAGE_REL_MIPS_SECTION: u32 = 10; +pub const IMAGE_REL_MIPS_SECREL: u32 = 11; +pub const IMAGE_REL_MIPS_SECRELLO: u32 = 12; +pub const IMAGE_REL_MIPS_SECRELHI: u32 = 13; +pub const IMAGE_REL_MIPS_TOKEN: u32 = 14; +pub const IMAGE_REL_MIPS_JMPADDR16: u32 = 16; +pub const IMAGE_REL_MIPS_REFWORDNB: u32 = 34; +pub const IMAGE_REL_MIPS_PAIR: u32 = 37; +pub const IMAGE_REL_ALPHA_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_ALPHA_REFLONG: u32 = 1; +pub const IMAGE_REL_ALPHA_REFQUAD: u32 = 2; +pub const IMAGE_REL_ALPHA_GPREL32: u32 = 3; +pub const IMAGE_REL_ALPHA_LITERAL: u32 = 4; +pub const IMAGE_REL_ALPHA_LITUSE: u32 = 5; +pub const IMAGE_REL_ALPHA_GPDISP: u32 = 6; +pub const IMAGE_REL_ALPHA_BRADDR: u32 = 7; +pub const IMAGE_REL_ALPHA_HINT: u32 = 8; +pub const IMAGE_REL_ALPHA_INLINE_REFLONG: u32 = 9; +pub const IMAGE_REL_ALPHA_REFHI: u32 = 10; +pub const IMAGE_REL_ALPHA_REFLO: u32 = 11; +pub const IMAGE_REL_ALPHA_PAIR: u32 = 12; +pub const IMAGE_REL_ALPHA_MATCH: u32 = 13; +pub const IMAGE_REL_ALPHA_SECTION: u32 = 14; +pub const IMAGE_REL_ALPHA_SECREL: u32 = 15; +pub const IMAGE_REL_ALPHA_REFLONGNB: u32 = 16; +pub const IMAGE_REL_ALPHA_SECRELLO: u32 = 17; +pub const IMAGE_REL_ALPHA_SECRELHI: u32 = 18; +pub const IMAGE_REL_ALPHA_REFQ3: u32 = 19; +pub const IMAGE_REL_ALPHA_REFQ2: u32 = 20; +pub const IMAGE_REL_ALPHA_REFQ1: u32 = 21; +pub const IMAGE_REL_ALPHA_GPRELLO: u32 = 22; +pub const IMAGE_REL_ALPHA_GPRELHI: u32 = 23; +pub const IMAGE_REL_PPC_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_PPC_ADDR64: u32 = 1; +pub const IMAGE_REL_PPC_ADDR32: u32 = 2; +pub const IMAGE_REL_PPC_ADDR24: u32 = 3; +pub const IMAGE_REL_PPC_ADDR16: u32 = 4; +pub const IMAGE_REL_PPC_ADDR14: u32 = 5; +pub const IMAGE_REL_PPC_REL24: u32 = 6; +pub const IMAGE_REL_PPC_REL14: u32 = 7; +pub const IMAGE_REL_PPC_TOCREL16: u32 = 8; +pub const IMAGE_REL_PPC_TOCREL14: u32 = 9; +pub const IMAGE_REL_PPC_ADDR32NB: u32 = 10; +pub const IMAGE_REL_PPC_SECREL: u32 = 11; +pub const IMAGE_REL_PPC_SECTION: u32 = 12; +pub const IMAGE_REL_PPC_IFGLUE: u32 = 13; +pub const IMAGE_REL_PPC_IMGLUE: u32 = 14; +pub const IMAGE_REL_PPC_SECREL16: u32 = 15; +pub const IMAGE_REL_PPC_REFHI: u32 = 16; +pub const IMAGE_REL_PPC_REFLO: u32 = 17; +pub const IMAGE_REL_PPC_PAIR: u32 = 18; +pub const IMAGE_REL_PPC_SECRELLO: u32 = 19; +pub const IMAGE_REL_PPC_SECRELHI: u32 = 20; +pub const IMAGE_REL_PPC_GPREL: u32 = 21; +pub const IMAGE_REL_PPC_TOKEN: u32 = 22; +pub const IMAGE_REL_PPC_TYPEMASK: u32 = 255; +pub const IMAGE_REL_PPC_NEG: u32 = 256; +pub const IMAGE_REL_PPC_BRTAKEN: u32 = 512; +pub const IMAGE_REL_PPC_BRNTAKEN: u32 = 1024; +pub const IMAGE_REL_PPC_TOCDEFN: u32 = 2048; +pub const IMAGE_REL_SH3_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_SH3_DIRECT16: u32 = 1; +pub const IMAGE_REL_SH3_DIRECT32: u32 = 2; +pub const IMAGE_REL_SH3_DIRECT8: u32 = 3; +pub const IMAGE_REL_SH3_DIRECT8_WORD: u32 = 4; +pub const IMAGE_REL_SH3_DIRECT8_LONG: u32 = 5; +pub const IMAGE_REL_SH3_DIRECT4: u32 = 6; +pub const IMAGE_REL_SH3_DIRECT4_WORD: u32 = 7; +pub const IMAGE_REL_SH3_DIRECT4_LONG: u32 = 8; +pub const IMAGE_REL_SH3_PCREL8_WORD: u32 = 9; +pub const IMAGE_REL_SH3_PCREL8_LONG: u32 = 10; +pub const IMAGE_REL_SH3_PCREL12_WORD: u32 = 11; +pub const IMAGE_REL_SH3_STARTOF_SECTION: u32 = 12; +pub const IMAGE_REL_SH3_SIZEOF_SECTION: u32 = 13; +pub const IMAGE_REL_SH3_SECTION: u32 = 14; +pub const IMAGE_REL_SH3_SECREL: u32 = 15; +pub const IMAGE_REL_SH3_DIRECT32_NB: u32 = 16; +pub const IMAGE_REL_SH3_GPREL4_LONG: u32 = 17; +pub const IMAGE_REL_SH3_TOKEN: u32 = 18; +pub const IMAGE_REL_SHM_PCRELPT: u32 = 19; +pub const IMAGE_REL_SHM_REFLO: u32 = 20; +pub const IMAGE_REL_SHM_REFHALF: u32 = 21; +pub const IMAGE_REL_SHM_RELLO: u32 = 22; +pub const IMAGE_REL_SHM_RELHALF: u32 = 23; +pub const IMAGE_REL_SHM_PAIR: u32 = 24; +pub const IMAGE_REL_SH_NOMODE: u32 = 32768; +pub const IMAGE_REL_ARM_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_ARM_ADDR32: u32 = 1; +pub const IMAGE_REL_ARM_ADDR32NB: u32 = 2; +pub const IMAGE_REL_ARM_BRANCH24: u32 = 3; +pub const IMAGE_REL_ARM_BRANCH11: u32 = 4; +pub const IMAGE_REL_ARM_TOKEN: u32 = 5; +pub const IMAGE_REL_ARM_GPREL12: u32 = 6; +pub const IMAGE_REL_ARM_GPREL7: u32 = 7; +pub const IMAGE_REL_ARM_BLX24: u32 = 8; +pub const IMAGE_REL_ARM_BLX11: u32 = 9; +pub const IMAGE_REL_ARM_SECTION: u32 = 14; +pub const IMAGE_REL_ARM_SECREL: u32 = 15; +pub const IMAGE_REL_ARM_MOV32A: u32 = 16; +pub const IMAGE_REL_ARM_MOV32: u32 = 16; +pub const IMAGE_REL_ARM_MOV32T: u32 = 17; +pub const IMAGE_REL_THUMB_MOV32: u32 = 17; +pub const IMAGE_REL_ARM_BRANCH20T: u32 = 18; +pub const IMAGE_REL_THUMB_BRANCH20: u32 = 18; +pub const IMAGE_REL_ARM_BRANCH24T: u32 = 20; +pub const IMAGE_REL_THUMB_BRANCH24: u32 = 20; +pub const IMAGE_REL_ARM_BLX23T: u32 = 21; +pub const IMAGE_REL_THUMB_BLX23: u32 = 21; +pub const IMAGE_REL_AM_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_AM_ADDR32: u32 = 1; +pub const IMAGE_REL_AM_ADDR32NB: u32 = 2; +pub const IMAGE_REL_AM_CALL32: u32 = 3; +pub const IMAGE_REL_AM_FUNCINFO: u32 = 4; +pub const IMAGE_REL_AM_REL32_1: u32 = 5; +pub const IMAGE_REL_AM_REL32_2: u32 = 6; +pub const IMAGE_REL_AM_SECREL: u32 = 7; +pub const IMAGE_REL_AM_SECTION: u32 = 8; +pub const IMAGE_REL_AM_TOKEN: u32 = 9; +pub const IMAGE_REL_AMD64_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_AMD64_ADDR64: u32 = 1; +pub const IMAGE_REL_AMD64_ADDR32: u32 = 2; +pub const IMAGE_REL_AMD64_ADDR32NB: u32 = 3; +pub const IMAGE_REL_AMD64_REL32: u32 = 4; +pub const IMAGE_REL_AMD64_REL32_1: u32 = 5; +pub const IMAGE_REL_AMD64_REL32_2: u32 = 6; +pub const IMAGE_REL_AMD64_REL32_3: u32 = 7; +pub const IMAGE_REL_AMD64_REL32_4: u32 = 8; +pub const IMAGE_REL_AMD64_REL32_5: u32 = 9; +pub const IMAGE_REL_AMD64_SECTION: u32 = 10; +pub const IMAGE_REL_AMD64_SECREL: u32 = 11; +pub const IMAGE_REL_AMD64_SECREL7: u32 = 12; +pub const IMAGE_REL_AMD64_TOKEN: u32 = 13; +pub const IMAGE_REL_AMD64_SREL32: u32 = 14; +pub const IMAGE_REL_AMD64_PAIR: u32 = 15; +pub const IMAGE_REL_AMD64_SSPAN32: u32 = 16; +pub const IMAGE_REL_IA64_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_IA64_IMM14: u32 = 1; +pub const IMAGE_REL_IA64_IMM22: u32 = 2; +pub const IMAGE_REL_IA64_IMM64: u32 = 3; +pub const IMAGE_REL_IA64_DIR32: u32 = 4; +pub const IMAGE_REL_IA64_DIR64: u32 = 5; +pub const IMAGE_REL_IA64_PCREL21B: u32 = 6; +pub const IMAGE_REL_IA64_PCREL21M: u32 = 7; +pub const IMAGE_REL_IA64_PCREL21F: u32 = 8; +pub const IMAGE_REL_IA64_GPREL22: u32 = 9; +pub const IMAGE_REL_IA64_LTOFF22: u32 = 10; +pub const IMAGE_REL_IA64_SECTION: u32 = 11; +pub const IMAGE_REL_IA64_SECREL22: u32 = 12; +pub const IMAGE_REL_IA64_SECREL64I: u32 = 13; +pub const IMAGE_REL_IA64_SECREL32: u32 = 14; +pub const IMAGE_REL_IA64_DIR32NB: u32 = 16; +pub const IMAGE_REL_IA64_SREL14: u32 = 17; +pub const IMAGE_REL_IA64_SREL22: u32 = 18; +pub const IMAGE_REL_IA64_SREL32: u32 = 19; +pub const IMAGE_REL_IA64_UREL32: u32 = 20; +pub const IMAGE_REL_IA64_PCREL60X: u32 = 21; +pub const IMAGE_REL_IA64_PCREL60B: u32 = 22; +pub const IMAGE_REL_IA64_PCREL60F: u32 = 23; +pub const IMAGE_REL_IA64_PCREL60I: u32 = 24; +pub const IMAGE_REL_IA64_PCREL60M: u32 = 25; +pub const IMAGE_REL_IA64_IMMGPREL64: u32 = 26; +pub const IMAGE_REL_IA64_TOKEN: u32 = 27; +pub const IMAGE_REL_IA64_GPREL32: u32 = 28; +pub const IMAGE_REL_IA64_ADDEND: u32 = 31; +pub const IMAGE_REL_CEF_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_CEF_ADDR32: u32 = 1; +pub const IMAGE_REL_CEF_ADDR64: u32 = 2; +pub const IMAGE_REL_CEF_ADDR32NB: u32 = 3; +pub const IMAGE_REL_CEF_SECTION: u32 = 4; +pub const IMAGE_REL_CEF_SECREL: u32 = 5; +pub const IMAGE_REL_CEF_TOKEN: u32 = 6; +pub const IMAGE_REL_CEE_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_CEE_ADDR32: u32 = 1; +pub const IMAGE_REL_CEE_ADDR64: u32 = 2; +pub const IMAGE_REL_CEE_ADDR32NB: u32 = 3; +pub const IMAGE_REL_CEE_SECTION: u32 = 4; +pub const IMAGE_REL_CEE_SECREL: u32 = 5; +pub const IMAGE_REL_CEE_TOKEN: u32 = 6; +pub const IMAGE_REL_M32R_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_M32R_ADDR32: u32 = 1; +pub const IMAGE_REL_M32R_ADDR32NB: u32 = 2; +pub const IMAGE_REL_M32R_ADDR24: u32 = 3; +pub const IMAGE_REL_M32R_GPREL16: u32 = 4; +pub const IMAGE_REL_M32R_PCREL24: u32 = 5; +pub const IMAGE_REL_M32R_PCREL16: u32 = 6; +pub const IMAGE_REL_M32R_PCREL8: u32 = 7; +pub const IMAGE_REL_M32R_REFHALF: u32 = 8; +pub const IMAGE_REL_M32R_REFHI: u32 = 9; +pub const IMAGE_REL_M32R_REFLO: u32 = 10; +pub const IMAGE_REL_M32R_PAIR: u32 = 11; +pub const IMAGE_REL_M32R_SECTION: u32 = 12; +pub const IMAGE_REL_M32R_SECREL32: u32 = 13; +pub const IMAGE_REL_M32R_TOKEN: u32 = 14; +pub const IMAGE_REL_EBC_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_EBC_ADDR32NB: u32 = 1; +pub const IMAGE_REL_EBC_REL32: u32 = 2; +pub const IMAGE_REL_EBC_SECTION: u32 = 3; +pub const IMAGE_REL_EBC_SECREL: u32 = 4; +pub const EMARCH_ENC_I17_IMM7B_INST_WORD_X: u32 = 3; +pub const EMARCH_ENC_I17_IMM7B_SIZE_X: u32 = 7; +pub const EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X: u32 = 4; +pub const EMARCH_ENC_I17_IMM7B_VAL_POS_X: u32 = 0; +pub const EMARCH_ENC_I17_IMM9D_INST_WORD_X: u32 = 3; +pub const EMARCH_ENC_I17_IMM9D_SIZE_X: u32 = 9; +pub const EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X: u32 = 18; +pub const EMARCH_ENC_I17_IMM9D_VAL_POS_X: u32 = 7; +pub const EMARCH_ENC_I17_IMM5C_INST_WORD_X: u32 = 3; +pub const EMARCH_ENC_I17_IMM5C_SIZE_X: u32 = 5; +pub const EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X: u32 = 13; +pub const EMARCH_ENC_I17_IMM5C_VAL_POS_X: u32 = 16; +pub const EMARCH_ENC_I17_IC_INST_WORD_X: u32 = 3; +pub const EMARCH_ENC_I17_IC_SIZE_X: u32 = 1; +pub const EMARCH_ENC_I17_IC_INST_WORD_POS_X: u32 = 12; +pub const EMARCH_ENC_I17_IC_VAL_POS_X: u32 = 21; +pub const EMARCH_ENC_I17_IMM41a_INST_WORD_X: u32 = 1; +pub const EMARCH_ENC_I17_IMM41a_SIZE_X: u32 = 10; +pub const EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X: u32 = 14; +pub const EMARCH_ENC_I17_IMM41a_VAL_POS_X: u32 = 22; +pub const EMARCH_ENC_I17_IMM41b_INST_WORD_X: u32 = 1; +pub const EMARCH_ENC_I17_IMM41b_SIZE_X: u32 = 8; +pub const EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X: u32 = 24; +pub const EMARCH_ENC_I17_IMM41b_VAL_POS_X: u32 = 32; +pub const EMARCH_ENC_I17_IMM41c_INST_WORD_X: u32 = 2; +pub const EMARCH_ENC_I17_IMM41c_SIZE_X: u32 = 23; +pub const EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X: u32 = 0; +pub const EMARCH_ENC_I17_IMM41c_VAL_POS_X: u32 = 40; +pub const EMARCH_ENC_I17_SIGN_INST_WORD_X: u32 = 3; +pub const EMARCH_ENC_I17_SIGN_SIZE_X: u32 = 1; +pub const EMARCH_ENC_I17_SIGN_INST_WORD_POS_X: u32 = 27; +pub const EMARCH_ENC_I17_SIGN_VAL_POS_X: u32 = 63; +pub const X3_OPCODE_INST_WORD_X: u32 = 3; +pub const X3_OPCODE_SIZE_X: u32 = 4; +pub const X3_OPCODE_INST_WORD_POS_X: u32 = 28; +pub const X3_OPCODE_SIGN_VAL_POS_X: u32 = 0; +pub const X3_I_INST_WORD_X: u32 = 3; +pub const X3_I_SIZE_X: u32 = 1; +pub const X3_I_INST_WORD_POS_X: u32 = 27; +pub const X3_I_SIGN_VAL_POS_X: u32 = 59; +pub const X3_D_WH_INST_WORD_X: u32 = 3; +pub const X3_D_WH_SIZE_X: u32 = 3; +pub const X3_D_WH_INST_WORD_POS_X: u32 = 24; +pub const X3_D_WH_SIGN_VAL_POS_X: u32 = 0; +pub const X3_IMM20_INST_WORD_X: u32 = 3; +pub const X3_IMM20_SIZE_X: u32 = 20; +pub const X3_IMM20_INST_WORD_POS_X: u32 = 4; +pub const X3_IMM20_SIGN_VAL_POS_X: u32 = 0; +pub const X3_IMM39_1_INST_WORD_X: u32 = 2; +pub const X3_IMM39_1_SIZE_X: u32 = 23; +pub const X3_IMM39_1_INST_WORD_POS_X: u32 = 0; +pub const X3_IMM39_1_SIGN_VAL_POS_X: u32 = 36; +pub const X3_IMM39_2_INST_WORD_X: u32 = 1; +pub const X3_IMM39_2_SIZE_X: u32 = 16; +pub const X3_IMM39_2_INST_WORD_POS_X: u32 = 16; +pub const X3_IMM39_2_SIGN_VAL_POS_X: u32 = 20; +pub const X3_P_INST_WORD_X: u32 = 3; +pub const X3_P_SIZE_X: u32 = 4; +pub const X3_P_INST_WORD_POS_X: u32 = 0; +pub const X3_P_SIGN_VAL_POS_X: u32 = 0; +pub const X3_TMPLT_INST_WORD_X: u32 = 0; +pub const X3_TMPLT_SIZE_X: u32 = 4; +pub const X3_TMPLT_INST_WORD_POS_X: u32 = 0; +pub const X3_TMPLT_SIGN_VAL_POS_X: u32 = 0; +pub const X3_BTYPE_QP_INST_WORD_X: u32 = 2; +pub const X3_BTYPE_QP_SIZE_X: u32 = 9; +pub const X3_BTYPE_QP_INST_WORD_POS_X: u32 = 23; +pub const X3_BTYPE_QP_INST_VAL_POS_X: u32 = 0; +pub const X3_EMPTY_INST_WORD_X: u32 = 1; +pub const X3_EMPTY_SIZE_X: u32 = 2; +pub const X3_EMPTY_INST_WORD_POS_X: u32 = 14; +pub const X3_EMPTY_INST_VAL_POS_X: u32 = 0; +pub const IMAGE_SIZEOF_LINENUMBER: u32 = 6; +pub const IMAGE_SIZEOF_BASE_RELOCATION: u32 = 8; +pub const IMAGE_REL_BASED_ABSOLUTE: u32 = 0; +pub const IMAGE_REL_BASED_HIGH: u32 = 1; +pub const IMAGE_REL_BASED_LOW: u32 = 2; +pub const IMAGE_REL_BASED_HIGHLOW: u32 = 3; +pub const IMAGE_REL_BASED_HIGHADJ: u32 = 4; +pub const IMAGE_REL_BASED_MIPS_JMPADDR: u32 = 5; +pub const IMAGE_REL_BASED_ARM_MOV32: u32 = 5; +pub const IMAGE_REL_BASED_THUMB_MOV32: u32 = 7; +pub const IMAGE_REL_BASED_MIPS_JMPADDR16: u32 = 9; +pub const IMAGE_REL_BASED_IA64_IMM64: u32 = 9; +pub const IMAGE_REL_BASED_DIR64: u32 = 10; +pub const IMAGE_ARCHIVE_START_SIZE: u32 = 8; +pub const IMAGE_ARCHIVE_START: &'static [u8; 9usize] = b"!\n\0"; +pub const IMAGE_ARCHIVE_END: &'static [u8; 3usize] = b"`\n\0"; +pub const IMAGE_ARCHIVE_PAD: &'static [u8; 2usize] = b"\n\0"; +pub const IMAGE_ARCHIVE_LINKER_MEMBER: &'static [u8; 17usize] = b"/ \0"; +pub const IMAGE_ARCHIVE_LONGNAMES_MEMBER: &'static [u8; 17usize] = b"// \0"; +pub const IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR: u32 = 60; +pub const IMAGE_ORDINAL_FLAG64: i64 = -9223372036854775808; +pub const IMAGE_ORDINAL_FLAG32: u32 = 2147483648; +pub const IMAGE_ORDINAL_FLAG: i64 = -9223372036854775808; +pub const IMAGE_RESOURCE_NAME_IS_STRING: u32 = 2147483648; +pub const IMAGE_RESOURCE_DATA_IS_DIRECTORY: u32 = 2147483648; +pub const IMAGE_DEBUG_TYPE_UNKNOWN: u32 = 0; +pub const IMAGE_DEBUG_TYPE_COFF: u32 = 1; +pub const IMAGE_DEBUG_TYPE_CODEVIEW: u32 = 2; +pub const IMAGE_DEBUG_TYPE_FPO: u32 = 3; +pub const IMAGE_DEBUG_TYPE_MISC: u32 = 4; +pub const IMAGE_DEBUG_TYPE_EXCEPTION: u32 = 5; +pub const IMAGE_DEBUG_TYPE_FIXUP: u32 = 6; +pub const IMAGE_DEBUG_TYPE_OMAP_TO_SRC: u32 = 7; +pub const IMAGE_DEBUG_TYPE_OMAP_FROM_SRC: u32 = 8; +pub const IMAGE_DEBUG_TYPE_BORLAND: u32 = 9; +pub const IMAGE_DEBUG_TYPE_RESERVED10: u32 = 10; +pub const IMAGE_DEBUG_TYPE_CLSID: u32 = 11; +pub const FRAME_FPO: u32 = 0; +pub const FRAME_TRAP: u32 = 1; +pub const FRAME_TSS: u32 = 2; +pub const FRAME_NONFPO: u32 = 3; +pub const SIZEOF_RFPO_DATA: u32 = 16; +pub const IMAGE_DEBUG_MISC_EXENAME: u32 = 1; +pub const IMAGE_SEPARATE_DEBUG_SIGNATURE: u32 = 18756; +pub const NON_PAGED_DEBUG_SIGNATURE: u32 = 18766; +pub const IMAGE_SEPARATE_DEBUG_FLAGS_MASK: u32 = 32768; +pub const IMAGE_SEPARATE_DEBUG_MISMATCH: u32 = 32768; +pub const IMPORT_OBJECT_HDR_SIG2: u32 = 65535; +pub const _RTL_RUN_ONCE_DEF: u32 = 1; +pub const RTL_RUN_ONCE_CTX_RESERVED_BITS: u32 = 2; +pub const FAST_FAIL_LEGACY_GS_VIOLATION: u32 = 0; +pub const FAST_FAIL_VTGUARD_CHECK_FAILURE: u32 = 1; +pub const FAST_FAIL_STACK_COOKIE_CHECK_FAILURE: u32 = 2; +pub const FAST_FAIL_CORRUPT_LIST_ENTRY: u32 = 3; +pub const FAST_FAIL_INCORRECT_STACK: u32 = 4; +pub const FAST_FAIL_INVALID_ARG: u32 = 5; +pub const FAST_FAIL_GS_COOKIE_INIT: u32 = 6; +pub const FAST_FAIL_FATAL_APP_EXIT: u32 = 7; +pub const FAST_FAIL_RANGE_CHECK_FAILURE: u32 = 8; +pub const FAST_FAIL_UNSAFE_REGISTRY_ACCESS: u32 = 9; +pub const FAST_FAIL_INVALID_FAST_FAIL_CODE: u32 = 4294967295; +pub const HEAP_NO_SERIALIZE: u32 = 1; +pub const HEAP_GROWABLE: u32 = 2; +pub const HEAP_GENERATE_EXCEPTIONS: u32 = 4; +pub const HEAP_ZERO_MEMORY: u32 = 8; +pub const HEAP_REALLOC_IN_PLACE_ONLY: u32 = 16; +pub const HEAP_TAIL_CHECKING_ENABLED: u32 = 32; +pub const HEAP_FREE_CHECKING_ENABLED: u32 = 64; +pub const HEAP_DISABLE_COALESCE_ON_FREE: u32 = 128; +pub const HEAP_CREATE_ALIGN_16: u32 = 65536; +pub const HEAP_CREATE_ENABLE_TRACING: u32 = 131072; +pub const HEAP_CREATE_ENABLE_EXECUTE: u32 = 262144; +pub const HEAP_MAXIMUM_TAG: u32 = 4095; +pub const HEAP_PSEUDO_TAG_FLAG: u32 = 32768; +pub const HEAP_TAG_SHIFT: u32 = 18; +pub const IS_TEXT_UNICODE_ASCII16: u32 = 1; +pub const IS_TEXT_UNICODE_REVERSE_ASCII16: u32 = 16; +pub const IS_TEXT_UNICODE_STATISTICS: u32 = 2; +pub const IS_TEXT_UNICODE_REVERSE_STATISTICS: u32 = 32; +pub const IS_TEXT_UNICODE_CONTROLS: u32 = 4; +pub const IS_TEXT_UNICODE_REVERSE_CONTROLS: u32 = 64; +pub const IS_TEXT_UNICODE_SIGNATURE: u32 = 8; +pub const IS_TEXT_UNICODE_REVERSE_SIGNATURE: u32 = 128; +pub const IS_TEXT_UNICODE_ILLEGAL_CHARS: u32 = 256; +pub const IS_TEXT_UNICODE_ODD_LENGTH: u32 = 512; +pub const IS_TEXT_UNICODE_DBCS_LEADBYTE: u32 = 1024; +pub const IS_TEXT_UNICODE_NULL_BYTES: u32 = 4096; +pub const IS_TEXT_UNICODE_UNICODE_MASK: u32 = 15; +pub const IS_TEXT_UNICODE_REVERSE_MASK: u32 = 240; +pub const IS_TEXT_UNICODE_NOT_UNICODE_MASK: u32 = 3840; +pub const IS_TEXT_UNICODE_NOT_ASCII_MASK: u32 = 61440; +pub const COMPRESSION_FORMAT_NONE: u32 = 0; +pub const COMPRESSION_FORMAT_DEFAULT: u32 = 1; +pub const COMPRESSION_FORMAT_LZNT1: u32 = 2; +pub const COMPRESSION_FORMAT_XPRESS: u32 = 3; +pub const COMPRESSION_FORMAT_XPRESS_HUFF: u32 = 4; +pub const COMPRESSION_ENGINE_STANDARD: u32 = 0; +pub const COMPRESSION_ENGINE_MAXIMUM: u32 = 256; +pub const COMPRESSION_ENGINE_HIBER: u32 = 512; +pub const SEF_DACL_AUTO_INHERIT: u32 = 1; +pub const SEF_SACL_AUTO_INHERIT: u32 = 2; +pub const SEF_DEFAULT_DESCRIPTOR_FOR_OBJECT: u32 = 4; +pub const SEF_AVOID_PRIVILEGE_CHECK: u32 = 8; +pub const SEF_AVOID_OWNER_CHECK: u32 = 16; +pub const SEF_DEFAULT_OWNER_FROM_PARENT: u32 = 32; +pub const SEF_DEFAULT_GROUP_FROM_PARENT: u32 = 64; +pub const SEF_MACL_NO_WRITE_UP: u32 = 256; +pub const SEF_MACL_NO_READ_UP: u32 = 512; +pub const SEF_MACL_NO_EXECUTE_UP: u32 = 1024; +pub const SEF_AVOID_OWNER_RESTRICTION: u32 = 4096; +pub const SEF_MACL_VALID_FLAGS: u32 = 1792; +pub const MESSAGE_RESOURCE_UNICODE: u32 = 1; +pub const VER_EQUAL: u32 = 1; +pub const VER_GREATER: u32 = 2; +pub const VER_GREATER_EQUAL: u32 = 3; +pub const VER_LESS: u32 = 4; +pub const VER_LESS_EQUAL: u32 = 5; +pub const VER_AND: u32 = 6; +pub const VER_OR: u32 = 7; +pub const VER_CONDITION_MASK: u32 = 7; +pub const VER_NUM_BITS_PER_CONDITION_MASK: u32 = 3; +pub const VER_MINORVERSION: u32 = 1; +pub const VER_MAJORVERSION: u32 = 2; +pub const VER_BUILDNUMBER: u32 = 4; +pub const VER_PLATFORMID: u32 = 8; +pub const VER_SERVICEPACKMINOR: u32 = 16; +pub const VER_SERVICEPACKMAJOR: u32 = 32; +pub const VER_SUITENAME: u32 = 64; +pub const VER_PRODUCT_TYPE: u32 = 128; +pub const VER_NT_WORKSTATION: u32 = 1; +pub const VER_NT_DOMAIN_CONTROLLER: u32 = 2; +pub const VER_NT_SERVER: u32 = 3; +pub const VER_PLATFORM_WIN32s: u32 = 0; +pub const VER_PLATFORM_WIN32_WINDOWS: u32 = 1; +pub const VER_PLATFORM_WIN32_NT: u32 = 2; +pub const RTL_UMS_VERSION: u32 = 256; +pub const RTL_CRITSECT_TYPE: u32 = 0; +pub const RTL_RESOURCE_TYPE: u32 = 1; +pub const RTL_CRITICAL_SECTION_FLAG_NO_DEBUG_INFO: u32 = 16777216; +pub const RTL_CRITICAL_SECTION_FLAG_DYNAMIC_SPIN: u32 = 33554432; +pub const RTL_CRITICAL_SECTION_FLAG_STATIC_INIT: u32 = 67108864; +pub const RTL_CRITICAL_SECTION_FLAG_RESOURCE_TYPE: u32 = 134217728; +pub const RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO: u32 = 268435456; +pub const RTL_CRITICAL_SECTION_ALL_FLAG_BITS: u32 = 4278190080; +pub const RTL_CRITICAL_SECTION_FLAG_RESERVED: u32 = 3758096384; +pub const RTL_CRITICAL_SECTION_DEBUG_FLAG_STATIC_INIT: u32 = 1; +pub const RTL_CONDITION_VARIABLE_LOCKMODE_SHARED: u32 = 1; +pub const WT_EXECUTEDEFAULT: u32 = 0; +pub const WT_EXECUTEINIOTHREAD: u32 = 1; +pub const WT_EXECUTEINUITHREAD: u32 = 2; +pub const WT_EXECUTEINWAITTHREAD: u32 = 4; +pub const WT_EXECUTEONLYONCE: u32 = 8; +pub const WT_EXECUTEINTIMERTHREAD: u32 = 32; +pub const WT_EXECUTELONGFUNCTION: u32 = 16; +pub const WT_EXECUTEINPERSISTENTIOTHREAD: u32 = 64; +pub const WT_EXECUTEINPERSISTENTTHREAD: u32 = 128; +pub const WT_TRANSFER_IMPERSONATION: u32 = 256; +pub const WT_EXECUTEDELETEWAIT: u32 = 8; +pub const WT_EXECUTEINLONGTHREAD: u32 = 16; +pub const MAX_SUPPORTED_OS_NUM: u32 = 4; +pub const ACTIVATION_CONTEXT_PATH_TYPE_NONE: u32 = 1; +pub const ACTIVATION_CONTEXT_PATH_TYPE_WIN32_FILE: u32 = 2; +pub const ACTIVATION_CONTEXT_PATH_TYPE_URL: u32 = 3; +pub const ACTIVATION_CONTEXT_PATH_TYPE_ASSEMBLYREF: u32 = 4; +pub const INVALID_OS_COUNT: u32 = 65535; +pub const CREATE_BOUNDARY_DESCRIPTOR_ADD_APPCONTAINER_SID: u32 = 1; +pub const RTL_VRF_FLG_FULL_PAGE_HEAP: u32 = 1; +pub const RTL_VRF_FLG_RESERVED_DONOTUSE: u32 = 2; +pub const RTL_VRF_FLG_HANDLE_CHECKS: u32 = 4; +pub const RTL_VRF_FLG_STACK_CHECKS: u32 = 8; +pub const RTL_VRF_FLG_APPCOMPAT_CHECKS: u32 = 16; +pub const RTL_VRF_FLG_TLS_CHECKS: u32 = 32; +pub const RTL_VRF_FLG_DIRTY_STACKS: u32 = 64; +pub const RTL_VRF_FLG_RPC_CHECKS: u32 = 128; +pub const RTL_VRF_FLG_COM_CHECKS: u32 = 256; +pub const RTL_VRF_FLG_DANGEROUS_APIS: u32 = 512; +pub const RTL_VRF_FLG_RACE_CHECKS: u32 = 1024; +pub const RTL_VRF_FLG_DEADLOCK_CHECKS: u32 = 2048; +pub const RTL_VRF_FLG_FIRST_CHANCE_EXCEPTION_CHECKS: u32 = 4096; +pub const RTL_VRF_FLG_VIRTUAL_MEM_CHECKS: u32 = 8192; +pub const RTL_VRF_FLG_ENABLE_LOGGING: u32 = 16384; +pub const RTL_VRF_FLG_FAST_FILL_HEAP: u32 = 32768; +pub const RTL_VRF_FLG_VIRTUAL_SPACE_TRACKING: u32 = 65536; +pub const RTL_VRF_FLG_ENABLED_SYSTEM_WIDE: u32 = 131072; +pub const RTL_VRF_FLG_MISCELLANEOUS_CHECKS: u32 = 131072; +pub const RTL_VRF_FLG_LOCK_CHECKS: u32 = 262144; +pub const APPLICATION_VERIFIER_INTERNAL_ERROR: u32 = 2147483648; +pub const APPLICATION_VERIFIER_INTERNAL_WARNING: u32 = 1073741824; +pub const APPLICATION_VERIFIER_NO_BREAK: u32 = 536870912; +pub const APPLICATION_VERIFIER_CONTINUABLE_BREAK: u32 = 268435456; +pub const APPLICATION_VERIFIER_UNKNOWN_ERROR: u32 = 1; +pub const APPLICATION_VERIFIER_ACCESS_VIOLATION: u32 = 2; +pub const APPLICATION_VERIFIER_UNSYNCHRONIZED_ACCESS: u32 = 3; +pub const APPLICATION_VERIFIER_EXTREME_SIZE_REQUEST: u32 = 4; +pub const APPLICATION_VERIFIER_BAD_HEAP_HANDLE: u32 = 5; +pub const APPLICATION_VERIFIER_SWITCHED_HEAP_HANDLE: u32 = 6; +pub const APPLICATION_VERIFIER_DOUBLE_FREE: u32 = 7; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK: u32 = 8; +pub const APPLICATION_VERIFIER_DESTROY_PROCESS_HEAP: u32 = 9; +pub const APPLICATION_VERIFIER_UNEXPECTED_EXCEPTION: u32 = 10; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_EXCEPTION_RAISED_FOR_HEADER: u32 = 11; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_EXCEPTION_RAISED_FOR_PROBING: u32 = 12; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_HEADER: u32 = 13; +pub const APPLICATION_VERIFIER_CORRUPTED_FREED_HEAP_BLOCK: u32 = 14; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_SUFFIX: u32 = 15; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_START_STAMP: u32 = 16; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_END_STAMP: u32 = 17; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_BLOCK_PREFIX: u32 = 18; +pub const APPLICATION_VERIFIER_FIRST_CHANCE_ACCESS_VIOLATION: u32 = 19; +pub const APPLICATION_VERIFIER_CORRUPTED_HEAP_LIST: u32 = 20; +pub const APPLICATION_VERIFIER_TERMINATE_THREAD_CALL: u32 = 256; +pub const APPLICATION_VERIFIER_STACK_OVERFLOW: u32 = 257; +pub const APPLICATION_VERIFIER_INVALID_EXIT_PROCESS_CALL: u32 = 258; +pub const APPLICATION_VERIFIER_EXIT_THREAD_OWNS_LOCK: u32 = 512; +pub const APPLICATION_VERIFIER_LOCK_IN_UNLOADED_DLL: u32 = 513; +pub const APPLICATION_VERIFIER_LOCK_IN_FREED_HEAP: u32 = 514; +pub const APPLICATION_VERIFIER_LOCK_DOUBLE_INITIALIZE: u32 = 515; +pub const APPLICATION_VERIFIER_LOCK_IN_FREED_MEMORY: u32 = 516; +pub const APPLICATION_VERIFIER_LOCK_CORRUPTED: u32 = 517; +pub const APPLICATION_VERIFIER_LOCK_INVALID_OWNER: u32 = 518; +pub const APPLICATION_VERIFIER_LOCK_INVALID_RECURSION_COUNT: u32 = 519; +pub const APPLICATION_VERIFIER_LOCK_INVALID_LOCK_COUNT: u32 = 520; +pub const APPLICATION_VERIFIER_LOCK_OVER_RELEASED: u32 = 521; +pub const APPLICATION_VERIFIER_LOCK_NOT_INITIALIZED: u32 = 528; +pub const APPLICATION_VERIFIER_LOCK_ALREADY_INITIALIZED: u32 = 529; +pub const APPLICATION_VERIFIER_LOCK_IN_FREED_VMEM: u32 = 530; +pub const APPLICATION_VERIFIER_LOCK_IN_UNMAPPED_MEM: u32 = 531; +pub const APPLICATION_VERIFIER_THREAD_NOT_LOCK_OWNER: u32 = 532; +pub const APPLICATION_VERIFIER_INVALID_HANDLE: u32 = 768; +pub const APPLICATION_VERIFIER_INVALID_TLS_VALUE: u32 = 769; +pub const APPLICATION_VERIFIER_INCORRECT_WAIT_CALL: u32 = 770; +pub const APPLICATION_VERIFIER_NULL_HANDLE: u32 = 771; +pub const APPLICATION_VERIFIER_WAIT_IN_DLLMAIN: u32 = 772; +pub const APPLICATION_VERIFIER_COM_ERROR: u32 = 1024; +pub const APPLICATION_VERIFIER_COM_API_IN_DLLMAIN: u32 = 1025; +pub const APPLICATION_VERIFIER_COM_UNHANDLED_EXCEPTION: u32 = 1026; +pub const APPLICATION_VERIFIER_COM_UNBALANCED_COINIT: u32 = 1027; +pub const APPLICATION_VERIFIER_COM_UNBALANCED_OLEINIT: u32 = 1028; +pub const APPLICATION_VERIFIER_COM_UNBALANCED_SWC: u32 = 1029; +pub const APPLICATION_VERIFIER_COM_NULL_DACL: u32 = 1030; +pub const APPLICATION_VERIFIER_COM_UNSAFE_IMPERSONATION: u32 = 1031; +pub const APPLICATION_VERIFIER_COM_SMUGGLED_WRAPPER: u32 = 1032; +pub const APPLICATION_VERIFIER_COM_SMUGGLED_PROXY: u32 = 1033; +pub const APPLICATION_VERIFIER_COM_CF_SUCCESS_WITH_NULL: u32 = 1034; +pub const APPLICATION_VERIFIER_COM_GCO_SUCCESS_WITH_NULL: u32 = 1035; +pub const APPLICATION_VERIFIER_COM_OBJECT_IN_FREED_MEMORY: u32 = 1036; +pub const APPLICATION_VERIFIER_COM_OBJECT_IN_UNLOADED_DLL: u32 = 1037; +pub const APPLICATION_VERIFIER_COM_VTBL_IN_FREED_MEMORY: u32 = 1038; +pub const APPLICATION_VERIFIER_COM_VTBL_IN_UNLOADED_DLL: u32 = 1039; +pub const APPLICATION_VERIFIER_COM_HOLDING_LOCKS_ON_CALL: u32 = 1040; +pub const APPLICATION_VERIFIER_RPC_ERROR: u32 = 1280; +pub const APPLICATION_VERIFIER_INVALID_FREEMEM: u32 = 1536; +pub const APPLICATION_VERIFIER_INVALID_ALLOCMEM: u32 = 1537; +pub const APPLICATION_VERIFIER_INVALID_MAPVIEW: u32 = 1538; +pub const APPLICATION_VERIFIER_PROBE_INVALID_ADDRESS: u32 = 1539; +pub const APPLICATION_VERIFIER_PROBE_FREE_MEM: u32 = 1540; +pub const APPLICATION_VERIFIER_PROBE_GUARD_PAGE: u32 = 1541; +pub const APPLICATION_VERIFIER_PROBE_NULL: u32 = 1542; +pub const APPLICATION_VERIFIER_PROBE_INVALID_START_OR_SIZE: u32 = 1543; +pub const APPLICATION_VERIFIER_SIZE_HEAP_UNEXPECTED_EXCEPTION: u32 = 1560; +pub const PERFORMANCE_DATA_VERSION: u32 = 1; +pub const READ_THREAD_PROFILING_FLAG_DISPATCHING: u32 = 1; +pub const READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS: u32 = 2; +pub const DLL_PROCESS_ATTACH: u32 = 1; +pub const DLL_THREAD_ATTACH: u32 = 2; +pub const DLL_THREAD_DETACH: u32 = 3; +pub const DLL_PROCESS_DETACH: u32 = 0; +pub const DLL_PROCESS_VERIFIER: u32 = 4; +pub const EVENTLOG_SEQUENTIAL_READ: u32 = 1; +pub const EVENTLOG_SEEK_READ: u32 = 2; +pub const EVENTLOG_FORWARDS_READ: u32 = 4; +pub const EVENTLOG_BACKWARDS_READ: u32 = 8; +pub const EVENTLOG_SUCCESS: u32 = 0; +pub const EVENTLOG_ERROR_TYPE: u32 = 1; +pub const EVENTLOG_WARNING_TYPE: u32 = 2; +pub const EVENTLOG_INFORMATION_TYPE: u32 = 4; +pub const EVENTLOG_AUDIT_SUCCESS: u32 = 8; +pub const EVENTLOG_AUDIT_FAILURE: u32 = 16; +pub const EVENTLOG_START_PAIRED_EVENT: u32 = 1; +pub const EVENTLOG_END_PAIRED_EVENT: u32 = 2; +pub const EVENTLOG_END_ALL_PAIRED_EVENTS: u32 = 4; +pub const EVENTLOG_PAIRED_EVENT_ACTIVE: u32 = 8; +pub const EVENTLOG_PAIRED_EVENT_INACTIVE: u32 = 16; +pub const MAXLOGICALLOGNAMESIZE: u32 = 256; +pub const KEY_QUERY_VALUE: u32 = 1; +pub const KEY_SET_VALUE: u32 = 2; +pub const KEY_CREATE_SUB_KEY: u32 = 4; +pub const KEY_ENUMERATE_SUB_KEYS: u32 = 8; +pub const KEY_NOTIFY: u32 = 16; +pub const KEY_CREATE_LINK: u32 = 32; +pub const KEY_WOW64_64KEY: u32 = 256; +pub const KEY_WOW64_32KEY: u32 = 512; +pub const KEY_WOW64_RES: u32 = 768; +pub const REG_STANDARD_FORMAT: u32 = 1; +pub const REG_LATEST_FORMAT: u32 = 2; +pub const REG_NO_COMPRESSION: u32 = 4; +pub const REG_FORCE_UNLOAD: u32 = 1; +pub const REG_NONE: u32 = 0; +pub const REG_SZ: u32 = 1; +pub const REG_EXPAND_SZ: u32 = 2; +pub const REG_BINARY: u32 = 3; +pub const REG_DWORD: u32 = 4; +pub const REG_DWORD_LITTLE_ENDIAN: u32 = 4; +pub const REG_DWORD_BIG_ENDIAN: u32 = 5; +pub const REG_LINK: u32 = 6; +pub const REG_MULTI_SZ: u32 = 7; +pub const REG_RESOURCE_LIST: u32 = 8; +pub const REG_FULL_RESOURCE_DESCRIPTOR: u32 = 9; +pub const REG_RESOURCE_REQUIREMENTS_LIST: u32 = 10; +pub const REG_QWORD: u32 = 11; +pub const REG_QWORD_LITTLE_ENDIAN: u32 = 11; +pub const SERVICE_KERNEL_DRIVER: u32 = 1; +pub const SERVICE_FILE_SYSTEM_DRIVER: u32 = 2; +pub const SERVICE_ADAPTER: u32 = 4; +pub const SERVICE_RECOGNIZER_DRIVER: u32 = 8; +pub const SERVICE_DRIVER: u32 = 11; +pub const SERVICE_WIN32_OWN_PROCESS: u32 = 16; +pub const SERVICE_WIN32_SHARE_PROCESS: u32 = 32; +pub const SERVICE_WIN32: u32 = 48; +pub const SERVICE_INTERACTIVE_PROCESS: u32 = 256; +pub const SERVICE_TYPE_ALL: u32 = 319; +pub const SERVICE_BOOT_START: u32 = 0; +pub const SERVICE_SYSTEM_START: u32 = 1; +pub const SERVICE_AUTO_START: u32 = 2; +pub const SERVICE_DEMAND_START: u32 = 3; +pub const SERVICE_DISABLED: u32 = 4; +pub const SERVICE_ERROR_IGNORE: u32 = 0; +pub const SERVICE_ERROR_NORMAL: u32 = 1; +pub const SERVICE_ERROR_SEVERE: u32 = 2; +pub const SERVICE_ERROR_CRITICAL: u32 = 3; +pub const CM_SERVICE_NETWORK_BOOT_LOAD: u32 = 1; +pub const CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD: u32 = 2; +pub const CM_SERVICE_USB_DISK_BOOT_LOAD: u32 = 4; +pub const CM_SERVICE_SD_DISK_BOOT_LOAD: u32 = 8; +pub const CM_SERVICE_USB3_DISK_BOOT_LOAD: u32 = 16; +pub const CM_SERVICE_MEASURED_BOOT_LOAD: u32 = 32; +pub const CM_SERVICE_VERIFIER_BOOT_LOAD: u32 = 64; +pub const CM_SERVICE_WINPE_BOOT_LOAD: u32 = 128; +pub const CM_SERVICE_VALID_PROMOTION_MASK: u32 = 255; +pub const TAPE_DRIVE_FIXED: u32 = 1; +pub const TAPE_DRIVE_SELECT: u32 = 2; +pub const TAPE_DRIVE_INITIATOR: u32 = 4; +pub const TAPE_DRIVE_ERASE_SHORT: u32 = 16; +pub const TAPE_DRIVE_ERASE_LONG: u32 = 32; +pub const TAPE_DRIVE_ERASE_BOP_ONLY: u32 = 64; +pub const TAPE_DRIVE_ERASE_IMMEDIATE: u32 = 128; +pub const TAPE_DRIVE_TAPE_CAPACITY: u32 = 256; +pub const TAPE_DRIVE_TAPE_REMAINING: u32 = 512; +pub const TAPE_DRIVE_FIXED_BLOCK: u32 = 1024; +pub const TAPE_DRIVE_VARIABLE_BLOCK: u32 = 2048; +pub const TAPE_DRIVE_WRITE_PROTECT: u32 = 4096; +pub const TAPE_DRIVE_EOT_WZ_SIZE: u32 = 8192; +pub const TAPE_DRIVE_ECC: u32 = 65536; +pub const TAPE_DRIVE_COMPRESSION: u32 = 131072; +pub const TAPE_DRIVE_PADDING: u32 = 262144; +pub const TAPE_DRIVE_REPORT_SMKS: u32 = 524288; +pub const TAPE_DRIVE_GET_ABSOLUTE_BLK: u32 = 1048576; +pub const TAPE_DRIVE_GET_LOGICAL_BLK: u32 = 2097152; +pub const TAPE_DRIVE_SET_EOT_WZ_SIZE: u32 = 4194304; +pub const TAPE_DRIVE_EJECT_MEDIA: u32 = 16777216; +pub const TAPE_DRIVE_CLEAN_REQUESTS: u32 = 33554432; +pub const TAPE_DRIVE_SET_CMP_BOP_ONLY: u32 = 67108864; +pub const TAPE_DRIVE_RESERVED_BIT: u32 = 2147483648; +pub const TAPE_DRIVE_LOAD_UNLOAD: u32 = 2147483649; +pub const TAPE_DRIVE_TENSION: u32 = 2147483650; +pub const TAPE_DRIVE_LOCK_UNLOCK: u32 = 2147483652; +pub const TAPE_DRIVE_REWIND_IMMEDIATE: u32 = 2147483656; +pub const TAPE_DRIVE_SET_BLOCK_SIZE: u32 = 2147483664; +pub const TAPE_DRIVE_LOAD_UNLD_IMMED: u32 = 2147483680; +pub const TAPE_DRIVE_TENSION_IMMED: u32 = 2147483712; +pub const TAPE_DRIVE_LOCK_UNLK_IMMED: u32 = 2147483776; +pub const TAPE_DRIVE_SET_ECC: u32 = 2147483904; +pub const TAPE_DRIVE_SET_COMPRESSION: u32 = 2147484160; +pub const TAPE_DRIVE_SET_PADDING: u32 = 2147484672; +pub const TAPE_DRIVE_SET_REPORT_SMKS: u32 = 2147485696; +pub const TAPE_DRIVE_ABSOLUTE_BLK: u32 = 2147487744; +pub const TAPE_DRIVE_ABS_BLK_IMMED: u32 = 2147491840; +pub const TAPE_DRIVE_LOGICAL_BLK: u32 = 2147500032; +pub const TAPE_DRIVE_LOG_BLK_IMMED: u32 = 2147516416; +pub const TAPE_DRIVE_END_OF_DATA: u32 = 2147549184; +pub const TAPE_DRIVE_RELATIVE_BLKS: u32 = 2147614720; +pub const TAPE_DRIVE_FILEMARKS: u32 = 2147745792; +pub const TAPE_DRIVE_SEQUENTIAL_FMKS: u32 = 2148007936; +pub const TAPE_DRIVE_SETMARKS: u32 = 2148532224; +pub const TAPE_DRIVE_SEQUENTIAL_SMKS: u32 = 2149580800; +pub const TAPE_DRIVE_REVERSE_POSITION: u32 = 2151677952; +pub const TAPE_DRIVE_SPACE_IMMEDIATE: u32 = 2155872256; +pub const TAPE_DRIVE_WRITE_SETMARKS: u32 = 2164260864; +pub const TAPE_DRIVE_WRITE_FILEMARKS: u32 = 2181038080; +pub const TAPE_DRIVE_WRITE_SHORT_FMKS: u32 = 2214592512; +pub const TAPE_DRIVE_WRITE_LONG_FMKS: u32 = 2281701376; +pub const TAPE_DRIVE_WRITE_MARK_IMMED: u32 = 2415919104; +pub const TAPE_DRIVE_FORMAT: u32 = 2684354560; +pub const TAPE_DRIVE_FORMAT_IMMEDIATE: u32 = 3221225472; +pub const TAPE_DRIVE_HIGH_FEATURES: u32 = 2147483648; +pub const TRANSACTION_MANAGER_VOLATILE: u32 = 1; +pub const TRANSACTION_MANAGER_COMMIT_DEFAULT: u32 = 0; +pub const TRANSACTION_MANAGER_COMMIT_SYSTEM_VOLUME: u32 = 2; +pub const TRANSACTION_MANAGER_COMMIT_SYSTEM_HIVES: u32 = 4; +pub const TRANSACTION_MANAGER_COMMIT_LOWEST: u32 = 8; +pub const TRANSACTION_MANAGER_CORRUPT_FOR_RECOVERY: u32 = 16; +pub const TRANSACTION_MANAGER_CORRUPT_FOR_PROGRESS: u32 = 32; +pub const TRANSACTION_MANAGER_MAXIMUM_OPTION: u32 = 63; +pub const TRANSACTION_DO_NOT_PROMOTE: u32 = 1; +pub const TRANSACTION_MAXIMUM_OPTION: u32 = 1; +pub const RESOURCE_MANAGER_VOLATILE: u32 = 1; +pub const RESOURCE_MANAGER_COMMUNICATION: u32 = 2; +pub const RESOURCE_MANAGER_MAXIMUM_OPTION: u32 = 3; +pub const CRM_PROTOCOL_EXPLICIT_MARSHAL_ONLY: u32 = 1; +pub const CRM_PROTOCOL_DYNAMIC_MARSHAL_INFO: u32 = 2; +pub const CRM_PROTOCOL_MAXIMUM_OPTION: u32 = 3; +pub const ENLISTMENT_SUPERIOR: u32 = 1; +pub const ENLISTMENT_MAXIMUM_OPTION: u32 = 1; +pub const TRANSACTION_NOTIFY_MASK: u32 = 1073741823; +pub const TRANSACTION_NOTIFY_PREPREPARE: u32 = 1; +pub const TRANSACTION_NOTIFY_PREPARE: u32 = 2; +pub const TRANSACTION_NOTIFY_COMMIT: u32 = 4; +pub const TRANSACTION_NOTIFY_ROLLBACK: u32 = 8; +pub const TRANSACTION_NOTIFY_PREPREPARE_COMPLETE: u32 = 16; +pub const TRANSACTION_NOTIFY_PREPARE_COMPLETE: u32 = 32; +pub const TRANSACTION_NOTIFY_COMMIT_COMPLETE: u32 = 64; +pub const TRANSACTION_NOTIFY_ROLLBACK_COMPLETE: u32 = 128; +pub const TRANSACTION_NOTIFY_RECOVER: u32 = 256; +pub const TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT: u32 = 512; +pub const TRANSACTION_NOTIFY_DELEGATE_COMMIT: u32 = 1024; +pub const TRANSACTION_NOTIFY_RECOVER_QUERY: u32 = 2048; +pub const TRANSACTION_NOTIFY_ENLIST_PREPREPARE: u32 = 4096; +pub const TRANSACTION_NOTIFY_LAST_RECOVER: u32 = 8192; +pub const TRANSACTION_NOTIFY_INDOUBT: u32 = 16384; +pub const TRANSACTION_NOTIFY_PROPAGATE_PULL: u32 = 32768; +pub const TRANSACTION_NOTIFY_PROPAGATE_PUSH: u32 = 65536; +pub const TRANSACTION_NOTIFY_MARSHAL: u32 = 131072; +pub const TRANSACTION_NOTIFY_ENLIST_MASK: u32 = 262144; +pub const TRANSACTION_NOTIFY_RM_DISCONNECTED: u32 = 16777216; +pub const TRANSACTION_NOTIFY_TM_ONLINE: u32 = 33554432; +pub const TRANSACTION_NOTIFY_COMMIT_REQUEST: u32 = 67108864; +pub const TRANSACTION_NOTIFY_PROMOTE: u32 = 134217728; +pub const TRANSACTION_NOTIFY_PROMOTE_NEW: u32 = 268435456; +pub const TRANSACTION_NOTIFY_REQUEST_OUTCOME: u32 = 536870912; +pub const TRANSACTION_NOTIFY_COMMIT_FINALIZE: u32 = 1073741824; +pub const TRANSACTIONMANAGER_OBJECT_PATH: &'static [u8; 21usize] = b"\\TransactionManager\\\0"; +pub const TRANSACTION_OBJECT_PATH: &'static [u8; 14usize] = b"\\Transaction\\\0"; +pub const ENLISTMENT_OBJECT_PATH: &'static [u8; 13usize] = b"\\Enlistment\\\0"; +pub const RESOURCE_MANAGER_OBJECT_PATH: &'static [u8; 18usize] = b"\\ResourceManager\\\0"; +pub const TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED: u32 = 1; +pub const KTM_MARSHAL_BLOB_VERSION_MAJOR: u32 = 1; +pub const KTM_MARSHAL_BLOB_VERSION_MINOR: u32 = 1; +pub const MAX_TRANSACTION_DESCRIPTION_LENGTH: u32 = 64; +pub const MAX_RESOURCEMANAGER_DESCRIPTION_LENGTH: u32 = 64; +pub const TRANSACTIONMANAGER_QUERY_INFORMATION: u32 = 1; +pub const TRANSACTIONMANAGER_SET_INFORMATION: u32 = 2; +pub const TRANSACTIONMANAGER_RECOVER: u32 = 4; +pub const TRANSACTIONMANAGER_RENAME: u32 = 8; +pub const TRANSACTIONMANAGER_CREATE_RM: u32 = 16; +pub const TRANSACTIONMANAGER_BIND_TRANSACTION: u32 = 32; +pub const TRANSACTION_QUERY_INFORMATION: u32 = 1; +pub const TRANSACTION_SET_INFORMATION: u32 = 2; +pub const TRANSACTION_ENLIST: u32 = 4; +pub const TRANSACTION_COMMIT: u32 = 8; +pub const TRANSACTION_ROLLBACK: u32 = 16; +pub const TRANSACTION_PROPAGATE: u32 = 32; +pub const TRANSACTION_RIGHT_RESERVED1: u32 = 64; +pub const RESOURCEMANAGER_QUERY_INFORMATION: u32 = 1; +pub const RESOURCEMANAGER_SET_INFORMATION: u32 = 2; +pub const RESOURCEMANAGER_RECOVER: u32 = 4; +pub const RESOURCEMANAGER_ENLIST: u32 = 8; +pub const RESOURCEMANAGER_GET_NOTIFICATION: u32 = 16; +pub const RESOURCEMANAGER_REGISTER_PROTOCOL: u32 = 32; +pub const RESOURCEMANAGER_COMPLETE_PROPAGATION: u32 = 64; +pub const ENLISTMENT_QUERY_INFORMATION: u32 = 1; +pub const ENLISTMENT_SET_INFORMATION: u32 = 2; +pub const ENLISTMENT_RECOVER: u32 = 4; +pub const ENLISTMENT_SUBORDINATE_RIGHTS: u32 = 8; +pub const ENLISTMENT_SUPERIOR_RIGHTS: u32 = 16; +pub const WOW64_CONTEXT_i386: u32 = 65536; +pub const WOW64_CONTEXT_i486: u32 = 65536; +pub const WOW64_CONTEXT_EXCEPTION_ACTIVE: u32 = 134217728; +pub const WOW64_CONTEXT_SERVICE_ACTIVE: u32 = 268435456; +pub const WOW64_CONTEXT_EXCEPTION_REQUEST: u32 = 1073741824; +pub const WOW64_CONTEXT_EXCEPTION_REPORTING: u32 = 2147483648; +pub const WOW64_SIZE_OF_80387_REGISTERS: u32 = 80; +pub const WOW64_MAXIMUM_SUPPORTED_EXTENSION: u32 = 512; +pub const ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION: u32 = 1; +pub const ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION: u32 = 2; +pub const ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION: u32 = 3; +pub const ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION: u32 = 4; +pub const ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION: u32 = 5; +pub const ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION: u32 = 6; +pub const ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION: u32 = 7; +pub const ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE: u32 = 8; +pub const ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES: u32 = 9; +pub const ACTIVATION_CONTEXT_SECTION_APPLICATION_SETTINGS: u32 = 10; +pub const ACTIVATION_CONTEXT_SECTION_COMPATIBILITY_INFO: u32 = 11; +pub const HMONITOR_DECLARED: u32 = 1; +pub const DM_UPDATE: u32 = 1; +pub const DM_COPY: u32 = 2; +pub const DM_PROMPT: u32 = 4; +pub const DM_MODIFY: u32 = 8; +pub const DM_IN_BUFFER: u32 = 8; +pub const DM_IN_PROMPT: u32 = 4; +pub const DM_OUT_BUFFER: u32 = 2; +pub const DM_OUT_DEFAULT: u32 = 1; +pub const DC_FIELDS: u32 = 1; +pub const DC_PAPERS: u32 = 2; +pub const DC_PAPERSIZE: u32 = 3; +pub const DC_MINEXTENT: u32 = 4; +pub const DC_MAXEXTENT: u32 = 5; +pub const DC_BINS: u32 = 6; +pub const DC_DUPLEX: u32 = 7; +pub const DC_SIZE: u32 = 8; +pub const DC_EXTRA: u32 = 9; +pub const DC_VERSION: u32 = 10; +pub const DC_DRIVER: u32 = 11; +pub const DC_BINNAMES: u32 = 12; +pub const DC_ENUMRESOLUTIONS: u32 = 13; +pub const DC_FILEDEPENDENCIES: u32 = 14; +pub const DC_TRUETYPE: u32 = 15; +pub const DC_PAPERNAMES: u32 = 16; +pub const DC_ORIENTATION: u32 = 17; +pub const DC_COPIES: u32 = 18; +pub const FIND_FIRST_EX_CASE_SENSITIVE: u32 = 1; +pub const FIND_FIRST_EX_LARGE_FETCH: u32 = 2; +pub const LOCKFILE_FAIL_IMMEDIATELY: u32 = 1; +pub const LOCKFILE_EXCLUSIVE_LOCK: u32 = 2; +pub const PROCESS_HEAP_REGION: u32 = 1; +pub const PROCESS_HEAP_UNCOMMITTED_RANGE: u32 = 2; +pub const PROCESS_HEAP_ENTRY_BUSY: u32 = 4; +pub const PROCESS_HEAP_SEG_ALLOC: u32 = 8; +pub const PROCESS_HEAP_ENTRY_MOVEABLE: u32 = 16; +pub const PROCESS_HEAP_ENTRY_DDESHARE: u32 = 32; +pub const EXCEPTION_DEBUG_EVENT: u32 = 1; +pub const CREATE_THREAD_DEBUG_EVENT: u32 = 2; +pub const CREATE_PROCESS_DEBUG_EVENT: u32 = 3; +pub const EXIT_THREAD_DEBUG_EVENT: u32 = 4; +pub const EXIT_PROCESS_DEBUG_EVENT: u32 = 5; +pub const LOAD_DLL_DEBUG_EVENT: u32 = 6; +pub const UNLOAD_DLL_DEBUG_EVENT: u32 = 7; +pub const OUTPUT_DEBUG_STRING_EVENT: u32 = 8; +pub const RIP_EVENT: u32 = 9; +pub const LMEM_FIXED: u32 = 0; +pub const LMEM_MOVEABLE: u32 = 2; +pub const LMEM_NOCOMPACT: u32 = 16; +pub const LMEM_NODISCARD: u32 = 32; +pub const LMEM_ZEROINIT: u32 = 64; +pub const LMEM_MODIFY: u32 = 128; +pub const LMEM_DISCARDABLE: u32 = 3840; +pub const LMEM_VALID_FLAGS: u32 = 3954; +pub const LMEM_INVALID_HANDLE: u32 = 32768; +pub const LHND: u32 = 66; +pub const LPTR: u32 = 64; +pub const NONZEROLHND: u32 = 2; +pub const NONZEROLPTR: u32 = 0; +pub const LMEM_DISCARDED: u32 = 16384; +pub const LMEM_LOCKCOUNT: u32 = 255; +pub const CREATE_NEW: u32 = 1; +pub const CREATE_ALWAYS: u32 = 2; +pub const OPEN_EXISTING: u32 = 3; +pub const OPEN_ALWAYS: u32 = 4; +pub const TRUNCATE_EXISTING: u32 = 5; +pub const FIND_RESOURCE_DIRECTORY_TYPES: u32 = 256; +pub const FIND_RESOURCE_DIRECTORY_NAMES: u32 = 512; +pub const FIND_RESOURCE_DIRECTORY_LANGUAGES: u32 = 1024; +pub const RESOURCE_ENUM_LN: u32 = 1; +pub const RESOURCE_ENUM_MUI: u32 = 2; +pub const RESOURCE_ENUM_MUI_SYSTEM: u32 = 4; +pub const RESOURCE_ENUM_VALIDATE: u32 = 8; +pub const RESOURCE_ENUM_MODULE_EXACT: u32 = 16; +pub const SUPPORT_LANG_NUMBER: u32 = 32; +pub const DONT_RESOLVE_DLL_REFERENCES: u32 = 1; +pub const LOAD_LIBRARY_AS_DATAFILE: u32 = 2; +pub const LOAD_WITH_ALTERED_SEARCH_PATH: u32 = 8; +pub const LOAD_IGNORE_CODE_AUTHZ_LEVEL: u32 = 16; +pub const LOAD_LIBRARY_AS_IMAGE_RESOURCE: u32 = 32; +pub const LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE: u32 = 64; +pub const LOAD_LIBRARY_REQUIRE_SIGNED_TARGET: u32 = 128; +pub const LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR: u32 = 256; +pub const LOAD_LIBRARY_SEARCH_APPLICATION_DIR: u32 = 512; +pub const LOAD_LIBRARY_SEARCH_USER_DIRS: u32 = 1024; +pub const LOAD_LIBRARY_SEARCH_SYSTEM32: u32 = 2048; +pub const LOAD_LIBRARY_SEARCH_DEFAULT_DIRS: u32 = 4096; +pub const LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER: u32 = 2048; +pub const GET_MODULE_HANDLE_EX_FLAG_PIN: u32 = 1; +pub const GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT: u32 = 2; +pub const GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS: u32 = 4; +pub const CURRENT_IMPORT_REDIRECTION_VERSION: u32 = 1; +pub const FILE_MAP_WRITE: u32 = 2; +pub const FILE_MAP_READ: u32 = 4; +pub const FILE_MAP_COPY: u32 = 1; +pub const FILE_MAP_RESERVE: u32 = 2147483648; +pub const FILE_MAP_EXECUTE: u32 = 32; +pub const FILE_CACHE_MAX_HARD_ENABLE: u32 = 1; +pub const FILE_CACHE_MAX_HARD_DISABLE: u32 = 2; +pub const FILE_CACHE_MIN_HARD_ENABLE: u32 = 4; +pub const FILE_CACHE_MIN_HARD_DISABLE: u32 = 8; +pub const PRIVATE_NAMESPACE_FLAG_DESTROY: u32 = 1; +pub const MEMORY_PRIORITY_VERY_LOW: u32 = 1; +pub const MEMORY_PRIORITY_LOW: u32 = 2; +pub const MEMORY_PRIORITY_MEDIUM: u32 = 3; +pub const MEMORY_PRIORITY_BELOW_NORMAL: u32 = 4; +pub const MEMORY_PRIORITY_NORMAL: u32 = 5; +pub const INIT_ONCE_CTX_RESERVED_BITS: u32 = 2; +pub const CONDITION_VARIABLE_LOCKMODE_SHARED: u32 = 1; +pub const MUTEX_MODIFY_STATE: u32 = 1; +pub const SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY: u32 = 1; +pub const SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY: u32 = 2; +pub const SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE: u32 = 4; +pub const FILE_BEGIN: u32 = 0; +pub const FILE_CURRENT: u32 = 1; +pub const FILE_END: u32 = 2; +pub const FILE_FLAG_WRITE_THROUGH: u32 = 2147483648; +pub const FILE_FLAG_OVERLAPPED: u32 = 1073741824; +pub const FILE_FLAG_NO_BUFFERING: u32 = 536870912; +pub const FILE_FLAG_RANDOM_ACCESS: u32 = 268435456; +pub const FILE_FLAG_SEQUENTIAL_SCAN: u32 = 134217728; +pub const FILE_FLAG_DELETE_ON_CLOSE: u32 = 67108864; +pub const FILE_FLAG_BACKUP_SEMANTICS: u32 = 33554432; +pub const FILE_FLAG_POSIX_SEMANTICS: u32 = 16777216; +pub const FILE_FLAG_SESSION_AWARE: u32 = 8388608; +pub const FILE_FLAG_OPEN_REPARSE_POINT: u32 = 2097152; +pub const FILE_FLAG_OPEN_NO_RECALL: u32 = 1048576; +pub const FILE_FLAG_FIRST_PIPE_INSTANCE: u32 = 524288; +pub const PROGRESS_CONTINUE: u32 = 0; +pub const PROGRESS_CANCEL: u32 = 1; +pub const PROGRESS_STOP: u32 = 2; +pub const PROGRESS_QUIET: u32 = 3; +pub const CALLBACK_CHUNK_FINISHED: u32 = 0; +pub const CALLBACK_STREAM_SWITCH: u32 = 1; +pub const COPY_FILE_FAIL_IF_EXISTS: u32 = 1; +pub const COPY_FILE_RESTARTABLE: u32 = 2; +pub const COPY_FILE_OPEN_SOURCE_FOR_WRITE: u32 = 4; +pub const COPY_FILE_ALLOW_DECRYPTED_DESTINATION: u32 = 8; +pub const REPLACEFILE_WRITE_THROUGH: u32 = 1; +pub const REPLACEFILE_IGNORE_MERGE_ERRORS: u32 = 2; +pub const PIPE_ACCESS_INBOUND: u32 = 1; +pub const PIPE_ACCESS_OUTBOUND: u32 = 2; +pub const PIPE_ACCESS_DUPLEX: u32 = 3; +pub const PIPE_CLIENT_END: u32 = 0; +pub const PIPE_SERVER_END: u32 = 1; +pub const PIPE_WAIT: u32 = 0; +pub const PIPE_NOWAIT: u32 = 1; +pub const PIPE_READMODE_BYTE: u32 = 0; +pub const PIPE_READMODE_MESSAGE: u32 = 2; +pub const PIPE_TYPE_BYTE: u32 = 0; +pub const PIPE_TYPE_MESSAGE: u32 = 4; +pub const PIPE_ACCEPT_REMOTE_CLIENTS: u32 = 0; +pub const PIPE_REJECT_REMOTE_CLIENTS: u32 = 8; +pub const PIPE_UNLIMITED_INSTANCES: u32 = 255; +pub const SECURITY_CONTEXT_TRACKING: u32 = 262144; +pub const SECURITY_EFFECTIVE_ONLY: u32 = 524288; +pub const SECURITY_SQOS_PRESENT: u32 = 1048576; +pub const SECURITY_VALID_SQOS_FLAGS: u32 = 2031616; +pub const FAIL_FAST_GENERATE_EXCEPTION_ADDRESS: u32 = 1; +pub const FAIL_FAST_NO_HARD_ERROR_DLG: u32 = 2; +pub const DTR_CONTROL_DISABLE: u32 = 0; +pub const DTR_CONTROL_ENABLE: u32 = 1; +pub const DTR_CONTROL_HANDSHAKE: u32 = 2; +pub const RTS_CONTROL_DISABLE: u32 = 0; +pub const RTS_CONTROL_ENABLE: u32 = 1; +pub const RTS_CONTROL_HANDSHAKE: u32 = 2; +pub const RTS_CONTROL_TOGGLE: u32 = 3; +pub const GMEM_FIXED: u32 = 0; +pub const GMEM_MOVEABLE: u32 = 2; +pub const GMEM_NOCOMPACT: u32 = 16; +pub const GMEM_NODISCARD: u32 = 32; +pub const GMEM_ZEROINIT: u32 = 64; +pub const GMEM_MODIFY: u32 = 128; +pub const GMEM_DISCARDABLE: u32 = 256; +pub const GMEM_NOT_BANKED: u32 = 4096; +pub const GMEM_SHARE: u32 = 8192; +pub const GMEM_DDESHARE: u32 = 8192; +pub const GMEM_NOTIFY: u32 = 16384; +pub const GMEM_LOWER: u32 = 4096; +pub const GMEM_VALID_FLAGS: u32 = 32626; +pub const GMEM_INVALID_HANDLE: u32 = 32768; +pub const GHND: u32 = 66; +pub const GPTR: u32 = 64; +pub const GMEM_DISCARDED: u32 = 16384; +pub const GMEM_LOCKCOUNT: u32 = 255; +pub const DEBUG_PROCESS: u32 = 1; +pub const DEBUG_ONLY_THIS_PROCESS: u32 = 2; +pub const CREATE_SUSPENDED: u32 = 4; +pub const DETACHED_PROCESS: u32 = 8; +pub const CREATE_NEW_CONSOLE: u32 = 16; +pub const NORMAL_PRIORITY_CLASS: u32 = 32; +pub const IDLE_PRIORITY_CLASS: u32 = 64; +pub const HIGH_PRIORITY_CLASS: u32 = 128; +pub const REALTIME_PRIORITY_CLASS: u32 = 256; +pub const CREATE_NEW_PROCESS_GROUP: u32 = 512; +pub const CREATE_UNICODE_ENVIRONMENT: u32 = 1024; +pub const CREATE_SEPARATE_WOW_VDM: u32 = 2048; +pub const CREATE_SHARED_WOW_VDM: u32 = 4096; +pub const CREATE_FORCEDOS: u32 = 8192; +pub const BELOW_NORMAL_PRIORITY_CLASS: u32 = 16384; +pub const ABOVE_NORMAL_PRIORITY_CLASS: u32 = 32768; +pub const INHERIT_PARENT_AFFINITY: u32 = 65536; +pub const INHERIT_CALLER_PRIORITY: u32 = 131072; +pub const CREATE_PROTECTED_PROCESS: u32 = 262144; +pub const EXTENDED_STARTUPINFO_PRESENT: u32 = 524288; +pub const PROCESS_MODE_BACKGROUND_BEGIN: u32 = 1048576; +pub const PROCESS_MODE_BACKGROUND_END: u32 = 2097152; +pub const CREATE_BREAKAWAY_FROM_JOB: u32 = 16777216; +pub const CREATE_PRESERVE_CODE_AUTHZ_LEVEL: u32 = 33554432; +pub const CREATE_DEFAULT_ERROR_MODE: u32 = 67108864; +pub const CREATE_NO_WINDOW: u32 = 134217728; +pub const PROFILE_USER: u32 = 268435456; +pub const PROFILE_KERNEL: u32 = 536870912; +pub const PROFILE_SERVER: u32 = 1073741824; +pub const CREATE_IGNORE_SYSTEM_DEFAULT: u32 = 2147483648; +pub const STACK_SIZE_PARAM_IS_A_RESERVATION: u32 = 65536; +pub const THREAD_PRIORITY_LOWEST: i32 = -2; +pub const THREAD_PRIORITY_BELOW_NORMAL: i32 = -1; +pub const THREAD_PRIORITY_NORMAL: u32 = 0; +pub const THREAD_PRIORITY_HIGHEST: u32 = 2; +pub const THREAD_PRIORITY_ABOVE_NORMAL: u32 = 1; +pub const THREAD_PRIORITY_ERROR_RETURN: u32 = 2147483647; +pub const THREAD_PRIORITY_TIME_CRITICAL: u32 = 15; +pub const THREAD_PRIORITY_IDLE: i32 = -15; +pub const THREAD_MODE_BACKGROUND_BEGIN: u32 = 65536; +pub const THREAD_MODE_BACKGROUND_END: u32 = 131072; +pub const VOLUME_NAME_DOS: u32 = 0; +pub const VOLUME_NAME_GUID: u32 = 1; +pub const VOLUME_NAME_NT: u32 = 2; +pub const VOLUME_NAME_NONE: u32 = 4; +pub const FILE_NAME_NORMALIZED: u32 = 0; +pub const FILE_NAME_OPENED: u32 = 8; +pub const DRIVE_UNKNOWN: u32 = 0; +pub const DRIVE_NO_ROOT_DIR: u32 = 1; +pub const DRIVE_REMOVABLE: u32 = 2; +pub const DRIVE_FIXED: u32 = 3; +pub const DRIVE_REMOTE: u32 = 4; +pub const DRIVE_CDROM: u32 = 5; +pub const DRIVE_RAMDISK: u32 = 6; +pub const FILE_TYPE_UNKNOWN: u32 = 0; +pub const FILE_TYPE_DISK: u32 = 1; +pub const FILE_TYPE_CHAR: u32 = 2; +pub const FILE_TYPE_PIPE: u32 = 3; +pub const FILE_TYPE_REMOTE: u32 = 32768; +pub const NOPARITY: u32 = 0; +pub const ODDPARITY: u32 = 1; +pub const EVENPARITY: u32 = 2; +pub const MARKPARITY: u32 = 3; +pub const SPACEPARITY: u32 = 4; +pub const ONESTOPBIT: u32 = 0; +pub const ONE5STOPBITS: u32 = 1; +pub const TWOSTOPBITS: u32 = 2; +pub const IGNORE: u32 = 0; +pub const INFINITE: u32 = 4294967295; +pub const CBR_110: u32 = 110; +pub const CBR_300: u32 = 300; +pub const CBR_600: u32 = 600; +pub const CBR_1200: u32 = 1200; +pub const CBR_2400: u32 = 2400; +pub const CBR_4800: u32 = 4800; +pub const CBR_9600: u32 = 9600; +pub const CBR_14400: u32 = 14400; +pub const CBR_19200: u32 = 19200; +pub const CBR_38400: u32 = 38400; +pub const CBR_56000: u32 = 56000; +pub const CBR_57600: u32 = 57600; +pub const CBR_115200: u32 = 115200; +pub const CBR_128000: u32 = 128000; +pub const CBR_256000: u32 = 256000; +pub const CE_RXOVER: u32 = 1; +pub const CE_OVERRUN: u32 = 2; +pub const CE_RXPARITY: u32 = 4; +pub const CE_FRAME: u32 = 8; +pub const CE_BREAK: u32 = 16; +pub const CE_TXFULL: u32 = 256; +pub const CE_PTO: u32 = 512; +pub const CE_IOE: u32 = 1024; +pub const CE_DNS: u32 = 2048; +pub const CE_OOP: u32 = 4096; +pub const CE_MODE: u32 = 32768; +pub const IE_BADID: i32 = -1; +pub const IE_OPEN: i32 = -2; +pub const IE_NOPEN: i32 = -3; +pub const IE_MEMORY: i32 = -4; +pub const IE_DEFAULT: i32 = -5; +pub const IE_HARDWARE: i32 = -10; +pub const IE_BYTESIZE: i32 = -11; +pub const IE_BAUDRATE: i32 = -12; +pub const EV_RXCHAR: u32 = 1; +pub const EV_RXFLAG: u32 = 2; +pub const EV_TXEMPTY: u32 = 4; +pub const EV_CTS: u32 = 8; +pub const EV_DSR: u32 = 16; +pub const EV_RLSD: u32 = 32; +pub const EV_BREAK: u32 = 64; +pub const EV_ERR: u32 = 128; +pub const EV_RING: u32 = 256; +pub const EV_PERR: u32 = 512; +pub const EV_RX80FULL: u32 = 1024; +pub const EV_EVENT1: u32 = 2048; +pub const EV_EVENT2: u32 = 4096; +pub const SETXOFF: u32 = 1; +pub const SETXON: u32 = 2; +pub const SETRTS: u32 = 3; +pub const CLRRTS: u32 = 4; +pub const SETDTR: u32 = 5; +pub const CLRDTR: u32 = 6; +pub const RESETDEV: u32 = 7; +pub const SETBREAK: u32 = 8; +pub const CLRBREAK: u32 = 9; +pub const PURGE_TXABORT: u32 = 1; +pub const PURGE_RXABORT: u32 = 2; +pub const PURGE_TXCLEAR: u32 = 4; +pub const PURGE_RXCLEAR: u32 = 8; +pub const LPTx: u32 = 128; +pub const S_QUEUEEMPTY: u32 = 0; +pub const S_THRESHOLD: u32 = 1; +pub const S_ALLTHRESHOLD: u32 = 2; +pub const S_NORMAL: u32 = 0; +pub const S_LEGATO: u32 = 1; +pub const S_STACCATO: u32 = 2; +pub const S_PERIOD512: u32 = 0; +pub const S_PERIOD1024: u32 = 1; +pub const S_PERIOD2048: u32 = 2; +pub const S_PERIODVOICE: u32 = 3; +pub const S_WHITE512: u32 = 4; +pub const S_WHITE1024: u32 = 5; +pub const S_WHITE2048: u32 = 6; +pub const S_WHITEVOICE: u32 = 7; +pub const S_SERDVNA: i32 = -1; +pub const S_SEROFM: i32 = -2; +pub const S_SERMACT: i32 = -3; +pub const S_SERQFUL: i32 = -4; +pub const S_SERBDNT: i32 = -5; +pub const S_SERDLN: i32 = -6; +pub const S_SERDCC: i32 = -7; +pub const S_SERDTP: i32 = -8; +pub const S_SERDVL: i32 = -9; +pub const S_SERDMD: i32 = -10; +pub const S_SERDSH: i32 = -11; +pub const S_SERDPT: i32 = -12; +pub const S_SERDFQ: i32 = -13; +pub const S_SERDDR: i32 = -14; +pub const S_SERDSR: i32 = -15; +pub const S_SERDST: i32 = -16; +pub const NMPWAIT_WAIT_FOREVER: u32 = 4294967295; +pub const NMPWAIT_NOWAIT: u32 = 1; +pub const NMPWAIT_USE_DEFAULT_WAIT: u32 = 0; +pub const FS_CASE_IS_PRESERVED: u32 = 2; +pub const FS_CASE_SENSITIVE: u32 = 1; +pub const FS_UNICODE_STORED_ON_DISK: u32 = 4; +pub const FS_PERSISTENT_ACLS: u32 = 8; +pub const FS_VOL_IS_COMPRESSED: u32 = 32768; +pub const FS_FILE_COMPRESSION: u32 = 16; +pub const FS_FILE_ENCRYPTION: u32 = 131072; +pub const OF_READ: u32 = 0; +pub const OF_WRITE: u32 = 1; +pub const OF_READWRITE: u32 = 2; +pub const OF_SHARE_COMPAT: u32 = 0; +pub const OF_SHARE_EXCLUSIVE: u32 = 16; +pub const OF_SHARE_DENY_WRITE: u32 = 32; +pub const OF_SHARE_DENY_READ: u32 = 48; +pub const OF_SHARE_DENY_NONE: u32 = 64; +pub const OF_PARSE: u32 = 256; +pub const OF_DELETE: u32 = 512; +pub const OF_VERIFY: u32 = 1024; +pub const OF_CANCEL: u32 = 2048; +pub const OF_CREATE: u32 = 4096; +pub const OF_PROMPT: u32 = 8192; +pub const OF_EXIST: u32 = 16384; +pub const OF_REOPEN: u32 = 32768; +pub const OFS_MAXPATHNAME: u32 = 128; +pub const MAXINTATOM: u32 = 49152; +pub const SCS_32BIT_BINARY: u32 = 0; +pub const SCS_DOS_BINARY: u32 = 1; +pub const SCS_WOW_BINARY: u32 = 2; +pub const SCS_PIF_BINARY: u32 = 3; +pub const SCS_POSIX_BINARY: u32 = 4; +pub const SCS_OS216_BINARY: u32 = 5; +pub const SCS_64BIT_BINARY: u32 = 6; +pub const SCS_THIS_PLATFORM_BINARY: u32 = 6; +pub const FIBER_FLAG_FLOAT_SWITCH: u32 = 1; +pub const SEM_FAILCRITICALERRORS: u32 = 1; +pub const SEM_NOGPFAULTERRORBOX: u32 = 2; +pub const SEM_NOALIGNMENTFAULTEXCEPT: u32 = 4; +pub const SEM_NOOPENFILEERRORBOX: u32 = 32768; +pub const CRITICAL_SECTION_NO_DEBUG_INFO: u32 = 16777216; +pub const HANDLE_FLAG_INHERIT: u32 = 1; +pub const HANDLE_FLAG_PROTECT_FROM_CLOSE: u32 = 2; +pub const HINSTANCE_ERROR: u32 = 32; +pub const GET_TAPE_MEDIA_INFORMATION: u32 = 0; +pub const GET_TAPE_DRIVE_INFORMATION: u32 = 1; +pub const SET_TAPE_MEDIA_INFORMATION: u32 = 0; +pub const SET_TAPE_DRIVE_INFORMATION: u32 = 1; +pub const FORMAT_MESSAGE_IGNORE_INSERTS: u32 = 512; +pub const FORMAT_MESSAGE_FROM_STRING: u32 = 1024; +pub const FORMAT_MESSAGE_FROM_HMODULE: u32 = 2048; +pub const FORMAT_MESSAGE_FROM_SYSTEM: u32 = 4096; +pub const FORMAT_MESSAGE_ARGUMENT_ARRAY: u32 = 8192; +pub const FORMAT_MESSAGE_MAX_WIDTH_MASK: u32 = 255; +pub const FILE_ENCRYPTABLE: u32 = 0; +pub const FILE_IS_ENCRYPTED: u32 = 1; +pub const FILE_SYSTEM_ATTR: u32 = 2; +pub const FILE_ROOT_DIR: u32 = 3; +pub const FILE_SYSTEM_DIR: u32 = 4; +pub const FILE_UNKNOWN: u32 = 5; +pub const FILE_SYSTEM_NOT_SUPPORT: u32 = 6; +pub const FILE_USER_DISALLOWED: u32 = 7; +pub const FILE_READ_ONLY: u32 = 8; +pub const FILE_DIR_DISALLOWED: u32 = 9; +pub const FORMAT_MESSAGE_ALLOCATE_BUFFER: u32 = 256; +pub const EFS_USE_RECOVERY_KEYS: u32 = 1; +pub const CREATE_FOR_IMPORT: u32 = 1; +pub const CREATE_FOR_DIR: u32 = 2; +pub const OVERWRITE_HIDDEN: u32 = 4; +pub const EFSRPC_SECURE_ONLY: u32 = 8; +pub const BACKUP_INVALID: u32 = 0; +pub const BACKUP_DATA: u32 = 1; +pub const BACKUP_EA_DATA: u32 = 2; +pub const BACKUP_SECURITY_DATA: u32 = 3; +pub const BACKUP_ALTERNATE_DATA: u32 = 4; +pub const BACKUP_LINK: u32 = 5; +pub const BACKUP_PROPERTY_DATA: u32 = 6; +pub const BACKUP_OBJECT_ID: u32 = 7; +pub const BACKUP_REPARSE_DATA: u32 = 8; +pub const BACKUP_SPARSE_BLOCK: u32 = 9; +pub const BACKUP_TXFS_DATA: u32 = 10; +pub const STREAM_NORMAL_ATTRIBUTE: u32 = 0; +pub const STREAM_MODIFIED_WHEN_READ: u32 = 1; +pub const STREAM_CONTAINS_SECURITY: u32 = 2; +pub const STREAM_CONTAINS_PROPERTIES: u32 = 4; +pub const STREAM_SPARSE_ATTRIBUTE: u32 = 8; +pub const STARTF_USESHOWWINDOW: u32 = 1; +pub const STARTF_USESIZE: u32 = 2; +pub const STARTF_USEPOSITION: u32 = 4; +pub const STARTF_USECOUNTCHARS: u32 = 8; +pub const STARTF_USEFILLATTRIBUTE: u32 = 16; +pub const STARTF_RUNFULLSCREEN: u32 = 32; +pub const STARTF_FORCEONFEEDBACK: u32 = 64; +pub const STARTF_FORCEOFFFEEDBACK: u32 = 128; +pub const STARTF_USESTDHANDLES: u32 = 256; +pub const STARTF_USEHOTKEY: u32 = 512; +pub const STARTF_TITLEISLINKNAME: u32 = 2048; +pub const STARTF_TITLEISAPPID: u32 = 4096; +pub const STARTF_PREVENTPINNING: u32 = 8192; +pub const SHUTDOWN_NORETRY: u32 = 1; +pub const ATOM_FLAG_GLOBAL: u32 = 2; +pub const GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A: &'static [u8; 25usize] = + b"GetSystemWow64DirectoryA\0"; +pub const GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W: &'static [u8; 25usize] = + b"GetSystemWow64DirectoryA\0"; +pub const GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A: &'static [u8; 25usize] = + b"GetSystemWow64DirectoryW\0"; +pub const GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W: &'static [u8; 25usize] = + b"GetSystemWow64DirectoryW\0"; +pub const BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE: u32 = 1; +pub const BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE: u32 = 65536; +pub const BASE_SEARCH_PATH_PERMANENT: u32 = 32768; +pub const BASE_SEARCH_PATH_INVALID_FLAGS: i32 = -98306; +pub const DDD_RAW_TARGET_PATH: u32 = 1; +pub const DDD_REMOVE_DEFINITION: u32 = 2; +pub const DDD_EXACT_MATCH_ON_REMOVE: u32 = 4; +pub const DDD_NO_BROADCAST_SYSTEM: u32 = 8; +pub const DDD_LUID_BROADCAST_DRIVE: u32 = 16; +pub const MOVEFILE_REPLACE_EXISTING: u32 = 1; +pub const MOVEFILE_COPY_ALLOWED: u32 = 2; +pub const MOVEFILE_DELAY_UNTIL_REBOOT: u32 = 4; +pub const MOVEFILE_WRITE_THROUGH: u32 = 8; +pub const MOVEFILE_CREATE_HARDLINK: u32 = 16; +pub const MOVEFILE_FAIL_IF_NOT_TRACKABLE: u32 = 32; +pub const EVENTLOG_FULL_INFO: u32 = 0; +pub const MAX_COMPUTERNAME_LENGTH: u32 = 15; +pub const LOGON32_LOGON_INTERACTIVE: u32 = 2; +pub const LOGON32_LOGON_NETWORK: u32 = 3; +pub const LOGON32_LOGON_BATCH: u32 = 4; +pub const LOGON32_LOGON_SERVICE: u32 = 5; +pub const LOGON32_LOGON_UNLOCK: u32 = 7; +pub const LOGON32_LOGON_NETWORK_CLEARTEXT: u32 = 8; +pub const LOGON32_LOGON_NEW_CREDENTIALS: u32 = 9; +pub const LOGON32_PROVIDER_DEFAULT: u32 = 0; +pub const LOGON32_PROVIDER_WINNT35: u32 = 1; +pub const LOGON32_PROVIDER_WINNT40: u32 = 2; +pub const LOGON32_PROVIDER_WINNT50: u32 = 3; +pub const LOGON_WITH_PROFILE: u32 = 1; +pub const LOGON_NETCREDENTIALS_ONLY: u32 = 2; +pub const LOGON_ZERO_PASSWORD_BUFFER: u32 = 2147483648; +pub const HW_PROFILE_GUIDLEN: u32 = 39; +pub const MAX_PROFILE_LEN: u32 = 80; +pub const DOCKINFO_UNDOCKED: u32 = 1; +pub const DOCKINFO_DOCKED: u32 = 2; +pub const DOCKINFO_USER_SUPPLIED: u32 = 4; +pub const DOCKINFO_USER_UNDOCKED: u32 = 5; +pub const DOCKINFO_USER_DOCKED: u32 = 6; +pub const __IN__WINERROR_: u32 = 1; +pub const FACILITY_WINDOWSUPDATE: u32 = 36; +pub const FACILITY_WINDOWS_CE: u32 = 24; +pub const FACILITY_WINDOWS: u32 = 8; +pub const FACILITY_URT: u32 = 19; +pub const FACILITY_UMI: u32 = 22; +pub const FACILITY_SXS: u32 = 23; +pub const FACILITY_STORAGE: u32 = 3; +pub const FACILITY_STATE_MANAGEMENT: u32 = 34; +pub const FACILITY_SSPI: u32 = 9; +pub const FACILITY_SCARD: u32 = 16; +pub const FACILITY_SETUPAPI: u32 = 15; +pub const FACILITY_SECURITY: u32 = 9; +pub const FACILITY_RPC: u32 = 1; +pub const FACILITY_WIN32: u32 = 7; +pub const FACILITY_CONTROL: u32 = 10; +pub const FACILITY_NULL: u32 = 0; +pub const FACILITY_METADIRECTORY: u32 = 35; +pub const FACILITY_MSMQ: u32 = 14; +pub const FACILITY_MEDIASERVER: u32 = 13; +pub const FACILITY_INTERNET: u32 = 12; +pub const FACILITY_ITF: u32 = 4; +pub const FACILITY_HTTP: u32 = 25; +pub const FACILITY_DPLAY: u32 = 21; +pub const FACILITY_DISPATCH: u32 = 2; +pub const FACILITY_DIRECTORYSERVICE: u32 = 37; +pub const FACILITY_CONFIGURATION: u32 = 33; +pub const FACILITY_COMPLUS: u32 = 17; +pub const FACILITY_CERT: u32 = 11; +pub const FACILITY_BACKGROUNDCOPY: u32 = 32; +pub const FACILITY_ACS: u32 = 20; +pub const FACILITY_AAF: u32 = 18; +pub const FACILITY_AUDCLNT: u32 = 2185; +pub const DNS_ERROR_RESPONSE_CODES_BASE: u32 = 9000; +pub const DNS_ERROR_MASK: u32 = 9000; +pub const DNS_ERROR_PACKET_FMT_BASE: u32 = 9500; +pub const DNS_ERROR_GENERAL_API_BASE: u32 = 9550; +pub const DNS_ERROR_ZONE_BASE: u32 = 9600; +pub const DNS_ERROR_DATAFILE_BASE: u32 = 9650; +pub const DNS_ERROR_DATABASE_BASE: u32 = 9700; +pub const DNS_ERROR_OPERATION_BASE: u32 = 9750; +pub const DNS_ERROR_SECURE_BASE: u32 = 9800; +pub const DNS_ERROR_SETUP_BASE: u32 = 9850; +pub const DNS_ERROR_DP_BASE: u32 = 9900; +pub const WSABASEERR: u32 = 10000; +pub const WSAEINTR: u32 = 10004; +pub const WSAEBADF: u32 = 10009; +pub const WSAEACCES: u32 = 10013; +pub const WSAEFAULT: u32 = 10014; +pub const WSAEINVAL: u32 = 10022; +pub const WSAEMFILE: u32 = 10024; +pub const WSAEWOULDBLOCK: u32 = 10035; +pub const WSAEINPROGRESS: u32 = 10036; +pub const WSAEALREADY: u32 = 10037; +pub const WSAENOTSOCK: u32 = 10038; +pub const WSAEDESTADDRREQ: u32 = 10039; +pub const WSAEMSGSIZE: u32 = 10040; +pub const WSAEPROTOTYPE: u32 = 10041; +pub const WSAENOPROTOOPT: u32 = 10042; +pub const WSAEPROTONOSUPPORT: u32 = 10043; +pub const WSAESOCKTNOSUPPORT: u32 = 10044; +pub const WSAEOPNOTSUPP: u32 = 10045; +pub const WSAEPFNOSUPPORT: u32 = 10046; +pub const WSAEAFNOSUPPORT: u32 = 10047; +pub const WSAEADDRINUSE: u32 = 10048; +pub const WSAEADDRNOTAVAIL: u32 = 10049; +pub const WSAENETDOWN: u32 = 10050; +pub const WSAENETUNREACH: u32 = 10051; +pub const WSAENETRESET: u32 = 10052; +pub const WSAECONNABORTED: u32 = 10053; +pub const WSAECONNRESET: u32 = 10054; +pub const WSAENOBUFS: u32 = 10055; +pub const WSAEISCONN: u32 = 10056; +pub const WSAENOTCONN: u32 = 10057; +pub const WSAESHUTDOWN: u32 = 10058; +pub const WSAETOOMANYREFS: u32 = 10059; +pub const WSAETIMEDOUT: u32 = 10060; +pub const WSAECONNREFUSED: u32 = 10061; +pub const WSAELOOP: u32 = 10062; +pub const WSAENAMETOOLONG: u32 = 10063; +pub const WSAEHOSTDOWN: u32 = 10064; +pub const WSAEHOSTUNREACH: u32 = 10065; +pub const WSAENOTEMPTY: u32 = 10066; +pub const WSAEPROCLIM: u32 = 10067; +pub const WSAEUSERS: u32 = 10068; +pub const WSAEDQUOT: u32 = 10069; +pub const WSAESTALE: u32 = 10070; +pub const WSAEREMOTE: u32 = 10071; +pub const WSASYSNOTREADY: u32 = 10091; +pub const WSAVERNOTSUPPORTED: u32 = 10092; +pub const WSANOTINITIALISED: u32 = 10093; +pub const WSAEDISCON: u32 = 10101; +pub const WSAENOMORE: u32 = 10102; +pub const WSAECANCELLED: u32 = 10103; +pub const WSAEINVALIDPROCTABLE: u32 = 10104; +pub const WSAEINVALIDPROVIDER: u32 = 10105; +pub const WSAEPROVIDERFAILEDINIT: u32 = 10106; +pub const WSASYSCALLFAILURE: u32 = 10107; +pub const WSASERVICE_NOT_FOUND: u32 = 10108; +pub const WSATYPE_NOT_FOUND: u32 = 10109; +pub const WSA_E_NO_MORE: u32 = 10110; +pub const WSA_E_CANCELLED: u32 = 10111; +pub const WSAEREFUSED: u32 = 10112; +pub const WSAHOST_NOT_FOUND: u32 = 11001; +pub const WSATRY_AGAIN: u32 = 11002; +pub const WSANO_RECOVERY: u32 = 11003; +pub const WSANO_DATA: u32 = 11004; +pub const WSA_QOS_RECEIVERS: u32 = 11005; +pub const WSA_QOS_SENDERS: u32 = 11006; +pub const WSA_QOS_NO_SENDERS: u32 = 11007; +pub const WSA_QOS_NO_RECEIVERS: u32 = 11008; +pub const WSA_QOS_REQUEST_CONFIRMED: u32 = 11009; +pub const WSA_QOS_ADMISSION_FAILURE: u32 = 11010; +pub const WSA_QOS_POLICY_FAILURE: u32 = 11011; +pub const WSA_QOS_BAD_STYLE: u32 = 11012; +pub const WSA_QOS_BAD_OBJECT: u32 = 11013; +pub const WSA_QOS_TRAFFIC_CTRL_ERROR: u32 = 11014; +pub const WSA_QOS_GENERIC_ERROR: u32 = 11015; +pub const WSA_QOS_ESERVICETYPE: u32 = 11016; +pub const WSA_QOS_EFLOWSPEC: u32 = 11017; +pub const WSA_QOS_EPROVSPECBUF: u32 = 11018; +pub const WSA_QOS_EFILTERSTYLE: u32 = 11019; +pub const WSA_QOS_EFILTERTYPE: u32 = 11020; +pub const WSA_QOS_EFILTERCOUNT: u32 = 11021; +pub const WSA_QOS_EOBJLENGTH: u32 = 11022; +pub const WSA_QOS_EFLOWCOUNT: u32 = 11023; +pub const WSA_QOS_EUNKNOWNPSOBJ: u32 = 11024; +pub const WSA_QOS_EUNKOWNPSOBJ: u32 = 11024; +pub const WSA_QOS_EPOLICYOBJ: u32 = 11025; +pub const WSA_QOS_EFLOWDESC: u32 = 11026; +pub const WSA_QOS_EPSFLOWSPEC: u32 = 11027; +pub const WSA_QOS_EPSFILTERSPEC: u32 = 11028; +pub const WSA_QOS_ESDMODEOBJ: u32 = 11029; +pub const WSA_QOS_ESHAPERATEOBJ: u32 = 11030; +pub const WSA_QOS_RESERVED_PETYPE: u32 = 11031; +pub const SEVERITY_SUCCESS: u32 = 0; +pub const SEVERITY_ERROR: u32 = 1; +pub const FACILITY_NT_BIT: u32 = 268435456; +pub const NOERROR: u32 = 0; +pub const XACT_E_FIRST: u32 = 2147799040; +pub const XACT_E_LAST: u32 = 2147799081; +pub const XACT_S_FIRST: u32 = 315392; +pub const XACT_S_LAST: u32 = 315408; +pub const NTE_OP_OK: u32 = 0; +pub const FACILITY_USERMODE_FILTER_MANAGER: u32 = 31; +pub const TC_NORMAL: u32 = 0; +pub const TC_HARDERR: u32 = 1; +pub const TC_GP_TRAP: u32 = 2; +pub const TC_SIGNAL: u32 = 3; +pub const AC_LINE_OFFLINE: u32 = 0; +pub const AC_LINE_ONLINE: u32 = 1; +pub const AC_LINE_BACKUP_POWER: u32 = 2; +pub const AC_LINE_UNKNOWN: u32 = 255; +pub const BATTERY_FLAG_HIGH: u32 = 1; +pub const BATTERY_FLAG_LOW: u32 = 2; +pub const BATTERY_FLAG_CRITICAL: u32 = 4; +pub const BATTERY_FLAG_CHARGING: u32 = 8; +pub const BATTERY_FLAG_NO_BATTERY: u32 = 128; +pub const BATTERY_FLAG_UNKNOWN: u32 = 255; +pub const BATTERY_PERCENTAGE_UNKNOWN: u32 = 255; +pub const BATTERY_LIFE_UNKNOWN: u32 = 4294967295; +pub const ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID: u32 = 1; +pub const ACTCTX_FLAG_LANGID_VALID: u32 = 2; +pub const ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID: u32 = 4; +pub const ACTCTX_FLAG_RESOURCE_NAME_VALID: u32 = 8; +pub const ACTCTX_FLAG_SET_PROCESS_DEFAULT: u32 = 16; +pub const ACTCTX_FLAG_APPLICATION_NAME_VALID: u32 = 32; +pub const ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF: u32 = 64; +pub const ACTCTX_FLAG_HMODULE_VALID: u32 = 128; +pub const DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION: u32 = 1; +pub const FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX: u32 = 1; +pub const FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS: u32 = 2; +pub const FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA: u32 = 4; +pub const ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED: u32 = 1; +pub const QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX: u32 = 4; +pub const QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE: u32 = 8; +pub const QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS: u32 = 16; +pub const QUERY_ACTCTX_FLAG_NO_ADDREF: u32 = 2147483648; +pub const RESTART_MAX_CMD_LINE: u32 = 1024; +pub const RESTART_NO_CRASH: u32 = 1; +pub const RESTART_NO_HANG: u32 = 2; +pub const RESTART_NO_PATCH: u32 = 4; +pub const RESTART_NO_REBOOT: u32 = 8; +pub const RECOVERY_DEFAULT_PING_INTERVAL: u32 = 5000; +pub const RECOVERY_MAX_PING_INTERVAL: u32 = 300000; +pub const MICROSOFT_WINBASE_H_DEFINE_INTERLOCKED_CPLUSPLUS_OVERLOADS: u32 = 0; +pub const R2_BLACK: u32 = 1; +pub const R2_NOTMERGEPEN: u32 = 2; +pub const R2_MASKNOTPEN: u32 = 3; +pub const R2_NOTCOPYPEN: u32 = 4; +pub const R2_MASKPENNOT: u32 = 5; +pub const R2_NOT: u32 = 6; +pub const R2_XORPEN: u32 = 7; +pub const R2_NOTMASKPEN: u32 = 8; +pub const R2_MASKPEN: u32 = 9; +pub const R2_NOTXORPEN: u32 = 10; +pub const R2_NOP: u32 = 11; +pub const R2_MERGENOTPEN: u32 = 12; +pub const R2_COPYPEN: u32 = 13; +pub const R2_MERGEPENNOT: u32 = 14; +pub const R2_MERGEPEN: u32 = 15; +pub const R2_WHITE: u32 = 16; +pub const R2_LAST: u32 = 16; +pub const ERROR: u32 = 0; +pub const NULLREGION: u32 = 1; +pub const SIMPLEREGION: u32 = 2; +pub const COMPLEXREGION: u32 = 3; +pub const RGN_ERROR: u32 = 0; +pub const RGN_AND: u32 = 1; +pub const RGN_OR: u32 = 2; +pub const RGN_XOR: u32 = 3; +pub const RGN_DIFF: u32 = 4; +pub const RGN_COPY: u32 = 5; +pub const RGN_MIN: u32 = 1; +pub const RGN_MAX: u32 = 5; +pub const BLACKONWHITE: u32 = 1; +pub const WHITEONBLACK: u32 = 2; +pub const COLORONCOLOR: u32 = 3; +pub const HALFTONE: u32 = 4; +pub const MAXSTRETCHBLTMODE: u32 = 4; +pub const STRETCH_ANDSCANS: u32 = 1; +pub const STRETCH_ORSCANS: u32 = 2; +pub const STRETCH_DELETESCANS: u32 = 3; +pub const STRETCH_HALFTONE: u32 = 4; +pub const ALTERNATE: u32 = 1; +pub const WINDING: u32 = 2; +pub const POLYFILL_LAST: u32 = 2; +pub const LAYOUT_RTL: u32 = 1; +pub const LAYOUT_BTT: u32 = 2; +pub const LAYOUT_VBH: u32 = 4; +pub const LAYOUT_ORIENTATIONMASK: u32 = 7; +pub const LAYOUT_BITMAPORIENTATIONPRESERVED: u32 = 8; +pub const TA_NOUPDATECP: u32 = 0; +pub const TA_UPDATECP: u32 = 1; +pub const TA_LEFT: u32 = 0; +pub const TA_RIGHT: u32 = 2; +pub const TA_CENTER: u32 = 6; +pub const TA_TOP: u32 = 0; +pub const TA_BOTTOM: u32 = 8; +pub const TA_BASELINE: u32 = 24; +pub const TA_RTLREADING: u32 = 256; +pub const TA_MASK: u32 = 287; +pub const VTA_BASELINE: u32 = 24; +pub const VTA_LEFT: u32 = 8; +pub const VTA_RIGHT: u32 = 0; +pub const VTA_CENTER: u32 = 6; +pub const VTA_BOTTOM: u32 = 2; +pub const VTA_TOP: u32 = 0; +pub const ETO_OPAQUE: u32 = 2; +pub const ETO_CLIPPED: u32 = 4; +pub const ETO_GLYPH_INDEX: u32 = 16; +pub const ETO_RTLREADING: u32 = 128; +pub const ETO_NUMERICSLOCAL: u32 = 1024; +pub const ETO_NUMERICSLATIN: u32 = 2048; +pub const ETO_IGNORELANGUAGE: u32 = 4096; +pub const ETO_PDY: u32 = 8192; +pub const ASPECT_FILTERING: u32 = 1; +pub const DCB_RESET: u32 = 1; +pub const DCB_ACCUMULATE: u32 = 2; +pub const DCB_DIRTY: u32 = 2; +pub const DCB_SET: u32 = 3; +pub const DCB_ENABLE: u32 = 4; +pub const DCB_DISABLE: u32 = 8; +pub const META_SETBKCOLOR: u32 = 513; +pub const META_SETBKMODE: u32 = 258; +pub const META_SETMAPMODE: u32 = 259; +pub const META_SETROP2: u32 = 260; +pub const META_SETRELABS: u32 = 261; +pub const META_SETPOLYFILLMODE: u32 = 262; +pub const META_SETSTRETCHBLTMODE: u32 = 263; +pub const META_SETTEXTCHAREXTRA: u32 = 264; +pub const META_SETTEXTCOLOR: u32 = 521; +pub const META_SETTEXTJUSTIFICATION: u32 = 522; +pub const META_SETWINDOWORG: u32 = 523; +pub const META_SETWINDOWEXT: u32 = 524; +pub const META_SETVIEWPORTORG: u32 = 525; +pub const META_SETVIEWPORTEXT: u32 = 526; +pub const META_OFFSETWINDOWORG: u32 = 527; +pub const META_SCALEWINDOWEXT: u32 = 1040; +pub const META_OFFSETVIEWPORTORG: u32 = 529; +pub const META_SCALEVIEWPORTEXT: u32 = 1042; +pub const META_LINETO: u32 = 531; +pub const META_MOVETO: u32 = 532; +pub const META_EXCLUDECLIPRECT: u32 = 1045; +pub const META_INTERSECTCLIPRECT: u32 = 1046; +pub const META_ARC: u32 = 2071; +pub const META_ELLIPSE: u32 = 1048; +pub const META_FLOODFILL: u32 = 1049; +pub const META_PIE: u32 = 2074; +pub const META_RECTANGLE: u32 = 1051; +pub const META_ROUNDRECT: u32 = 1564; +pub const META_PATBLT: u32 = 1565; +pub const META_SAVEDC: u32 = 30; +pub const META_SETPIXEL: u32 = 1055; +pub const META_OFFSETCLIPRGN: u32 = 544; +pub const META_TEXTOUT: u32 = 1313; +pub const META_BITBLT: u32 = 2338; +pub const META_STRETCHBLT: u32 = 2851; +pub const META_POLYGON: u32 = 804; +pub const META_POLYLINE: u32 = 805; +pub const META_ESCAPE: u32 = 1574; +pub const META_RESTOREDC: u32 = 295; +pub const META_FILLREGION: u32 = 552; +pub const META_FRAMEREGION: u32 = 1065; +pub const META_INVERTREGION: u32 = 298; +pub const META_PAINTREGION: u32 = 299; +pub const META_SELECTCLIPREGION: u32 = 300; +pub const META_SELECTOBJECT: u32 = 301; +pub const META_SETTEXTALIGN: u32 = 302; +pub const META_CHORD: u32 = 2096; +pub const META_SETMAPPERFLAGS: u32 = 561; +pub const META_EXTTEXTOUT: u32 = 2610; +pub const META_SETDIBTODEV: u32 = 3379; +pub const META_SELECTPALETTE: u32 = 564; +pub const META_REALIZEPALETTE: u32 = 53; +pub const META_ANIMATEPALETTE: u32 = 1078; +pub const META_SETPALENTRIES: u32 = 55; +pub const META_POLYPOLYGON: u32 = 1336; +pub const META_RESIZEPALETTE: u32 = 313; +pub const META_DIBBITBLT: u32 = 2368; +pub const META_DIBSTRETCHBLT: u32 = 2881; +pub const META_DIBCREATEPATTERNBRUSH: u32 = 322; +pub const META_STRETCHDIB: u32 = 3907; +pub const META_EXTFLOODFILL: u32 = 1352; +pub const META_SETLAYOUT: u32 = 329; +pub const META_DELETEOBJECT: u32 = 496; +pub const META_CREATEPALETTE: u32 = 247; +pub const META_CREATEPATTERNBRUSH: u32 = 505; +pub const META_CREATEPENINDIRECT: u32 = 762; +pub const META_CREATEFONTINDIRECT: u32 = 763; +pub const META_CREATEBRUSHINDIRECT: u32 = 764; +pub const META_CREATEREGION: u32 = 1791; +pub const NEWFRAME: u32 = 1; +pub const ABORTDOC: u32 = 2; +pub const NEXTBAND: u32 = 3; +pub const SETCOLORTABLE: u32 = 4; +pub const GETCOLORTABLE: u32 = 5; +pub const FLUSHOUTPUT: u32 = 6; +pub const DRAFTMODE: u32 = 7; +pub const QUERYESCSUPPORT: u32 = 8; +pub const SETABORTPROC: u32 = 9; +pub const STARTDOC: u32 = 10; +pub const ENDDOC: u32 = 11; +pub const GETPHYSPAGESIZE: u32 = 12; +pub const GETPRINTINGOFFSET: u32 = 13; +pub const GETSCALINGFACTOR: u32 = 14; +pub const MFCOMMENT: u32 = 15; +pub const GETPENWIDTH: u32 = 16; +pub const SETCOPYCOUNT: u32 = 17; +pub const SELECTPAPERSOURCE: u32 = 18; +pub const DEVICEDATA: u32 = 19; +pub const PASSTHROUGH: u32 = 19; +pub const GETTECHNOLGY: u32 = 20; +pub const GETTECHNOLOGY: u32 = 20; +pub const SETLINECAP: u32 = 21; +pub const SETLINEJOIN: u32 = 22; +pub const SETMITERLIMIT: u32 = 23; +pub const BANDINFO: u32 = 24; +pub const DRAWPATTERNRECT: u32 = 25; +pub const GETVECTORPENSIZE: u32 = 26; +pub const GETVECTORBRUSHSIZE: u32 = 27; +pub const ENABLEDUPLEX: u32 = 28; +pub const GETSETPAPERBINS: u32 = 29; +pub const GETSETPRINTORIENT: u32 = 30; +pub const ENUMPAPERBINS: u32 = 31; +pub const SETDIBSCALING: u32 = 32; +pub const EPSPRINTING: u32 = 33; +pub const ENUMPAPERMETRICS: u32 = 34; +pub const GETSETPAPERMETRICS: u32 = 35; +pub const POSTSCRIPT_DATA: u32 = 37; +pub const POSTSCRIPT_IGNORE: u32 = 38; +pub const MOUSETRAILS: u32 = 39; +pub const GETDEVICEUNITS: u32 = 42; +pub const GETEXTENDEDTEXTMETRICS: u32 = 256; +pub const GETEXTENTTABLE: u32 = 257; +pub const GETPAIRKERNTABLE: u32 = 258; +pub const GETTRACKKERNTABLE: u32 = 259; +pub const EXTTEXTOUT: u32 = 512; +pub const GETFACENAME: u32 = 513; +pub const DOWNLOADFACE: u32 = 514; +pub const ENABLERELATIVEWIDTHS: u32 = 768; +pub const ENABLEPAIRKERNING: u32 = 769; +pub const SETKERNTRACK: u32 = 770; +pub const SETALLJUSTVALUES: u32 = 771; +pub const SETCHARSET: u32 = 772; +pub const STRETCHBLT: u32 = 2048; +pub const METAFILE_DRIVER: u32 = 2049; +pub const GETSETSCREENPARAMS: u32 = 3072; +pub const QUERYDIBSUPPORT: u32 = 3073; +pub const BEGIN_PATH: u32 = 4096; +pub const CLIP_TO_PATH: u32 = 4097; +pub const END_PATH: u32 = 4098; +pub const EXT_DEVICE_CAPS: u32 = 4099; +pub const RESTORE_CTM: u32 = 4100; +pub const SAVE_CTM: u32 = 4101; +pub const SET_ARC_DIRECTION: u32 = 4102; +pub const SET_BACKGROUND_COLOR: u32 = 4103; +pub const SET_POLY_MODE: u32 = 4104; +pub const SET_SCREEN_ANGLE: u32 = 4105; +pub const SET_SPREAD: u32 = 4106; +pub const TRANSFORM_CTM: u32 = 4107; +pub const SET_CLIP_BOX: u32 = 4108; +pub const SET_BOUNDS: u32 = 4109; +pub const SET_MIRROR_MODE: u32 = 4110; +pub const OPENCHANNEL: u32 = 4110; +pub const DOWNLOADHEADER: u32 = 4111; +pub const CLOSECHANNEL: u32 = 4112; +pub const POSTSCRIPT_PASSTHROUGH: u32 = 4115; +pub const ENCAPSULATED_POSTSCRIPT: u32 = 4116; +pub const POSTSCRIPT_IDENTIFY: u32 = 4117; +pub const POSTSCRIPT_INJECTION: u32 = 4118; +pub const CHECKJPEGFORMAT: u32 = 4119; +pub const CHECKPNGFORMAT: u32 = 4120; +pub const GET_PS_FEATURESETTING: u32 = 4121; +pub const GDIPLUS_TS_QUERYVER: u32 = 4122; +pub const GDIPLUS_TS_RECORD: u32 = 4123; +pub const SPCLPASSTHROUGH2: u32 = 4568; +pub const PSIDENT_GDICENTRIC: u32 = 0; +pub const PSIDENT_PSCENTRIC: u32 = 1; +pub const PSINJECT_BEGINSTREAM: u32 = 1; +pub const PSINJECT_PSADOBE: u32 = 2; +pub const PSINJECT_PAGESATEND: u32 = 3; +pub const PSINJECT_PAGES: u32 = 4; +pub const PSINJECT_DOCNEEDEDRES: u32 = 5; +pub const PSINJECT_DOCSUPPLIEDRES: u32 = 6; +pub const PSINJECT_PAGEORDER: u32 = 7; +pub const PSINJECT_ORIENTATION: u32 = 8; +pub const PSINJECT_BOUNDINGBOX: u32 = 9; +pub const PSINJECT_DOCUMENTPROCESSCOLORS: u32 = 10; +pub const PSINJECT_COMMENTS: u32 = 11; +pub const PSINJECT_BEGINDEFAULTS: u32 = 12; +pub const PSINJECT_ENDDEFAULTS: u32 = 13; +pub const PSINJECT_BEGINPROLOG: u32 = 14; +pub const PSINJECT_ENDPROLOG: u32 = 15; +pub const PSINJECT_BEGINSETUP: u32 = 16; +pub const PSINJECT_ENDSETUP: u32 = 17; +pub const PSINJECT_TRAILER: u32 = 18; +pub const PSINJECT_EOF: u32 = 19; +pub const PSINJECT_ENDSTREAM: u32 = 20; +pub const PSINJECT_DOCUMENTPROCESSCOLORSATEND: u32 = 21; +pub const PSINJECT_PAGENUMBER: u32 = 100; +pub const PSINJECT_BEGINPAGESETUP: u32 = 101; +pub const PSINJECT_ENDPAGESETUP: u32 = 102; +pub const PSINJECT_PAGETRAILER: u32 = 103; +pub const PSINJECT_PLATECOLOR: u32 = 104; +pub const PSINJECT_SHOWPAGE: u32 = 105; +pub const PSINJECT_PAGEBBOX: u32 = 106; +pub const PSINJECT_ENDPAGECOMMENTS: u32 = 107; +pub const PSINJECT_VMSAVE: u32 = 200; +pub const PSINJECT_VMRESTORE: u32 = 201; +pub const FEATURESETTING_NUP: u32 = 0; +pub const FEATURESETTING_OUTPUT: u32 = 1; +pub const FEATURESETTING_PSLEVEL: u32 = 2; +pub const FEATURESETTING_CUSTPAPER: u32 = 3; +pub const FEATURESETTING_MIRROR: u32 = 4; +pub const FEATURESETTING_NEGATIVE: u32 = 5; +pub const FEATURESETTING_PROTOCOL: u32 = 6; +pub const FEATURESETTING_PRIVATE_BEGIN: u32 = 4096; +pub const FEATURESETTING_PRIVATE_END: u32 = 8191; +pub const PSPROTOCOL_ASCII: u32 = 0; +pub const PSPROTOCOL_BCP: u32 = 1; +pub const PSPROTOCOL_TBCP: u32 = 2; +pub const PSPROTOCOL_BINARY: u32 = 3; +pub const QDI_SETDIBITS: u32 = 1; +pub const QDI_GETDIBITS: u32 = 2; +pub const QDI_DIBTOSCREEN: u32 = 4; +pub const QDI_STRETCHDIB: u32 = 8; +pub const SP_NOTREPORTED: u32 = 16384; +pub const SP_ERROR: i32 = -1; +pub const SP_APPABORT: i32 = -2; +pub const SP_USERABORT: i32 = -3; +pub const SP_OUTOFDISK: i32 = -4; +pub const SP_OUTOFMEMORY: i32 = -5; +pub const PR_JOBSTATUS: u32 = 0; +pub const OBJ_PEN: u32 = 1; +pub const OBJ_BRUSH: u32 = 2; +pub const OBJ_DC: u32 = 3; +pub const OBJ_METADC: u32 = 4; +pub const OBJ_PAL: u32 = 5; +pub const OBJ_FONT: u32 = 6; +pub const OBJ_BITMAP: u32 = 7; +pub const OBJ_REGION: u32 = 8; +pub const OBJ_METAFILE: u32 = 9; +pub const OBJ_MEMDC: u32 = 10; +pub const OBJ_EXTPEN: u32 = 11; +pub const OBJ_ENHMETADC: u32 = 12; +pub const OBJ_ENHMETAFILE: u32 = 13; +pub const OBJ_COLORSPACE: u32 = 14; +pub const GDI_OBJ_LAST: u32 = 14; +pub const MWT_IDENTITY: u32 = 1; +pub const MWT_LEFTMULTIPLY: u32 = 2; +pub const MWT_RIGHTMULTIPLY: u32 = 3; +pub const MWT_MIN: u32 = 1; +pub const MWT_MAX: u32 = 3; +pub const CM_OUT_OF_GAMUT: u32 = 255; +pub const CM_IN_GAMUT: u32 = 0; +pub const ICM_ADDPROFILE: u32 = 1; +pub const ICM_DELETEPROFILE: u32 = 2; +pub const ICM_QUERYPROFILE: u32 = 3; +pub const ICM_SETDEFAULTPROFILE: u32 = 4; +pub const ICM_REGISTERICMATCHER: u32 = 5; +pub const ICM_UNREGISTERICMATCHER: u32 = 6; +pub const ICM_QUERYMATCH: u32 = 7; +pub const TCI_SRCCHARSET: u32 = 1; +pub const TCI_SRCCODEPAGE: u32 = 2; +pub const TCI_SRCFONTSIG: u32 = 3; +pub const TCI_SRCLOCALE: u32 = 4096; +pub const TMPF_FIXED_PITCH: u32 = 1; +pub const TMPF_VECTOR: u32 = 2; +pub const TMPF_DEVICE: u32 = 8; +pub const TMPF_TRUETYPE: u32 = 4; +pub const NTM_NONNEGATIVE_AC: u32 = 65536; +pub const NTM_PS_OPENTYPE: u32 = 131072; +pub const NTM_TT_OPENTYPE: u32 = 262144; +pub const NTM_MULTIPLEMASTER: u32 = 524288; +pub const NTM_TYPE1: u32 = 1048576; +pub const NTM_DSIG: u32 = 2097152; +pub const LF_FACESIZE: u32 = 32; +pub const LF_FULLFACESIZE: u32 = 64; +pub const OUT_DEFAULT_PRECIS: u32 = 0; +pub const OUT_STRING_PRECIS: u32 = 1; +pub const OUT_CHARACTER_PRECIS: u32 = 2; +pub const OUT_STROKE_PRECIS: u32 = 3; +pub const OUT_TT_PRECIS: u32 = 4; +pub const OUT_DEVICE_PRECIS: u32 = 5; +pub const OUT_RASTER_PRECIS: u32 = 6; +pub const OUT_TT_ONLY_PRECIS: u32 = 7; +pub const OUT_OUTLINE_PRECIS: u32 = 8; +pub const OUT_SCREEN_OUTLINE_PRECIS: u32 = 9; +pub const OUT_PS_ONLY_PRECIS: u32 = 10; +pub const CLIP_DEFAULT_PRECIS: u32 = 0; +pub const CLIP_CHARACTER_PRECIS: u32 = 1; +pub const CLIP_STROKE_PRECIS: u32 = 2; +pub const CLIP_MASK: u32 = 15; +pub const CLIP_LH_ANGLES: u32 = 16; +pub const CLIP_TT_ALWAYS: u32 = 32; +pub const CLIP_EMBEDDED: u32 = 128; +pub const DEFAULT_QUALITY: u32 = 0; +pub const DRAFT_QUALITY: u32 = 1; +pub const PROOF_QUALITY: u32 = 2; +pub const NONANTIALIASED_QUALITY: u32 = 3; +pub const ANTIALIASED_QUALITY: u32 = 4; +pub const CLEARTYPE_QUALITY: u32 = 5; +pub const CLEARTYPE_NATURAL_QUALITY: u32 = 6; +pub const DEFAULT_PITCH: u32 = 0; +pub const FIXED_PITCH: u32 = 1; +pub const VARIABLE_PITCH: u32 = 2; +pub const MONO_FONT: u32 = 8; +pub const ANSI_CHARSET: u32 = 0; +pub const DEFAULT_CHARSET: u32 = 1; +pub const SYMBOL_CHARSET: u32 = 2; +pub const SHIFTJIS_CHARSET: u32 = 128; +pub const HANGEUL_CHARSET: u32 = 129; +pub const HANGUL_CHARSET: u32 = 129; +pub const GB2312_CHARSET: u32 = 134; +pub const CHINESEBIG5_CHARSET: u32 = 136; +pub const OEM_CHARSET: u32 = 255; +pub const JOHAB_CHARSET: u32 = 130; +pub const HEBREW_CHARSET: u32 = 177; +pub const ARABIC_CHARSET: u32 = 178; +pub const GREEK_CHARSET: u32 = 161; +pub const TURKISH_CHARSET: u32 = 162; +pub const VIETNAMESE_CHARSET: u32 = 163; +pub const THAI_CHARSET: u32 = 222; +pub const EASTEUROPE_CHARSET: u32 = 238; +pub const RUSSIAN_CHARSET: u32 = 204; +pub const MAC_CHARSET: u32 = 77; +pub const BALTIC_CHARSET: u32 = 186; +pub const FF_DONTCARE: u32 = 0; +pub const FF_ROMAN: u32 = 16; +pub const FF_SWISS: u32 = 32; +pub const FF_MODERN: u32 = 48; +pub const FF_SCRIPT: u32 = 64; +pub const FF_DECORATIVE: u32 = 80; +pub const FW_DONTCARE: u32 = 0; +pub const FW_THIN: u32 = 100; +pub const FW_EXTRALIGHT: u32 = 200; +pub const FW_LIGHT: u32 = 300; +pub const FW_NORMAL: u32 = 400; +pub const FW_MEDIUM: u32 = 500; +pub const FW_SEMIBOLD: u32 = 600; +pub const FW_BOLD: u32 = 700; +pub const FW_EXTRABOLD: u32 = 800; +pub const FW_HEAVY: u32 = 900; +pub const FW_ULTRALIGHT: u32 = 200; +pub const FW_REGULAR: u32 = 400; +pub const FW_DEMIBOLD: u32 = 600; +pub const FW_ULTRABOLD: u32 = 800; +pub const FW_BLACK: u32 = 900; +pub const PANOSE_COUNT: u32 = 10; +pub const PAN_FAMILYTYPE_INDEX: u32 = 0; +pub const PAN_SERIFSTYLE_INDEX: u32 = 1; +pub const PAN_WEIGHT_INDEX: u32 = 2; +pub const PAN_PROPORTION_INDEX: u32 = 3; +pub const PAN_CONTRAST_INDEX: u32 = 4; +pub const PAN_STROKEVARIATION_INDEX: u32 = 5; +pub const PAN_ARMSTYLE_INDEX: u32 = 6; +pub const PAN_LETTERFORM_INDEX: u32 = 7; +pub const PAN_MIDLINE_INDEX: u32 = 8; +pub const PAN_XHEIGHT_INDEX: u32 = 9; +pub const PAN_CULTURE_LATIN: u32 = 0; +pub const PAN_ANY: u32 = 0; +pub const PAN_NO_FIT: u32 = 1; +pub const PAN_FAMILY_TEXT_DISPLAY: u32 = 2; +pub const PAN_FAMILY_SCRIPT: u32 = 3; +pub const PAN_FAMILY_DECORATIVE: u32 = 4; +pub const PAN_FAMILY_PICTORIAL: u32 = 5; +pub const PAN_SERIF_COVE: u32 = 2; +pub const PAN_SERIF_OBTUSE_COVE: u32 = 3; +pub const PAN_SERIF_SQUARE_COVE: u32 = 4; +pub const PAN_SERIF_OBTUSE_SQUARE_COVE: u32 = 5; +pub const PAN_SERIF_SQUARE: u32 = 6; +pub const PAN_SERIF_THIN: u32 = 7; +pub const PAN_SERIF_BONE: u32 = 8; +pub const PAN_SERIF_EXAGGERATED: u32 = 9; +pub const PAN_SERIF_TRIANGLE: u32 = 10; +pub const PAN_SERIF_NORMAL_SANS: u32 = 11; +pub const PAN_SERIF_OBTUSE_SANS: u32 = 12; +pub const PAN_SERIF_PERP_SANS: u32 = 13; +pub const PAN_SERIF_FLARED: u32 = 14; +pub const PAN_SERIF_ROUNDED: u32 = 15; +pub const PAN_WEIGHT_VERY_LIGHT: u32 = 2; +pub const PAN_WEIGHT_LIGHT: u32 = 3; +pub const PAN_WEIGHT_THIN: u32 = 4; +pub const PAN_WEIGHT_BOOK: u32 = 5; +pub const PAN_WEIGHT_MEDIUM: u32 = 6; +pub const PAN_WEIGHT_DEMI: u32 = 7; +pub const PAN_WEIGHT_BOLD: u32 = 8; +pub const PAN_WEIGHT_HEAVY: u32 = 9; +pub const PAN_WEIGHT_BLACK: u32 = 10; +pub const PAN_WEIGHT_NORD: u32 = 11; +pub const PAN_PROP_OLD_STYLE: u32 = 2; +pub const PAN_PROP_MODERN: u32 = 3; +pub const PAN_PROP_EVEN_WIDTH: u32 = 4; +pub const PAN_PROP_EXPANDED: u32 = 5; +pub const PAN_PROP_CONDENSED: u32 = 6; +pub const PAN_PROP_VERY_EXPANDED: u32 = 7; +pub const PAN_PROP_VERY_CONDENSED: u32 = 8; +pub const PAN_PROP_MONOSPACED: u32 = 9; +pub const PAN_CONTRAST_NONE: u32 = 2; +pub const PAN_CONTRAST_VERY_LOW: u32 = 3; +pub const PAN_CONTRAST_LOW: u32 = 4; +pub const PAN_CONTRAST_MEDIUM_LOW: u32 = 5; +pub const PAN_CONTRAST_MEDIUM: u32 = 6; +pub const PAN_CONTRAST_MEDIUM_HIGH: u32 = 7; +pub const PAN_CONTRAST_HIGH: u32 = 8; +pub const PAN_CONTRAST_VERY_HIGH: u32 = 9; +pub const PAN_STROKE_GRADUAL_DIAG: u32 = 2; +pub const PAN_STROKE_GRADUAL_TRAN: u32 = 3; +pub const PAN_STROKE_GRADUAL_VERT: u32 = 4; +pub const PAN_STROKE_GRADUAL_HORZ: u32 = 5; +pub const PAN_STROKE_RAPID_VERT: u32 = 6; +pub const PAN_STROKE_RAPID_HORZ: u32 = 7; +pub const PAN_STROKE_INSTANT_VERT: u32 = 8; +pub const PAN_STRAIGHT_ARMS_HORZ: u32 = 2; +pub const PAN_STRAIGHT_ARMS_WEDGE: u32 = 3; +pub const PAN_STRAIGHT_ARMS_VERT: u32 = 4; +pub const PAN_STRAIGHT_ARMS_SINGLE_SERIF: u32 = 5; +pub const PAN_STRAIGHT_ARMS_DOUBLE_SERIF: u32 = 6; +pub const PAN_BENT_ARMS_HORZ: u32 = 7; +pub const PAN_BENT_ARMS_WEDGE: u32 = 8; +pub const PAN_BENT_ARMS_VERT: u32 = 9; +pub const PAN_BENT_ARMS_SINGLE_SERIF: u32 = 10; +pub const PAN_BENT_ARMS_DOUBLE_SERIF: u32 = 11; +pub const PAN_LETT_NORMAL_CONTACT: u32 = 2; +pub const PAN_LETT_NORMAL_WEIGHTED: u32 = 3; +pub const PAN_LETT_NORMAL_BOXED: u32 = 4; +pub const PAN_LETT_NORMAL_FLATTENED: u32 = 5; +pub const PAN_LETT_NORMAL_ROUNDED: u32 = 6; +pub const PAN_LETT_NORMAL_OFF_CENTER: u32 = 7; +pub const PAN_LETT_NORMAL_SQUARE: u32 = 8; +pub const PAN_LETT_OBLIQUE_CONTACT: u32 = 9; +pub const PAN_LETT_OBLIQUE_WEIGHTED: u32 = 10; +pub const PAN_LETT_OBLIQUE_BOXED: u32 = 11; +pub const PAN_LETT_OBLIQUE_FLATTENED: u32 = 12; +pub const PAN_LETT_OBLIQUE_ROUNDED: u32 = 13; +pub const PAN_LETT_OBLIQUE_OFF_CENTER: u32 = 14; +pub const PAN_LETT_OBLIQUE_SQUARE: u32 = 15; +pub const PAN_MIDLINE_STANDARD_TRIMMED: u32 = 2; +pub const PAN_MIDLINE_STANDARD_POINTED: u32 = 3; +pub const PAN_MIDLINE_STANDARD_SERIFED: u32 = 4; +pub const PAN_MIDLINE_HIGH_TRIMMED: u32 = 5; +pub const PAN_MIDLINE_HIGH_POINTED: u32 = 6; +pub const PAN_MIDLINE_HIGH_SERIFED: u32 = 7; +pub const PAN_MIDLINE_CONSTANT_TRIMMED: u32 = 8; +pub const PAN_MIDLINE_CONSTANT_POINTED: u32 = 9; +pub const PAN_MIDLINE_CONSTANT_SERIFED: u32 = 10; +pub const PAN_MIDLINE_LOW_TRIMMED: u32 = 11; +pub const PAN_MIDLINE_LOW_POINTED: u32 = 12; +pub const PAN_MIDLINE_LOW_SERIFED: u32 = 13; +pub const PAN_XHEIGHT_CONSTANT_SMALL: u32 = 2; +pub const PAN_XHEIGHT_CONSTANT_STD: u32 = 3; +pub const PAN_XHEIGHT_CONSTANT_LARGE: u32 = 4; +pub const PAN_XHEIGHT_DUCKING_SMALL: u32 = 5; +pub const PAN_XHEIGHT_DUCKING_STD: u32 = 6; +pub const PAN_XHEIGHT_DUCKING_LARGE: u32 = 7; +pub const ELF_VENDOR_SIZE: u32 = 4; +pub const ELF_VERSION: u32 = 0; +pub const ELF_CULTURE_LATIN: u32 = 0; +pub const RASTER_FONTTYPE: u32 = 1; +pub const DEVICE_FONTTYPE: u32 = 2; +pub const TRUETYPE_FONTTYPE: u32 = 4; +pub const PC_RESERVED: u32 = 1; +pub const PC_EXPLICIT: u32 = 2; +pub const PC_NOCOLLAPSE: u32 = 4; +pub const TRANSPARENT: u32 = 1; +pub const OPAQUE: u32 = 2; +pub const BKMODE_LAST: u32 = 2; +pub const GM_COMPATIBLE: u32 = 1; +pub const GM_ADVANCED: u32 = 2; +pub const GM_LAST: u32 = 2; +pub const PT_CLOSEFIGURE: u32 = 1; +pub const PT_LINETO: u32 = 2; +pub const PT_BEZIERTO: u32 = 4; +pub const PT_MOVETO: u32 = 6; +pub const MM_TEXT: u32 = 1; +pub const MM_LOMETRIC: u32 = 2; +pub const MM_HIMETRIC: u32 = 3; +pub const MM_LOENGLISH: u32 = 4; +pub const MM_HIENGLISH: u32 = 5; +pub const MM_TWIPS: u32 = 6; +pub const MM_ISOTROPIC: u32 = 7; +pub const MM_ANISOTROPIC: u32 = 8; +pub const MM_MIN: u32 = 1; +pub const MM_MAX: u32 = 8; +pub const MM_MAX_FIXEDSCALE: u32 = 6; +pub const ABSOLUTE: u32 = 1; +pub const RELATIVE: u32 = 2; +pub const WHITE_BRUSH: u32 = 0; +pub const LTGRAY_BRUSH: u32 = 1; +pub const GRAY_BRUSH: u32 = 2; +pub const DKGRAY_BRUSH: u32 = 3; +pub const BLACK_BRUSH: u32 = 4; +pub const NULL_BRUSH: u32 = 5; +pub const HOLLOW_BRUSH: u32 = 5; +pub const WHITE_PEN: u32 = 6; +pub const BLACK_PEN: u32 = 7; +pub const NULL_PEN: u32 = 8; +pub const OEM_FIXED_FONT: u32 = 10; +pub const ANSI_FIXED_FONT: u32 = 11; +pub const ANSI_VAR_FONT: u32 = 12; +pub const SYSTEM_FONT: u32 = 13; +pub const DEVICE_DEFAULT_FONT: u32 = 14; +pub const DEFAULT_PALETTE: u32 = 15; +pub const SYSTEM_FIXED_FONT: u32 = 16; +pub const DEFAULT_GUI_FONT: u32 = 17; +pub const DC_BRUSH: u32 = 18; +pub const DC_PEN: u32 = 19; +pub const STOCK_LAST: u32 = 19; +pub const CLR_INVALID: u32 = 4294967295; +pub const BS_SOLID: u32 = 0; +pub const BS_NULL: u32 = 1; +pub const BS_HOLLOW: u32 = 1; +pub const BS_HATCHED: u32 = 2; +pub const BS_PATTERN: u32 = 3; +pub const BS_INDEXED: u32 = 4; +pub const BS_DIBPATTERN: u32 = 5; +pub const BS_DIBPATTERNPT: u32 = 6; +pub const BS_PATTERN8X8: u32 = 7; +pub const BS_DIBPATTERN8X8: u32 = 8; +pub const BS_MONOPATTERN: u32 = 9; +pub const HS_HORIZONTAL: u32 = 0; +pub const HS_VERTICAL: u32 = 1; +pub const HS_FDIAGONAL: u32 = 2; +pub const HS_BDIAGONAL: u32 = 3; +pub const HS_CROSS: u32 = 4; +pub const HS_DIAGCROSS: u32 = 5; +pub const HS_API_MAX: u32 = 12; +pub const PS_SOLID: u32 = 0; +pub const PS_DASH: u32 = 1; +pub const PS_DOT: u32 = 2; +pub const PS_DASHDOT: u32 = 3; +pub const PS_DASHDOTDOT: u32 = 4; +pub const PS_NULL: u32 = 5; +pub const PS_INSIDEFRAME: u32 = 6; +pub const PS_USERSTYLE: u32 = 7; +pub const PS_ALTERNATE: u32 = 8; +pub const PS_STYLE_MASK: u32 = 15; +pub const PS_ENDCAP_ROUND: u32 = 0; +pub const PS_ENDCAP_SQUARE: u32 = 256; +pub const PS_ENDCAP_FLAT: u32 = 512; +pub const PS_ENDCAP_MASK: u32 = 3840; +pub const PS_JOIN_ROUND: u32 = 0; +pub const PS_JOIN_BEVEL: u32 = 4096; +pub const PS_JOIN_MITER: u32 = 8192; +pub const PS_JOIN_MASK: u32 = 61440; +pub const PS_COSMETIC: u32 = 0; +pub const PS_GEOMETRIC: u32 = 65536; +pub const PS_TYPE_MASK: u32 = 983040; +pub const AD_COUNTERCLOCKWISE: u32 = 1; +pub const AD_CLOCKWISE: u32 = 2; +pub const DRIVERVERSION: u32 = 0; +pub const TECHNOLOGY: u32 = 2; +pub const HORZSIZE: u32 = 4; +pub const VERTSIZE: u32 = 6; +pub const HORZRES: u32 = 8; +pub const VERTRES: u32 = 10; +pub const BITSPIXEL: u32 = 12; +pub const PLANES: u32 = 14; +pub const NUMBRUSHES: u32 = 16; +pub const NUMPENS: u32 = 18; +pub const NUMMARKERS: u32 = 20; +pub const NUMFONTS: u32 = 22; +pub const NUMCOLORS: u32 = 24; +pub const PDEVICESIZE: u32 = 26; +pub const CURVECAPS: u32 = 28; +pub const LINECAPS: u32 = 30; +pub const POLYGONALCAPS: u32 = 32; +pub const TEXTCAPS: u32 = 34; +pub const CLIPCAPS: u32 = 36; +pub const RASTERCAPS: u32 = 38; +pub const ASPECTX: u32 = 40; +pub const ASPECTY: u32 = 42; +pub const ASPECTXY: u32 = 44; +pub const LOGPIXELSX: u32 = 88; +pub const LOGPIXELSY: u32 = 90; +pub const SIZEPALETTE: u32 = 104; +pub const NUMRESERVED: u32 = 106; +pub const COLORRES: u32 = 108; +pub const PHYSICALWIDTH: u32 = 110; +pub const PHYSICALHEIGHT: u32 = 111; +pub const PHYSICALOFFSETX: u32 = 112; +pub const PHYSICALOFFSETY: u32 = 113; +pub const SCALINGFACTORX: u32 = 114; +pub const SCALINGFACTORY: u32 = 115; +pub const VREFRESH: u32 = 116; +pub const DESKTOPVERTRES: u32 = 117; +pub const DESKTOPHORZRES: u32 = 118; +pub const BLTALIGNMENT: u32 = 119; +pub const SHADEBLENDCAPS: u32 = 120; +pub const COLORMGMTCAPS: u32 = 121; +pub const DT_PLOTTER: u32 = 0; +pub const DT_RASDISPLAY: u32 = 1; +pub const DT_RASPRINTER: u32 = 2; +pub const DT_RASCAMERA: u32 = 3; +pub const DT_CHARSTREAM: u32 = 4; +pub const DT_METAFILE: u32 = 5; +pub const DT_DISPFILE: u32 = 6; +pub const CC_NONE: u32 = 0; +pub const CC_CIRCLES: u32 = 1; +pub const CC_PIE: u32 = 2; +pub const CC_CHORD: u32 = 4; +pub const CC_ELLIPSES: u32 = 8; +pub const CC_WIDE: u32 = 16; +pub const CC_STYLED: u32 = 32; +pub const CC_WIDESTYLED: u32 = 64; +pub const CC_INTERIORS: u32 = 128; +pub const CC_ROUNDRECT: u32 = 256; +pub const LC_NONE: u32 = 0; +pub const LC_POLYLINE: u32 = 2; +pub const LC_MARKER: u32 = 4; +pub const LC_POLYMARKER: u32 = 8; +pub const LC_WIDE: u32 = 16; +pub const LC_STYLED: u32 = 32; +pub const LC_WIDESTYLED: u32 = 64; +pub const LC_INTERIORS: u32 = 128; +pub const PC_NONE: u32 = 0; +pub const PC_POLYGON: u32 = 1; +pub const PC_RECTANGLE: u32 = 2; +pub const PC_WINDPOLYGON: u32 = 4; +pub const PC_TRAPEZOID: u32 = 4; +pub const PC_SCANLINE: u32 = 8; +pub const PC_WIDE: u32 = 16; +pub const PC_STYLED: u32 = 32; +pub const PC_WIDESTYLED: u32 = 64; +pub const PC_INTERIORS: u32 = 128; +pub const PC_POLYPOLYGON: u32 = 256; +pub const PC_PATHS: u32 = 512; +pub const CP_NONE: u32 = 0; +pub const CP_RECTANGLE: u32 = 1; +pub const CP_REGION: u32 = 2; +pub const TC_OP_CHARACTER: u32 = 1; +pub const TC_OP_STROKE: u32 = 2; +pub const TC_CP_STROKE: u32 = 4; +pub const TC_CR_90: u32 = 8; +pub const TC_CR_ANY: u32 = 16; +pub const TC_SF_X_YINDEP: u32 = 32; +pub const TC_SA_DOUBLE: u32 = 64; +pub const TC_SA_INTEGER: u32 = 128; +pub const TC_SA_CONTIN: u32 = 256; +pub const TC_EA_DOUBLE: u32 = 512; +pub const TC_IA_ABLE: u32 = 1024; +pub const TC_UA_ABLE: u32 = 2048; +pub const TC_SO_ABLE: u32 = 4096; +pub const TC_RA_ABLE: u32 = 8192; +pub const TC_VA_ABLE: u32 = 16384; +pub const TC_RESERVED: u32 = 32768; +pub const TC_SCROLLBLT: u32 = 65536; +pub const RC_BITBLT: u32 = 1; +pub const RC_BANDING: u32 = 2; +pub const RC_SCALING: u32 = 4; +pub const RC_BITMAP64: u32 = 8; +pub const RC_GDI20_OUTPUT: u32 = 16; +pub const RC_GDI20_STATE: u32 = 32; +pub const RC_SAVEBITMAP: u32 = 64; +pub const RC_DI_BITMAP: u32 = 128; +pub const RC_PALETTE: u32 = 256; +pub const RC_DIBTODEV: u32 = 512; +pub const RC_BIGFONT: u32 = 1024; +pub const RC_STRETCHBLT: u32 = 2048; +pub const RC_FLOODFILL: u32 = 4096; +pub const RC_STRETCHDIB: u32 = 8192; +pub const RC_OP_DX_OUTPUT: u32 = 16384; +pub const RC_DEVBITS: u32 = 32768; +pub const SB_NONE: u32 = 0; +pub const SB_CONST_ALPHA: u32 = 1; +pub const SB_PIXEL_ALPHA: u32 = 2; +pub const SB_PREMULT_ALPHA: u32 = 4; +pub const SB_GRAD_RECT: u32 = 16; +pub const SB_GRAD_TRI: u32 = 32; +pub const CM_NONE: u32 = 0; +pub const CM_DEVICE_ICM: u32 = 1; +pub const CM_GAMMA_RAMP: u32 = 2; +pub const CM_CMYK_COLOR: u32 = 4; +pub const DIB_RGB_COLORS: u32 = 0; +pub const DIB_PAL_COLORS: u32 = 1; +pub const SYSPAL_ERROR: u32 = 0; +pub const SYSPAL_STATIC: u32 = 1; +pub const SYSPAL_NOSTATIC: u32 = 2; +pub const SYSPAL_NOSTATIC256: u32 = 3; +pub const FLOODFILLBORDER: u32 = 0; +pub const FLOODFILLSURFACE: u32 = 1; +pub const CCHDEVICENAME: u32 = 32; +pub const CCHFORMNAME: u32 = 32; +pub const DM_SPECVERSION: u32 = 1025; +pub const DMORIENT_PORTRAIT: u32 = 1; +pub const DMORIENT_LANDSCAPE: u32 = 2; +pub const DMPAPER_LETTER: u32 = 1; +pub const DMPAPER_LETTERSMALL: u32 = 2; +pub const DMPAPER_TABLOID: u32 = 3; +pub const DMPAPER_LEDGER: u32 = 4; +pub const DMPAPER_LEGAL: u32 = 5; +pub const DMPAPER_STATEMENT: u32 = 6; +pub const DMPAPER_EXECUTIVE: u32 = 7; +pub const DMPAPER_A3: u32 = 8; +pub const DMPAPER_A4: u32 = 9; +pub const DMPAPER_A4SMALL: u32 = 10; +pub const DMPAPER_A5: u32 = 11; +pub const DMPAPER_B4: u32 = 12; +pub const DMPAPER_B5: u32 = 13; +pub const DMPAPER_FOLIO: u32 = 14; +pub const DMPAPER_QUARTO: u32 = 15; +pub const DMPAPER_10X14: u32 = 16; +pub const DMPAPER_11X17: u32 = 17; +pub const DMPAPER_NOTE: u32 = 18; +pub const DMPAPER_ENV_9: u32 = 19; +pub const DMPAPER_ENV_10: u32 = 20; +pub const DMPAPER_ENV_11: u32 = 21; +pub const DMPAPER_ENV_12: u32 = 22; +pub const DMPAPER_ENV_14: u32 = 23; +pub const DMPAPER_CSHEET: u32 = 24; +pub const DMPAPER_DSHEET: u32 = 25; +pub const DMPAPER_ESHEET: u32 = 26; +pub const DMPAPER_ENV_DL: u32 = 27; +pub const DMPAPER_ENV_C5: u32 = 28; +pub const DMPAPER_ENV_C3: u32 = 29; +pub const DMPAPER_ENV_C4: u32 = 30; +pub const DMPAPER_ENV_C6: u32 = 31; +pub const DMPAPER_ENV_C65: u32 = 32; +pub const DMPAPER_ENV_B4: u32 = 33; +pub const DMPAPER_ENV_B5: u32 = 34; +pub const DMPAPER_ENV_B6: u32 = 35; +pub const DMPAPER_ENV_ITALY: u32 = 36; +pub const DMPAPER_ENV_MONARCH: u32 = 37; +pub const DMPAPER_ENV_PERSONAL: u32 = 38; +pub const DMPAPER_FANFOLD_US: u32 = 39; +pub const DMPAPER_FANFOLD_STD_GERMAN: u32 = 40; +pub const DMPAPER_FANFOLD_LGL_GERMAN: u32 = 41; +pub const DMPAPER_ISO_B4: u32 = 42; +pub const DMPAPER_JAPANESE_POSTCARD: u32 = 43; +pub const DMPAPER_9X11: u32 = 44; +pub const DMPAPER_10X11: u32 = 45; +pub const DMPAPER_15X11: u32 = 46; +pub const DMPAPER_ENV_INVITE: u32 = 47; +pub const DMPAPER_RESERVED_48: u32 = 48; +pub const DMPAPER_RESERVED_49: u32 = 49; +pub const DMPAPER_LETTER_EXTRA: u32 = 50; +pub const DMPAPER_LEGAL_EXTRA: u32 = 51; +pub const DMPAPER_TABLOID_EXTRA: u32 = 52; +pub const DMPAPER_A4_EXTRA: u32 = 53; +pub const DMPAPER_LETTER_TRANSVERSE: u32 = 54; +pub const DMPAPER_A4_TRANSVERSE: u32 = 55; +pub const DMPAPER_LETTER_EXTRA_TRANSVERSE: u32 = 56; +pub const DMPAPER_A_PLUS: u32 = 57; +pub const DMPAPER_B_PLUS: u32 = 58; +pub const DMPAPER_LETTER_PLUS: u32 = 59; +pub const DMPAPER_A4_PLUS: u32 = 60; +pub const DMPAPER_A5_TRANSVERSE: u32 = 61; +pub const DMPAPER_B5_TRANSVERSE: u32 = 62; +pub const DMPAPER_A3_EXTRA: u32 = 63; +pub const DMPAPER_A5_EXTRA: u32 = 64; +pub const DMPAPER_B5_EXTRA: u32 = 65; +pub const DMPAPER_A2: u32 = 66; +pub const DMPAPER_A3_TRANSVERSE: u32 = 67; +pub const DMPAPER_A3_EXTRA_TRANSVERSE: u32 = 68; +pub const DMPAPER_DBL_JAPANESE_POSTCARD: u32 = 69; +pub const DMPAPER_A6: u32 = 70; +pub const DMPAPER_JENV_KAKU2: u32 = 71; +pub const DMPAPER_JENV_KAKU3: u32 = 72; +pub const DMPAPER_JENV_CHOU3: u32 = 73; +pub const DMPAPER_JENV_CHOU4: u32 = 74; +pub const DMPAPER_LETTER_ROTATED: u32 = 75; +pub const DMPAPER_A3_ROTATED: u32 = 76; +pub const DMPAPER_A4_ROTATED: u32 = 77; +pub const DMPAPER_A5_ROTATED: u32 = 78; +pub const DMPAPER_B4_JIS_ROTATED: u32 = 79; +pub const DMPAPER_B5_JIS_ROTATED: u32 = 80; +pub const DMPAPER_JAPANESE_POSTCARD_ROTATED: u32 = 81; +pub const DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED: u32 = 82; +pub const DMPAPER_A6_ROTATED: u32 = 83; +pub const DMPAPER_JENV_KAKU2_ROTATED: u32 = 84; +pub const DMPAPER_JENV_KAKU3_ROTATED: u32 = 85; +pub const DMPAPER_JENV_CHOU3_ROTATED: u32 = 86; +pub const DMPAPER_JENV_CHOU4_ROTATED: u32 = 87; +pub const DMPAPER_B6_JIS: u32 = 88; +pub const DMPAPER_B6_JIS_ROTATED: u32 = 89; +pub const DMPAPER_12X11: u32 = 90; +pub const DMPAPER_JENV_YOU4: u32 = 91; +pub const DMPAPER_JENV_YOU4_ROTATED: u32 = 92; +pub const DMPAPER_P16K: u32 = 93; +pub const DMPAPER_P32K: u32 = 94; +pub const DMPAPER_P32KBIG: u32 = 95; +pub const DMPAPER_PENV_1: u32 = 96; +pub const DMPAPER_PENV_2: u32 = 97; +pub const DMPAPER_PENV_3: u32 = 98; +pub const DMPAPER_PENV_4: u32 = 99; +pub const DMPAPER_PENV_5: u32 = 100; +pub const DMPAPER_PENV_6: u32 = 101; +pub const DMPAPER_PENV_7: u32 = 102; +pub const DMPAPER_PENV_8: u32 = 103; +pub const DMPAPER_PENV_9: u32 = 104; +pub const DMPAPER_PENV_10: u32 = 105; +pub const DMPAPER_P16K_ROTATED: u32 = 106; +pub const DMPAPER_P32K_ROTATED: u32 = 107; +pub const DMPAPER_P32KBIG_ROTATED: u32 = 108; +pub const DMPAPER_PENV_1_ROTATED: u32 = 109; +pub const DMPAPER_PENV_2_ROTATED: u32 = 110; +pub const DMPAPER_PENV_3_ROTATED: u32 = 111; +pub const DMPAPER_PENV_4_ROTATED: u32 = 112; +pub const DMPAPER_PENV_5_ROTATED: u32 = 113; +pub const DMPAPER_PENV_6_ROTATED: u32 = 114; +pub const DMPAPER_PENV_7_ROTATED: u32 = 115; +pub const DMPAPER_PENV_8_ROTATED: u32 = 116; +pub const DMPAPER_PENV_9_ROTATED: u32 = 117; +pub const DMPAPER_PENV_10_ROTATED: u32 = 118; +pub const DMPAPER_LAST: u32 = 118; +pub const DMPAPER_USER: u32 = 256; +pub const DMBIN_UPPER: u32 = 1; +pub const DMBIN_ONLYONE: u32 = 1; +pub const DMBIN_LOWER: u32 = 2; +pub const DMBIN_MIDDLE: u32 = 3; +pub const DMBIN_MANUAL: u32 = 4; +pub const DMBIN_ENVELOPE: u32 = 5; +pub const DMBIN_ENVMANUAL: u32 = 6; +pub const DMBIN_AUTO: u32 = 7; +pub const DMBIN_TRACTOR: u32 = 8; +pub const DMBIN_SMALLFMT: u32 = 9; +pub const DMBIN_LARGEFMT: u32 = 10; +pub const DMBIN_LARGECAPACITY: u32 = 11; +pub const DMBIN_CASSETTE: u32 = 14; +pub const DMBIN_FORMSOURCE: u32 = 15; +pub const DMBIN_LAST: u32 = 15; +pub const DMBIN_USER: u32 = 256; +pub const DMRES_DRAFT: i32 = -1; +pub const DMRES_LOW: i32 = -2; +pub const DMRES_MEDIUM: i32 = -3; +pub const DMRES_HIGH: i32 = -4; +pub const DMCOLOR_MONOCHROME: u32 = 1; +pub const DMCOLOR_COLOR: u32 = 2; +pub const DMDUP_SIMPLEX: u32 = 1; +pub const DMDUP_VERTICAL: u32 = 2; +pub const DMDUP_HORIZONTAL: u32 = 3; +pub const DMTT_BITMAP: u32 = 1; +pub const DMTT_DOWNLOAD: u32 = 2; +pub const DMTT_SUBDEV: u32 = 3; +pub const DMTT_DOWNLOAD_OUTLINE: u32 = 4; +pub const DMCOLLATE_FALSE: u32 = 0; +pub const DMCOLLATE_TRUE: u32 = 1; +pub const DMDO_DEFAULT: u32 = 0; +pub const DMDO_90: u32 = 1; +pub const DMDO_180: u32 = 2; +pub const DMDO_270: u32 = 3; +pub const DMDFO_DEFAULT: u32 = 0; +pub const DMDFO_STRETCH: u32 = 1; +pub const DMDFO_CENTER: u32 = 2; +pub const DM_INTERLACED: u32 = 2; +pub const DMDISPLAYFLAGS_TEXTMODE: u32 = 4; +pub const DMNUP_SYSTEM: u32 = 1; +pub const DMNUP_ONEUP: u32 = 2; +pub const DMICMMETHOD_NONE: u32 = 1; +pub const DMICMMETHOD_SYSTEM: u32 = 2; +pub const DMICMMETHOD_DRIVER: u32 = 3; +pub const DMICMMETHOD_DEVICE: u32 = 4; +pub const DMICMMETHOD_USER: u32 = 256; +pub const DMICM_SATURATE: u32 = 1; +pub const DMICM_CONTRAST: u32 = 2; +pub const DMICM_COLORIMETRIC: u32 = 3; +pub const DMICM_ABS_COLORIMETRIC: u32 = 4; +pub const DMICM_USER: u32 = 256; +pub const DMMEDIA_STANDARD: u32 = 1; +pub const DMMEDIA_TRANSPARENCY: u32 = 2; +pub const DMMEDIA_GLOSSY: u32 = 3; +pub const DMMEDIA_USER: u32 = 256; +pub const DMDITHER_NONE: u32 = 1; +pub const DMDITHER_COARSE: u32 = 2; +pub const DMDITHER_FINE: u32 = 3; +pub const DMDITHER_LINEART: u32 = 4; +pub const DMDITHER_ERRORDIFFUSION: u32 = 5; +pub const DMDITHER_RESERVED6: u32 = 6; +pub const DMDITHER_RESERVED7: u32 = 7; +pub const DMDITHER_RESERVED8: u32 = 8; +pub const DMDITHER_RESERVED9: u32 = 9; +pub const DMDITHER_GRAYSCALE: u32 = 10; +pub const DMDITHER_USER: u32 = 256; +pub const DISPLAY_DEVICE_ATTACHED_TO_DESKTOP: u32 = 1; +pub const DISPLAY_DEVICE_MULTI_DRIVER: u32 = 2; +pub const DISPLAY_DEVICE_PRIMARY_DEVICE: u32 = 4; +pub const DISPLAY_DEVICE_MIRRORING_DRIVER: u32 = 8; +pub const DISPLAY_DEVICE_VGA_COMPATIBLE: u32 = 16; +pub const DISPLAY_DEVICE_REMOVABLE: u32 = 32; +pub const DISPLAY_DEVICE_TS_COMPATIBLE: u32 = 2097152; +pub const DISPLAY_DEVICE_MODESPRUNED: u32 = 134217728; +pub const DISPLAY_DEVICE_REMOTE: u32 = 67108864; +pub const DISPLAY_DEVICE_DISCONNECT: u32 = 33554432; +pub const DISPLAY_DEVICE_ACTIVE: u32 = 1; +pub const DISPLAY_DEVICE_ATTACHED: u32 = 2; +pub const RDH_RECTANGLES: u32 = 1; +pub const SYSRGN: u32 = 4; +pub const GGO_METRICS: u32 = 0; +pub const GGO_BITMAP: u32 = 1; +pub const GGO_NATIVE: u32 = 2; +pub const GGO_BEZIER: u32 = 3; +pub const GGO_GRAY2_BITMAP: u32 = 4; +pub const GGO_GRAY4_BITMAP: u32 = 5; +pub const GGO_GRAY8_BITMAP: u32 = 6; +pub const GGO_GLYPH_INDEX: u32 = 128; +pub const GGO_UNHINTED: u32 = 256; +pub const TT_POLYGON_TYPE: u32 = 24; +pub const TT_PRIM_LINE: u32 = 1; +pub const TT_PRIM_QSPLINE: u32 = 2; +pub const TT_PRIM_CSPLINE: u32 = 3; +pub const GCP_DBCS: u32 = 1; +pub const GCP_REORDER: u32 = 2; +pub const GCP_USEKERNING: u32 = 8; +pub const GCP_GLYPHSHAPE: u32 = 16; +pub const GCP_LIGATE: u32 = 32; +pub const GCP_DIACRITIC: u32 = 256; +pub const GCP_KASHIDA: u32 = 1024; +pub const GCP_ERROR: u32 = 32768; +pub const FLI_MASK: u32 = 4155; +pub const GCPCLASS_LATIN: u32 = 1; +pub const GCPCLASS_HEBREW: u32 = 2; +pub const GCPCLASS_ARABIC: u32 = 2; +pub const GCPCLASS_NEUTRAL: u32 = 3; +pub const GCPCLASS_LOCALNUMBER: u32 = 4; +pub const GCPCLASS_LATINNUMBER: u32 = 5; +pub const GCPCLASS_LATINNUMERICTERMINATOR: u32 = 6; +pub const GCPCLASS_LATINNUMERICSEPARATOR: u32 = 7; +pub const GCPCLASS_NUMERICSEPARATOR: u32 = 8; +pub const GCPCLASS_PREBOUNDLTR: u32 = 128; +pub const GCPCLASS_PREBOUNDRTL: u32 = 64; +pub const GCPCLASS_POSTBOUNDLTR: u32 = 32; +pub const GCPCLASS_POSTBOUNDRTL: u32 = 16; +pub const GCPGLYPH_LINKBEFORE: u32 = 32768; +pub const GCPGLYPH_LINKAFTER: u32 = 16384; +pub const TT_AVAILABLE: u32 = 1; +pub const TT_ENABLED: u32 = 2; +pub const PFD_TYPE_RGBA: u32 = 0; +pub const PFD_TYPE_COLORINDEX: u32 = 1; +pub const PFD_MAIN_PLANE: u32 = 0; +pub const PFD_OVERLAY_PLANE: u32 = 1; +pub const PFD_UNDERLAY_PLANE: i32 = -1; +pub const PFD_DOUBLEBUFFER: u32 = 1; +pub const PFD_STEREO: u32 = 2; +pub const PFD_DRAW_TO_WINDOW: u32 = 4; +pub const PFD_DRAW_TO_BITMAP: u32 = 8; +pub const PFD_SUPPORT_GDI: u32 = 16; +pub const PFD_SUPPORT_OPENGL: u32 = 32; +pub const PFD_GENERIC_FORMAT: u32 = 64; +pub const PFD_NEED_PALETTE: u32 = 128; +pub const PFD_NEED_SYSTEM_PALETTE: u32 = 256; +pub const PFD_SWAP_EXCHANGE: u32 = 512; +pub const PFD_SWAP_COPY: u32 = 1024; +pub const PFD_SWAP_LAYER_BUFFERS: u32 = 2048; +pub const PFD_GENERIC_ACCELERATED: u32 = 4096; +pub const PFD_SUPPORT_DIRECTDRAW: u32 = 8192; +pub const PFD_DIRECT3D_ACCELERATED: u32 = 16384; +pub const PFD_SUPPORT_COMPOSITION: u32 = 32768; +pub const PFD_DEPTH_DONTCARE: u32 = 536870912; +pub const PFD_DOUBLEBUFFER_DONTCARE: u32 = 1073741824; +pub const PFD_STEREO_DONTCARE: u32 = 2147483648; +pub const DC_BINADJUST: u32 = 19; +pub const DC_EMF_COMPLIANT: u32 = 20; +pub const DC_DATATYPE_PRODUCED: u32 = 21; +pub const DC_COLLATE: u32 = 22; +pub const DC_MANUFACTURER: u32 = 23; +pub const DC_MODEL: u32 = 24; +pub const DC_PERSONALITY: u32 = 25; +pub const DC_PRINTRATE: u32 = 26; +pub const DC_PRINTRATEUNIT: u32 = 27; +pub const PRINTRATEUNIT_PPM: u32 = 1; +pub const PRINTRATEUNIT_CPS: u32 = 2; +pub const PRINTRATEUNIT_LPM: u32 = 3; +pub const PRINTRATEUNIT_IPM: u32 = 4; +pub const DC_PRINTERMEM: u32 = 28; +pub const DC_MEDIAREADY: u32 = 29; +pub const DC_STAPLE: u32 = 30; +pub const DC_PRINTRATEPPM: u32 = 31; +pub const DC_COLORDEVICE: u32 = 32; +pub const DC_NUP: u32 = 33; +pub const DC_MEDIATYPENAMES: u32 = 34; +pub const DC_MEDIATYPES: u32 = 35; +pub const DCBA_FACEUPNONE: u32 = 0; +pub const DCBA_FACEUPCENTER: u32 = 1; +pub const DCBA_FACEUPLEFT: u32 = 2; +pub const DCBA_FACEUPRIGHT: u32 = 3; +pub const DCBA_FACEDOWNNONE: u32 = 256; +pub const DCBA_FACEDOWNCENTER: u32 = 257; +pub const DCBA_FACEDOWNLEFT: u32 = 258; +pub const DCBA_FACEDOWNRIGHT: u32 = 259; +pub const GS_8BIT_INDICES: u32 = 1; +pub const GGI_MARK_NONEXISTING_GLYPHS: u32 = 1; +pub const MM_MAX_NUMAXES: u32 = 16; +pub const FR_PRIVATE: u32 = 16; +pub const FR_NOT_ENUM: u32 = 32; +pub const MM_MAX_AXES_NAMELEN: u32 = 16; +pub const AC_SRC_OVER: u32 = 0; +pub const AC_SRC_ALPHA: u32 = 1; +pub const GRADIENT_FILL_RECT_H: u32 = 0; +pub const GRADIENT_FILL_RECT_V: u32 = 1; +pub const GRADIENT_FILL_TRIANGLE: u32 = 2; +pub const GRADIENT_FILL_OP_FLAG: u32 = 255; +pub const CA_NEGATIVE: u32 = 1; +pub const CA_LOG_FILTER: u32 = 2; +pub const ILLUMINANT_DEVICE_DEFAULT: u32 = 0; +pub const ILLUMINANT_A: u32 = 1; +pub const ILLUMINANT_B: u32 = 2; +pub const ILLUMINANT_C: u32 = 3; +pub const ILLUMINANT_D50: u32 = 4; +pub const ILLUMINANT_D55: u32 = 5; +pub const ILLUMINANT_D65: u32 = 6; +pub const ILLUMINANT_D75: u32 = 7; +pub const ILLUMINANT_F2: u32 = 8; +pub const ILLUMINANT_MAX_INDEX: u32 = 8; +pub const ILLUMINANT_TUNGSTEN: u32 = 1; +pub const ILLUMINANT_DAYLIGHT: u32 = 3; +pub const ILLUMINANT_FLUORESCENT: u32 = 8; +pub const ILLUMINANT_NTSC: u32 = 3; +pub const DI_APPBANDING: u32 = 1; +pub const DI_ROPS_READ_DESTINATION: u32 = 2; +pub const FONTMAPPER_MAX: u32 = 10; +pub const ICM_OFF: u32 = 1; +pub const ICM_ON: u32 = 2; +pub const ICM_QUERY: u32 = 3; +pub const ICM_DONE_OUTSIDEDC: u32 = 4; +pub const ENHMETA_SIGNATURE: u32 = 1179469088; +pub const ENHMETA_STOCK_OBJECT: u32 = 2147483648; +pub const EMR_HEADER: u32 = 1; +pub const EMR_POLYBEZIER: u32 = 2; +pub const EMR_POLYGON: u32 = 3; +pub const EMR_POLYLINE: u32 = 4; +pub const EMR_POLYBEZIERTO: u32 = 5; +pub const EMR_POLYLINETO: u32 = 6; +pub const EMR_POLYPOLYLINE: u32 = 7; +pub const EMR_POLYPOLYGON: u32 = 8; +pub const EMR_SETWINDOWEXTEX: u32 = 9; +pub const EMR_SETWINDOWORGEX: u32 = 10; +pub const EMR_SETVIEWPORTEXTEX: u32 = 11; +pub const EMR_SETVIEWPORTORGEX: u32 = 12; +pub const EMR_SETBRUSHORGEX: u32 = 13; +pub const EMR_EOF: u32 = 14; +pub const EMR_SETPIXELV: u32 = 15; +pub const EMR_SETMAPPERFLAGS: u32 = 16; +pub const EMR_SETMAPMODE: u32 = 17; +pub const EMR_SETBKMODE: u32 = 18; +pub const EMR_SETPOLYFILLMODE: u32 = 19; +pub const EMR_SETROP2: u32 = 20; +pub const EMR_SETSTRETCHBLTMODE: u32 = 21; +pub const EMR_SETTEXTALIGN: u32 = 22; +pub const EMR_SETCOLORADJUSTMENT: u32 = 23; +pub const EMR_SETTEXTCOLOR: u32 = 24; +pub const EMR_SETBKCOLOR: u32 = 25; +pub const EMR_OFFSETCLIPRGN: u32 = 26; +pub const EMR_MOVETOEX: u32 = 27; +pub const EMR_SETMETARGN: u32 = 28; +pub const EMR_EXCLUDECLIPRECT: u32 = 29; +pub const EMR_INTERSECTCLIPRECT: u32 = 30; +pub const EMR_SCALEVIEWPORTEXTEX: u32 = 31; +pub const EMR_SCALEWINDOWEXTEX: u32 = 32; +pub const EMR_SAVEDC: u32 = 33; +pub const EMR_RESTOREDC: u32 = 34; +pub const EMR_SETWORLDTRANSFORM: u32 = 35; +pub const EMR_MODIFYWORLDTRANSFORM: u32 = 36; +pub const EMR_SELECTOBJECT: u32 = 37; +pub const EMR_CREATEPEN: u32 = 38; +pub const EMR_CREATEBRUSHINDIRECT: u32 = 39; +pub const EMR_DELETEOBJECT: u32 = 40; +pub const EMR_ANGLEARC: u32 = 41; +pub const EMR_ELLIPSE: u32 = 42; +pub const EMR_RECTANGLE: u32 = 43; +pub const EMR_ROUNDRECT: u32 = 44; +pub const EMR_ARC: u32 = 45; +pub const EMR_CHORD: u32 = 46; +pub const EMR_PIE: u32 = 47; +pub const EMR_SELECTPALETTE: u32 = 48; +pub const EMR_CREATEPALETTE: u32 = 49; +pub const EMR_SETPALETTEENTRIES: u32 = 50; +pub const EMR_RESIZEPALETTE: u32 = 51; +pub const EMR_REALIZEPALETTE: u32 = 52; +pub const EMR_EXTFLOODFILL: u32 = 53; +pub const EMR_LINETO: u32 = 54; +pub const EMR_ARCTO: u32 = 55; +pub const EMR_POLYDRAW: u32 = 56; +pub const EMR_SETARCDIRECTION: u32 = 57; +pub const EMR_SETMITERLIMIT: u32 = 58; +pub const EMR_BEGINPATH: u32 = 59; +pub const EMR_ENDPATH: u32 = 60; +pub const EMR_CLOSEFIGURE: u32 = 61; +pub const EMR_FILLPATH: u32 = 62; +pub const EMR_STROKEANDFILLPATH: u32 = 63; +pub const EMR_STROKEPATH: u32 = 64; +pub const EMR_FLATTENPATH: u32 = 65; +pub const EMR_WIDENPATH: u32 = 66; +pub const EMR_SELECTCLIPPATH: u32 = 67; +pub const EMR_ABORTPATH: u32 = 68; +pub const EMR_GDICOMMENT: u32 = 70; +pub const EMR_FILLRGN: u32 = 71; +pub const EMR_FRAMERGN: u32 = 72; +pub const EMR_INVERTRGN: u32 = 73; +pub const EMR_PAINTRGN: u32 = 74; +pub const EMR_EXTSELECTCLIPRGN: u32 = 75; +pub const EMR_BITBLT: u32 = 76; +pub const EMR_STRETCHBLT: u32 = 77; +pub const EMR_MASKBLT: u32 = 78; +pub const EMR_PLGBLT: u32 = 79; +pub const EMR_SETDIBITSTODEVICE: u32 = 80; +pub const EMR_STRETCHDIBITS: u32 = 81; +pub const EMR_EXTCREATEFONTINDIRECTW: u32 = 82; +pub const EMR_EXTTEXTOUTA: u32 = 83; +pub const EMR_EXTTEXTOUTW: u32 = 84; +pub const EMR_POLYBEZIER16: u32 = 85; +pub const EMR_POLYGON16: u32 = 86; +pub const EMR_POLYLINE16: u32 = 87; +pub const EMR_POLYBEZIERTO16: u32 = 88; +pub const EMR_POLYLINETO16: u32 = 89; +pub const EMR_POLYPOLYLINE16: u32 = 90; +pub const EMR_POLYPOLYGON16: u32 = 91; +pub const EMR_POLYDRAW16: u32 = 92; +pub const EMR_CREATEMONOBRUSH: u32 = 93; +pub const EMR_CREATEDIBPATTERNBRUSHPT: u32 = 94; +pub const EMR_EXTCREATEPEN: u32 = 95; +pub const EMR_POLYTEXTOUTA: u32 = 96; +pub const EMR_POLYTEXTOUTW: u32 = 97; +pub const EMR_SETICMMODE: u32 = 98; +pub const EMR_CREATECOLORSPACE: u32 = 99; +pub const EMR_SETCOLORSPACE: u32 = 100; +pub const EMR_DELETECOLORSPACE: u32 = 101; +pub const EMR_GLSRECORD: u32 = 102; +pub const EMR_GLSBOUNDEDRECORD: u32 = 103; +pub const EMR_PIXELFORMAT: u32 = 104; +pub const EMR_RESERVED_105: u32 = 105; +pub const EMR_RESERVED_106: u32 = 106; +pub const EMR_RESERVED_107: u32 = 107; +pub const EMR_RESERVED_108: u32 = 108; +pub const EMR_RESERVED_109: u32 = 109; +pub const EMR_RESERVED_110: u32 = 110; +pub const EMR_COLORCORRECTPALETTE: u32 = 111; +pub const EMR_SETICMPROFILEA: u32 = 112; +pub const EMR_SETICMPROFILEW: u32 = 113; +pub const EMR_ALPHABLEND: u32 = 114; +pub const EMR_SETLAYOUT: u32 = 115; +pub const EMR_TRANSPARENTBLT: u32 = 116; +pub const EMR_RESERVED_117: u32 = 117; +pub const EMR_GRADIENTFILL: u32 = 118; +pub const EMR_RESERVED_119: u32 = 119; +pub const EMR_RESERVED_120: u32 = 120; +pub const EMR_COLORMATCHTOTARGETW: u32 = 121; +pub const EMR_CREATECOLORSPACEW: u32 = 122; +pub const EMR_MIN: u32 = 1; +pub const EMR_MAX: u32 = 122; +pub const SETICMPROFILE_EMBEDED: u32 = 1; +pub const CREATECOLORSPACE_EMBEDED: u32 = 1; +pub const COLORMATCHTOTARGET_EMBEDED: u32 = 1; +pub const GDICOMMENT_IDENTIFIER: u32 = 1128875079; +pub const GDICOMMENT_WINDOWS_METAFILE: u32 = 2147483649; +pub const GDICOMMENT_BEGINGROUP: u32 = 2; +pub const GDICOMMENT_ENDGROUP: u32 = 3; +pub const GDICOMMENT_MULTIFORMATS: u32 = 1073741828; +pub const EPS_SIGNATURE: u32 = 1179865157; +pub const GDICOMMENT_UNICODE_STRING: u32 = 64; +pub const GDICOMMENT_UNICODE_END: u32 = 128; +pub const WGL_FONT_LINES: u32 = 0; +pub const WGL_FONT_POLYGONS: u32 = 1; +pub const LPD_DOUBLEBUFFER: u32 = 1; +pub const LPD_STEREO: u32 = 2; +pub const LPD_SUPPORT_GDI: u32 = 16; +pub const LPD_SUPPORT_OPENGL: u32 = 32; +pub const LPD_SHARE_DEPTH: u32 = 64; +pub const LPD_SHARE_STENCIL: u32 = 128; +pub const LPD_SHARE_ACCUM: u32 = 256; +pub const LPD_SWAP_EXCHANGE: u32 = 512; +pub const LPD_SWAP_COPY: u32 = 1024; +pub const LPD_TRANSPARENT: u32 = 4096; +pub const LPD_TYPE_RGBA: u32 = 0; +pub const LPD_TYPE_COLORINDEX: u32 = 1; +pub const WGL_SWAP_MAIN_PLANE: u32 = 1; +pub const WGL_SWAP_OVERLAY1: u32 = 2; +pub const WGL_SWAP_OVERLAY2: u32 = 4; +pub const WGL_SWAP_OVERLAY3: u32 = 8; +pub const WGL_SWAP_OVERLAY4: u32 = 16; +pub const WGL_SWAP_OVERLAY5: u32 = 32; +pub const WGL_SWAP_OVERLAY6: u32 = 64; +pub const WGL_SWAP_OVERLAY7: u32 = 128; +pub const WGL_SWAP_OVERLAY8: u32 = 256; +pub const WGL_SWAP_OVERLAY9: u32 = 512; +pub const WGL_SWAP_OVERLAY10: u32 = 1024; +pub const WGL_SWAP_OVERLAY11: u32 = 2048; +pub const WGL_SWAP_OVERLAY12: u32 = 4096; +pub const WGL_SWAP_OVERLAY13: u32 = 8192; +pub const WGL_SWAP_OVERLAY14: u32 = 16384; +pub const WGL_SWAP_OVERLAY15: u32 = 32768; +pub const WGL_SWAP_UNDERLAY1: u32 = 65536; +pub const WGL_SWAP_UNDERLAY2: u32 = 131072; +pub const WGL_SWAP_UNDERLAY3: u32 = 262144; +pub const WGL_SWAP_UNDERLAY4: u32 = 524288; +pub const WGL_SWAP_UNDERLAY5: u32 = 1048576; +pub const WGL_SWAP_UNDERLAY6: u32 = 2097152; +pub const WGL_SWAP_UNDERLAY7: u32 = 4194304; +pub const WGL_SWAP_UNDERLAY8: u32 = 8388608; +pub const WGL_SWAP_UNDERLAY9: u32 = 16777216; +pub const WGL_SWAP_UNDERLAY10: u32 = 33554432; +pub const WGL_SWAP_UNDERLAY11: u32 = 67108864; +pub const WGL_SWAP_UNDERLAY12: u32 = 134217728; +pub const WGL_SWAP_UNDERLAY13: u32 = 268435456; +pub const WGL_SWAP_UNDERLAY14: u32 = 536870912; +pub const WGL_SWAP_UNDERLAY15: u32 = 1073741824; +pub const WGL_SWAPMULTIPLE_MAX: u32 = 16; +pub const DIFFERENCE: u32 = 11; +pub const SB_HORZ: u32 = 0; +pub const SB_VERT: u32 = 1; +pub const SB_CTL: u32 = 2; +pub const SB_BOTH: u32 = 3; +pub const SB_LINEUP: u32 = 0; +pub const SB_LINELEFT: u32 = 0; +pub const SB_LINEDOWN: u32 = 1; +pub const SB_LINERIGHT: u32 = 1; +pub const SB_PAGEUP: u32 = 2; +pub const SB_PAGELEFT: u32 = 2; +pub const SB_PAGEDOWN: u32 = 3; +pub const SB_PAGERIGHT: u32 = 3; +pub const SB_THUMBPOSITION: u32 = 4; +pub const SB_THUMBTRACK: u32 = 5; +pub const SB_TOP: u32 = 6; +pub const SB_LEFT: u32 = 6; +pub const SB_BOTTOM: u32 = 7; +pub const SB_RIGHT: u32 = 7; +pub const SB_ENDSCROLL: u32 = 8; +pub const SW_HIDE: u32 = 0; +pub const SW_SHOWNORMAL: u32 = 1; +pub const SW_NORMAL: u32 = 1; +pub const SW_SHOWMINIMIZED: u32 = 2; +pub const SW_SHOWMAXIMIZED: u32 = 3; +pub const SW_MAXIMIZE: u32 = 3; +pub const SW_SHOWNOACTIVATE: u32 = 4; +pub const SW_SHOW: u32 = 5; +pub const SW_MINIMIZE: u32 = 6; +pub const SW_SHOWMINNOACTIVE: u32 = 7; +pub const SW_SHOWNA: u32 = 8; +pub const SW_RESTORE: u32 = 9; +pub const SW_SHOWDEFAULT: u32 = 10; +pub const SW_FORCEMINIMIZE: u32 = 11; +pub const SW_MAX: u32 = 11; +pub const HIDE_WINDOW: u32 = 0; +pub const SHOW_OPENWINDOW: u32 = 1; +pub const SHOW_ICONWINDOW: u32 = 2; +pub const SHOW_FULLSCREEN: u32 = 3; +pub const SHOW_OPENNOACTIVATE: u32 = 4; +pub const SW_PARENTCLOSING: u32 = 1; +pub const SW_OTHERZOOM: u32 = 2; +pub const SW_PARENTOPENING: u32 = 3; +pub const SW_OTHERUNZOOM: u32 = 4; +pub const AW_HOR_POSITIVE: u32 = 1; +pub const AW_HOR_NEGATIVE: u32 = 2; +pub const AW_VER_POSITIVE: u32 = 4; +pub const AW_VER_NEGATIVE: u32 = 8; +pub const AW_CENTER: u32 = 16; +pub const AW_HIDE: u32 = 65536; +pub const AW_ACTIVATE: u32 = 131072; +pub const AW_SLIDE: u32 = 262144; +pub const AW_BLEND: u32 = 524288; +pub const KF_EXTENDED: u32 = 256; +pub const KF_DLGMODE: u32 = 2048; +pub const KF_MENUMODE: u32 = 4096; +pub const KF_ALTDOWN: u32 = 8192; +pub const KF_REPEAT: u32 = 16384; +pub const KF_UP: u32 = 32768; +pub const VK_LBUTTON: u32 = 1; +pub const VK_RBUTTON: u32 = 2; +pub const VK_CANCEL: u32 = 3; +pub const VK_MBUTTON: u32 = 4; +pub const VK_XBUTTON1: u32 = 5; +pub const VK_XBUTTON2: u32 = 6; +pub const VK_BACK: u32 = 8; +pub const VK_TAB: u32 = 9; +pub const VK_CLEAR: u32 = 12; +pub const VK_RETURN: u32 = 13; +pub const VK_SHIFT: u32 = 16; +pub const VK_CONTROL: u32 = 17; +pub const VK_MENU: u32 = 18; +pub const VK_PAUSE: u32 = 19; +pub const VK_CAPITAL: u32 = 20; +pub const VK_KANA: u32 = 21; +pub const VK_HANGEUL: u32 = 21; +pub const VK_HANGUL: u32 = 21; +pub const VK_JUNJA: u32 = 23; +pub const VK_FINAL: u32 = 24; +pub const VK_HANJA: u32 = 25; +pub const VK_KANJI: u32 = 25; +pub const VK_ESCAPE: u32 = 27; +pub const VK_CONVERT: u32 = 28; +pub const VK_NONCONVERT: u32 = 29; +pub const VK_ACCEPT: u32 = 30; +pub const VK_MODECHANGE: u32 = 31; +pub const VK_SPACE: u32 = 32; +pub const VK_PRIOR: u32 = 33; +pub const VK_NEXT: u32 = 34; +pub const VK_END: u32 = 35; +pub const VK_HOME: u32 = 36; +pub const VK_LEFT: u32 = 37; +pub const VK_UP: u32 = 38; +pub const VK_RIGHT: u32 = 39; +pub const VK_DOWN: u32 = 40; +pub const VK_SELECT: u32 = 41; +pub const VK_PRINT: u32 = 42; +pub const VK_EXECUTE: u32 = 43; +pub const VK_SNAPSHOT: u32 = 44; +pub const VK_INSERT: u32 = 45; +pub const VK_DELETE: u32 = 46; +pub const VK_HELP: u32 = 47; +pub const VK_LWIN: u32 = 91; +pub const VK_RWIN: u32 = 92; +pub const VK_APPS: u32 = 93; +pub const VK_SLEEP: u32 = 95; +pub const VK_NUMPAD0: u32 = 96; +pub const VK_NUMPAD1: u32 = 97; +pub const VK_NUMPAD2: u32 = 98; +pub const VK_NUMPAD3: u32 = 99; +pub const VK_NUMPAD4: u32 = 100; +pub const VK_NUMPAD5: u32 = 101; +pub const VK_NUMPAD6: u32 = 102; +pub const VK_NUMPAD7: u32 = 103; +pub const VK_NUMPAD8: u32 = 104; +pub const VK_NUMPAD9: u32 = 105; +pub const VK_MULTIPLY: u32 = 106; +pub const VK_ADD: u32 = 107; +pub const VK_SEPARATOR: u32 = 108; +pub const VK_SUBTRACT: u32 = 109; +pub const VK_DECIMAL: u32 = 110; +pub const VK_DIVIDE: u32 = 111; +pub const VK_F1: u32 = 112; +pub const VK_F2: u32 = 113; +pub const VK_F3: u32 = 114; +pub const VK_F4: u32 = 115; +pub const VK_F5: u32 = 116; +pub const VK_F6: u32 = 117; +pub const VK_F7: u32 = 118; +pub const VK_F8: u32 = 119; +pub const VK_F9: u32 = 120; +pub const VK_F10: u32 = 121; +pub const VK_F11: u32 = 122; +pub const VK_F12: u32 = 123; +pub const VK_F13: u32 = 124; +pub const VK_F14: u32 = 125; +pub const VK_F15: u32 = 126; +pub const VK_F16: u32 = 127; +pub const VK_F17: u32 = 128; +pub const VK_F18: u32 = 129; +pub const VK_F19: u32 = 130; +pub const VK_F20: u32 = 131; +pub const VK_F21: u32 = 132; +pub const VK_F22: u32 = 133; +pub const VK_F23: u32 = 134; +pub const VK_F24: u32 = 135; +pub const VK_NUMLOCK: u32 = 144; +pub const VK_SCROLL: u32 = 145; +pub const VK_OEM_NEC_EQUAL: u32 = 146; +pub const VK_OEM_FJ_JISHO: u32 = 146; +pub const VK_OEM_FJ_MASSHOU: u32 = 147; +pub const VK_OEM_FJ_TOUROKU: u32 = 148; +pub const VK_OEM_FJ_LOYA: u32 = 149; +pub const VK_OEM_FJ_ROYA: u32 = 150; +pub const VK_LSHIFT: u32 = 160; +pub const VK_RSHIFT: u32 = 161; +pub const VK_LCONTROL: u32 = 162; +pub const VK_RCONTROL: u32 = 163; +pub const VK_LMENU: u32 = 164; +pub const VK_RMENU: u32 = 165; +pub const VK_BROWSER_BACK: u32 = 166; +pub const VK_BROWSER_FORWARD: u32 = 167; +pub const VK_BROWSER_REFRESH: u32 = 168; +pub const VK_BROWSER_STOP: u32 = 169; +pub const VK_BROWSER_SEARCH: u32 = 170; +pub const VK_BROWSER_FAVORITES: u32 = 171; +pub const VK_BROWSER_HOME: u32 = 172; +pub const VK_VOLUME_MUTE: u32 = 173; +pub const VK_VOLUME_DOWN: u32 = 174; +pub const VK_VOLUME_UP: u32 = 175; +pub const VK_MEDIA_NEXT_TRACK: u32 = 176; +pub const VK_MEDIA_PREV_TRACK: u32 = 177; +pub const VK_MEDIA_STOP: u32 = 178; +pub const VK_MEDIA_PLAY_PAUSE: u32 = 179; +pub const VK_LAUNCH_MAIL: u32 = 180; +pub const VK_LAUNCH_MEDIA_SELECT: u32 = 181; +pub const VK_LAUNCH_APP1: u32 = 182; +pub const VK_LAUNCH_APP2: u32 = 183; +pub const VK_OEM_1: u32 = 186; +pub const VK_OEM_PLUS: u32 = 187; +pub const VK_OEM_COMMA: u32 = 188; +pub const VK_OEM_MINUS: u32 = 189; +pub const VK_OEM_PERIOD: u32 = 190; +pub const VK_OEM_2: u32 = 191; +pub const VK_OEM_3: u32 = 192; +pub const VK_OEM_4: u32 = 219; +pub const VK_OEM_5: u32 = 220; +pub const VK_OEM_6: u32 = 221; +pub const VK_OEM_7: u32 = 222; +pub const VK_OEM_8: u32 = 223; +pub const VK_OEM_AX: u32 = 225; +pub const VK_OEM_102: u32 = 226; +pub const VK_ICO_HELP: u32 = 227; +pub const VK_ICO_00: u32 = 228; +pub const VK_PROCESSKEY: u32 = 229; +pub const VK_ICO_CLEAR: u32 = 230; +pub const VK_PACKET: u32 = 231; +pub const VK_OEM_RESET: u32 = 233; +pub const VK_OEM_JUMP: u32 = 234; +pub const VK_OEM_PA1: u32 = 235; +pub const VK_OEM_PA2: u32 = 236; +pub const VK_OEM_PA3: u32 = 237; +pub const VK_OEM_WSCTRL: u32 = 238; +pub const VK_OEM_CUSEL: u32 = 239; +pub const VK_OEM_ATTN: u32 = 240; +pub const VK_OEM_FINISH: u32 = 241; +pub const VK_OEM_COPY: u32 = 242; +pub const VK_OEM_AUTO: u32 = 243; +pub const VK_OEM_ENLW: u32 = 244; +pub const VK_OEM_BACKTAB: u32 = 245; +pub const VK_ATTN: u32 = 246; +pub const VK_CRSEL: u32 = 247; +pub const VK_EXSEL: u32 = 248; +pub const VK_EREOF: u32 = 249; +pub const VK_PLAY: u32 = 250; +pub const VK_ZOOM: u32 = 251; +pub const VK_NONAME: u32 = 252; +pub const VK_PA1: u32 = 253; +pub const VK_OEM_CLEAR: u32 = 254; +pub const WH_MIN: i32 = -1; +pub const WH_MSGFILTER: i32 = -1; +pub const WH_JOURNALRECORD: u32 = 0; +pub const WH_JOURNALPLAYBACK: u32 = 1; +pub const WH_KEYBOARD: u32 = 2; +pub const WH_GETMESSAGE: u32 = 3; +pub const WH_CALLWNDPROC: u32 = 4; +pub const WH_CBT: u32 = 5; +pub const WH_SYSMSGFILTER: u32 = 6; +pub const WH_MOUSE: u32 = 7; +pub const WH_HARDWARE: u32 = 8; +pub const WH_DEBUG: u32 = 9; +pub const WH_SHELL: u32 = 10; +pub const WH_FOREGROUNDIDLE: u32 = 11; +pub const WH_CALLWNDPROCRET: u32 = 12; +pub const WH_KEYBOARD_LL: u32 = 13; +pub const WH_MOUSE_LL: u32 = 14; +pub const WH_MAX: u32 = 14; +pub const WH_MINHOOK: i32 = -1; +pub const WH_MAXHOOK: u32 = 14; +pub const HC_ACTION: u32 = 0; +pub const HC_GETNEXT: u32 = 1; +pub const HC_SKIP: u32 = 2; +pub const HC_NOREMOVE: u32 = 3; +pub const HC_NOREM: u32 = 3; +pub const HC_SYSMODALON: u32 = 4; +pub const HC_SYSMODALOFF: u32 = 5; +pub const HCBT_MOVESIZE: u32 = 0; +pub const HCBT_MINMAX: u32 = 1; +pub const HCBT_QS: u32 = 2; +pub const HCBT_CREATEWND: u32 = 3; +pub const HCBT_DESTROYWND: u32 = 4; +pub const HCBT_ACTIVATE: u32 = 5; +pub const HCBT_CLICKSKIPPED: u32 = 6; +pub const HCBT_KEYSKIPPED: u32 = 7; +pub const HCBT_SYSCOMMAND: u32 = 8; +pub const HCBT_SETFOCUS: u32 = 9; +pub const WTS_CONSOLE_CONNECT: u32 = 1; +pub const WTS_CONSOLE_DISCONNECT: u32 = 2; +pub const WTS_REMOTE_CONNECT: u32 = 3; +pub const WTS_REMOTE_DISCONNECT: u32 = 4; +pub const WTS_SESSION_LOGON: u32 = 5; +pub const WTS_SESSION_LOGOFF: u32 = 6; +pub const WTS_SESSION_LOCK: u32 = 7; +pub const WTS_SESSION_UNLOCK: u32 = 8; +pub const WTS_SESSION_REMOTE_CONTROL: u32 = 9; +pub const WTS_SESSION_CREATE: u32 = 10; +pub const WTS_SESSION_TERMINATE: u32 = 11; +pub const MSGF_DIALOGBOX: u32 = 0; +pub const MSGF_MESSAGEBOX: u32 = 1; +pub const MSGF_MENU: u32 = 2; +pub const MSGF_SCROLLBAR: u32 = 5; +pub const MSGF_NEXTWINDOW: u32 = 6; +pub const MSGF_MAX: u32 = 8; +pub const MSGF_USER: u32 = 4096; +pub const HSHELL_WINDOWCREATED: u32 = 1; +pub const HSHELL_WINDOWDESTROYED: u32 = 2; +pub const HSHELL_ACTIVATESHELLWINDOW: u32 = 3; +pub const HSHELL_WINDOWACTIVATED: u32 = 4; +pub const HSHELL_GETMINRECT: u32 = 5; +pub const HSHELL_REDRAW: u32 = 6; +pub const HSHELL_TASKMAN: u32 = 7; +pub const HSHELL_LANGUAGE: u32 = 8; +pub const HSHELL_SYSMENU: u32 = 9; +pub const HSHELL_ENDTASK: u32 = 10; +pub const HSHELL_ACCESSIBILITYSTATE: u32 = 11; +pub const HSHELL_APPCOMMAND: u32 = 12; +pub const HSHELL_WINDOWREPLACED: u32 = 13; +pub const HSHELL_WINDOWREPLACING: u32 = 14; +pub const HSHELL_HIGHBIT: u32 = 32768; +pub const HSHELL_FLASH: u32 = 32774; +pub const HSHELL_RUDEAPPACTIVATED: u32 = 32772; +pub const ACCESS_STICKYKEYS: u32 = 1; +pub const ACCESS_FILTERKEYS: u32 = 2; +pub const ACCESS_MOUSEKEYS: u32 = 3; +pub const APPCOMMAND_BROWSER_BACKWARD: u32 = 1; +pub const APPCOMMAND_BROWSER_FORWARD: u32 = 2; +pub const APPCOMMAND_BROWSER_REFRESH: u32 = 3; +pub const APPCOMMAND_BROWSER_STOP: u32 = 4; +pub const APPCOMMAND_BROWSER_SEARCH: u32 = 5; +pub const APPCOMMAND_BROWSER_FAVORITES: u32 = 6; +pub const APPCOMMAND_BROWSER_HOME: u32 = 7; +pub const APPCOMMAND_VOLUME_MUTE: u32 = 8; +pub const APPCOMMAND_VOLUME_DOWN: u32 = 9; +pub const APPCOMMAND_VOLUME_UP: u32 = 10; +pub const APPCOMMAND_MEDIA_NEXTTRACK: u32 = 11; +pub const APPCOMMAND_MEDIA_PREVIOUSTRACK: u32 = 12; +pub const APPCOMMAND_MEDIA_STOP: u32 = 13; +pub const APPCOMMAND_MEDIA_PLAY_PAUSE: u32 = 14; +pub const APPCOMMAND_LAUNCH_MAIL: u32 = 15; +pub const APPCOMMAND_LAUNCH_MEDIA_SELECT: u32 = 16; +pub const APPCOMMAND_LAUNCH_APP1: u32 = 17; +pub const APPCOMMAND_LAUNCH_APP2: u32 = 18; +pub const APPCOMMAND_BASS_DOWN: u32 = 19; +pub const APPCOMMAND_BASS_BOOST: u32 = 20; +pub const APPCOMMAND_BASS_UP: u32 = 21; +pub const APPCOMMAND_TREBLE_DOWN: u32 = 22; +pub const APPCOMMAND_TREBLE_UP: u32 = 23; +pub const APPCOMMAND_MICROPHONE_VOLUME_MUTE: u32 = 24; +pub const APPCOMMAND_MICROPHONE_VOLUME_DOWN: u32 = 25; +pub const APPCOMMAND_MICROPHONE_VOLUME_UP: u32 = 26; +pub const APPCOMMAND_HELP: u32 = 27; +pub const APPCOMMAND_FIND: u32 = 28; +pub const APPCOMMAND_NEW: u32 = 29; +pub const APPCOMMAND_OPEN: u32 = 30; +pub const APPCOMMAND_CLOSE: u32 = 31; +pub const APPCOMMAND_SAVE: u32 = 32; +pub const APPCOMMAND_PRINT: u32 = 33; +pub const APPCOMMAND_UNDO: u32 = 34; +pub const APPCOMMAND_REDO: u32 = 35; +pub const APPCOMMAND_COPY: u32 = 36; +pub const APPCOMMAND_CUT: u32 = 37; +pub const APPCOMMAND_PASTE: u32 = 38; +pub const APPCOMMAND_REPLY_TO_MAIL: u32 = 39; +pub const APPCOMMAND_FORWARD_MAIL: u32 = 40; +pub const APPCOMMAND_SEND_MAIL: u32 = 41; +pub const APPCOMMAND_SPELL_CHECK: u32 = 42; +pub const APPCOMMAND_DICTATE_OR_COMMAND_CONTROL_TOGGLE: u32 = 43; +pub const APPCOMMAND_MIC_ON_OFF_TOGGLE: u32 = 44; +pub const APPCOMMAND_CORRECTION_LIST: u32 = 45; +pub const APPCOMMAND_MEDIA_PLAY: u32 = 46; +pub const APPCOMMAND_MEDIA_PAUSE: u32 = 47; +pub const APPCOMMAND_MEDIA_RECORD: u32 = 48; +pub const APPCOMMAND_MEDIA_FAST_FORWARD: u32 = 49; +pub const APPCOMMAND_MEDIA_REWIND: u32 = 50; +pub const APPCOMMAND_MEDIA_CHANNEL_UP: u32 = 51; +pub const APPCOMMAND_MEDIA_CHANNEL_DOWN: u32 = 52; +pub const FAPPCOMMAND_MOUSE: u32 = 32768; +pub const FAPPCOMMAND_KEY: u32 = 0; +pub const FAPPCOMMAND_OEM: u32 = 4096; +pub const FAPPCOMMAND_MASK: u32 = 61440; +pub const LLKHF_EXTENDED: u32 = 1; +pub const LLKHF_INJECTED: u32 = 16; +pub const LLKHF_ALTDOWN: u32 = 32; +pub const LLKHF_UP: u32 = 128; +pub const LLMHF_INJECTED: u32 = 1; +pub const HKL_PREV: u32 = 0; +pub const HKL_NEXT: u32 = 1; +pub const KLF_ACTIVATE: u32 = 1; +pub const KLF_SUBSTITUTE_OK: u32 = 2; +pub const KLF_REORDER: u32 = 8; +pub const KLF_REPLACELANG: u32 = 16; +pub const KLF_NOTELLSHELL: u32 = 128; +pub const KLF_SETFORPROCESS: u32 = 256; +pub const KLF_SHIFTLOCK: u32 = 65536; +pub const KLF_RESET: u32 = 1073741824; +pub const INPUTLANGCHANGE_SYSCHARSET: u32 = 1; +pub const INPUTLANGCHANGE_FORWARD: u32 = 2; +pub const INPUTLANGCHANGE_BACKWARD: u32 = 4; +pub const KL_NAMELENGTH: u32 = 9; +pub const GMMP_USE_DISPLAY_POINTS: u32 = 1; +pub const GMMP_USE_HIGH_RESOLUTION_POINTS: u32 = 2; +pub const CWF_CREATE_ONLY: u32 = 1; +pub const UOI_FLAGS: u32 = 1; +pub const UOI_NAME: u32 = 2; +pub const UOI_TYPE: u32 = 3; +pub const UOI_USER_SID: u32 = 4; +pub const GWL_WNDPROC: i32 = -4; +pub const GWL_HINSTANCE: i32 = -6; +pub const GWL_HWNDPARENT: i32 = -8; +pub const GWL_STYLE: i32 = -16; +pub const GWL_EXSTYLE: i32 = -20; +pub const GWL_USERDATA: i32 = -21; +pub const GWL_ID: i32 = -12; +pub const GWLP_WNDPROC: i32 = -4; +pub const GWLP_HINSTANCE: i32 = -6; +pub const GWLP_HWNDPARENT: i32 = -8; +pub const GWLP_USERDATA: i32 = -21; +pub const GWLP_ID: i32 = -12; +pub const GCL_MENUNAME: i32 = -8; +pub const GCL_HBRBACKGROUND: i32 = -10; +pub const GCL_HCURSOR: i32 = -12; +pub const GCL_HICON: i32 = -14; +pub const GCL_HMODULE: i32 = -16; +pub const GCL_CBWNDEXTRA: i32 = -18; +pub const GCL_CBCLSEXTRA: i32 = -20; +pub const GCL_WNDPROC: i32 = -24; +pub const GCL_STYLE: i32 = -26; +pub const GCW_ATOM: i32 = -32; +pub const GCL_HICONSM: i32 = -34; +pub const GCLP_MENUNAME: i32 = -8; +pub const GCLP_HBRBACKGROUND: i32 = -10; +pub const GCLP_HCURSOR: i32 = -12; +pub const GCLP_HICON: i32 = -14; +pub const GCLP_HMODULE: i32 = -16; +pub const GCLP_WNDPROC: i32 = -24; +pub const GCLP_HICONSM: i32 = -34; +pub const WM_NULL: u32 = 0; +pub const WM_CREATE: u32 = 1; +pub const WM_DESTROY: u32 = 2; +pub const WM_MOVE: u32 = 3; +pub const WM_SIZE: u32 = 5; +pub const WM_ACTIVATE: u32 = 6; +pub const WA_INACTIVE: u32 = 0; +pub const WA_ACTIVE: u32 = 1; +pub const WA_CLICKACTIVE: u32 = 2; +pub const WM_SETFOCUS: u32 = 7; +pub const WM_KILLFOCUS: u32 = 8; +pub const WM_ENABLE: u32 = 10; +pub const WM_SETREDRAW: u32 = 11; +pub const WM_SETTEXT: u32 = 12; +pub const WM_GETTEXT: u32 = 13; +pub const WM_GETTEXTLENGTH: u32 = 14; +pub const WM_PAINT: u32 = 15; +pub const WM_CLOSE: u32 = 16; +pub const WM_QUERYENDSESSION: u32 = 17; +pub const WM_QUERYOPEN: u32 = 19; +pub const WM_ENDSESSION: u32 = 22; +pub const WM_QUIT: u32 = 18; +pub const WM_ERASEBKGND: u32 = 20; +pub const WM_SYSCOLORCHANGE: u32 = 21; +pub const WM_SHOWWINDOW: u32 = 24; +pub const WM_WININICHANGE: u32 = 26; +pub const WM_SETTINGCHANGE: u32 = 26; +pub const WM_DEVMODECHANGE: u32 = 27; +pub const WM_ACTIVATEAPP: u32 = 28; +pub const WM_FONTCHANGE: u32 = 29; +pub const WM_TIMECHANGE: u32 = 30; +pub const WM_CANCELMODE: u32 = 31; +pub const WM_SETCURSOR: u32 = 32; +pub const WM_MOUSEACTIVATE: u32 = 33; +pub const WM_CHILDACTIVATE: u32 = 34; +pub const WM_QUEUESYNC: u32 = 35; +pub const WM_GETMINMAXINFO: u32 = 36; +pub const WM_PAINTICON: u32 = 38; +pub const WM_ICONERASEBKGND: u32 = 39; +pub const WM_NEXTDLGCTL: u32 = 40; +pub const WM_SPOOLERSTATUS: u32 = 42; +pub const WM_DRAWITEM: u32 = 43; +pub const WM_MEASUREITEM: u32 = 44; +pub const WM_DELETEITEM: u32 = 45; +pub const WM_VKEYTOITEM: u32 = 46; +pub const WM_CHARTOITEM: u32 = 47; +pub const WM_SETFONT: u32 = 48; +pub const WM_GETFONT: u32 = 49; +pub const WM_SETHOTKEY: u32 = 50; +pub const WM_GETHOTKEY: u32 = 51; +pub const WM_QUERYDRAGICON: u32 = 55; +pub const WM_COMPAREITEM: u32 = 57; +pub const WM_GETOBJECT: u32 = 61; +pub const WM_COMPACTING: u32 = 65; +pub const WM_COMMNOTIFY: u32 = 68; +pub const WM_WINDOWPOSCHANGING: u32 = 70; +pub const WM_WINDOWPOSCHANGED: u32 = 71; +pub const WM_POWER: u32 = 72; +pub const PWR_OK: u32 = 1; +pub const PWR_FAIL: i32 = -1; +pub const PWR_SUSPENDREQUEST: u32 = 1; +pub const PWR_SUSPENDRESUME: u32 = 2; +pub const PWR_CRITICALRESUME: u32 = 3; +pub const WM_COPYDATA: u32 = 74; +pub const WM_CANCELJOURNAL: u32 = 75; +pub const WM_NOTIFY: u32 = 78; +pub const WM_INPUTLANGCHANGEREQUEST: u32 = 80; +pub const WM_INPUTLANGCHANGE: u32 = 81; +pub const WM_TCARD: u32 = 82; +pub const WM_HELP: u32 = 83; +pub const WM_USERCHANGED: u32 = 84; +pub const WM_NOTIFYFORMAT: u32 = 85; +pub const NFR_ANSI: u32 = 1; +pub const NFR_UNICODE: u32 = 2; +pub const NF_QUERY: u32 = 3; +pub const NF_REQUERY: u32 = 4; +pub const WM_CONTEXTMENU: u32 = 123; +pub const WM_STYLECHANGING: u32 = 124; +pub const WM_STYLECHANGED: u32 = 125; +pub const WM_DISPLAYCHANGE: u32 = 126; +pub const WM_GETICON: u32 = 127; +pub const WM_SETICON: u32 = 128; +pub const WM_NCCREATE: u32 = 129; +pub const WM_NCDESTROY: u32 = 130; +pub const WM_NCCALCSIZE: u32 = 131; +pub const WM_NCHITTEST: u32 = 132; +pub const WM_NCPAINT: u32 = 133; +pub const WM_NCACTIVATE: u32 = 134; +pub const WM_GETDLGCODE: u32 = 135; +pub const WM_SYNCPAINT: u32 = 136; +pub const WM_NCMOUSEMOVE: u32 = 160; +pub const WM_NCLBUTTONDOWN: u32 = 161; +pub const WM_NCLBUTTONUP: u32 = 162; +pub const WM_NCLBUTTONDBLCLK: u32 = 163; +pub const WM_NCRBUTTONDOWN: u32 = 164; +pub const WM_NCRBUTTONUP: u32 = 165; +pub const WM_NCRBUTTONDBLCLK: u32 = 166; +pub const WM_NCMBUTTONDOWN: u32 = 167; +pub const WM_NCMBUTTONUP: u32 = 168; +pub const WM_NCMBUTTONDBLCLK: u32 = 169; +pub const WM_NCXBUTTONDOWN: u32 = 171; +pub const WM_NCXBUTTONUP: u32 = 172; +pub const WM_NCXBUTTONDBLCLK: u32 = 173; +pub const WM_INPUT_DEVICE_CHANGE: u32 = 254; +pub const WM_INPUT: u32 = 255; +pub const WM_KEYFIRST: u32 = 256; +pub const WM_KEYDOWN: u32 = 256; +pub const WM_KEYUP: u32 = 257; +pub const WM_CHAR: u32 = 258; +pub const WM_DEADCHAR: u32 = 259; +pub const WM_SYSKEYDOWN: u32 = 260; +pub const WM_SYSKEYUP: u32 = 261; +pub const WM_SYSCHAR: u32 = 262; +pub const WM_SYSDEADCHAR: u32 = 263; +pub const WM_UNICHAR: u32 = 265; +pub const WM_KEYLAST: u32 = 265; +pub const UNICODE_NOCHAR: u32 = 65535; +pub const WM_IME_STARTCOMPOSITION: u32 = 269; +pub const WM_IME_ENDCOMPOSITION: u32 = 270; +pub const WM_IME_COMPOSITION: u32 = 271; +pub const WM_IME_KEYLAST: u32 = 271; +pub const WM_INITDIALOG: u32 = 272; +pub const WM_COMMAND: u32 = 273; +pub const WM_SYSCOMMAND: u32 = 274; +pub const WM_TIMER: u32 = 275; +pub const WM_HSCROLL: u32 = 276; +pub const WM_VSCROLL: u32 = 277; +pub const WM_INITMENU: u32 = 278; +pub const WM_INITMENUPOPUP: u32 = 279; +pub const WM_MENUSELECT: u32 = 287; +pub const WM_MENUCHAR: u32 = 288; +pub const WM_ENTERIDLE: u32 = 289; +pub const WM_MENURBUTTONUP: u32 = 290; +pub const WM_MENUDRAG: u32 = 291; +pub const WM_MENUGETOBJECT: u32 = 292; +pub const WM_UNINITMENUPOPUP: u32 = 293; +pub const WM_MENUCOMMAND: u32 = 294; +pub const WM_CHANGEUISTATE: u32 = 295; +pub const WM_UPDATEUISTATE: u32 = 296; +pub const WM_QUERYUISTATE: u32 = 297; +pub const UIS_SET: u32 = 1; +pub const UIS_CLEAR: u32 = 2; +pub const UIS_INITIALIZE: u32 = 3; +pub const UISF_HIDEFOCUS: u32 = 1; +pub const UISF_HIDEACCEL: u32 = 2; +pub const UISF_ACTIVE: u32 = 4; +pub const WM_CTLCOLORMSGBOX: u32 = 306; +pub const WM_CTLCOLOREDIT: u32 = 307; +pub const WM_CTLCOLORLISTBOX: u32 = 308; +pub const WM_CTLCOLORBTN: u32 = 309; +pub const WM_CTLCOLORDLG: u32 = 310; +pub const WM_CTLCOLORSCROLLBAR: u32 = 311; +pub const WM_CTLCOLORSTATIC: u32 = 312; +pub const MN_GETHMENU: u32 = 481; +pub const WM_MOUSEFIRST: u32 = 512; +pub const WM_MOUSEMOVE: u32 = 512; +pub const WM_LBUTTONDOWN: u32 = 513; +pub const WM_LBUTTONUP: u32 = 514; +pub const WM_LBUTTONDBLCLK: u32 = 515; +pub const WM_RBUTTONDOWN: u32 = 516; +pub const WM_RBUTTONUP: u32 = 517; +pub const WM_RBUTTONDBLCLK: u32 = 518; +pub const WM_MBUTTONDOWN: u32 = 519; +pub const WM_MBUTTONUP: u32 = 520; +pub const WM_MBUTTONDBLCLK: u32 = 521; +pub const WM_MOUSEWHEEL: u32 = 522; +pub const WM_XBUTTONDOWN: u32 = 523; +pub const WM_XBUTTONUP: u32 = 524; +pub const WM_XBUTTONDBLCLK: u32 = 525; +pub const WM_MOUSELAST: u32 = 525; +pub const WHEEL_DELTA: u32 = 120; +pub const WHEEL_PAGESCROLL: u32 = 4294967295; +pub const XBUTTON1: u32 = 1; +pub const XBUTTON2: u32 = 2; +pub const WM_PARENTNOTIFY: u32 = 528; +pub const WM_ENTERMENULOOP: u32 = 529; +pub const WM_EXITMENULOOP: u32 = 530; +pub const WM_NEXTMENU: u32 = 531; +pub const WM_SIZING: u32 = 532; +pub const WM_CAPTURECHANGED: u32 = 533; +pub const WM_MOVING: u32 = 534; +pub const WM_POWERBROADCAST: u32 = 536; +pub const PBT_APMQUERYSUSPEND: u32 = 0; +pub const PBT_APMQUERYSTANDBY: u32 = 1; +pub const PBT_APMQUERYSUSPENDFAILED: u32 = 2; +pub const PBT_APMQUERYSTANDBYFAILED: u32 = 3; +pub const PBT_APMSUSPEND: u32 = 4; +pub const PBT_APMSTANDBY: u32 = 5; +pub const PBT_APMRESUMECRITICAL: u32 = 6; +pub const PBT_APMRESUMESUSPEND: u32 = 7; +pub const PBT_APMRESUMESTANDBY: u32 = 8; +pub const PBTF_APMRESUMEFROMFAILURE: u32 = 1; +pub const PBT_APMBATTERYLOW: u32 = 9; +pub const PBT_APMPOWERSTATUSCHANGE: u32 = 10; +pub const PBT_APMOEMEVENT: u32 = 11; +pub const PBT_APMRESUMEAUTOMATIC: u32 = 18; +pub const PBT_POWERSETTINGCHANGE: u32 = 32787; +pub const WM_DEVICECHANGE: u32 = 537; +pub const WM_MDICREATE: u32 = 544; +pub const WM_MDIDESTROY: u32 = 545; +pub const WM_MDIACTIVATE: u32 = 546; +pub const WM_MDIRESTORE: u32 = 547; +pub const WM_MDINEXT: u32 = 548; +pub const WM_MDIMAXIMIZE: u32 = 549; +pub const WM_MDITILE: u32 = 550; +pub const WM_MDICASCADE: u32 = 551; +pub const WM_MDIICONARRANGE: u32 = 552; +pub const WM_MDIGETACTIVE: u32 = 553; +pub const WM_MDISETMENU: u32 = 560; +pub const WM_ENTERSIZEMOVE: u32 = 561; +pub const WM_EXITSIZEMOVE: u32 = 562; +pub const WM_DROPFILES: u32 = 563; +pub const WM_MDIREFRESHMENU: u32 = 564; +pub const WM_IME_SETCONTEXT: u32 = 641; +pub const WM_IME_NOTIFY: u32 = 642; +pub const WM_IME_CONTROL: u32 = 643; +pub const WM_IME_COMPOSITIONFULL: u32 = 644; +pub const WM_IME_SELECT: u32 = 645; +pub const WM_IME_CHAR: u32 = 646; +pub const WM_IME_REQUEST: u32 = 648; +pub const WM_IME_KEYDOWN: u32 = 656; +pub const WM_IME_KEYUP: u32 = 657; +pub const WM_MOUSEHOVER: u32 = 673; +pub const WM_MOUSELEAVE: u32 = 675; +pub const WM_NCMOUSEHOVER: u32 = 672; +pub const WM_NCMOUSELEAVE: u32 = 674; +pub const WM_WTSSESSION_CHANGE: u32 = 689; +pub const WM_TABLET_FIRST: u32 = 704; +pub const WM_TABLET_LAST: u32 = 735; +pub const WM_CUT: u32 = 768; +pub const WM_COPY: u32 = 769; +pub const WM_PASTE: u32 = 770; +pub const WM_CLEAR: u32 = 771; +pub const WM_UNDO: u32 = 772; +pub const WM_RENDERFORMAT: u32 = 773; +pub const WM_RENDERALLFORMATS: u32 = 774; +pub const WM_DESTROYCLIPBOARD: u32 = 775; +pub const WM_DRAWCLIPBOARD: u32 = 776; +pub const WM_PAINTCLIPBOARD: u32 = 777; +pub const WM_VSCROLLCLIPBOARD: u32 = 778; +pub const WM_SIZECLIPBOARD: u32 = 779; +pub const WM_ASKCBFORMATNAME: u32 = 780; +pub const WM_CHANGECBCHAIN: u32 = 781; +pub const WM_HSCROLLCLIPBOARD: u32 = 782; +pub const WM_QUERYNEWPALETTE: u32 = 783; +pub const WM_PALETTEISCHANGING: u32 = 784; +pub const WM_PALETTECHANGED: u32 = 785; +pub const WM_HOTKEY: u32 = 786; +pub const WM_PRINT: u32 = 791; +pub const WM_PRINTCLIENT: u32 = 792; +pub const WM_APPCOMMAND: u32 = 793; +pub const WM_THEMECHANGED: u32 = 794; +pub const WM_CLIPBOARDUPDATE: u32 = 797; +pub const WM_HANDHELDFIRST: u32 = 856; +pub const WM_HANDHELDLAST: u32 = 863; +pub const WM_AFXFIRST: u32 = 864; +pub const WM_AFXLAST: u32 = 895; +pub const WM_PENWINFIRST: u32 = 896; +pub const WM_PENWINLAST: u32 = 911; +pub const WM_APP: u32 = 32768; +pub const WM_USER: u32 = 1024; +pub const WMSZ_LEFT: u32 = 1; +pub const WMSZ_RIGHT: u32 = 2; +pub const WMSZ_TOP: u32 = 3; +pub const WMSZ_TOPLEFT: u32 = 4; +pub const WMSZ_TOPRIGHT: u32 = 5; +pub const WMSZ_BOTTOM: u32 = 6; +pub const WMSZ_BOTTOMLEFT: u32 = 7; +pub const WMSZ_BOTTOMRIGHT: u32 = 8; +pub const HTERROR: i32 = -2; +pub const HTTRANSPARENT: i32 = -1; +pub const HTNOWHERE: u32 = 0; +pub const HTCLIENT: u32 = 1; +pub const HTCAPTION: u32 = 2; +pub const HTSYSMENU: u32 = 3; +pub const HTGROWBOX: u32 = 4; +pub const HTSIZE: u32 = 4; +pub const HTMENU: u32 = 5; +pub const HTHSCROLL: u32 = 6; +pub const HTVSCROLL: u32 = 7; +pub const HTMINBUTTON: u32 = 8; +pub const HTMAXBUTTON: u32 = 9; +pub const HTLEFT: u32 = 10; +pub const HTRIGHT: u32 = 11; +pub const HTTOP: u32 = 12; +pub const HTTOPLEFT: u32 = 13; +pub const HTTOPRIGHT: u32 = 14; +pub const HTBOTTOM: u32 = 15; +pub const HTBOTTOMLEFT: u32 = 16; +pub const HTBOTTOMRIGHT: u32 = 17; +pub const HTBORDER: u32 = 18; +pub const HTREDUCE: u32 = 8; +pub const HTZOOM: u32 = 9; +pub const HTSIZEFIRST: u32 = 10; +pub const HTSIZELAST: u32 = 17; +pub const HTOBJECT: u32 = 19; +pub const HTCLOSE: u32 = 20; +pub const HTHELP: u32 = 21; +pub const SMTO_NORMAL: u32 = 0; +pub const SMTO_BLOCK: u32 = 1; +pub const SMTO_ABORTIFHUNG: u32 = 2; +pub const SMTO_NOTIMEOUTIFNOTHUNG: u32 = 8; +pub const MA_ACTIVATE: u32 = 1; +pub const MA_ACTIVATEANDEAT: u32 = 2; +pub const MA_NOACTIVATE: u32 = 3; +pub const MA_NOACTIVATEANDEAT: u32 = 4; +pub const ICON_SMALL: u32 = 0; +pub const ICON_BIG: u32 = 1; +pub const ICON_SMALL2: u32 = 2; +pub const SIZE_RESTORED: u32 = 0; +pub const SIZE_MINIMIZED: u32 = 1; +pub const SIZE_MAXIMIZED: u32 = 2; +pub const SIZE_MAXSHOW: u32 = 3; +pub const SIZE_MAXHIDE: u32 = 4; +pub const SIZENORMAL: u32 = 0; +pub const SIZEICONIC: u32 = 1; +pub const SIZEFULLSCREEN: u32 = 2; +pub const SIZEZOOMSHOW: u32 = 3; +pub const SIZEZOOMHIDE: u32 = 4; +pub const WVR_ALIGNTOP: u32 = 16; +pub const WVR_ALIGNLEFT: u32 = 32; +pub const WVR_ALIGNBOTTOM: u32 = 64; +pub const WVR_ALIGNRIGHT: u32 = 128; +pub const WVR_HREDRAW: u32 = 256; +pub const WVR_VREDRAW: u32 = 512; +pub const WVR_REDRAW: u32 = 768; +pub const WVR_VALIDRECTS: u32 = 1024; +pub const MK_LBUTTON: u32 = 1; +pub const MK_RBUTTON: u32 = 2; +pub const MK_SHIFT: u32 = 4; +pub const MK_CONTROL: u32 = 8; +pub const MK_MBUTTON: u32 = 16; +pub const MK_XBUTTON1: u32 = 32; +pub const MK_XBUTTON2: u32 = 64; +pub const TME_HOVER: u32 = 1; +pub const TME_LEAVE: u32 = 2; +pub const TME_NONCLIENT: u32 = 16; +pub const TME_QUERY: u32 = 1073741824; +pub const TME_CANCEL: u32 = 2147483648; +pub const HOVER_DEFAULT: u32 = 4294967295; +pub const WS_EX_LAYERED: u32 = 524288; +pub const CS_VREDRAW: u32 = 1; +pub const CS_HREDRAW: u32 = 2; +pub const CS_DBLCLKS: u32 = 8; +pub const CS_OWNDC: u32 = 32; +pub const CS_CLASSDC: u32 = 64; +pub const CS_PARENTDC: u32 = 128; +pub const CS_NOCLOSE: u32 = 512; +pub const CS_SAVEBITS: u32 = 2048; +pub const CS_BYTEALIGNCLIENT: u32 = 4096; +pub const CS_BYTEALIGNWINDOW: u32 = 8192; +pub const CS_GLOBALCLASS: u32 = 16384; +pub const CS_IME: u32 = 65536; +pub const CS_DROPSHADOW: u32 = 131072; +pub const BDR_RAISEDOUTER: u32 = 1; +pub const BDR_SUNKENOUTER: u32 = 2; +pub const BDR_RAISEDINNER: u32 = 4; +pub const BDR_SUNKENINNER: u32 = 8; +pub const BDR_OUTER: u32 = 3; +pub const BDR_INNER: u32 = 12; +pub const BDR_RAISED: u32 = 5; +pub const BDR_SUNKEN: u32 = 10; +pub const EDGE_RAISED: u32 = 5; +pub const EDGE_SUNKEN: u32 = 10; +pub const EDGE_ETCHED: u32 = 6; +pub const EDGE_BUMP: u32 = 9; +pub const BF_LEFT: u32 = 1; +pub const BF_TOP: u32 = 2; +pub const BF_RIGHT: u32 = 4; +pub const BF_BOTTOM: u32 = 8; +pub const BF_TOPLEFT: u32 = 3; +pub const BF_TOPRIGHT: u32 = 6; +pub const BF_BOTTOMLEFT: u32 = 9; +pub const BF_BOTTOMRIGHT: u32 = 12; +pub const BF_RECT: u32 = 15; +pub const BF_DIAGONAL: u32 = 16; +pub const BF_DIAGONAL_ENDTOPRIGHT: u32 = 22; +pub const BF_DIAGONAL_ENDTOPLEFT: u32 = 19; +pub const BF_DIAGONAL_ENDBOTTOMLEFT: u32 = 25; +pub const BF_DIAGONAL_ENDBOTTOMRIGHT: u32 = 28; +pub const BF_MIDDLE: u32 = 2048; +pub const BF_SOFT: u32 = 4096; +pub const BF_ADJUST: u32 = 8192; +pub const BF_FLAT: u32 = 16384; +pub const BF_MONO: u32 = 32768; +pub const DFC_CAPTION: u32 = 1; +pub const DFC_MENU: u32 = 2; +pub const DFC_SCROLL: u32 = 3; +pub const DFC_BUTTON: u32 = 4; +pub const DFC_POPUPMENU: u32 = 5; +pub const DFCS_CAPTIONCLOSE: u32 = 0; +pub const DFCS_CAPTIONMIN: u32 = 1; +pub const DFCS_CAPTIONMAX: u32 = 2; +pub const DFCS_CAPTIONRESTORE: u32 = 3; +pub const DFCS_CAPTIONHELP: u32 = 4; +pub const DFCS_MENUARROW: u32 = 0; +pub const DFCS_MENUCHECK: u32 = 1; +pub const DFCS_MENUBULLET: u32 = 2; +pub const DFCS_MENUARROWRIGHT: u32 = 4; +pub const DFCS_SCROLLUP: u32 = 0; +pub const DFCS_SCROLLDOWN: u32 = 1; +pub const DFCS_SCROLLLEFT: u32 = 2; +pub const DFCS_SCROLLRIGHT: u32 = 3; +pub const DFCS_SCROLLCOMBOBOX: u32 = 5; +pub const DFCS_SCROLLSIZEGRIP: u32 = 8; +pub const DFCS_SCROLLSIZEGRIPRIGHT: u32 = 16; +pub const DFCS_BUTTONCHECK: u32 = 0; +pub const DFCS_BUTTONRADIOIMAGE: u32 = 1; +pub const DFCS_BUTTONRADIOMASK: u32 = 2; +pub const DFCS_BUTTONRADIO: u32 = 4; +pub const DFCS_BUTTON3STATE: u32 = 8; +pub const DFCS_BUTTONPUSH: u32 = 16; +pub const DFCS_INACTIVE: u32 = 256; +pub const DFCS_PUSHED: u32 = 512; +pub const DFCS_CHECKED: u32 = 1024; +pub const DFCS_TRANSPARENT: u32 = 2048; +pub const DFCS_HOT: u32 = 4096; +pub const DFCS_ADJUSTRECT: u32 = 8192; +pub const DFCS_FLAT: u32 = 16384; +pub const DFCS_MONO: u32 = 32768; +pub const DC_ACTIVE: u32 = 1; +pub const DC_SMALLCAP: u32 = 2; +pub const DC_ICON: u32 = 4; +pub const DC_TEXT: u32 = 8; +pub const DC_INBUTTON: u32 = 16; +pub const DC_GRADIENT: u32 = 32; +pub const DC_BUTTONS: u32 = 4096; +pub const IDANI_OPEN: u32 = 1; +pub const IDANI_CAPTION: u32 = 3; +pub const CF_TEXT: u32 = 1; +pub const CF_BITMAP: u32 = 2; +pub const CF_METAFILEPICT: u32 = 3; +pub const CF_SYLK: u32 = 4; +pub const CF_DIF: u32 = 5; +pub const CF_TIFF: u32 = 6; +pub const CF_OEMTEXT: u32 = 7; +pub const CF_DIB: u32 = 8; +pub const CF_PALETTE: u32 = 9; +pub const CF_PENDATA: u32 = 10; +pub const CF_RIFF: u32 = 11; +pub const CF_WAVE: u32 = 12; +pub const CF_UNICODETEXT: u32 = 13; +pub const CF_ENHMETAFILE: u32 = 14; +pub const CF_HDROP: u32 = 15; +pub const CF_LOCALE: u32 = 16; +pub const CF_DIBV5: u32 = 17; +pub const CF_MAX: u32 = 18; +pub const CF_OWNERDISPLAY: u32 = 128; +pub const CF_DSPTEXT: u32 = 129; +pub const CF_DSPBITMAP: u32 = 130; +pub const CF_DSPMETAFILEPICT: u32 = 131; +pub const CF_DSPENHMETAFILE: u32 = 142; +pub const CF_PRIVATEFIRST: u32 = 512; +pub const CF_PRIVATELAST: u32 = 767; +pub const CF_GDIOBJFIRST: u32 = 768; +pub const CF_GDIOBJLAST: u32 = 1023; +pub const FVIRTKEY: u32 = 1; +pub const FNOINVERT: u32 = 2; +pub const FSHIFT: u32 = 4; +pub const FCONTROL: u32 = 8; +pub const FALT: u32 = 16; +pub const WPF_SETMINPOSITION: u32 = 1; +pub const WPF_RESTORETOMAXIMIZED: u32 = 2; +pub const WPF_ASYNCWINDOWPLACEMENT: u32 = 4; +pub const ODT_MENU: u32 = 1; +pub const ODT_LISTBOX: u32 = 2; +pub const ODT_COMBOBOX: u32 = 3; +pub const ODT_BUTTON: u32 = 4; +pub const ODT_STATIC: u32 = 5; +pub const ODA_DRAWENTIRE: u32 = 1; +pub const ODA_SELECT: u32 = 2; +pub const ODA_FOCUS: u32 = 4; +pub const ODS_SELECTED: u32 = 1; +pub const ODS_GRAYED: u32 = 2; +pub const ODS_DISABLED: u32 = 4; +pub const ODS_CHECKED: u32 = 8; +pub const ODS_FOCUS: u32 = 16; +pub const ODS_DEFAULT: u32 = 32; +pub const ODS_COMBOBOXEDIT: u32 = 4096; +pub const ODS_HOTLIGHT: u32 = 64; +pub const ODS_INACTIVE: u32 = 128; +pub const ODS_NOACCEL: u32 = 256; +pub const ODS_NOFOCUSRECT: u32 = 512; +pub const PM_NOREMOVE: u32 = 0; +pub const PM_REMOVE: u32 = 1; +pub const PM_NOYIELD: u32 = 2; +pub const MOD_ALT: u32 = 1; +pub const MOD_CONTROL: u32 = 2; +pub const MOD_SHIFT: u32 = 4; +pub const MOD_WIN: u32 = 8; +pub const IDHOT_SNAPWINDOW: i32 = -1; +pub const IDHOT_SNAPDESKTOP: i32 = -2; +pub const ENDSESSION_CLOSEAPP: u32 = 1; +pub const ENDSESSION_CRITICAL: u32 = 1073741824; +pub const ENDSESSION_LOGOFF: u32 = 2147483648; +pub const EWX_LOGOFF: u32 = 0; +pub const EWX_SHUTDOWN: u32 = 1; +pub const EWX_REBOOT: u32 = 2; +pub const EWX_FORCE: u32 = 4; +pub const EWX_POWEROFF: u32 = 8; +pub const EWX_FORCEIFHUNG: u32 = 16; +pub const EWX_QUICKRESOLVE: u32 = 32; +pub const EWX_HYBRID_SHUTDOWN: u32 = 4194304; +pub const EWX_BOOTOPTIONS: u32 = 16777216; +pub const BSM_ALLCOMPONENTS: u32 = 0; +pub const BSM_VXDS: u32 = 1; +pub const BSM_NETDRIVER: u32 = 2; +pub const BSM_INSTALLABLEDRIVERS: u32 = 4; +pub const BSM_APPLICATIONS: u32 = 8; +pub const BSM_ALLDESKTOPS: u32 = 16; +pub const BSF_QUERY: u32 = 1; +pub const BSF_IGNORECURRENTTASK: u32 = 2; +pub const BSF_FLUSHDISK: u32 = 4; +pub const BSF_NOHANG: u32 = 8; +pub const BSF_POSTMESSAGE: u32 = 16; +pub const BSF_FORCEIFHUNG: u32 = 32; +pub const BSF_NOTIMEOUTIFNOTHUNG: u32 = 64; +pub const BSF_ALLOWSFW: u32 = 128; +pub const BSF_SENDNOTIFYMESSAGE: u32 = 256; +pub const BSF_RETURNHDESK: u32 = 512; +pub const BSF_LUID: u32 = 1024; +pub const BROADCAST_QUERY_DENY: u32 = 1112363332; +pub const DEVICE_NOTIFY_WINDOW_HANDLE: u32 = 0; +pub const DEVICE_NOTIFY_SERVICE_HANDLE: u32 = 1; +pub const DEVICE_NOTIFY_ALL_INTERFACE_CLASSES: u32 = 4; +pub const ISMEX_NOSEND: u32 = 0; +pub const ISMEX_SEND: u32 = 1; +pub const ISMEX_NOTIFY: u32 = 2; +pub const ISMEX_CALLBACK: u32 = 4; +pub const ISMEX_REPLIED: u32 = 8; +pub const PW_CLIENTONLY: u32 = 1; +pub const LWA_COLORKEY: u32 = 1; +pub const LWA_ALPHA: u32 = 2; +pub const ULW_COLORKEY: u32 = 1; +pub const ULW_ALPHA: u32 = 2; +pub const ULW_OPAQUE: u32 = 4; +pub const ULW_EX_NORESIZE: u32 = 8; +pub const FLASHW_STOP: u32 = 0; +pub const FLASHW_CAPTION: u32 = 1; +pub const FLASHW_TRAY: u32 = 2; +pub const FLASHW_ALL: u32 = 3; +pub const FLASHW_TIMER: u32 = 4; +pub const FLASHW_TIMERNOFG: u32 = 12; +pub const SWP_NOSIZE: u32 = 1; +pub const SWP_NOMOVE: u32 = 2; +pub const SWP_NOZORDER: u32 = 4; +pub const SWP_NOREDRAW: u32 = 8; +pub const SWP_NOACTIVATE: u32 = 16; +pub const SWP_FRAMECHANGED: u32 = 32; +pub const SWP_SHOWWINDOW: u32 = 64; +pub const SWP_HIDEWINDOW: u32 = 128; +pub const SWP_NOCOPYBITS: u32 = 256; +pub const SWP_NOOWNERZORDER: u32 = 512; +pub const SWP_NOSENDCHANGING: u32 = 1024; +pub const SWP_DRAWFRAME: u32 = 32; +pub const SWP_NOREPOSITION: u32 = 512; +pub const SWP_DEFERERASE: u32 = 8192; +pub const SWP_ASYNCWINDOWPOS: u32 = 16384; +pub const DLGWINDOWEXTRA: u32 = 30; +pub const KEYEVENTF_EXTENDEDKEY: u32 = 1; +pub const KEYEVENTF_KEYUP: u32 = 2; +pub const KEYEVENTF_UNICODE: u32 = 4; +pub const KEYEVENTF_SCANCODE: u32 = 8; +pub const MOUSEEVENTF_MOVE: u32 = 1; +pub const MOUSEEVENTF_LEFTDOWN: u32 = 2; +pub const MOUSEEVENTF_LEFTUP: u32 = 4; +pub const MOUSEEVENTF_RIGHTDOWN: u32 = 8; +pub const MOUSEEVENTF_RIGHTUP: u32 = 16; +pub const MOUSEEVENTF_MIDDLEDOWN: u32 = 32; +pub const MOUSEEVENTF_MIDDLEUP: u32 = 64; +pub const MOUSEEVENTF_XDOWN: u32 = 128; +pub const MOUSEEVENTF_XUP: u32 = 256; +pub const MOUSEEVENTF_WHEEL: u32 = 2048; +pub const MOUSEEVENTF_VIRTUALDESK: u32 = 16384; +pub const MOUSEEVENTF_ABSOLUTE: u32 = 32768; +pub const INPUT_MOUSE: u32 = 0; +pub const INPUT_KEYBOARD: u32 = 1; +pub const INPUT_HARDWARE: u32 = 2; +pub const MAPVK_VK_TO_VSC: u32 = 0; +pub const MAPVK_VSC_TO_VK: u32 = 1; +pub const MAPVK_VK_TO_CHAR: u32 = 2; +pub const MAPVK_VSC_TO_VK_EX: u32 = 3; +pub const MWMO_WAITALL: u32 = 1; +pub const MWMO_ALERTABLE: u32 = 2; +pub const MWMO_INPUTAVAILABLE: u32 = 4; +pub const QS_KEY: u32 = 1; +pub const QS_MOUSEMOVE: u32 = 2; +pub const QS_MOUSEBUTTON: u32 = 4; +pub const QS_POSTMESSAGE: u32 = 8; +pub const QS_TIMER: u32 = 16; +pub const QS_PAINT: u32 = 32; +pub const QS_SENDMESSAGE: u32 = 64; +pub const QS_HOTKEY: u32 = 128; +pub const QS_ALLPOSTMESSAGE: u32 = 256; +pub const QS_RAWINPUT: u32 = 1024; +pub const QS_MOUSE: u32 = 6; +pub const QS_INPUT: u32 = 1031; +pub const QS_ALLEVENTS: u32 = 1215; +pub const QS_ALLINPUT: u32 = 1279; +pub const USER_TIMER_MAXIMUM: u32 = 2147483647; +pub const USER_TIMER_MINIMUM: u32 = 10; +pub const SM_CXSCREEN: u32 = 0; +pub const SM_CYSCREEN: u32 = 1; +pub const SM_CXVSCROLL: u32 = 2; +pub const SM_CYHSCROLL: u32 = 3; +pub const SM_CYCAPTION: u32 = 4; +pub const SM_CXBORDER: u32 = 5; +pub const SM_CYBORDER: u32 = 6; +pub const SM_CXDLGFRAME: u32 = 7; +pub const SM_CYDLGFRAME: u32 = 8; +pub const SM_CYVTHUMB: u32 = 9; +pub const SM_CXHTHUMB: u32 = 10; +pub const SM_CXICON: u32 = 11; +pub const SM_CYICON: u32 = 12; +pub const SM_CXCURSOR: u32 = 13; +pub const SM_CYCURSOR: u32 = 14; +pub const SM_CYMENU: u32 = 15; +pub const SM_CXFULLSCREEN: u32 = 16; +pub const SM_CYFULLSCREEN: u32 = 17; +pub const SM_CYKANJIWINDOW: u32 = 18; +pub const SM_MOUSEPRESENT: u32 = 19; +pub const SM_CYVSCROLL: u32 = 20; +pub const SM_CXHSCROLL: u32 = 21; +pub const SM_DEBUG: u32 = 22; +pub const SM_SWAPBUTTON: u32 = 23; +pub const SM_RESERVED1: u32 = 24; +pub const SM_RESERVED2: u32 = 25; +pub const SM_RESERVED3: u32 = 26; +pub const SM_RESERVED4: u32 = 27; +pub const SM_CXMIN: u32 = 28; +pub const SM_CYMIN: u32 = 29; +pub const SM_CXSIZE: u32 = 30; +pub const SM_CYSIZE: u32 = 31; +pub const SM_CXFRAME: u32 = 32; +pub const SM_CYFRAME: u32 = 33; +pub const SM_CXMINTRACK: u32 = 34; +pub const SM_CYMINTRACK: u32 = 35; +pub const SM_CXDOUBLECLK: u32 = 36; +pub const SM_CYDOUBLECLK: u32 = 37; +pub const SM_CXICONSPACING: u32 = 38; +pub const SM_CYICONSPACING: u32 = 39; +pub const SM_MENUDROPALIGNMENT: u32 = 40; +pub const SM_PENWINDOWS: u32 = 41; +pub const SM_DBCSENABLED: u32 = 42; +pub const SM_CMOUSEBUTTONS: u32 = 43; +pub const SM_CXFIXEDFRAME: u32 = 7; +pub const SM_CYFIXEDFRAME: u32 = 8; +pub const SM_CXSIZEFRAME: u32 = 32; +pub const SM_CYSIZEFRAME: u32 = 33; +pub const SM_SECURE: u32 = 44; +pub const SM_CXEDGE: u32 = 45; +pub const SM_CYEDGE: u32 = 46; +pub const SM_CXMINSPACING: u32 = 47; +pub const SM_CYMINSPACING: u32 = 48; +pub const SM_CXSMICON: u32 = 49; +pub const SM_CYSMICON: u32 = 50; +pub const SM_CYSMCAPTION: u32 = 51; +pub const SM_CXSMSIZE: u32 = 52; +pub const SM_CYSMSIZE: u32 = 53; +pub const SM_CXMENUSIZE: u32 = 54; +pub const SM_CYMENUSIZE: u32 = 55; +pub const SM_ARRANGE: u32 = 56; +pub const SM_CXMINIMIZED: u32 = 57; +pub const SM_CYMINIMIZED: u32 = 58; +pub const SM_CXMAXTRACK: u32 = 59; +pub const SM_CYMAXTRACK: u32 = 60; +pub const SM_CXMAXIMIZED: u32 = 61; +pub const SM_CYMAXIMIZED: u32 = 62; +pub const SM_NETWORK: u32 = 63; +pub const SM_CLEANBOOT: u32 = 67; +pub const SM_CXDRAG: u32 = 68; +pub const SM_CYDRAG: u32 = 69; +pub const SM_SHOWSOUNDS: u32 = 70; +pub const SM_CXMENUCHECK: u32 = 71; +pub const SM_CYMENUCHECK: u32 = 72; +pub const SM_SLOWMACHINE: u32 = 73; +pub const SM_MIDEASTENABLED: u32 = 74; +pub const SM_MOUSEWHEELPRESENT: u32 = 75; +pub const SM_XVIRTUALSCREEN: u32 = 76; +pub const SM_YVIRTUALSCREEN: u32 = 77; +pub const SM_CXVIRTUALSCREEN: u32 = 78; +pub const SM_CYVIRTUALSCREEN: u32 = 79; +pub const SM_CMONITORS: u32 = 80; +pub const SM_SAMEDISPLAYFORMAT: u32 = 81; +pub const SM_IMMENABLED: u32 = 82; +pub const SM_CXFOCUSBORDER: u32 = 83; +pub const SM_CYFOCUSBORDER: u32 = 84; +pub const SM_TABLETPC: u32 = 86; +pub const SM_MEDIACENTER: u32 = 87; +pub const SM_STARTER: u32 = 88; +pub const SM_SERVERR2: u32 = 89; +pub const SM_CMETRICS: u32 = 97; +pub const SM_REMOTESESSION: u32 = 4096; +pub const SM_SHUTTINGDOWN: u32 = 8192; +pub const SM_REMOTECONTROL: u32 = 8193; +pub const SM_CARETBLINKINGENABLED: u32 = 8194; +pub const PMB_ACTIVE: u32 = 1; +pub const MNC_IGNORE: u32 = 0; +pub const MNC_CLOSE: u32 = 1; +pub const MNC_EXECUTE: u32 = 2; +pub const MNC_SELECT: u32 = 3; +pub const MNS_NOCHECK: u32 = 2147483648; +pub const MNS_MODELESS: u32 = 1073741824; +pub const MNS_DRAGDROP: u32 = 536870912; +pub const MNS_AUTODISMISS: u32 = 268435456; +pub const MNS_NOTIFYBYPOS: u32 = 134217728; +pub const MNS_CHECKORBMP: u32 = 67108864; +pub const MIM_MAXHEIGHT: u32 = 1; +pub const MIM_BACKGROUND: u32 = 2; +pub const MIM_HELPID: u32 = 4; +pub const MIM_MENUDATA: u32 = 8; +pub const MIM_STYLE: u32 = 16; +pub const MIM_APPLYTOSUBMENUS: u32 = 2147483648; +pub const MND_CONTINUE: u32 = 0; +pub const MND_ENDMENU: u32 = 1; +pub const MNGOF_TOPGAP: u32 = 1; +pub const MNGOF_BOTTOMGAP: u32 = 2; +pub const MNGO_NOINTERFACE: u32 = 0; +pub const MNGO_NOERROR: u32 = 1; +pub const MIIM_STATE: u32 = 1; +pub const MIIM_ID: u32 = 2; +pub const MIIM_SUBMENU: u32 = 4; +pub const MIIM_CHECKMARKS: u32 = 8; +pub const MIIM_TYPE: u32 = 16; +pub const MIIM_DATA: u32 = 32; +pub const MIIM_STRING: u32 = 64; +pub const MIIM_BITMAP: u32 = 128; +pub const MIIM_FTYPE: u32 = 256; +pub const DOF_EXECUTABLE: u32 = 32769; +pub const DOF_DOCUMENT: u32 = 32770; +pub const DOF_DIRECTORY: u32 = 32771; +pub const DOF_MULTIPLE: u32 = 32772; +pub const DOF_PROGMAN: u32 = 1; +pub const DOF_SHELLDATA: u32 = 2; +pub const DT_TOP: u32 = 0; +pub const DT_LEFT: u32 = 0; +pub const DT_CENTER: u32 = 1; +pub const DT_RIGHT: u32 = 2; +pub const DT_VCENTER: u32 = 4; +pub const DT_BOTTOM: u32 = 8; +pub const DT_WORDBREAK: u32 = 16; +pub const DT_SINGLELINE: u32 = 32; +pub const DT_EXPANDTABS: u32 = 64; +pub const DT_TABSTOP: u32 = 128; +pub const DT_NOCLIP: u32 = 256; +pub const DT_EXTERNALLEADING: u32 = 512; +pub const DT_CALCRECT: u32 = 1024; +pub const DT_NOPREFIX: u32 = 2048; +pub const DT_INTERNAL: u32 = 4096; +pub const DT_EDITCONTROL: u32 = 8192; +pub const DT_PATH_ELLIPSIS: u32 = 16384; +pub const DT_END_ELLIPSIS: u32 = 32768; +pub const DT_MODIFYSTRING: u32 = 65536; +pub const DT_RTLREADING: u32 = 131072; +pub const DT_WORD_ELLIPSIS: u32 = 262144; +pub const DT_NOFULLWIDTHCHARBREAK: u32 = 524288; +pub const DT_HIDEPREFIX: u32 = 1048576; +pub const DT_PREFIXONLY: u32 = 2097152; +pub const DST_COMPLEX: u32 = 0; +pub const DST_TEXT: u32 = 1; +pub const DST_PREFIXTEXT: u32 = 2; +pub const DST_ICON: u32 = 3; +pub const DST_BITMAP: u32 = 4; +pub const DSS_NORMAL: u32 = 0; +pub const DSS_UNION: u32 = 16; +pub const DSS_DISABLED: u32 = 32; +pub const DSS_MONO: u32 = 128; +pub const DSS_HIDEPREFIX: u32 = 512; +pub const DSS_PREFIXONLY: u32 = 1024; +pub const DSS_RIGHT: u32 = 32768; +pub const LSFW_LOCK: u32 = 1; +pub const LSFW_UNLOCK: u32 = 2; +pub const RDW_INVALIDATE: u32 = 1; +pub const RDW_INTERNALPAINT: u32 = 2; +pub const RDW_ERASE: u32 = 4; +pub const RDW_VALIDATE: u32 = 8; +pub const RDW_NOINTERNALPAINT: u32 = 16; +pub const RDW_NOERASE: u32 = 32; +pub const RDW_NOCHILDREN: u32 = 64; +pub const RDW_ALLCHILDREN: u32 = 128; +pub const RDW_UPDATENOW: u32 = 256; +pub const RDW_ERASENOW: u32 = 512; +pub const RDW_FRAME: u32 = 1024; +pub const RDW_NOFRAME: u32 = 2048; +pub const SW_SCROLLCHILDREN: u32 = 1; +pub const SW_INVALIDATE: u32 = 2; +pub const SW_ERASE: u32 = 4; +pub const SW_SMOOTHSCROLL: u32 = 16; +pub const ESB_ENABLE_BOTH: u32 = 0; +pub const ESB_DISABLE_BOTH: u32 = 3; +pub const ESB_DISABLE_LEFT: u32 = 1; +pub const ESB_DISABLE_RIGHT: u32 = 2; +pub const ESB_DISABLE_UP: u32 = 1; +pub const ESB_DISABLE_DOWN: u32 = 2; +pub const ESB_DISABLE_LTUP: u32 = 1; +pub const ESB_DISABLE_RTDN: u32 = 2; +pub const HELPINFO_WINDOW: u32 = 1; +pub const HELPINFO_MENUITEM: u32 = 2; +pub const CWP_ALL: u32 = 0; +pub const CWP_SKIPINVISIBLE: u32 = 1; +pub const CWP_SKIPDISABLED: u32 = 2; +pub const CWP_SKIPTRANSPARENT: u32 = 4; +pub const CTLCOLOR_MSGBOX: u32 = 0; +pub const CTLCOLOR_EDIT: u32 = 1; +pub const CTLCOLOR_LISTBOX: u32 = 2; +pub const CTLCOLOR_BTN: u32 = 3; +pub const CTLCOLOR_DLG: u32 = 4; +pub const CTLCOLOR_SCROLLBAR: u32 = 5; +pub const CTLCOLOR_STATIC: u32 = 6; +pub const CTLCOLOR_MAX: u32 = 7; +pub const COLOR_SCROLLBAR: u32 = 0; +pub const COLOR_BACKGROUND: u32 = 1; +pub const COLOR_ACTIVECAPTION: u32 = 2; +pub const COLOR_INACTIVECAPTION: u32 = 3; +pub const COLOR_MENU: u32 = 4; +pub const COLOR_WINDOW: u32 = 5; +pub const COLOR_WINDOWFRAME: u32 = 6; +pub const COLOR_MENUTEXT: u32 = 7; +pub const COLOR_WINDOWTEXT: u32 = 8; +pub const COLOR_CAPTIONTEXT: u32 = 9; +pub const COLOR_ACTIVEBORDER: u32 = 10; +pub const COLOR_INACTIVEBORDER: u32 = 11; +pub const COLOR_APPWORKSPACE: u32 = 12; +pub const COLOR_HIGHLIGHT: u32 = 13; +pub const COLOR_HIGHLIGHTTEXT: u32 = 14; +pub const COLOR_BTNFACE: u32 = 15; +pub const COLOR_BTNSHADOW: u32 = 16; +pub const COLOR_GRAYTEXT: u32 = 17; +pub const COLOR_BTNTEXT: u32 = 18; +pub const COLOR_INACTIVECAPTIONTEXT: u32 = 19; +pub const COLOR_BTNHIGHLIGHT: u32 = 20; +pub const COLOR_3DDKSHADOW: u32 = 21; +pub const COLOR_3DLIGHT: u32 = 22; +pub const COLOR_INFOTEXT: u32 = 23; +pub const COLOR_INFOBK: u32 = 24; +pub const COLOR_HOTLIGHT: u32 = 26; +pub const COLOR_GRADIENTACTIVECAPTION: u32 = 27; +pub const COLOR_GRADIENTINACTIVECAPTION: u32 = 28; +pub const COLOR_MENUHILIGHT: u32 = 29; +pub const COLOR_MENUBAR: u32 = 30; +pub const COLOR_DESKTOP: u32 = 1; +pub const COLOR_3DFACE: u32 = 15; +pub const COLOR_3DSHADOW: u32 = 16; +pub const COLOR_3DHIGHLIGHT: u32 = 20; +pub const COLOR_3DHILIGHT: u32 = 20; +pub const COLOR_BTNHILIGHT: u32 = 20; +pub const GW_HWNDFIRST: u32 = 0; +pub const GW_HWNDLAST: u32 = 1; +pub const GW_HWNDNEXT: u32 = 2; +pub const GW_HWNDPREV: u32 = 3; +pub const GW_OWNER: u32 = 4; +pub const GW_CHILD: u32 = 5; +pub const GW_ENABLEDPOPUP: u32 = 6; +pub const GW_MAX: u32 = 6; +pub const SC_SIZE: u32 = 61440; +pub const SC_MOVE: u32 = 61456; +pub const SC_MINIMIZE: u32 = 61472; +pub const SC_MAXIMIZE: u32 = 61488; +pub const SC_NEXTWINDOW: u32 = 61504; +pub const SC_PREVWINDOW: u32 = 61520; +pub const SC_CLOSE: u32 = 61536; +pub const SC_VSCROLL: u32 = 61552; +pub const SC_HSCROLL: u32 = 61568; +pub const SC_MOUSEMENU: u32 = 61584; +pub const SC_KEYMENU: u32 = 61696; +pub const SC_ARRANGE: u32 = 61712; +pub const SC_RESTORE: u32 = 61728; +pub const SC_TASKLIST: u32 = 61744; +pub const SC_SCREENSAVE: u32 = 61760; +pub const SC_HOTKEY: u32 = 61776; +pub const SC_DEFAULT: u32 = 61792; +pub const SC_MONITORPOWER: u32 = 61808; +pub const SC_CONTEXTHELP: u32 = 61824; +pub const SC_SEPARATOR: u32 = 61455; +pub const SC_ICON: u32 = 61472; +pub const SC_ZOOM: u32 = 61488; +pub const IMAGE_BITMAP: u32 = 0; +pub const IMAGE_ICON: u32 = 1; +pub const IMAGE_CURSOR: u32 = 2; +pub const IMAGE_ENHMETAFILE: u32 = 3; +pub const LR_DEFAULTCOLOR: u32 = 0; +pub const LR_MONOCHROME: u32 = 1; +pub const LR_COLOR: u32 = 2; +pub const LR_COPYRETURNORG: u32 = 4; +pub const LR_COPYDELETEORG: u32 = 8; +pub const LR_LOADFROMFILE: u32 = 16; +pub const LR_LOADTRANSPARENT: u32 = 32; +pub const LR_DEFAULTSIZE: u32 = 64; +pub const LR_VGACOLOR: u32 = 128; +pub const LR_LOADMAP3DCOLORS: u32 = 4096; +pub const LR_CREATEDIBSECTION: u32 = 8192; +pub const LR_COPYFROMRESOURCE: u32 = 16384; +pub const LR_SHARED: u32 = 32768; +pub const DI_MASK: u32 = 1; +pub const DI_IMAGE: u32 = 2; +pub const DI_NORMAL: u32 = 3; +pub const DI_COMPAT: u32 = 4; +pub const DI_DEFAULTSIZE: u32 = 8; +pub const DI_NOMIRROR: u32 = 16; +pub const RES_ICON: u32 = 1; +pub const RES_CURSOR: u32 = 2; +pub const ORD_LANGDRIVER: u32 = 1; +pub const IDOK: u32 = 1; +pub const IDCANCEL: u32 = 2; +pub const IDABORT: u32 = 3; +pub const IDRETRY: u32 = 4; +pub const IDIGNORE: u32 = 5; +pub const IDYES: u32 = 6; +pub const IDNO: u32 = 7; +pub const IDCLOSE: u32 = 8; +pub const IDHELP: u32 = 9; +pub const IDTRYAGAIN: u32 = 10; +pub const IDCONTINUE: u32 = 11; +pub const IDTIMEOUT: u32 = 32000; +pub const EN_SETFOCUS: u32 = 256; +pub const EN_KILLFOCUS: u32 = 512; +pub const EN_CHANGE: u32 = 768; +pub const EN_UPDATE: u32 = 1024; +pub const EN_ERRSPACE: u32 = 1280; +pub const EN_MAXTEXT: u32 = 1281; +pub const EN_HSCROLL: u32 = 1537; +pub const EN_VSCROLL: u32 = 1538; +pub const EN_ALIGN_LTR_EC: u32 = 1792; +pub const EN_ALIGN_RTL_EC: u32 = 1793; +pub const EC_LEFTMARGIN: u32 = 1; +pub const EC_RIGHTMARGIN: u32 = 2; +pub const EC_USEFONTINFO: u32 = 65535; +pub const EMSIS_COMPOSITIONSTRING: u32 = 1; +pub const EIMES_GETCOMPSTRATONCE: u32 = 1; +pub const EIMES_CANCELCOMPSTRINFOCUS: u32 = 2; +pub const EIMES_COMPLETECOMPSTRKILLFOCUS: u32 = 4; +pub const EM_GETSEL: u32 = 176; +pub const EM_SETSEL: u32 = 177; +pub const EM_GETRECT: u32 = 178; +pub const EM_SETRECT: u32 = 179; +pub const EM_SETRECTNP: u32 = 180; +pub const EM_SCROLL: u32 = 181; +pub const EM_LINESCROLL: u32 = 182; +pub const EM_SCROLLCARET: u32 = 183; +pub const EM_GETMODIFY: u32 = 184; +pub const EM_SETMODIFY: u32 = 185; +pub const EM_GETLINECOUNT: u32 = 186; +pub const EM_LINEINDEX: u32 = 187; +pub const EM_SETHANDLE: u32 = 188; +pub const EM_GETHANDLE: u32 = 189; +pub const EM_GETTHUMB: u32 = 190; +pub const EM_LINELENGTH: u32 = 193; +pub const EM_REPLACESEL: u32 = 194; +pub const EM_GETLINE: u32 = 196; +pub const EM_LIMITTEXT: u32 = 197; +pub const EM_CANUNDO: u32 = 198; +pub const EM_UNDO: u32 = 199; +pub const EM_FMTLINES: u32 = 200; +pub const EM_LINEFROMCHAR: u32 = 201; +pub const EM_SETTABSTOPS: u32 = 203; +pub const EM_SETPASSWORDCHAR: u32 = 204; +pub const EM_EMPTYUNDOBUFFER: u32 = 205; +pub const EM_GETFIRSTVISIBLELINE: u32 = 206; +pub const EM_SETREADONLY: u32 = 207; +pub const EM_SETWORDBREAKPROC: u32 = 208; +pub const EM_GETWORDBREAKPROC: u32 = 209; +pub const EM_GETPASSWORDCHAR: u32 = 210; +pub const EM_SETMARGINS: u32 = 211; +pub const EM_GETMARGINS: u32 = 212; +pub const EM_SETLIMITTEXT: u32 = 197; +pub const EM_GETLIMITTEXT: u32 = 213; +pub const EM_POSFROMCHAR: u32 = 214; +pub const EM_CHARFROMPOS: u32 = 215; +pub const EM_SETIMESTATUS: u32 = 216; +pub const EM_GETIMESTATUS: u32 = 217; +pub const WB_LEFT: u32 = 0; +pub const WB_RIGHT: u32 = 1; +pub const WB_ISDELIMITER: u32 = 2; +pub const BN_CLICKED: u32 = 0; +pub const BN_PAINT: u32 = 1; +pub const BN_HILITE: u32 = 2; +pub const BN_UNHILITE: u32 = 3; +pub const BN_DISABLE: u32 = 4; +pub const BN_DOUBLECLICKED: u32 = 5; +pub const BN_PUSHED: u32 = 2; +pub const BN_UNPUSHED: u32 = 3; +pub const BN_DBLCLK: u32 = 5; +pub const BN_SETFOCUS: u32 = 6; +pub const BN_KILLFOCUS: u32 = 7; +pub const BM_GETCHECK: u32 = 240; +pub const BM_SETCHECK: u32 = 241; +pub const BM_GETSTATE: u32 = 242; +pub const BM_SETSTATE: u32 = 243; +pub const BM_SETSTYLE: u32 = 244; +pub const BM_CLICK: u32 = 245; +pub const BM_GETIMAGE: u32 = 246; +pub const BM_SETIMAGE: u32 = 247; +pub const BST_UNCHECKED: u32 = 0; +pub const BST_CHECKED: u32 = 1; +pub const BST_INDETERMINATE: u32 = 2; +pub const BST_PUSHED: u32 = 4; +pub const BST_FOCUS: u32 = 8; +pub const STM_SETICON: u32 = 368; +pub const STM_GETICON: u32 = 369; +pub const STM_SETIMAGE: u32 = 370; +pub const STM_GETIMAGE: u32 = 371; +pub const STN_CLICKED: u32 = 0; +pub const STN_DBLCLK: u32 = 1; +pub const STN_ENABLE: u32 = 2; +pub const STN_DISABLE: u32 = 3; +pub const STM_MSGMAX: u32 = 372; +pub const DWL_MSGRESULT: u32 = 0; +pub const DWL_DLGPROC: u32 = 4; +pub const DWL_USER: u32 = 8; +pub const DWLP_MSGRESULT: u32 = 0; +pub const DDL_READWRITE: u32 = 0; +pub const DDL_READONLY: u32 = 1; +pub const DDL_HIDDEN: u32 = 2; +pub const DDL_SYSTEM: u32 = 4; +pub const DDL_DIRECTORY: u32 = 16; +pub const DDL_ARCHIVE: u32 = 32; +pub const DDL_POSTMSGS: u32 = 8192; +pub const DDL_DRIVES: u32 = 16384; +pub const DDL_EXCLUSIVE: u32 = 32768; +pub const DM_GETDEFID: u32 = 1024; +pub const DM_SETDEFID: u32 = 1025; +pub const DM_REPOSITION: u32 = 1026; +pub const DC_HASDEFID: u32 = 21323; +pub const DLGC_WANTARROWS: u32 = 1; +pub const DLGC_WANTTAB: u32 = 2; +pub const DLGC_WANTALLKEYS: u32 = 4; +pub const DLGC_WANTMESSAGE: u32 = 4; +pub const DLGC_HASSETSEL: u32 = 8; +pub const DLGC_DEFPUSHBUTTON: u32 = 16; +pub const DLGC_UNDEFPUSHBUTTON: u32 = 32; +pub const DLGC_RADIOBUTTON: u32 = 64; +pub const DLGC_WANTCHARS: u32 = 128; +pub const DLGC_STATIC: u32 = 256; +pub const DLGC_BUTTON: u32 = 8192; +pub const LB_OKAY: u32 = 0; +pub const LB_ERR: i32 = -1; +pub const LB_ERRSPACE: i32 = -2; +pub const LBN_ERRSPACE: i32 = -2; +pub const LBN_SELCHANGE: u32 = 1; +pub const LBN_DBLCLK: u32 = 2; +pub const LBN_SELCANCEL: u32 = 3; +pub const LBN_SETFOCUS: u32 = 4; +pub const LBN_KILLFOCUS: u32 = 5; +pub const LB_ADDSTRING: u32 = 384; +pub const LB_INSERTSTRING: u32 = 385; +pub const LB_DELETESTRING: u32 = 386; +pub const LB_SELITEMRANGEEX: u32 = 387; +pub const LB_RESETCONTENT: u32 = 388; +pub const LB_SETSEL: u32 = 389; +pub const LB_SETCURSEL: u32 = 390; +pub const LB_GETSEL: u32 = 391; +pub const LB_GETCURSEL: u32 = 392; +pub const LB_GETTEXT: u32 = 393; +pub const LB_GETTEXTLEN: u32 = 394; +pub const LB_GETCOUNT: u32 = 395; +pub const LB_SELECTSTRING: u32 = 396; +pub const LB_DIR: u32 = 397; +pub const LB_GETTOPINDEX: u32 = 398; +pub const LB_FINDSTRING: u32 = 399; +pub const LB_GETSELCOUNT: u32 = 400; +pub const LB_GETSELITEMS: u32 = 401; +pub const LB_SETTABSTOPS: u32 = 402; +pub const LB_GETHORIZONTALEXTENT: u32 = 403; +pub const LB_SETHORIZONTALEXTENT: u32 = 404; +pub const LB_SETCOLUMNWIDTH: u32 = 405; +pub const LB_ADDFILE: u32 = 406; +pub const LB_SETTOPINDEX: u32 = 407; +pub const LB_GETITEMRECT: u32 = 408; +pub const LB_GETITEMDATA: u32 = 409; +pub const LB_SETITEMDATA: u32 = 410; +pub const LB_SELITEMRANGE: u32 = 411; +pub const LB_SETANCHORINDEX: u32 = 412; +pub const LB_GETANCHORINDEX: u32 = 413; +pub const LB_SETCARETINDEX: u32 = 414; +pub const LB_GETCARETINDEX: u32 = 415; +pub const LB_SETITEMHEIGHT: u32 = 416; +pub const LB_GETITEMHEIGHT: u32 = 417; +pub const LB_FINDSTRINGEXACT: u32 = 418; +pub const LB_SETLOCALE: u32 = 421; +pub const LB_GETLOCALE: u32 = 422; +pub const LB_SETCOUNT: u32 = 423; +pub const LB_INITSTORAGE: u32 = 424; +pub const LB_ITEMFROMPOINT: u32 = 425; +pub const LB_GETLISTBOXINFO: u32 = 434; +pub const LB_MSGMAX: u32 = 435; +pub const CB_OKAY: u32 = 0; +pub const CB_ERR: i32 = -1; +pub const CB_ERRSPACE: i32 = -2; +pub const CBN_ERRSPACE: i32 = -1; +pub const CBN_SELCHANGE: u32 = 1; +pub const CBN_DBLCLK: u32 = 2; +pub const CBN_SETFOCUS: u32 = 3; +pub const CBN_KILLFOCUS: u32 = 4; +pub const CBN_EDITCHANGE: u32 = 5; +pub const CBN_EDITUPDATE: u32 = 6; +pub const CBN_DROPDOWN: u32 = 7; +pub const CBN_CLOSEUP: u32 = 8; +pub const CBN_SELENDOK: u32 = 9; +pub const CBN_SELENDCANCEL: u32 = 10; +pub const CB_GETEDITSEL: u32 = 320; +pub const CB_LIMITTEXT: u32 = 321; +pub const CB_SETEDITSEL: u32 = 322; +pub const CB_ADDSTRING: u32 = 323; +pub const CB_DELETESTRING: u32 = 324; +pub const CB_DIR: u32 = 325; +pub const CB_GETCOUNT: u32 = 326; +pub const CB_GETCURSEL: u32 = 327; +pub const CB_GETLBTEXT: u32 = 328; +pub const CB_GETLBTEXTLEN: u32 = 329; +pub const CB_INSERTSTRING: u32 = 330; +pub const CB_RESETCONTENT: u32 = 331; +pub const CB_FINDSTRING: u32 = 332; +pub const CB_SELECTSTRING: u32 = 333; +pub const CB_SETCURSEL: u32 = 334; +pub const CB_SHOWDROPDOWN: u32 = 335; +pub const CB_GETITEMDATA: u32 = 336; +pub const CB_SETITEMDATA: u32 = 337; +pub const CB_GETDROPPEDCONTROLRECT: u32 = 338; +pub const CB_SETITEMHEIGHT: u32 = 339; +pub const CB_GETITEMHEIGHT: u32 = 340; +pub const CB_SETEXTENDEDUI: u32 = 341; +pub const CB_GETEXTENDEDUI: u32 = 342; +pub const CB_GETDROPPEDSTATE: u32 = 343; +pub const CB_FINDSTRINGEXACT: u32 = 344; +pub const CB_SETLOCALE: u32 = 345; +pub const CB_GETLOCALE: u32 = 346; +pub const CB_GETTOPINDEX: u32 = 347; +pub const CB_SETTOPINDEX: u32 = 348; +pub const CB_GETHORIZONTALEXTENT: u32 = 349; +pub const CB_SETHORIZONTALEXTENT: u32 = 350; +pub const CB_GETDROPPEDWIDTH: u32 = 351; +pub const CB_SETDROPPEDWIDTH: u32 = 352; +pub const CB_INITSTORAGE: u32 = 353; +pub const CB_GETCOMBOBOXINFO: u32 = 356; +pub const CB_MSGMAX: u32 = 357; +pub const SBM_SETPOS: u32 = 224; +pub const SBM_GETPOS: u32 = 225; +pub const SBM_SETRANGE: u32 = 226; +pub const SBM_SETRANGEREDRAW: u32 = 230; +pub const SBM_GETRANGE: u32 = 227; +pub const SBM_ENABLE_ARROWS: u32 = 228; +pub const SBM_SETSCROLLINFO: u32 = 233; +pub const SBM_GETSCROLLINFO: u32 = 234; +pub const SBM_GETSCROLLBARINFO: u32 = 235; +pub const SIF_RANGE: u32 = 1; +pub const SIF_PAGE: u32 = 2; +pub const SIF_POS: u32 = 4; +pub const SIF_DISABLENOSCROLL: u32 = 8; +pub const SIF_TRACKPOS: u32 = 16; +pub const SIF_ALL: u32 = 23; +pub const MDIS_ALLCHILDSTYLES: u32 = 1; +pub const MDITILE_VERTICAL: u32 = 0; +pub const MDITILE_HORIZONTAL: u32 = 1; +pub const MDITILE_SKIPDISABLED: u32 = 2; +pub const MDITILE_ZORDER: u32 = 4; +pub const HELP_CONTEXT: u32 = 1; +pub const HELP_QUIT: u32 = 2; +pub const HELP_INDEX: u32 = 3; +pub const HELP_CONTENTS: u32 = 3; +pub const HELP_HELPONHELP: u32 = 4; +pub const HELP_SETINDEX: u32 = 5; +pub const HELP_SETCONTENTS: u32 = 5; +pub const HELP_CONTEXTPOPUP: u32 = 8; +pub const HELP_FORCEFILE: u32 = 9; +pub const HELP_KEY: u32 = 257; +pub const HELP_COMMAND: u32 = 258; +pub const HELP_PARTIALKEY: u32 = 261; +pub const HELP_MULTIKEY: u32 = 513; +pub const HELP_SETWINPOS: u32 = 515; +pub const HELP_CONTEXTMENU: u32 = 10; +pub const HELP_FINDER: u32 = 11; +pub const HELP_WM_HELP: u32 = 12; +pub const HELP_SETPOPUP_POS: u32 = 13; +pub const HELP_TCARD: u32 = 32768; +pub const HELP_TCARD_DATA: u32 = 16; +pub const HELP_TCARD_OTHER_CALLER: u32 = 17; +pub const IDH_NO_HELP: u32 = 28440; +pub const IDH_MISSING_CONTEXT: u32 = 28441; +pub const IDH_GENERIC_HELP_BUTTON: u32 = 28442; +pub const IDH_OK: u32 = 28443; +pub const IDH_CANCEL: u32 = 28444; +pub const IDH_HELP: u32 = 28445; +pub const GR_GDIOBJECTS: u32 = 0; +pub const GR_USEROBJECTS: u32 = 1; +pub const SPI_GETBEEP: u32 = 1; +pub const SPI_SETBEEP: u32 = 2; +pub const SPI_GETMOUSE: u32 = 3; +pub const SPI_SETMOUSE: u32 = 4; +pub const SPI_GETBORDER: u32 = 5; +pub const SPI_SETBORDER: u32 = 6; +pub const SPI_GETKEYBOARDSPEED: u32 = 10; +pub const SPI_SETKEYBOARDSPEED: u32 = 11; +pub const SPI_LANGDRIVER: u32 = 12; +pub const SPI_ICONHORIZONTALSPACING: u32 = 13; +pub const SPI_GETSCREENSAVETIMEOUT: u32 = 14; +pub const SPI_SETSCREENSAVETIMEOUT: u32 = 15; +pub const SPI_GETSCREENSAVEACTIVE: u32 = 16; +pub const SPI_SETSCREENSAVEACTIVE: u32 = 17; +pub const SPI_GETGRIDGRANULARITY: u32 = 18; +pub const SPI_SETGRIDGRANULARITY: u32 = 19; +pub const SPI_SETDESKWALLPAPER: u32 = 20; +pub const SPI_SETDESKPATTERN: u32 = 21; +pub const SPI_GETKEYBOARDDELAY: u32 = 22; +pub const SPI_SETKEYBOARDDELAY: u32 = 23; +pub const SPI_ICONVERTICALSPACING: u32 = 24; +pub const SPI_GETICONTITLEWRAP: u32 = 25; +pub const SPI_SETICONTITLEWRAP: u32 = 26; +pub const SPI_GETMENUDROPALIGNMENT: u32 = 27; +pub const SPI_SETMENUDROPALIGNMENT: u32 = 28; +pub const SPI_SETDOUBLECLKWIDTH: u32 = 29; +pub const SPI_SETDOUBLECLKHEIGHT: u32 = 30; +pub const SPI_GETICONTITLELOGFONT: u32 = 31; +pub const SPI_SETDOUBLECLICKTIME: u32 = 32; +pub const SPI_SETMOUSEBUTTONSWAP: u32 = 33; +pub const SPI_SETICONTITLELOGFONT: u32 = 34; +pub const SPI_GETFASTTASKSWITCH: u32 = 35; +pub const SPI_SETFASTTASKSWITCH: u32 = 36; +pub const SPI_SETDRAGFULLWINDOWS: u32 = 37; +pub const SPI_GETDRAGFULLWINDOWS: u32 = 38; +pub const SPI_GETNONCLIENTMETRICS: u32 = 41; +pub const SPI_SETNONCLIENTMETRICS: u32 = 42; +pub const SPI_GETMINIMIZEDMETRICS: u32 = 43; +pub const SPI_SETMINIMIZEDMETRICS: u32 = 44; +pub const SPI_GETICONMETRICS: u32 = 45; +pub const SPI_SETICONMETRICS: u32 = 46; +pub const SPI_SETWORKAREA: u32 = 47; +pub const SPI_GETWORKAREA: u32 = 48; +pub const SPI_SETPENWINDOWS: u32 = 49; +pub const SPI_GETHIGHCONTRAST: u32 = 66; +pub const SPI_SETHIGHCONTRAST: u32 = 67; +pub const SPI_GETKEYBOARDPREF: u32 = 68; +pub const SPI_SETKEYBOARDPREF: u32 = 69; +pub const SPI_GETSCREENREADER: u32 = 70; +pub const SPI_SETSCREENREADER: u32 = 71; +pub const SPI_GETANIMATION: u32 = 72; +pub const SPI_SETANIMATION: u32 = 73; +pub const SPI_GETFONTSMOOTHING: u32 = 74; +pub const SPI_SETFONTSMOOTHING: u32 = 75; +pub const SPI_SETDRAGWIDTH: u32 = 76; +pub const SPI_SETDRAGHEIGHT: u32 = 77; +pub const SPI_SETHANDHELD: u32 = 78; +pub const SPI_GETLOWPOWERTIMEOUT: u32 = 79; +pub const SPI_GETPOWEROFFTIMEOUT: u32 = 80; +pub const SPI_SETLOWPOWERTIMEOUT: u32 = 81; +pub const SPI_SETPOWEROFFTIMEOUT: u32 = 82; +pub const SPI_GETLOWPOWERACTIVE: u32 = 83; +pub const SPI_GETPOWEROFFACTIVE: u32 = 84; +pub const SPI_SETLOWPOWERACTIVE: u32 = 85; +pub const SPI_SETPOWEROFFACTIVE: u32 = 86; +pub const SPI_SETCURSORS: u32 = 87; +pub const SPI_SETICONS: u32 = 88; +pub const SPI_GETDEFAULTINPUTLANG: u32 = 89; +pub const SPI_SETDEFAULTINPUTLANG: u32 = 90; +pub const SPI_SETLANGTOGGLE: u32 = 91; +pub const SPI_GETWINDOWSEXTENSION: u32 = 92; +pub const SPI_SETMOUSETRAILS: u32 = 93; +pub const SPI_GETMOUSETRAILS: u32 = 94; +pub const SPI_SETSCREENSAVERRUNNING: u32 = 97; +pub const SPI_SCREENSAVERRUNNING: u32 = 97; +pub const SPI_GETFILTERKEYS: u32 = 50; +pub const SPI_SETFILTERKEYS: u32 = 51; +pub const SPI_GETTOGGLEKEYS: u32 = 52; +pub const SPI_SETTOGGLEKEYS: u32 = 53; +pub const SPI_GETMOUSEKEYS: u32 = 54; +pub const SPI_SETMOUSEKEYS: u32 = 55; +pub const SPI_GETSHOWSOUNDS: u32 = 56; +pub const SPI_SETSHOWSOUNDS: u32 = 57; +pub const SPI_GETSTICKYKEYS: u32 = 58; +pub const SPI_SETSTICKYKEYS: u32 = 59; +pub const SPI_GETACCESSTIMEOUT: u32 = 60; +pub const SPI_SETACCESSTIMEOUT: u32 = 61; +pub const SPI_GETSERIALKEYS: u32 = 62; +pub const SPI_SETSERIALKEYS: u32 = 63; +pub const SPI_GETSOUNDSENTRY: u32 = 64; +pub const SPI_SETSOUNDSENTRY: u32 = 65; +pub const SPI_GETSNAPTODEFBUTTON: u32 = 95; +pub const SPI_SETSNAPTODEFBUTTON: u32 = 96; +pub const SPI_GETMOUSEHOVERWIDTH: u32 = 98; +pub const SPI_SETMOUSEHOVERWIDTH: u32 = 99; +pub const SPI_GETMOUSEHOVERHEIGHT: u32 = 100; +pub const SPI_SETMOUSEHOVERHEIGHT: u32 = 101; +pub const SPI_GETMOUSEHOVERTIME: u32 = 102; +pub const SPI_SETMOUSEHOVERTIME: u32 = 103; +pub const SPI_GETWHEELSCROLLLINES: u32 = 104; +pub const SPI_SETWHEELSCROLLLINES: u32 = 105; +pub const SPI_GETMENUSHOWDELAY: u32 = 106; +pub const SPI_SETMENUSHOWDELAY: u32 = 107; +pub const SPI_GETSHOWIMEUI: u32 = 110; +pub const SPI_SETSHOWIMEUI: u32 = 111; +pub const SPI_GETMOUSESPEED: u32 = 112; +pub const SPI_SETMOUSESPEED: u32 = 113; +pub const SPI_GETSCREENSAVERRUNNING: u32 = 114; +pub const SPI_GETDESKWALLPAPER: u32 = 115; +pub const SPI_GETACTIVEWINDOWTRACKING: u32 = 4096; +pub const SPI_SETACTIVEWINDOWTRACKING: u32 = 4097; +pub const SPI_GETMENUANIMATION: u32 = 4098; +pub const SPI_SETMENUANIMATION: u32 = 4099; +pub const SPI_GETCOMBOBOXANIMATION: u32 = 4100; +pub const SPI_SETCOMBOBOXANIMATION: u32 = 4101; +pub const SPI_GETLISTBOXSMOOTHSCROLLING: u32 = 4102; +pub const SPI_SETLISTBOXSMOOTHSCROLLING: u32 = 4103; +pub const SPI_GETGRADIENTCAPTIONS: u32 = 4104; +pub const SPI_SETGRADIENTCAPTIONS: u32 = 4105; +pub const SPI_GETKEYBOARDCUES: u32 = 4106; +pub const SPI_SETKEYBOARDCUES: u32 = 4107; +pub const SPI_GETMENUUNDERLINES: u32 = 4106; +pub const SPI_SETMENUUNDERLINES: u32 = 4107; +pub const SPI_GETACTIVEWNDTRKZORDER: u32 = 4108; +pub const SPI_SETACTIVEWNDTRKZORDER: u32 = 4109; +pub const SPI_GETHOTTRACKING: u32 = 4110; +pub const SPI_SETHOTTRACKING: u32 = 4111; +pub const SPI_GETMENUFADE: u32 = 4114; +pub const SPI_SETMENUFADE: u32 = 4115; +pub const SPI_GETSELECTIONFADE: u32 = 4116; +pub const SPI_SETSELECTIONFADE: u32 = 4117; +pub const SPI_GETTOOLTIPANIMATION: u32 = 4118; +pub const SPI_SETTOOLTIPANIMATION: u32 = 4119; +pub const SPI_GETTOOLTIPFADE: u32 = 4120; +pub const SPI_SETTOOLTIPFADE: u32 = 4121; +pub const SPI_GETCURSORSHADOW: u32 = 4122; +pub const SPI_SETCURSORSHADOW: u32 = 4123; +pub const SPI_GETMOUSESONAR: u32 = 4124; +pub const SPI_SETMOUSESONAR: u32 = 4125; +pub const SPI_GETMOUSECLICKLOCK: u32 = 4126; +pub const SPI_SETMOUSECLICKLOCK: u32 = 4127; +pub const SPI_GETMOUSEVANISH: u32 = 4128; +pub const SPI_SETMOUSEVANISH: u32 = 4129; +pub const SPI_GETFLATMENU: u32 = 4130; +pub const SPI_SETFLATMENU: u32 = 4131; +pub const SPI_GETDROPSHADOW: u32 = 4132; +pub const SPI_SETDROPSHADOW: u32 = 4133; +pub const SPI_GETBLOCKSENDINPUTRESETS: u32 = 4134; +pub const SPI_SETBLOCKSENDINPUTRESETS: u32 = 4135; +pub const SPI_GETUIEFFECTS: u32 = 4158; +pub const SPI_SETUIEFFECTS: u32 = 4159; +pub const SPI_GETFOREGROUNDLOCKTIMEOUT: u32 = 8192; +pub const SPI_SETFOREGROUNDLOCKTIMEOUT: u32 = 8193; +pub const SPI_GETACTIVEWNDTRKTIMEOUT: u32 = 8194; +pub const SPI_SETACTIVEWNDTRKTIMEOUT: u32 = 8195; +pub const SPI_GETFOREGROUNDFLASHCOUNT: u32 = 8196; +pub const SPI_SETFOREGROUNDFLASHCOUNT: u32 = 8197; +pub const SPI_GETCARETWIDTH: u32 = 8198; +pub const SPI_SETCARETWIDTH: u32 = 8199; +pub const SPI_GETMOUSECLICKLOCKTIME: u32 = 8200; +pub const SPI_SETMOUSECLICKLOCKTIME: u32 = 8201; +pub const SPI_GETFONTSMOOTHINGTYPE: u32 = 8202; +pub const SPI_SETFONTSMOOTHINGTYPE: u32 = 8203; +pub const FE_FONTSMOOTHINGSTANDARD: u32 = 1; +pub const FE_FONTSMOOTHINGCLEARTYPE: u32 = 2; +pub const FE_FONTSMOOTHINGDOCKING: u32 = 32768; +pub const SPI_GETFONTSMOOTHINGCONTRAST: u32 = 8204; +pub const SPI_SETFONTSMOOTHINGCONTRAST: u32 = 8205; +pub const SPI_GETFOCUSBORDERWIDTH: u32 = 8206; +pub const SPI_SETFOCUSBORDERWIDTH: u32 = 8207; +pub const SPI_GETFOCUSBORDERHEIGHT: u32 = 8208; +pub const SPI_SETFOCUSBORDERHEIGHT: u32 = 8209; +pub const SPI_GETFONTSMOOTHINGORIENTATION: u32 = 8210; +pub const SPI_SETFONTSMOOTHINGORIENTATION: u32 = 8211; +pub const FE_FONTSMOOTHINGORIENTATIONBGR: u32 = 0; +pub const FE_FONTSMOOTHINGORIENTATIONRGB: u32 = 1; +pub const SPIF_UPDATEINIFILE: u32 = 1; +pub const SPIF_SENDWININICHANGE: u32 = 2; +pub const SPIF_SENDCHANGE: u32 = 2; +pub const METRICS_USEDEFAULT: i32 = -1; +pub const SERKF_SERIALKEYSON: u32 = 1; +pub const SERKF_AVAILABLE: u32 = 2; +pub const SERKF_INDICATOR: u32 = 4; +pub const HCF_HIGHCONTRASTON: u32 = 1; +pub const HCF_AVAILABLE: u32 = 2; +pub const HCF_HOTKEYACTIVE: u32 = 4; +pub const HCF_CONFIRMHOTKEY: u32 = 8; +pub const HCF_HOTKEYSOUND: u32 = 16; +pub const HCF_INDICATOR: u32 = 32; +pub const HCF_HOTKEYAVAILABLE: u32 = 64; +pub const HCF_LOGONDESKTOP: u32 = 256; +pub const HCF_DEFAULTDESKTOP: u32 = 512; +pub const CDS_UPDATEREGISTRY: u32 = 1; +pub const CDS_TEST: u32 = 2; +pub const CDS_FULLSCREEN: u32 = 4; +pub const CDS_GLOBAL: u32 = 8; +pub const CDS_SET_PRIMARY: u32 = 16; +pub const CDS_VIDEOPARAMETERS: u32 = 32; +pub const CDS_RESET: u32 = 1073741824; +pub const CDS_RESET_EX: u32 = 536870912; +pub const CDS_NORESET: u32 = 268435456; +pub const VP_COMMAND_GET: u32 = 1; +pub const VP_COMMAND_SET: u32 = 2; +pub const VP_FLAGS_TV_MODE: u32 = 1; +pub const VP_FLAGS_TV_STANDARD: u32 = 2; +pub const VP_FLAGS_FLICKER: u32 = 4; +pub const VP_FLAGS_OVERSCAN: u32 = 8; +pub const VP_FLAGS_MAX_UNSCALED: u32 = 16; +pub const VP_FLAGS_POSITION: u32 = 32; +pub const VP_FLAGS_BRIGHTNESS: u32 = 64; +pub const VP_FLAGS_CONTRAST: u32 = 128; +pub const VP_FLAGS_COPYPROTECT: u32 = 256; +pub const VP_MODE_WIN_GRAPHICS: u32 = 1; +pub const VP_MODE_TV_PLAYBACK: u32 = 2; +pub const VP_TV_STANDARD_NTSC_M: u32 = 1; +pub const VP_TV_STANDARD_NTSC_M_J: u32 = 2; +pub const VP_TV_STANDARD_PAL_B: u32 = 4; +pub const VP_TV_STANDARD_PAL_D: u32 = 8; +pub const VP_TV_STANDARD_PAL_H: u32 = 16; +pub const VP_TV_STANDARD_PAL_I: u32 = 32; +pub const VP_TV_STANDARD_PAL_M: u32 = 64; +pub const VP_TV_STANDARD_PAL_N: u32 = 128; +pub const VP_TV_STANDARD_SECAM_B: u32 = 256; +pub const VP_TV_STANDARD_SECAM_D: u32 = 512; +pub const VP_TV_STANDARD_SECAM_G: u32 = 1024; +pub const VP_TV_STANDARD_SECAM_H: u32 = 2048; +pub const VP_TV_STANDARD_SECAM_K: u32 = 4096; +pub const VP_TV_STANDARD_SECAM_K1: u32 = 8192; +pub const VP_TV_STANDARD_SECAM_L: u32 = 16384; +pub const VP_TV_STANDARD_WIN_VGA: u32 = 32768; +pub const VP_TV_STANDARD_NTSC_433: u32 = 65536; +pub const VP_TV_STANDARD_PAL_G: u32 = 131072; +pub const VP_TV_STANDARD_PAL_60: u32 = 262144; +pub const VP_TV_STANDARD_SECAM_L1: u32 = 524288; +pub const VP_CP_TYPE_APS_TRIGGER: u32 = 1; +pub const VP_CP_TYPE_MACROVISION: u32 = 2; +pub const VP_CP_CMD_ACTIVATE: u32 = 1; +pub const VP_CP_CMD_DEACTIVATE: u32 = 2; +pub const VP_CP_CMD_CHANGE: u32 = 4; +pub const DISP_CHANGE_SUCCESSFUL: u32 = 0; +pub const DISP_CHANGE_RESTART: u32 = 1; +pub const DISP_CHANGE_FAILED: i32 = -1; +pub const DISP_CHANGE_BADMODE: i32 = -2; +pub const DISP_CHANGE_NOTUPDATED: i32 = -3; +pub const DISP_CHANGE_BADFLAGS: i32 = -4; +pub const DISP_CHANGE_BADPARAM: i32 = -5; +pub const DISP_CHANGE_BADDUALVIEW: i32 = -6; +pub const EDS_RAWMODE: u32 = 2; +pub const EDD_GET_DEVICE_INTERFACE_NAME: u32 = 1; +pub const FKF_FILTERKEYSON: u32 = 1; +pub const FKF_AVAILABLE: u32 = 2; +pub const FKF_HOTKEYACTIVE: u32 = 4; +pub const FKF_CONFIRMHOTKEY: u32 = 8; +pub const FKF_HOTKEYSOUND: u32 = 16; +pub const FKF_INDICATOR: u32 = 32; +pub const FKF_CLICKON: u32 = 64; +pub const SKF_STICKYKEYSON: u32 = 1; +pub const SKF_AVAILABLE: u32 = 2; +pub const SKF_HOTKEYACTIVE: u32 = 4; +pub const SKF_CONFIRMHOTKEY: u32 = 8; +pub const SKF_HOTKEYSOUND: u32 = 16; +pub const SKF_INDICATOR: u32 = 32; +pub const SKF_AUDIBLEFEEDBACK: u32 = 64; +pub const SKF_TRISTATE: u32 = 128; +pub const SKF_TWOKEYSOFF: u32 = 256; +pub const SKF_LALTLATCHED: u32 = 268435456; +pub const SKF_LCTLLATCHED: u32 = 67108864; +pub const SKF_LSHIFTLATCHED: u32 = 16777216; +pub const SKF_RALTLATCHED: u32 = 536870912; +pub const SKF_RCTLLATCHED: u32 = 134217728; +pub const SKF_RSHIFTLATCHED: u32 = 33554432; +pub const SKF_LWINLATCHED: u32 = 1073741824; +pub const SKF_RWINLATCHED: u32 = 2147483648; +pub const SKF_LALTLOCKED: u32 = 1048576; +pub const SKF_LCTLLOCKED: u32 = 262144; +pub const SKF_LSHIFTLOCKED: u32 = 65536; +pub const SKF_RALTLOCKED: u32 = 2097152; +pub const SKF_RCTLLOCKED: u32 = 524288; +pub const SKF_RSHIFTLOCKED: u32 = 131072; +pub const SKF_LWINLOCKED: u32 = 4194304; +pub const SKF_RWINLOCKED: u32 = 8388608; +pub const MKF_MOUSEKEYSON: u32 = 1; +pub const MKF_AVAILABLE: u32 = 2; +pub const MKF_HOTKEYACTIVE: u32 = 4; +pub const MKF_CONFIRMHOTKEY: u32 = 8; +pub const MKF_HOTKEYSOUND: u32 = 16; +pub const MKF_INDICATOR: u32 = 32; +pub const MKF_MODIFIERS: u32 = 64; +pub const MKF_REPLACENUMBERS: u32 = 128; +pub const MKF_LEFTBUTTONSEL: u32 = 268435456; +pub const MKF_RIGHTBUTTONSEL: u32 = 536870912; +pub const MKF_LEFTBUTTONDOWN: u32 = 16777216; +pub const MKF_RIGHTBUTTONDOWN: u32 = 33554432; +pub const MKF_MOUSEMODE: u32 = 2147483648; +pub const ATF_TIMEOUTON: u32 = 1; +pub const ATF_ONOFFFEEDBACK: u32 = 2; +pub const SSGF_NONE: u32 = 0; +pub const SSGF_DISPLAY: u32 = 3; +pub const SSTF_NONE: u32 = 0; +pub const SSTF_CHARS: u32 = 1; +pub const SSTF_BORDER: u32 = 2; +pub const SSTF_DISPLAY: u32 = 3; +pub const SSWF_NONE: u32 = 0; +pub const SSWF_TITLE: u32 = 1; +pub const SSWF_WINDOW: u32 = 2; +pub const SSWF_DISPLAY: u32 = 3; +pub const SSWF_CUSTOM: u32 = 4; +pub const SSF_SOUNDSENTRYON: u32 = 1; +pub const SSF_AVAILABLE: u32 = 2; +pub const SSF_INDICATOR: u32 = 4; +pub const TKF_TOGGLEKEYSON: u32 = 1; +pub const TKF_AVAILABLE: u32 = 2; +pub const TKF_HOTKEYACTIVE: u32 = 4; +pub const TKF_CONFIRMHOTKEY: u32 = 8; +pub const TKF_HOTKEYSOUND: u32 = 16; +pub const TKF_INDICATOR: u32 = 32; +pub const SLE_ERROR: u32 = 1; +pub const SLE_MINORERROR: u32 = 2; +pub const SLE_WARNING: u32 = 3; +pub const MONITOR_DEFAULTTONULL: u32 = 0; +pub const MONITOR_DEFAULTTOPRIMARY: u32 = 1; +pub const MONITOR_DEFAULTTONEAREST: u32 = 2; +pub const MONITORINFOF_PRIMARY: u32 = 1; +pub const WINEVENT_OUTOFCONTEXT: u32 = 0; +pub const WINEVENT_SKIPOWNTHREAD: u32 = 1; +pub const WINEVENT_SKIPOWNPROCESS: u32 = 2; +pub const WINEVENT_INCONTEXT: u32 = 4; +pub const CHILDID_SELF: u32 = 0; +pub const INDEXID_OBJECT: u32 = 0; +pub const INDEXID_CONTAINER: u32 = 0; +pub const EVENT_MIN: u32 = 1; +pub const EVENT_MAX: u32 = 2147483647; +pub const EVENT_SYSTEM_SOUND: u32 = 1; +pub const EVENT_SYSTEM_ALERT: u32 = 2; +pub const EVENT_SYSTEM_FOREGROUND: u32 = 3; +pub const EVENT_SYSTEM_MENUSTART: u32 = 4; +pub const EVENT_SYSTEM_MENUEND: u32 = 5; +pub const EVENT_SYSTEM_MENUPOPUPSTART: u32 = 6; +pub const EVENT_SYSTEM_MENUPOPUPEND: u32 = 7; +pub const EVENT_SYSTEM_CAPTURESTART: u32 = 8; +pub const EVENT_SYSTEM_CAPTUREEND: u32 = 9; +pub const EVENT_SYSTEM_MOVESIZESTART: u32 = 10; +pub const EVENT_SYSTEM_MOVESIZEEND: u32 = 11; +pub const EVENT_SYSTEM_CONTEXTHELPSTART: u32 = 12; +pub const EVENT_SYSTEM_CONTEXTHELPEND: u32 = 13; +pub const EVENT_SYSTEM_DRAGDROPSTART: u32 = 14; +pub const EVENT_SYSTEM_DRAGDROPEND: u32 = 15; +pub const EVENT_SYSTEM_DIALOGSTART: u32 = 16; +pub const EVENT_SYSTEM_DIALOGEND: u32 = 17; +pub const EVENT_SYSTEM_SCROLLINGSTART: u32 = 18; +pub const EVENT_SYSTEM_SCROLLINGEND: u32 = 19; +pub const EVENT_SYSTEM_SWITCHSTART: u32 = 20; +pub const EVENT_SYSTEM_SWITCHEND: u32 = 21; +pub const EVENT_SYSTEM_MINIMIZESTART: u32 = 22; +pub const EVENT_SYSTEM_MINIMIZEEND: u32 = 23; +pub const EVENT_CONSOLE_CARET: u32 = 16385; +pub const EVENT_CONSOLE_UPDATE_REGION: u32 = 16386; +pub const EVENT_CONSOLE_UPDATE_SIMPLE: u32 = 16387; +pub const EVENT_CONSOLE_UPDATE_SCROLL: u32 = 16388; +pub const EVENT_CONSOLE_LAYOUT: u32 = 16389; +pub const EVENT_CONSOLE_START_APPLICATION: u32 = 16390; +pub const EVENT_CONSOLE_END_APPLICATION: u32 = 16391; +pub const CONSOLE_APPLICATION_16BIT: u32 = 0; +pub const CONSOLE_CARET_SELECTION: u32 = 1; +pub const CONSOLE_CARET_VISIBLE: u32 = 2; +pub const EVENT_OBJECT_CREATE: u32 = 32768; +pub const EVENT_OBJECT_DESTROY: u32 = 32769; +pub const EVENT_OBJECT_SHOW: u32 = 32770; +pub const EVENT_OBJECT_HIDE: u32 = 32771; +pub const EVENT_OBJECT_REORDER: u32 = 32772; +pub const EVENT_OBJECT_FOCUS: u32 = 32773; +pub const EVENT_OBJECT_SELECTION: u32 = 32774; +pub const EVENT_OBJECT_SELECTIONADD: u32 = 32775; +pub const EVENT_OBJECT_SELECTIONREMOVE: u32 = 32776; +pub const EVENT_OBJECT_SELECTIONWITHIN: u32 = 32777; +pub const EVENT_OBJECT_STATECHANGE: u32 = 32778; +pub const EVENT_OBJECT_LOCATIONCHANGE: u32 = 32779; +pub const EVENT_OBJECT_NAMECHANGE: u32 = 32780; +pub const EVENT_OBJECT_DESCRIPTIONCHANGE: u32 = 32781; +pub const EVENT_OBJECT_VALUECHANGE: u32 = 32782; +pub const EVENT_OBJECT_PARENTCHANGE: u32 = 32783; +pub const EVENT_OBJECT_HELPCHANGE: u32 = 32784; +pub const EVENT_OBJECT_DEFACTIONCHANGE: u32 = 32785; +pub const EVENT_OBJECT_ACCELERATORCHANGE: u32 = 32786; +pub const SOUND_SYSTEM_STARTUP: u32 = 1; +pub const SOUND_SYSTEM_SHUTDOWN: u32 = 2; +pub const SOUND_SYSTEM_BEEP: u32 = 3; +pub const SOUND_SYSTEM_ERROR: u32 = 4; +pub const SOUND_SYSTEM_QUESTION: u32 = 5; +pub const SOUND_SYSTEM_WARNING: u32 = 6; +pub const SOUND_SYSTEM_INFORMATION: u32 = 7; +pub const SOUND_SYSTEM_MAXIMIZE: u32 = 8; +pub const SOUND_SYSTEM_MINIMIZE: u32 = 9; +pub const SOUND_SYSTEM_RESTOREUP: u32 = 10; +pub const SOUND_SYSTEM_RESTOREDOWN: u32 = 11; +pub const SOUND_SYSTEM_APPSTART: u32 = 12; +pub const SOUND_SYSTEM_FAULT: u32 = 13; +pub const SOUND_SYSTEM_APPEND: u32 = 14; +pub const SOUND_SYSTEM_MENUCOMMAND: u32 = 15; +pub const SOUND_SYSTEM_MENUPOPUP: u32 = 16; +pub const CSOUND_SYSTEM: u32 = 16; +pub const ALERT_SYSTEM_INFORMATIONAL: u32 = 1; +pub const ALERT_SYSTEM_WARNING: u32 = 2; +pub const ALERT_SYSTEM_ERROR: u32 = 3; +pub const ALERT_SYSTEM_QUERY: u32 = 4; +pub const ALERT_SYSTEM_CRITICAL: u32 = 5; +pub const CALERT_SYSTEM: u32 = 6; +pub const GUI_CARETBLINKING: u32 = 1; +pub const GUI_INMOVESIZE: u32 = 2; +pub const GUI_INMENUMODE: u32 = 4; +pub const GUI_SYSTEMMENUMODE: u32 = 8; +pub const GUI_POPUPMENUMODE: u32 = 16; +pub const GUI_16BITTASK: u32 = 0; +pub const STATE_SYSTEM_UNAVAILABLE: u32 = 1; +pub const STATE_SYSTEM_SELECTED: u32 = 2; +pub const STATE_SYSTEM_FOCUSED: u32 = 4; +pub const STATE_SYSTEM_PRESSED: u32 = 8; +pub const STATE_SYSTEM_CHECKED: u32 = 16; +pub const STATE_SYSTEM_MIXED: u32 = 32; +pub const STATE_SYSTEM_INDETERMINATE: u32 = 32; +pub const STATE_SYSTEM_READONLY: u32 = 64; +pub const STATE_SYSTEM_HOTTRACKED: u32 = 128; +pub const STATE_SYSTEM_DEFAULT: u32 = 256; +pub const STATE_SYSTEM_EXPANDED: u32 = 512; +pub const STATE_SYSTEM_COLLAPSED: u32 = 1024; +pub const STATE_SYSTEM_BUSY: u32 = 2048; +pub const STATE_SYSTEM_FLOATING: u32 = 4096; +pub const STATE_SYSTEM_MARQUEED: u32 = 8192; +pub const STATE_SYSTEM_ANIMATED: u32 = 16384; +pub const STATE_SYSTEM_INVISIBLE: u32 = 32768; +pub const STATE_SYSTEM_OFFSCREEN: u32 = 65536; +pub const STATE_SYSTEM_SIZEABLE: u32 = 131072; +pub const STATE_SYSTEM_MOVEABLE: u32 = 262144; +pub const STATE_SYSTEM_SELFVOICING: u32 = 524288; +pub const STATE_SYSTEM_FOCUSABLE: u32 = 1048576; +pub const STATE_SYSTEM_SELECTABLE: u32 = 2097152; +pub const STATE_SYSTEM_LINKED: u32 = 4194304; +pub const STATE_SYSTEM_TRAVERSED: u32 = 8388608; +pub const STATE_SYSTEM_MULTISELECTABLE: u32 = 16777216; +pub const STATE_SYSTEM_EXTSELECTABLE: u32 = 33554432; +pub const STATE_SYSTEM_ALERT_LOW: u32 = 67108864; +pub const STATE_SYSTEM_ALERT_MEDIUM: u32 = 134217728; +pub const STATE_SYSTEM_ALERT_HIGH: u32 = 268435456; +pub const STATE_SYSTEM_PROTECTED: u32 = 536870912; +pub const STATE_SYSTEM_VALID: u32 = 1073741823; +pub const CCHILDREN_TITLEBAR: u32 = 5; +pub const CCHILDREN_SCROLLBAR: u32 = 5; +pub const CURSOR_SHOWING: u32 = 1; +pub const WS_ACTIVECAPTION: u32 = 1; +pub const GA_PARENT: u32 = 1; +pub const GA_ROOT: u32 = 2; +pub const GA_ROOTOWNER: u32 = 3; +pub const RIM_INPUT: u32 = 0; +pub const RIM_INPUTSINK: u32 = 1; +pub const RIM_TYPEMOUSE: u32 = 0; +pub const RIM_TYPEKEYBOARD: u32 = 1; +pub const RIM_TYPEHID: u32 = 2; +pub const RI_MOUSE_LEFT_BUTTON_DOWN: u32 = 1; +pub const RI_MOUSE_LEFT_BUTTON_UP: u32 = 2; +pub const RI_MOUSE_RIGHT_BUTTON_DOWN: u32 = 4; +pub const RI_MOUSE_RIGHT_BUTTON_UP: u32 = 8; +pub const RI_MOUSE_MIDDLE_BUTTON_DOWN: u32 = 16; +pub const RI_MOUSE_MIDDLE_BUTTON_UP: u32 = 32; +pub const RI_MOUSE_BUTTON_4_DOWN: u32 = 64; +pub const RI_MOUSE_BUTTON_4_UP: u32 = 128; +pub const RI_MOUSE_BUTTON_5_DOWN: u32 = 256; +pub const RI_MOUSE_BUTTON_5_UP: u32 = 512; +pub const RI_MOUSE_WHEEL: u32 = 1024; +pub const RI_MOUSE_BUTTON_1_DOWN: u32 = 1; +pub const RI_MOUSE_BUTTON_1_UP: u32 = 2; +pub const RI_MOUSE_BUTTON_2_DOWN: u32 = 4; +pub const RI_MOUSE_BUTTON_2_UP: u32 = 8; +pub const RI_MOUSE_BUTTON_3_DOWN: u32 = 16; +pub const RI_MOUSE_BUTTON_3_UP: u32 = 32; +pub const MOUSE_MOVE_RELATIVE: u32 = 0; +pub const MOUSE_MOVE_ABSOLUTE: u32 = 1; +pub const MOUSE_VIRTUAL_DESKTOP: u32 = 2; +pub const MOUSE_ATTRIBUTES_CHANGED: u32 = 4; +pub const KEYBOARD_OVERRUN_MAKE_CODE: u32 = 255; +pub const RI_KEY_MAKE: u32 = 0; +pub const RI_KEY_BREAK: u32 = 1; +pub const RI_KEY_E0: u32 = 2; +pub const RI_KEY_E1: u32 = 4; +pub const RI_KEY_TERMSRV_SET_LED: u32 = 8; +pub const RI_KEY_TERMSRV_SHADOW: u32 = 16; +pub const RID_INPUT: u32 = 268435459; +pub const RID_HEADER: u32 = 268435461; +pub const RIDI_PREPARSEDDATA: u32 = 536870917; +pub const RIDI_DEVICENAME: u32 = 536870919; +pub const RIDI_DEVICEINFO: u32 = 536870923; +pub const RIDEV_REMOVE: u32 = 1; +pub const RIDEV_EXCLUDE: u32 = 16; +pub const RIDEV_PAGEONLY: u32 = 32; +pub const RIDEV_NOLEGACY: u32 = 48; +pub const RIDEV_INPUTSINK: u32 = 256; +pub const RIDEV_CAPTUREMOUSE: u32 = 512; +pub const RIDEV_NOHOTKEYS: u32 = 512; +pub const RIDEV_APPKEYS: u32 = 1024; +pub const RIDEV_EXINPUTSINK: u32 = 4096; +pub const RIDEV_DEVNOTIFY: u32 = 8192; +pub const RIDEV_EXMODEMASK: u32 = 240; +pub const GIDC_ARRIVAL: u32 = 1; +pub const GIDC_REMOVAL: u32 = 2; +pub const MAX_STR_BLOCKREASON: u32 = 256; +pub const MAX_LEADBYTES: u32 = 12; +pub const MAX_DEFAULTCHAR: u32 = 2; +pub const HIGH_SURROGATE_START: u32 = 55296; +pub const HIGH_SURROGATE_END: u32 = 56319; +pub const LOW_SURROGATE_START: u32 = 56320; +pub const LOW_SURROGATE_END: u32 = 57343; +pub const MB_PRECOMPOSED: u32 = 1; +pub const MB_COMPOSITE: u32 = 2; +pub const MB_USEGLYPHCHARS: u32 = 4; +pub const MB_ERR_INVALID_CHARS: u32 = 8; +pub const WC_DISCARDNS: u32 = 16; +pub const WC_SEPCHARS: u32 = 32; +pub const WC_DEFAULTCHAR: u32 = 64; +pub const WC_COMPOSITECHECK: u32 = 512; +pub const WC_NO_BEST_FIT_CHARS: u32 = 1024; +pub const CT_CTYPE1: u32 = 1; +pub const CT_CTYPE2: u32 = 2; +pub const CT_CTYPE3: u32 = 4; +pub const C1_UPPER: u32 = 1; +pub const C1_LOWER: u32 = 2; +pub const C1_DIGIT: u32 = 4; +pub const C1_SPACE: u32 = 8; +pub const C1_PUNCT: u32 = 16; +pub const C1_CNTRL: u32 = 32; +pub const C1_BLANK: u32 = 64; +pub const C1_XDIGIT: u32 = 128; +pub const C1_ALPHA: u32 = 256; +pub const C1_DEFINED: u32 = 512; +pub const C2_LEFTTORIGHT: u32 = 1; +pub const C2_RIGHTTOLEFT: u32 = 2; +pub const C2_EUROPENUMBER: u32 = 3; +pub const C2_EUROPESEPARATOR: u32 = 4; +pub const C2_EUROPETERMINATOR: u32 = 5; +pub const C2_ARABICNUMBER: u32 = 6; +pub const C2_COMMONSEPARATOR: u32 = 7; +pub const C2_BLOCKSEPARATOR: u32 = 8; +pub const C2_SEGMENTSEPARATOR: u32 = 9; +pub const C2_WHITESPACE: u32 = 10; +pub const C2_OTHERNEUTRAL: u32 = 11; +pub const C2_NOTAPPLICABLE: u32 = 0; +pub const C3_NONSPACING: u32 = 1; +pub const C3_DIACRITIC: u32 = 2; +pub const C3_VOWELMARK: u32 = 4; +pub const C3_SYMBOL: u32 = 8; +pub const C3_KATAKANA: u32 = 16; +pub const C3_HIRAGANA: u32 = 32; +pub const C3_HALFWIDTH: u32 = 64; +pub const C3_FULLWIDTH: u32 = 128; +pub const C3_IDEOGRAPH: u32 = 256; +pub const C3_KASHIDA: u32 = 512; +pub const C3_LEXICAL: u32 = 1024; +pub const C3_HIGHSURROGATE: u32 = 2048; +pub const C3_LOWSURROGATE: u32 = 4096; +pub const C3_ALPHA: u32 = 32768; +pub const C3_NOTAPPLICABLE: u32 = 0; +pub const NORM_IGNORECASE: u32 = 1; +pub const NORM_IGNORENONSPACE: u32 = 2; +pub const NORM_IGNORESYMBOLS: u32 = 4; +pub const LINGUISTIC_IGNORECASE: u32 = 16; +pub const LINGUISTIC_IGNOREDIACRITIC: u32 = 32; +pub const NORM_IGNOREKANATYPE: u32 = 65536; +pub const NORM_IGNOREWIDTH: u32 = 131072; +pub const NORM_LINGUISTIC_CASING: u32 = 134217728; +pub const MAP_FOLDCZONE: u32 = 16; +pub const MAP_PRECOMPOSED: u32 = 32; +pub const MAP_COMPOSITE: u32 = 64; +pub const MAP_FOLDDIGITS: u32 = 128; +pub const MAP_EXPAND_LIGATURES: u32 = 8192; +pub const LCMAP_LOWERCASE: u32 = 256; +pub const LCMAP_UPPERCASE: u32 = 512; +pub const LCMAP_SORTKEY: u32 = 1024; +pub const LCMAP_BYTEREV: u32 = 2048; +pub const LCMAP_HIRAGANA: u32 = 1048576; +pub const LCMAP_KATAKANA: u32 = 2097152; +pub const LCMAP_HALFWIDTH: u32 = 4194304; +pub const LCMAP_FULLWIDTH: u32 = 8388608; +pub const LCMAP_LINGUISTIC_CASING: u32 = 16777216; +pub const LCMAP_SIMPLIFIED_CHINESE: u32 = 33554432; +pub const LCMAP_TRADITIONAL_CHINESE: u32 = 67108864; +pub const FIND_STARTSWITH: u32 = 1048576; +pub const FIND_ENDSWITH: u32 = 2097152; +pub const FIND_FROMSTART: u32 = 4194304; +pub const FIND_FROMEND: u32 = 8388608; +pub const LGRPID_INSTALLED: u32 = 1; +pub const LGRPID_SUPPORTED: u32 = 2; +pub const LCID_INSTALLED: u32 = 1; +pub const LCID_SUPPORTED: u32 = 2; +pub const LCID_ALTERNATE_SORTS: u32 = 4; +pub const CP_INSTALLED: u32 = 1; +pub const CP_SUPPORTED: u32 = 2; +pub const SORT_STRINGSORT: u32 = 4096; +pub const CSTR_LESS_THAN: u32 = 1; +pub const CSTR_EQUAL: u32 = 2; +pub const CSTR_GREATER_THAN: u32 = 3; +pub const CP_ACP: u32 = 0; +pub const CP_OEMCP: u32 = 1; +pub const CP_MACCP: u32 = 2; +pub const CP_THREAD_ACP: u32 = 3; +pub const CP_SYMBOL: u32 = 42; +pub const CP_UTF7: u32 = 65000; +pub const CP_UTF8: u32 = 65001; +pub const CTRY_DEFAULT: u32 = 0; +pub const CTRY_ALBANIA: u32 = 355; +pub const CTRY_ALGERIA: u32 = 213; +pub const CTRY_ARGENTINA: u32 = 54; +pub const CTRY_ARMENIA: u32 = 374; +pub const CTRY_AUSTRALIA: u32 = 61; +pub const CTRY_AUSTRIA: u32 = 43; +pub const CTRY_AZERBAIJAN: u32 = 994; +pub const CTRY_BAHRAIN: u32 = 973; +pub const CTRY_BELARUS: u32 = 375; +pub const CTRY_BELGIUM: u32 = 32; +pub const CTRY_BELIZE: u32 = 501; +pub const CTRY_BOLIVIA: u32 = 591; +pub const CTRY_BRAZIL: u32 = 55; +pub const CTRY_BRUNEI_DARUSSALAM: u32 = 673; +pub const CTRY_BULGARIA: u32 = 359; +pub const CTRY_CANADA: u32 = 2; +pub const CTRY_CARIBBEAN: u32 = 1; +pub const CTRY_CHILE: u32 = 56; +pub const CTRY_COLOMBIA: u32 = 57; +pub const CTRY_COSTA_RICA: u32 = 506; +pub const CTRY_CROATIA: u32 = 385; +pub const CTRY_CZECH: u32 = 420; +pub const CTRY_DENMARK: u32 = 45; +pub const CTRY_DOMINICAN_REPUBLIC: u32 = 1; +pub const CTRY_ECUADOR: u32 = 593; +pub const CTRY_EGYPT: u32 = 20; +pub const CTRY_EL_SALVADOR: u32 = 503; +pub const CTRY_ESTONIA: u32 = 372; +pub const CTRY_FAEROE_ISLANDS: u32 = 298; +pub const CTRY_FINLAND: u32 = 358; +pub const CTRY_FRANCE: u32 = 33; +pub const CTRY_GEORGIA: u32 = 995; +pub const CTRY_GERMANY: u32 = 49; +pub const CTRY_GREECE: u32 = 30; +pub const CTRY_GUATEMALA: u32 = 502; +pub const CTRY_HONDURAS: u32 = 504; +pub const CTRY_HONG_KONG: u32 = 852; +pub const CTRY_HUNGARY: u32 = 36; +pub const CTRY_ICELAND: u32 = 354; +pub const CTRY_INDIA: u32 = 91; +pub const CTRY_INDONESIA: u32 = 62; +pub const CTRY_IRAN: u32 = 981; +pub const CTRY_IRAQ: u32 = 964; +pub const CTRY_IRELAND: u32 = 353; +pub const CTRY_ISRAEL: u32 = 972; +pub const CTRY_ITALY: u32 = 39; +pub const CTRY_JAMAICA: u32 = 1; +pub const CTRY_JAPAN: u32 = 81; +pub const CTRY_JORDAN: u32 = 962; +pub const CTRY_KAZAKSTAN: u32 = 7; +pub const CTRY_KENYA: u32 = 254; +pub const CTRY_KUWAIT: u32 = 965; +pub const CTRY_KYRGYZSTAN: u32 = 996; +pub const CTRY_LATVIA: u32 = 371; +pub const CTRY_LEBANON: u32 = 961; +pub const CTRY_LIBYA: u32 = 218; +pub const CTRY_LIECHTENSTEIN: u32 = 41; +pub const CTRY_LITHUANIA: u32 = 370; +pub const CTRY_LUXEMBOURG: u32 = 352; +pub const CTRY_MACAU: u32 = 853; +pub const CTRY_MACEDONIA: u32 = 389; +pub const CTRY_MALAYSIA: u32 = 60; +pub const CTRY_MALDIVES: u32 = 960; +pub const CTRY_MEXICO: u32 = 52; +pub const CTRY_MONACO: u32 = 33; +pub const CTRY_MONGOLIA: u32 = 976; +pub const CTRY_MOROCCO: u32 = 212; +pub const CTRY_NETHERLANDS: u32 = 31; +pub const CTRY_NEW_ZEALAND: u32 = 64; +pub const CTRY_NICARAGUA: u32 = 505; +pub const CTRY_NORWAY: u32 = 47; +pub const CTRY_OMAN: u32 = 968; +pub const CTRY_PAKISTAN: u32 = 92; +pub const CTRY_PANAMA: u32 = 507; +pub const CTRY_PARAGUAY: u32 = 595; +pub const CTRY_PERU: u32 = 51; +pub const CTRY_PHILIPPINES: u32 = 63; +pub const CTRY_POLAND: u32 = 48; +pub const CTRY_PORTUGAL: u32 = 351; +pub const CTRY_PRCHINA: u32 = 86; +pub const CTRY_PUERTO_RICO: u32 = 1; +pub const CTRY_QATAR: u32 = 974; +pub const CTRY_ROMANIA: u32 = 40; +pub const CTRY_RUSSIA: u32 = 7; +pub const CTRY_SAUDI_ARABIA: u32 = 966; +pub const CTRY_SERBIA: u32 = 381; +pub const CTRY_SINGAPORE: u32 = 65; +pub const CTRY_SLOVAK: u32 = 421; +pub const CTRY_SLOVENIA: u32 = 386; +pub const CTRY_SOUTH_AFRICA: u32 = 27; +pub const CTRY_SOUTH_KOREA: u32 = 82; +pub const CTRY_SPAIN: u32 = 34; +pub const CTRY_SWEDEN: u32 = 46; +pub const CTRY_SWITZERLAND: u32 = 41; +pub const CTRY_SYRIA: u32 = 963; +pub const CTRY_TAIWAN: u32 = 886; +pub const CTRY_TATARSTAN: u32 = 7; +pub const CTRY_THAILAND: u32 = 66; +pub const CTRY_TRINIDAD_Y_TOBAGO: u32 = 1; +pub const CTRY_TUNISIA: u32 = 216; +pub const CTRY_TURKEY: u32 = 90; +pub const CTRY_UAE: u32 = 971; +pub const CTRY_UKRAINE: u32 = 380; +pub const CTRY_UNITED_KINGDOM: u32 = 44; +pub const CTRY_UNITED_STATES: u32 = 1; +pub const CTRY_URUGUAY: u32 = 598; +pub const CTRY_UZBEKISTAN: u32 = 7; +pub const CTRY_VENEZUELA: u32 = 58; +pub const CTRY_VIET_NAM: u32 = 84; +pub const CTRY_YEMEN: u32 = 967; +pub const CTRY_ZIMBABWE: u32 = 263; +pub const LOCALE_SLOCALIZEDDISPLAYNAME: u32 = 2; +pub const LOCALE_RETURN_NUMBER: u32 = 536870912; +pub const LOCALE_USE_CP_ACP: u32 = 1073741824; +pub const LOCALE_NOUSEROVERRIDE: u32 = 2147483648; +pub const LOCALE_SENGLISHLANGUAGENAME: u32 = 4097; +pub const LOCALE_SNATIVELANGUAGENAME: u32 = 4; +pub const LOCALE_SLOCALIZEDCOUNTRYNAME: u32 = 6; +pub const LOCALE_SENGLISHCOUNTRYNAME: u32 = 4098; +pub const LOCALE_SNATIVECOUNTRYNAME: u32 = 8; +pub const LOCALE_SLANGUAGE: u32 = 2; +pub const LOCALE_SENGLANGUAGE: u32 = 4097; +pub const LOCALE_SNATIVELANGNAME: u32 = 4; +pub const LOCALE_SCOUNTRY: u32 = 6; +pub const LOCALE_SENGCOUNTRY: u32 = 4098; +pub const LOCALE_SNATIVECTRYNAME: u32 = 8; +pub const LOCALE_ILANGUAGE: u32 = 1; +pub const LOCALE_SABBREVLANGNAME: u32 = 3; +pub const LOCALE_ICOUNTRY: u32 = 5; +pub const LOCALE_SABBREVCTRYNAME: u32 = 7; +pub const LOCALE_IGEOID: u32 = 91; +pub const LOCALE_IDEFAULTLANGUAGE: u32 = 9; +pub const LOCALE_IDEFAULTCOUNTRY: u32 = 10; +pub const LOCALE_IDEFAULTCODEPAGE: u32 = 11; +pub const LOCALE_IDEFAULTANSICODEPAGE: u32 = 4100; +pub const LOCALE_IDEFAULTMACCODEPAGE: u32 = 4113; +pub const LOCALE_SLIST: u32 = 12; +pub const LOCALE_IMEASURE: u32 = 13; +pub const LOCALE_SDECIMAL: u32 = 14; +pub const LOCALE_STHOUSAND: u32 = 15; +pub const LOCALE_SGROUPING: u32 = 16; +pub const LOCALE_IDIGITS: u32 = 17; +pub const LOCALE_ILZERO: u32 = 18; +pub const LOCALE_INEGNUMBER: u32 = 4112; +pub const LOCALE_SNATIVEDIGITS: u32 = 19; +pub const LOCALE_SCURRENCY: u32 = 20; +pub const LOCALE_SINTLSYMBOL: u32 = 21; +pub const LOCALE_SMONDECIMALSEP: u32 = 22; +pub const LOCALE_SMONTHOUSANDSEP: u32 = 23; +pub const LOCALE_SMONGROUPING: u32 = 24; +pub const LOCALE_ICURRDIGITS: u32 = 25; +pub const LOCALE_IINTLCURRDIGITS: u32 = 26; +pub const LOCALE_ICURRENCY: u32 = 27; +pub const LOCALE_INEGCURR: u32 = 28; +pub const LOCALE_SDATE: u32 = 29; +pub const LOCALE_STIME: u32 = 30; +pub const LOCALE_SSHORTDATE: u32 = 31; +pub const LOCALE_SLONGDATE: u32 = 32; +pub const LOCALE_STIMEFORMAT: u32 = 4099; +pub const LOCALE_IDATE: u32 = 33; +pub const LOCALE_ILDATE: u32 = 34; +pub const LOCALE_ITIME: u32 = 35; +pub const LOCALE_ITIMEMARKPOSN: u32 = 4101; +pub const LOCALE_ICENTURY: u32 = 36; +pub const LOCALE_ITLZERO: u32 = 37; +pub const LOCALE_IDAYLZERO: u32 = 38; +pub const LOCALE_IMONLZERO: u32 = 39; +pub const LOCALE_S1159: u32 = 40; +pub const LOCALE_S2359: u32 = 41; +pub const LOCALE_ICALENDARTYPE: u32 = 4105; +pub const LOCALE_IOPTIONALCALENDAR: u32 = 4107; +pub const LOCALE_IFIRSTDAYOFWEEK: u32 = 4108; +pub const LOCALE_IFIRSTWEEKOFYEAR: u32 = 4109; +pub const LOCALE_SDAYNAME1: u32 = 42; +pub const LOCALE_SDAYNAME2: u32 = 43; +pub const LOCALE_SDAYNAME3: u32 = 44; +pub const LOCALE_SDAYNAME4: u32 = 45; +pub const LOCALE_SDAYNAME5: u32 = 46; +pub const LOCALE_SDAYNAME6: u32 = 47; +pub const LOCALE_SDAYNAME7: u32 = 48; +pub const LOCALE_SABBREVDAYNAME1: u32 = 49; +pub const LOCALE_SABBREVDAYNAME2: u32 = 50; +pub const LOCALE_SABBREVDAYNAME3: u32 = 51; +pub const LOCALE_SABBREVDAYNAME4: u32 = 52; +pub const LOCALE_SABBREVDAYNAME5: u32 = 53; +pub const LOCALE_SABBREVDAYNAME6: u32 = 54; +pub const LOCALE_SABBREVDAYNAME7: u32 = 55; +pub const LOCALE_SMONTHNAME1: u32 = 56; +pub const LOCALE_SMONTHNAME2: u32 = 57; +pub const LOCALE_SMONTHNAME3: u32 = 58; +pub const LOCALE_SMONTHNAME4: u32 = 59; +pub const LOCALE_SMONTHNAME5: u32 = 60; +pub const LOCALE_SMONTHNAME6: u32 = 61; +pub const LOCALE_SMONTHNAME7: u32 = 62; +pub const LOCALE_SMONTHNAME8: u32 = 63; +pub const LOCALE_SMONTHNAME9: u32 = 64; +pub const LOCALE_SMONTHNAME10: u32 = 65; +pub const LOCALE_SMONTHNAME11: u32 = 66; +pub const LOCALE_SMONTHNAME12: u32 = 67; +pub const LOCALE_SMONTHNAME13: u32 = 4110; +pub const LOCALE_SABBREVMONTHNAME1: u32 = 68; +pub const LOCALE_SABBREVMONTHNAME2: u32 = 69; +pub const LOCALE_SABBREVMONTHNAME3: u32 = 70; +pub const LOCALE_SABBREVMONTHNAME4: u32 = 71; +pub const LOCALE_SABBREVMONTHNAME5: u32 = 72; +pub const LOCALE_SABBREVMONTHNAME6: u32 = 73; +pub const LOCALE_SABBREVMONTHNAME7: u32 = 74; +pub const LOCALE_SABBREVMONTHNAME8: u32 = 75; +pub const LOCALE_SABBREVMONTHNAME9: u32 = 76; +pub const LOCALE_SABBREVMONTHNAME10: u32 = 77; +pub const LOCALE_SABBREVMONTHNAME11: u32 = 78; +pub const LOCALE_SABBREVMONTHNAME12: u32 = 79; +pub const LOCALE_SABBREVMONTHNAME13: u32 = 4111; +pub const LOCALE_SPOSITIVESIGN: u32 = 80; +pub const LOCALE_SNEGATIVESIGN: u32 = 81; +pub const LOCALE_IPOSSIGNPOSN: u32 = 82; +pub const LOCALE_INEGSIGNPOSN: u32 = 83; +pub const LOCALE_IPOSSYMPRECEDES: u32 = 84; +pub const LOCALE_IPOSSEPBYSPACE: u32 = 85; +pub const LOCALE_INEGSYMPRECEDES: u32 = 86; +pub const LOCALE_INEGSEPBYSPACE: u32 = 87; +pub const LOCALE_FONTSIGNATURE: u32 = 88; +pub const LOCALE_SISO639LANGNAME: u32 = 89; +pub const LOCALE_SISO3166CTRYNAME: u32 = 90; +pub const LOCALE_IDEFAULTEBCDICCODEPAGE: u32 = 4114; +pub const LOCALE_IPAPERSIZE: u32 = 4106; +pub const LOCALE_SENGCURRNAME: u32 = 4103; +pub const LOCALE_SNATIVECURRNAME: u32 = 4104; +pub const LOCALE_SYEARMONTH: u32 = 4102; +pub const LOCALE_SSORTNAME: u32 = 4115; +pub const LOCALE_IDIGITSUBSTITUTION: u32 = 4116; +pub const TIME_NOMINUTESORSECONDS: u32 = 1; +pub const TIME_NOSECONDS: u32 = 2; +pub const TIME_NOTIMEMARKER: u32 = 4; +pub const TIME_FORCE24HOURFORMAT: u32 = 8; +pub const DATE_SHORTDATE: u32 = 1; +pub const DATE_LONGDATE: u32 = 2; +pub const DATE_USE_ALT_CALENDAR: u32 = 4; +pub const DATE_YEARMONTH: u32 = 8; +pub const DATE_LTRREADING: u32 = 16; +pub const DATE_RTLREADING: u32 = 32; +pub const CAL_NOUSEROVERRIDE: u32 = 2147483648; +pub const CAL_USE_CP_ACP: u32 = 1073741824; +pub const CAL_RETURN_NUMBER: u32 = 536870912; +pub const CAL_ICALINTVALUE: u32 = 1; +pub const CAL_SCALNAME: u32 = 2; +pub const CAL_IYEAROFFSETRANGE: u32 = 3; +pub const CAL_SERASTRING: u32 = 4; +pub const CAL_SSHORTDATE: u32 = 5; +pub const CAL_SLONGDATE: u32 = 6; +pub const CAL_SDAYNAME1: u32 = 7; +pub const CAL_SDAYNAME2: u32 = 8; +pub const CAL_SDAYNAME3: u32 = 9; +pub const CAL_SDAYNAME4: u32 = 10; +pub const CAL_SDAYNAME5: u32 = 11; +pub const CAL_SDAYNAME6: u32 = 12; +pub const CAL_SDAYNAME7: u32 = 13; +pub const CAL_SABBREVDAYNAME1: u32 = 14; +pub const CAL_SABBREVDAYNAME2: u32 = 15; +pub const CAL_SABBREVDAYNAME3: u32 = 16; +pub const CAL_SABBREVDAYNAME4: u32 = 17; +pub const CAL_SABBREVDAYNAME5: u32 = 18; +pub const CAL_SABBREVDAYNAME6: u32 = 19; +pub const CAL_SABBREVDAYNAME7: u32 = 20; +pub const CAL_SMONTHNAME1: u32 = 21; +pub const CAL_SMONTHNAME2: u32 = 22; +pub const CAL_SMONTHNAME3: u32 = 23; +pub const CAL_SMONTHNAME4: u32 = 24; +pub const CAL_SMONTHNAME5: u32 = 25; +pub const CAL_SMONTHNAME6: u32 = 26; +pub const CAL_SMONTHNAME7: u32 = 27; +pub const CAL_SMONTHNAME8: u32 = 28; +pub const CAL_SMONTHNAME9: u32 = 29; +pub const CAL_SMONTHNAME10: u32 = 30; +pub const CAL_SMONTHNAME11: u32 = 31; +pub const CAL_SMONTHNAME12: u32 = 32; +pub const CAL_SMONTHNAME13: u32 = 33; +pub const CAL_SABBREVMONTHNAME1: u32 = 34; +pub const CAL_SABBREVMONTHNAME2: u32 = 35; +pub const CAL_SABBREVMONTHNAME3: u32 = 36; +pub const CAL_SABBREVMONTHNAME4: u32 = 37; +pub const CAL_SABBREVMONTHNAME5: u32 = 38; +pub const CAL_SABBREVMONTHNAME6: u32 = 39; +pub const CAL_SABBREVMONTHNAME7: u32 = 40; +pub const CAL_SABBREVMONTHNAME8: u32 = 41; +pub const CAL_SABBREVMONTHNAME9: u32 = 42; +pub const CAL_SABBREVMONTHNAME10: u32 = 43; +pub const CAL_SABBREVMONTHNAME11: u32 = 44; +pub const CAL_SABBREVMONTHNAME12: u32 = 45; +pub const CAL_SABBREVMONTHNAME13: u32 = 46; +pub const CAL_SYEARMONTH: u32 = 47; +pub const CAL_ITWODIGITYEARMAX: u32 = 48; +pub const ENUM_ALL_CALENDARS: u32 = 4294967295; +pub const CAL_GREGORIAN: u32 = 1; +pub const CAL_GREGORIAN_US: u32 = 2; +pub const CAL_JAPAN: u32 = 3; +pub const CAL_TAIWAN: u32 = 4; +pub const CAL_KOREA: u32 = 5; +pub const CAL_HIJRI: u32 = 6; +pub const CAL_THAI: u32 = 7; +pub const CAL_HEBREW: u32 = 8; +pub const CAL_GREGORIAN_ME_FRENCH: u32 = 9; +pub const CAL_GREGORIAN_ARABIC: u32 = 10; +pub const CAL_GREGORIAN_XLIT_ENGLISH: u32 = 11; +pub const CAL_GREGORIAN_XLIT_FRENCH: u32 = 12; +pub const CAL_UMALQURA: u32 = 23; +pub const LGRPID_WESTERN_EUROPE: u32 = 1; +pub const LGRPID_CENTRAL_EUROPE: u32 = 2; +pub const LGRPID_BALTIC: u32 = 3; +pub const LGRPID_GREEK: u32 = 4; +pub const LGRPID_CYRILLIC: u32 = 5; +pub const LGRPID_TURKIC: u32 = 6; +pub const LGRPID_TURKISH: u32 = 6; +pub const LGRPID_JAPANESE: u32 = 7; +pub const LGRPID_KOREAN: u32 = 8; +pub const LGRPID_TRADITIONAL_CHINESE: u32 = 9; +pub const LGRPID_SIMPLIFIED_CHINESE: u32 = 10; +pub const LGRPID_THAI: u32 = 11; +pub const LGRPID_HEBREW: u32 = 12; +pub const LGRPID_ARABIC: u32 = 13; +pub const LGRPID_VIETNAMESE: u32 = 14; +pub const LGRPID_INDIC: u32 = 15; +pub const LGRPID_GEORGIAN: u32 = 16; +pub const LGRPID_ARMENIAN: u32 = 17; +pub const GEOID_NOT_AVAILABLE: i32 = -1; +pub const RIGHT_ALT_PRESSED: u32 = 1; +pub const LEFT_ALT_PRESSED: u32 = 2; +pub const RIGHT_CTRL_PRESSED: u32 = 4; +pub const LEFT_CTRL_PRESSED: u32 = 8; +pub const SHIFT_PRESSED: u32 = 16; +pub const NUMLOCK_ON: u32 = 32; +pub const SCROLLLOCK_ON: u32 = 64; +pub const CAPSLOCK_ON: u32 = 128; +pub const ENHANCED_KEY: u32 = 256; +pub const NLS_DBCSCHAR: u32 = 65536; +pub const NLS_ALPHANUMERIC: u32 = 0; +pub const NLS_KATAKANA: u32 = 131072; +pub const NLS_HIRAGANA: u32 = 262144; +pub const NLS_ROMAN: u32 = 4194304; +pub const NLS_IME_CONVERSION: u32 = 8388608; +pub const NLS_IME_DISABLE: u32 = 536870912; +pub const FROM_LEFT_1ST_BUTTON_PRESSED: u32 = 1; +pub const RIGHTMOST_BUTTON_PRESSED: u32 = 2; +pub const FROM_LEFT_2ND_BUTTON_PRESSED: u32 = 4; +pub const FROM_LEFT_3RD_BUTTON_PRESSED: u32 = 8; +pub const FROM_LEFT_4TH_BUTTON_PRESSED: u32 = 16; +pub const MOUSE_MOVED: u32 = 1; +pub const DOUBLE_CLICK: u32 = 2; +pub const MOUSE_WHEELED: u32 = 4; +pub const KEY_EVENT: u32 = 1; +pub const MOUSE_EVENT: u32 = 2; +pub const WINDOW_BUFFER_SIZE_EVENT: u32 = 4; +pub const MENU_EVENT: u32 = 8; +pub const FOCUS_EVENT: u32 = 16; +pub const FOREGROUND_BLUE: u32 = 1; +pub const FOREGROUND_GREEN: u32 = 2; +pub const FOREGROUND_RED: u32 = 4; +pub const FOREGROUND_INTENSITY: u32 = 8; +pub const BACKGROUND_BLUE: u32 = 16; +pub const BACKGROUND_GREEN: u32 = 32; +pub const BACKGROUND_RED: u32 = 64; +pub const BACKGROUND_INTENSITY: u32 = 128; +pub const COMMON_LVB_LEADING_BYTE: u32 = 256; +pub const COMMON_LVB_TRAILING_BYTE: u32 = 512; +pub const COMMON_LVB_GRID_HORIZONTAL: u32 = 1024; +pub const COMMON_LVB_GRID_LVERTICAL: u32 = 2048; +pub const COMMON_LVB_GRID_RVERTICAL: u32 = 4096; +pub const COMMON_LVB_REVERSE_VIDEO: u32 = 16384; +pub const COMMON_LVB_UNDERSCORE: u32 = 32768; +pub const COMMON_LVB_SBCSDBCS: u32 = 768; +pub const CONSOLE_NO_SELECTION: u32 = 0; +pub const CONSOLE_SELECTION_IN_PROGRESS: u32 = 1; +pub const CONSOLE_SELECTION_NOT_EMPTY: u32 = 2; +pub const CONSOLE_MOUSE_SELECTION: u32 = 4; +pub const CONSOLE_MOUSE_DOWN: u32 = 8; +pub const CTRL_C_EVENT: u32 = 0; +pub const CTRL_BREAK_EVENT: u32 = 1; +pub const CTRL_CLOSE_EVENT: u32 = 2; +pub const CTRL_LOGOFF_EVENT: u32 = 5; +pub const CTRL_SHUTDOWN_EVENT: u32 = 6; +pub const ENABLE_PROCESSED_INPUT: u32 = 1; +pub const ENABLE_LINE_INPUT: u32 = 2; +pub const ENABLE_ECHO_INPUT: u32 = 4; +pub const ENABLE_WINDOW_INPUT: u32 = 8; +pub const ENABLE_MOUSE_INPUT: u32 = 16; +pub const ENABLE_INSERT_MODE: u32 = 32; +pub const ENABLE_QUICK_EDIT_MODE: u32 = 64; +pub const ENABLE_EXTENDED_FLAGS: u32 = 128; +pub const ENABLE_AUTO_POSITION: u32 = 256; +pub const ENABLE_VIRTUAL_TERMINAL_INPUT: u32 = 512; +pub const ENABLE_PROCESSED_OUTPUT: u32 = 1; +pub const ENABLE_WRAP_AT_EOL_OUTPUT: u32 = 2; +pub const ENABLE_VIRTUAL_TERMINAL_PROCESSING: u32 = 4; +pub const DISABLE_NEWLINE_AUTO_RETURN: u32 = 8; +pub const ENABLE_LVB_GRID_WORLDWIDE: u32 = 16; +pub const CONSOLE_TEXTMODE_BUFFER: u32 = 1; +pub const CONSOLE_FULLSCREEN: u32 = 1; +pub const CONSOLE_FULLSCREEN_HARDWARE: u32 = 2; +pub const CONSOLE_FULLSCREEN_MODE: u32 = 1; +pub const CONSOLE_WINDOWED_MODE: u32 = 2; +pub const VS_VERSION_INFO: u32 = 1; +pub const VS_USER_DEFINED: u32 = 100; +pub const VFFF_ISSHAREDFILE: u32 = 1; +pub const VFF_CURNEDEST: u32 = 1; +pub const VFF_FILEINUSE: u32 = 2; +pub const VFF_BUFFTOOSMALL: u32 = 4; +pub const VIFF_FORCEINSTALL: u32 = 1; +pub const VIFF_DONTDELETEOLD: u32 = 2; +pub const RRF_RT_REG_NONE: u32 = 1; +pub const RRF_RT_REG_SZ: u32 = 2; +pub const RRF_RT_REG_EXPAND_SZ: u32 = 4; +pub const RRF_RT_REG_BINARY: u32 = 8; +pub const RRF_RT_REG_DWORD: u32 = 16; +pub const RRF_RT_REG_MULTI_SZ: u32 = 32; +pub const RRF_RT_REG_QWORD: u32 = 64; +pub const RRF_RT_DWORD: u32 = 24; +pub const RRF_RT_QWORD: u32 = 72; +pub const RRF_RT_ANY: u32 = 65535; +pub const RRF_NOEXPAND: u32 = 268435456; +pub const RRF_ZEROONFAILURE: u32 = 536870912; +pub const REG_PROCESS_APPKEY: u32 = 1; +pub const PROVIDER_KEEPS_VALUE_LENGTH: u32 = 1; +pub const REG_MUI_STRING_TRUNCATE: u32 = 1; +pub const REG_SECURE_CONNECTION: u32 = 1; +pub const SHTDN_REASON_FLAG_COMMENT_REQUIRED: u32 = 16777216; +pub const SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED: u32 = 33554432; +pub const SHTDN_REASON_FLAG_CLEAN_UI: u32 = 67108864; +pub const SHTDN_REASON_FLAG_DIRTY_UI: u32 = 134217728; +pub const SHTDN_REASON_FLAG_USER_DEFINED: u32 = 1073741824; +pub const SHTDN_REASON_FLAG_PLANNED: u32 = 2147483648; +pub const SHTDN_REASON_MAJOR_OTHER: u32 = 0; +pub const SHTDN_REASON_MAJOR_NONE: u32 = 0; +pub const SHTDN_REASON_MAJOR_HARDWARE: u32 = 65536; +pub const SHTDN_REASON_MAJOR_OPERATINGSYSTEM: u32 = 131072; +pub const SHTDN_REASON_MAJOR_SOFTWARE: u32 = 196608; +pub const SHTDN_REASON_MAJOR_APPLICATION: u32 = 262144; +pub const SHTDN_REASON_MAJOR_SYSTEM: u32 = 327680; +pub const SHTDN_REASON_MAJOR_POWER: u32 = 393216; +pub const SHTDN_REASON_MAJOR_LEGACY_API: u32 = 458752; +pub const SHTDN_REASON_MINOR_OTHER: u32 = 0; +pub const SHTDN_REASON_MINOR_NONE: u32 = 255; +pub const SHTDN_REASON_MINOR_MAINTENANCE: u32 = 1; +pub const SHTDN_REASON_MINOR_INSTALLATION: u32 = 2; +pub const SHTDN_REASON_MINOR_UPGRADE: u32 = 3; +pub const SHTDN_REASON_MINOR_RECONFIG: u32 = 4; +pub const SHTDN_REASON_MINOR_HUNG: u32 = 5; +pub const SHTDN_REASON_MINOR_UNSTABLE: u32 = 6; +pub const SHTDN_REASON_MINOR_DISK: u32 = 7; +pub const SHTDN_REASON_MINOR_PROCESSOR: u32 = 8; +pub const SHTDN_REASON_MINOR_NETWORKCARD: u32 = 9; +pub const SHTDN_REASON_MINOR_POWER_SUPPLY: u32 = 10; +pub const SHTDN_REASON_MINOR_CORDUNPLUGGED: u32 = 11; +pub const SHTDN_REASON_MINOR_ENVIRONMENT: u32 = 12; +pub const SHTDN_REASON_MINOR_HARDWARE_DRIVER: u32 = 13; +pub const SHTDN_REASON_MINOR_OTHERDRIVER: u32 = 14; +pub const SHTDN_REASON_MINOR_BLUESCREEN: u32 = 15; +pub const SHTDN_REASON_MINOR_SERVICEPACK: u32 = 16; +pub const SHTDN_REASON_MINOR_HOTFIX: u32 = 17; +pub const SHTDN_REASON_MINOR_SECURITYFIX: u32 = 18; +pub const SHTDN_REASON_MINOR_SECURITY: u32 = 19; +pub const SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY: u32 = 20; +pub const SHTDN_REASON_MINOR_WMI: u32 = 21; +pub const SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL: u32 = 22; +pub const SHTDN_REASON_MINOR_HOTFIX_UNINSTALL: u32 = 23; +pub const SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL: u32 = 24; +pub const SHTDN_REASON_MINOR_MMC: u32 = 25; +pub const SHTDN_REASON_MINOR_SYSTEMRESTORE: u32 = 26; +pub const SHTDN_REASON_MINOR_TERMSRV: u32 = 32; +pub const SHTDN_REASON_MINOR_DC_PROMOTION: u32 = 33; +pub const SHTDN_REASON_MINOR_DC_DEMOTION: u32 = 34; +pub const SHTDN_REASON_UNKNOWN: u32 = 255; +pub const SHTDN_REASON_LEGACY_API: u32 = 2147942400; +pub const SHTDN_REASON_VALID_BIT_MASK: u32 = 3238002687; +pub const PCLEANUI: u32 = 2214592512; +pub const UCLEANUI: u32 = 67108864; +pub const PDIRTYUI: u32 = 2281701376; +pub const UDIRTYUI: u32 = 134217728; +pub const MAX_REASON_NAME_LEN: u32 = 64; +pub const MAX_REASON_DESC_LEN: u32 = 256; +pub const MAX_REASON_BUGID_LEN: u32 = 32; +pub const MAX_REASON_COMMENT_LEN: u32 = 512; +pub const SHUTDOWN_TYPE_LEN: u32 = 32; +pub const POLICY_SHOWREASONUI_NEVER: u32 = 0; +pub const POLICY_SHOWREASONUI_ALWAYS: u32 = 1; +pub const POLICY_SHOWREASONUI_WORKSTATIONONLY: u32 = 2; +pub const POLICY_SHOWREASONUI_SERVERONLY: u32 = 3; +pub const SNAPSHOT_POLICY_NEVER: u32 = 0; +pub const SNAPSHOT_POLICY_ALWAYS: u32 = 1; +pub const SNAPSHOT_POLICY_UNPLANNED: u32 = 2; +pub const MAX_NUM_REASONS: u32 = 256; +pub const REASON_SWINSTALL: u32 = 196610; +pub const REASON_HWINSTALL: u32 = 65538; +pub const REASON_SERVICEHANG: u32 = 196613; +pub const REASON_UNSTABLE: u32 = 327686; +pub const REASON_SWHWRECONF: u32 = 196612; +pub const REASON_OTHER: u32 = 0; +pub const REASON_UNKNOWN: u32 = 255; +pub const REASON_LEGACY_API: u32 = 2147942400; +pub const REASON_PLANNED_FLAG: u32 = 2147483648; +pub const MAX_SHUTDOWN_TIMEOUT: u32 = 315360000; +pub const WNNC_NET_MSNET: u32 = 65536; +pub const WNNC_NET_SMB: u32 = 131072; +pub const WNNC_NET_NETWARE: u32 = 196608; +pub const WNNC_NET_VINES: u32 = 262144; +pub const WNNC_NET_10NET: u32 = 327680; +pub const WNNC_NET_LOCUS: u32 = 393216; +pub const WNNC_NET_SUN_PC_NFS: u32 = 458752; +pub const WNNC_NET_LANSTEP: u32 = 524288; +pub const WNNC_NET_9TILES: u32 = 589824; +pub const WNNC_NET_LANTASTIC: u32 = 655360; +pub const WNNC_NET_AS400: u32 = 720896; +pub const WNNC_NET_FTP_NFS: u32 = 786432; +pub const WNNC_NET_PATHWORKS: u32 = 851968; +pub const WNNC_NET_LIFENET: u32 = 917504; +pub const WNNC_NET_POWERLAN: u32 = 983040; +pub const WNNC_NET_BWNFS: u32 = 1048576; +pub const WNNC_NET_COGENT: u32 = 1114112; +pub const WNNC_NET_FARALLON: u32 = 1179648; +pub const WNNC_NET_APPLETALK: u32 = 1245184; +pub const WNNC_NET_INTERGRAPH: u32 = 1310720; +pub const WNNC_NET_SYMFONET: u32 = 1376256; +pub const WNNC_NET_CLEARCASE: u32 = 1441792; +pub const WNNC_NET_FRONTIER: u32 = 1507328; +pub const WNNC_NET_BMC: u32 = 1572864; +pub const WNNC_NET_DCE: u32 = 1638400; +pub const WNNC_NET_AVID: u32 = 1703936; +pub const WNNC_NET_DOCUSPACE: u32 = 1769472; +pub const WNNC_NET_MANGOSOFT: u32 = 1835008; +pub const WNNC_NET_SERNET: u32 = 1900544; +pub const WNNC_NET_RIVERFRONT1: u32 = 1966080; +pub const WNNC_NET_RIVERFRONT2: u32 = 2031616; +pub const WNNC_NET_DECORB: u32 = 2097152; +pub const WNNC_NET_PROTSTOR: u32 = 2162688; +pub const WNNC_NET_FJ_REDIR: u32 = 2228224; +pub const WNNC_NET_DISTINCT: u32 = 2293760; +pub const WNNC_NET_TWINS: u32 = 2359296; +pub const WNNC_NET_RDR2SAMPLE: u32 = 2424832; +pub const WNNC_NET_CSC: u32 = 2490368; +pub const WNNC_NET_3IN1: u32 = 2555904; +pub const WNNC_NET_EXTENDNET: u32 = 2686976; +pub const WNNC_NET_STAC: u32 = 2752512; +pub const WNNC_NET_FOXBAT: u32 = 2818048; +pub const WNNC_NET_YAHOO: u32 = 2883584; +pub const WNNC_NET_EXIFS: u32 = 2949120; +pub const WNNC_NET_DAV: u32 = 3014656; +pub const WNNC_NET_KNOWARE: u32 = 3080192; +pub const WNNC_NET_OBJECT_DIRE: u32 = 3145728; +pub const WNNC_NET_MASFAX: u32 = 3211264; +pub const WNNC_NET_HOB_NFS: u32 = 3276800; +pub const WNNC_NET_SHIVA: u32 = 3342336; +pub const WNNC_NET_IBMAL: u32 = 3407872; +pub const WNNC_NET_LOCK: u32 = 3473408; +pub const WNNC_NET_TERMSRV: u32 = 3538944; +pub const WNNC_NET_SRT: u32 = 3604480; +pub const WNNC_NET_QUINCY: u32 = 3670016; +pub const WNNC_NET_OPENAFS: u32 = 3735552; +pub const WNNC_NET_AVID1: u32 = 3801088; +pub const WNNC_NET_DFS: u32 = 3866624; +pub const WNNC_NET_KWNP: u32 = 3932160; +pub const WNNC_NET_ZENWORKS: u32 = 3997696; +pub const WNNC_NET_DRIVEONWEB: u32 = 4063232; +pub const WNNC_NET_VMWARE: u32 = 4128768; +pub const WNNC_NET_RSFX: u32 = 4194304; +pub const WNNC_NET_MFILES: u32 = 4259840; +pub const WNNC_NET_MS_NFS: u32 = 4325376; +pub const WNNC_NET_GOOGLE: u32 = 4390912; +pub const WNNC_NET_NDFS: u32 = 4456448; +pub const WNNC_CRED_MANAGER: u32 = 4294901760; +pub const RESOURCE_CONNECTED: u32 = 1; +pub const RESOURCE_GLOBALNET: u32 = 2; +pub const RESOURCE_REMEMBERED: u32 = 3; +pub const RESOURCE_RECENT: u32 = 4; +pub const RESOURCE_CONTEXT: u32 = 5; +pub const RESOURCETYPE_ANY: u32 = 0; +pub const RESOURCETYPE_DISK: u32 = 1; +pub const RESOURCETYPE_PRINT: u32 = 2; +pub const RESOURCETYPE_RESERVED: u32 = 8; +pub const RESOURCETYPE_UNKNOWN: u32 = 4294967295; +pub const RESOURCEUSAGE_CONNECTABLE: u32 = 1; +pub const RESOURCEUSAGE_CONTAINER: u32 = 2; +pub const RESOURCEUSAGE_NOLOCALDEVICE: u32 = 4; +pub const RESOURCEUSAGE_SIBLING: u32 = 8; +pub const RESOURCEUSAGE_ATTACHED: u32 = 16; +pub const RESOURCEUSAGE_ALL: u32 = 19; +pub const RESOURCEUSAGE_RESERVED: u32 = 2147483648; +pub const RESOURCEDISPLAYTYPE_GENERIC: u32 = 0; +pub const RESOURCEDISPLAYTYPE_DOMAIN: u32 = 1; +pub const RESOURCEDISPLAYTYPE_SERVER: u32 = 2; +pub const RESOURCEDISPLAYTYPE_SHARE: u32 = 3; +pub const RESOURCEDISPLAYTYPE_FILE: u32 = 4; +pub const RESOURCEDISPLAYTYPE_GROUP: u32 = 5; +pub const RESOURCEDISPLAYTYPE_NETWORK: u32 = 6; +pub const RESOURCEDISPLAYTYPE_ROOT: u32 = 7; +pub const RESOURCEDISPLAYTYPE_SHAREADMIN: u32 = 8; +pub const RESOURCEDISPLAYTYPE_DIRECTORY: u32 = 9; +pub const RESOURCEDISPLAYTYPE_TREE: u32 = 10; +pub const RESOURCEDISPLAYTYPE_NDSCONTAINER: u32 = 11; +pub const NETPROPERTY_PERSISTENT: u32 = 1; +pub const CONNECT_UPDATE_PROFILE: u32 = 1; +pub const CONNECT_UPDATE_RECENT: u32 = 2; +pub const CONNECT_TEMPORARY: u32 = 4; +pub const CONNECT_INTERACTIVE: u32 = 8; +pub const CONNECT_PROMPT: u32 = 16; +pub const CONNECT_NEED_DRIVE: u32 = 32; +pub const CONNECT_REFCOUNT: u32 = 64; +pub const CONNECT_REDIRECT: u32 = 128; +pub const CONNECT_LOCALDRIVE: u32 = 256; +pub const CONNECT_CURRENT_MEDIA: u32 = 512; +pub const CONNECT_DEFERRED: u32 = 1024; +pub const CONNECT_RESERVED: u32 = 4278190080; +pub const CONNECT_COMMANDLINE: u32 = 2048; +pub const CONNECT_CMD_SAVECRED: u32 = 4096; +pub const CONNDLG_RO_PATH: u32 = 1; +pub const CONNDLG_CONN_POINT: u32 = 2; +pub const CONNDLG_USE_MRU: u32 = 4; +pub const CONNDLG_HIDE_BOX: u32 = 8; +pub const CONNDLG_PERSIST: u32 = 16; +pub const CONNDLG_NOT_PERSIST: u32 = 32; +pub const DISC_UPDATE_PROFILE: u32 = 1; +pub const DISC_NO_FORCE: u32 = 64; +pub const UNIVERSAL_NAME_INFO_LEVEL: u32 = 1; +pub const REMOTE_NAME_INFO_LEVEL: u32 = 2; +pub const WNFMT_MULTILINE: u32 = 1; +pub const WNFMT_ABBREVIATED: u32 = 2; +pub const WNFMT_INENUM: u32 = 16; +pub const WNFMT_CONNECTION: u32 = 32; +pub const NETINFO_DLL16: u32 = 1; +pub const NETINFO_DISKRED: u32 = 4; +pub const NETINFO_PRINTERRED: u32 = 8; +pub const RP_LOGON: u32 = 1; +pub const RP_INIFILE: u32 = 2; +pub const PP_DISPLAYERRORS: u32 = 1; +pub const WNCON_FORNETCARD: u32 = 1; +pub const WNCON_NOTROUTED: u32 = 2; +pub const WNCON_SLOWLINK: u32 = 4; +pub const WNCON_DYNAMIC: u32 = 8; +pub const _STRALIGN_USE_SECURE_CRT: u32 = 0; +pub const SERVICES_ACTIVE_DATABASEW: &'static [u8; 15usize] = b"ServicesActive\0"; +pub const SERVICES_FAILED_DATABASEW: &'static [u8; 15usize] = b"ServicesFailed\0"; +pub const SERVICES_ACTIVE_DATABASEA: &'static [u8; 15usize] = b"ServicesActive\0"; +pub const SERVICES_FAILED_DATABASEA: &'static [u8; 15usize] = b"ServicesFailed\0"; +pub const SC_GROUP_IDENTIFIERW: u8 = 43u8; +pub const SC_GROUP_IDENTIFIERA: u8 = 43u8; +pub const SERVICE_NO_CHANGE: u32 = 4294967295; +pub const SERVICE_ACTIVE: u32 = 1; +pub const SERVICE_INACTIVE: u32 = 2; +pub const SERVICE_STATE_ALL: u32 = 3; +pub const SERVICE_CONTROL_STOP: u32 = 1; +pub const SERVICE_CONTROL_PAUSE: u32 = 2; +pub const SERVICE_CONTROL_CONTINUE: u32 = 3; +pub const SERVICE_CONTROL_INTERROGATE: u32 = 4; +pub const SERVICE_CONTROL_SHUTDOWN: u32 = 5; +pub const SERVICE_CONTROL_PARAMCHANGE: u32 = 6; +pub const SERVICE_CONTROL_NETBINDADD: u32 = 7; +pub const SERVICE_CONTROL_NETBINDREMOVE: u32 = 8; +pub const SERVICE_CONTROL_NETBINDENABLE: u32 = 9; +pub const SERVICE_CONTROL_NETBINDDISABLE: u32 = 10; +pub const SERVICE_CONTROL_DEVICEEVENT: u32 = 11; +pub const SERVICE_CONTROL_HARDWAREPROFILECHANGE: u32 = 12; +pub const SERVICE_CONTROL_POWEREVENT: u32 = 13; +pub const SERVICE_CONTROL_SESSIONCHANGE: u32 = 14; +pub const SERVICE_STOPPED: u32 = 1; +pub const SERVICE_START_PENDING: u32 = 2; +pub const SERVICE_STOP_PENDING: u32 = 3; +pub const SERVICE_RUNNING: u32 = 4; +pub const SERVICE_CONTINUE_PENDING: u32 = 5; +pub const SERVICE_PAUSE_PENDING: u32 = 6; +pub const SERVICE_PAUSED: u32 = 7; +pub const SERVICE_ACCEPT_STOP: u32 = 1; +pub const SERVICE_ACCEPT_PAUSE_CONTINUE: u32 = 2; +pub const SERVICE_ACCEPT_SHUTDOWN: u32 = 4; +pub const SERVICE_ACCEPT_PARAMCHANGE: u32 = 8; +pub const SERVICE_ACCEPT_NETBINDCHANGE: u32 = 16; +pub const SERVICE_ACCEPT_HARDWAREPROFILECHANGE: u32 = 32; +pub const SERVICE_ACCEPT_POWEREVENT: u32 = 64; +pub const SERVICE_ACCEPT_SESSIONCHANGE: u32 = 128; +pub const SC_MANAGER_CONNECT: u32 = 1; +pub const SC_MANAGER_CREATE_SERVICE: u32 = 2; +pub const SC_MANAGER_ENUMERATE_SERVICE: u32 = 4; +pub const SC_MANAGER_LOCK: u32 = 8; +pub const SC_MANAGER_QUERY_LOCK_STATUS: u32 = 16; +pub const SC_MANAGER_MODIFY_BOOT_CONFIG: u32 = 32; +pub const SERVICE_QUERY_CONFIG: u32 = 1; +pub const SERVICE_CHANGE_CONFIG: u32 = 2; +pub const SERVICE_QUERY_STATUS: u32 = 4; +pub const SERVICE_ENUMERATE_DEPENDENTS: u32 = 8; +pub const SERVICE_START: u32 = 16; +pub const SERVICE_STOP: u32 = 32; +pub const SERVICE_PAUSE_CONTINUE: u32 = 64; +pub const SERVICE_INTERROGATE: u32 = 128; +pub const SERVICE_USER_DEFINED_CONTROL: u32 = 256; +pub const SERVICE_RUNS_IN_SYSTEM_PROCESS: u32 = 1; +pub const SERVICE_CONFIG_DESCRIPTION: u32 = 1; +pub const SERVICE_CONFIG_FAILURE_ACTIONS: u32 = 2; +pub const DIALOPTION_BILLING: u32 = 64; +pub const DIALOPTION_QUIET: u32 = 128; +pub const DIALOPTION_DIALTONE: u32 = 256; +pub const MDMVOLFLAG_LOW: u32 = 1; +pub const MDMVOLFLAG_MEDIUM: u32 = 2; +pub const MDMVOLFLAG_HIGH: u32 = 4; +pub const MDMVOL_LOW: u32 = 0; +pub const MDMVOL_MEDIUM: u32 = 1; +pub const MDMVOL_HIGH: u32 = 2; +pub const MDMSPKRFLAG_OFF: u32 = 1; +pub const MDMSPKRFLAG_DIAL: u32 = 2; +pub const MDMSPKRFLAG_ON: u32 = 4; +pub const MDMSPKRFLAG_CALLSETUP: u32 = 8; +pub const MDMSPKR_OFF: u32 = 0; +pub const MDMSPKR_DIAL: u32 = 1; +pub const MDMSPKR_ON: u32 = 2; +pub const MDMSPKR_CALLSETUP: u32 = 3; +pub const MDM_COMPRESSION: u32 = 1; +pub const MDM_ERROR_CONTROL: u32 = 2; +pub const MDM_FORCED_EC: u32 = 4; +pub const MDM_CELLULAR: u32 = 8; +pub const MDM_FLOWCONTROL_HARD: u32 = 16; +pub const MDM_FLOWCONTROL_SOFT: u32 = 32; +pub const MDM_CCITT_OVERRIDE: u32 = 64; +pub const MDM_SPEED_ADJUST: u32 = 128; +pub const MDM_TONE_DIAL: u32 = 256; +pub const MDM_BLIND_DIAL: u32 = 512; +pub const MDM_V23_OVERRIDE: u32 = 1024; +pub const MDM_DIAGNOSTICS: u32 = 2048; +pub const MDM_MASK_BEARERMODE: u32 = 61440; +pub const MDM_SHIFT_BEARERMODE: u32 = 12; +pub const MDM_MASK_PROTOCOLID: u32 = 983040; +pub const MDM_SHIFT_PROTOCOLID: u32 = 16; +pub const MDM_MASK_PROTOCOLDATA: u32 = 267386880; +pub const MDM_SHIFT_PROTOCOLDATA: u32 = 20; +pub const MDM_MASK_PROTOCOLINFO: u32 = 268369920; +pub const MDM_SHIFT_PROTOCOLINFO: u32 = 16; +pub const MDM_MASK_EXTENDEDINFO: u32 = 268431360; +pub const MDM_SHIFT_EXTENDEDINFO: u32 = 12; +pub const MDM_BEARERMODE_ANALOG: u32 = 0; +pub const MDM_BEARERMODE_ISDN: u32 = 1; +pub const MDM_BEARERMODE_GSM: u32 = 2; +pub const MDM_PROTOCOLID_DEFAULT: u32 = 0; +pub const MDM_PROTOCOLID_HDLCPPP: u32 = 1; +pub const MDM_PROTOCOLID_V128: u32 = 2; +pub const MDM_PROTOCOLID_X75: u32 = 3; +pub const MDM_PROTOCOLID_V110: u32 = 4; +pub const MDM_PROTOCOLID_V120: u32 = 5; +pub const MDM_PROTOCOLID_AUTO: u32 = 6; +pub const MDM_PROTOCOLID_ANALOG: u32 = 7; +pub const MDM_PROTOCOLID_GPRS: u32 = 8; +pub const MDM_PROTOCOLID_PIAFS: u32 = 9; +pub const MDM_SHIFT_HDLCPPP_SPEED: u32 = 0; +pub const MDM_MASK_HDLCPPP_SPEED: u32 = 7; +pub const MDM_HDLCPPP_SPEED_DEFAULT: u32 = 0; +pub const MDM_HDLCPPP_SPEED_64K: u32 = 1; +pub const MDM_HDLCPPP_SPEED_56K: u32 = 2; +pub const MDM_SHIFT_HDLCPPP_AUTH: u32 = 3; +pub const MDM_MASK_HDLCPPP_AUTH: u32 = 56; +pub const MDM_HDLCPPP_AUTH_DEFAULT: u32 = 0; +pub const MDM_HDLCPPP_AUTH_NONE: u32 = 1; +pub const MDM_HDLCPPP_AUTH_PAP: u32 = 2; +pub const MDM_HDLCPPP_AUTH_CHAP: u32 = 3; +pub const MDM_HDLCPPP_AUTH_MSCHAP: u32 = 4; +pub const MDM_SHIFT_HDLCPPP_ML: u32 = 6; +pub const MDM_MASK_HDLCPPP_ML: u32 = 192; +pub const MDM_HDLCPPP_ML_DEFAULT: u32 = 0; +pub const MDM_HDLCPPP_ML_NONE: u32 = 1; +pub const MDM_HDLCPPP_ML_2: u32 = 2; +pub const MDM_SHIFT_V120_SPEED: u32 = 0; +pub const MDM_MASK_V120_SPEED: u32 = 7; +pub const MDM_V120_SPEED_DEFAULT: u32 = 0; +pub const MDM_V120_SPEED_64K: u32 = 1; +pub const MDM_V120_SPEED_56K: u32 = 2; +pub const MDM_SHIFT_V120_ML: u32 = 6; +pub const MDM_MASK_V120_ML: u32 = 192; +pub const MDM_V120_ML_DEFAULT: u32 = 0; +pub const MDM_V120_ML_NONE: u32 = 1; +pub const MDM_V120_ML_2: u32 = 2; +pub const MDM_SHIFT_X75_DATA: u32 = 0; +pub const MDM_MASK_X75_DATA: u32 = 7; +pub const MDM_X75_DATA_DEFAULT: u32 = 0; +pub const MDM_X75_DATA_64K: u32 = 1; +pub const MDM_X75_DATA_128K: u32 = 2; +pub const MDM_X75_DATA_T_70: u32 = 3; +pub const MDM_X75_DATA_BTX: u32 = 4; +pub const MDM_SHIFT_V110_SPEED: u32 = 0; +pub const MDM_MASK_V110_SPEED: u32 = 15; +pub const MDM_V110_SPEED_DEFAULT: u32 = 0; +pub const MDM_V110_SPEED_1DOT2K: u32 = 1; +pub const MDM_V110_SPEED_2DOT4K: u32 = 2; +pub const MDM_V110_SPEED_4DOT8K: u32 = 3; +pub const MDM_V110_SPEED_9DOT6K: u32 = 4; +pub const MDM_V110_SPEED_12DOT0K: u32 = 5; +pub const MDM_V110_SPEED_14DOT4K: u32 = 6; +pub const MDM_V110_SPEED_19DOT2K: u32 = 7; +pub const MDM_V110_SPEED_28DOT8K: u32 = 8; +pub const MDM_V110_SPEED_38DOT4K: u32 = 9; +pub const MDM_V110_SPEED_57DOT6K: u32 = 10; +pub const MDM_SHIFT_AUTO_SPEED: u32 = 0; +pub const MDM_MASK_AUTO_SPEED: u32 = 7; +pub const MDM_AUTO_SPEED_DEFAULT: u32 = 0; +pub const MDM_SHIFT_AUTO_ML: u32 = 6; +pub const MDM_MASK_AUTO_ML: u32 = 192; +pub const MDM_AUTO_ML_DEFAULT: u32 = 0; +pub const MDM_AUTO_ML_NONE: u32 = 1; +pub const MDM_AUTO_ML_2: u32 = 2; +pub const MDM_ANALOG_RLP_ON: u32 = 0; +pub const MDM_ANALOG_RLP_OFF: u32 = 1; +pub const MDM_ANALOG_V34: u32 = 2; +pub const MDM_PIAFS_INCOMING: u32 = 0; +pub const MDM_PIAFS_OUTGOING: u32 = 1; +pub const STYLE_DESCRIPTION_SIZE: u32 = 32; +pub const IMEMENUITEM_STRING_SIZE: u32 = 80; +pub const IMC_GETCANDIDATEPOS: u32 = 7; +pub const IMC_SETCANDIDATEPOS: u32 = 8; +pub const IMC_GETCOMPOSITIONFONT: u32 = 9; +pub const IMC_SETCOMPOSITIONFONT: u32 = 10; +pub const IMC_GETCOMPOSITIONWINDOW: u32 = 11; +pub const IMC_SETCOMPOSITIONWINDOW: u32 = 12; +pub const IMC_GETSTATUSWINDOWPOS: u32 = 15; +pub const IMC_SETSTATUSWINDOWPOS: u32 = 16; +pub const IMC_CLOSESTATUSWINDOW: u32 = 33; +pub const IMC_OPENSTATUSWINDOW: u32 = 34; +pub const NI_OPENCANDIDATE: u32 = 16; +pub const NI_CLOSECANDIDATE: u32 = 17; +pub const NI_SELECTCANDIDATESTR: u32 = 18; +pub const NI_CHANGECANDIDATELIST: u32 = 19; +pub const NI_FINALIZECONVERSIONRESULT: u32 = 20; +pub const NI_COMPOSITIONSTR: u32 = 21; +pub const NI_SETCANDIDATE_PAGESTART: u32 = 22; +pub const NI_SETCANDIDATE_PAGESIZE: u32 = 23; +pub const NI_IMEMENUSELECTED: u32 = 24; +pub const ISC_SHOWUICANDIDATEWINDOW: u32 = 1; +pub const ISC_SHOWUICOMPOSITIONWINDOW: u32 = 2147483648; +pub const ISC_SHOWUIGUIDELINE: u32 = 1073741824; +pub const ISC_SHOWUIALLCANDIDATEWINDOW: u32 = 15; +pub const ISC_SHOWUIALL: u32 = 3221225487; +pub const CPS_COMPLETE: u32 = 1; +pub const CPS_CONVERT: u32 = 2; +pub const CPS_REVERT: u32 = 3; +pub const CPS_CANCEL: u32 = 4; +pub const MOD_LEFT: u32 = 32768; +pub const MOD_RIGHT: u32 = 16384; +pub const MOD_ON_KEYUP: u32 = 2048; +pub const MOD_IGNORE_ALL_MODIFIER: u32 = 1024; +pub const IME_CHOTKEY_IME_NONIME_TOGGLE: u32 = 16; +pub const IME_CHOTKEY_SHAPE_TOGGLE: u32 = 17; +pub const IME_CHOTKEY_SYMBOL_TOGGLE: u32 = 18; +pub const IME_JHOTKEY_CLOSE_OPEN: u32 = 48; +pub const IME_KHOTKEY_SHAPE_TOGGLE: u32 = 80; +pub const IME_KHOTKEY_HANJACONVERT: u32 = 81; +pub const IME_KHOTKEY_ENGLISH: u32 = 82; +pub const IME_THOTKEY_IME_NONIME_TOGGLE: u32 = 112; +pub const IME_THOTKEY_SHAPE_TOGGLE: u32 = 113; +pub const IME_THOTKEY_SYMBOL_TOGGLE: u32 = 114; +pub const IME_HOTKEY_DSWITCH_FIRST: u32 = 256; +pub const IME_HOTKEY_DSWITCH_LAST: u32 = 287; +pub const IME_HOTKEY_PRIVATE_FIRST: u32 = 512; +pub const IME_ITHOTKEY_RESEND_RESULTSTR: u32 = 512; +pub const IME_ITHOTKEY_PREVIOUS_COMPOSITION: u32 = 513; +pub const IME_ITHOTKEY_UISTYLE_TOGGLE: u32 = 514; +pub const IME_ITHOTKEY_RECONVERTSTRING: u32 = 515; +pub const IME_HOTKEY_PRIVATE_LAST: u32 = 543; +pub const GCS_COMPREADSTR: u32 = 1; +pub const GCS_COMPREADATTR: u32 = 2; +pub const GCS_COMPREADCLAUSE: u32 = 4; +pub const GCS_COMPSTR: u32 = 8; +pub const GCS_COMPATTR: u32 = 16; +pub const GCS_COMPCLAUSE: u32 = 32; +pub const GCS_CURSORPOS: u32 = 128; +pub const GCS_DELTASTART: u32 = 256; +pub const GCS_RESULTREADSTR: u32 = 512; +pub const GCS_RESULTREADCLAUSE: u32 = 1024; +pub const GCS_RESULTSTR: u32 = 2048; +pub const GCS_RESULTCLAUSE: u32 = 4096; +pub const CS_INSERTCHAR: u32 = 8192; +pub const CS_NOMOVECARET: u32 = 16384; +pub const IMEVER_0310: u32 = 196618; +pub const IMEVER_0400: u32 = 262144; +pub const IME_PROP_AT_CARET: u32 = 65536; +pub const IME_PROP_SPECIAL_UI: u32 = 131072; +pub const IME_PROP_CANDLIST_START_FROM_1: u32 = 262144; +pub const IME_PROP_UNICODE: u32 = 524288; +pub const IME_PROP_COMPLETE_ON_UNSELECT: u32 = 1048576; +pub const UI_CAP_2700: u32 = 1; +pub const UI_CAP_ROT90: u32 = 2; +pub const UI_CAP_ROTANY: u32 = 4; +pub const SCS_CAP_COMPSTR: u32 = 1; +pub const SCS_CAP_MAKEREAD: u32 = 2; +pub const SCS_CAP_SETRECONVERTSTRING: u32 = 4; +pub const SELECT_CAP_CONVERSION: u32 = 1; +pub const SELECT_CAP_SENTENCE: u32 = 2; +pub const GGL_LEVEL: u32 = 1; +pub const GGL_INDEX: u32 = 2; +pub const GGL_STRING: u32 = 3; +pub const GGL_PRIVATE: u32 = 4; +pub const GL_LEVEL_NOGUIDELINE: u32 = 0; +pub const GL_LEVEL_FATAL: u32 = 1; +pub const GL_LEVEL_ERROR: u32 = 2; +pub const GL_LEVEL_WARNING: u32 = 3; +pub const GL_LEVEL_INFORMATION: u32 = 4; +pub const GL_ID_UNKNOWN: u32 = 0; +pub const GL_ID_NOMODULE: u32 = 1; +pub const GL_ID_NODICTIONARY: u32 = 16; +pub const GL_ID_CANNOTSAVE: u32 = 17; +pub const GL_ID_NOCONVERT: u32 = 32; +pub const GL_ID_TYPINGERROR: u32 = 33; +pub const GL_ID_TOOMANYSTROKE: u32 = 34; +pub const GL_ID_READINGCONFLICT: u32 = 35; +pub const GL_ID_INPUTREADING: u32 = 36; +pub const GL_ID_INPUTRADICAL: u32 = 37; +pub const GL_ID_INPUTCODE: u32 = 38; +pub const GL_ID_INPUTSYMBOL: u32 = 39; +pub const GL_ID_CHOOSECANDIDATE: u32 = 40; +pub const GL_ID_REVERSECONVERSION: u32 = 41; +pub const GL_ID_PRIVATE_FIRST: u32 = 32768; +pub const GL_ID_PRIVATE_LAST: u32 = 65535; +pub const IGP_PROPERTY: u32 = 4; +pub const IGP_CONVERSION: u32 = 8; +pub const IGP_SENTENCE: u32 = 12; +pub const IGP_UI: u32 = 16; +pub const IGP_SETCOMPSTR: u32 = 20; +pub const IGP_SELECT: u32 = 24; +pub const SCS_SETSTR: u32 = 9; +pub const SCS_CHANGEATTR: u32 = 18; +pub const SCS_CHANGECLAUSE: u32 = 36; +pub const SCS_SETRECONVERTSTRING: u32 = 65536; +pub const SCS_QUERYRECONVERTSTRING: u32 = 131072; +pub const ATTR_INPUT: u32 = 0; +pub const ATTR_TARGET_CONVERTED: u32 = 1; +pub const ATTR_CONVERTED: u32 = 2; +pub const ATTR_TARGET_NOTCONVERTED: u32 = 3; +pub const ATTR_INPUT_ERROR: u32 = 4; +pub const ATTR_FIXEDCONVERTED: u32 = 5; +pub const CFS_DEFAULT: u32 = 0; +pub const CFS_RECT: u32 = 1; +pub const CFS_POINT: u32 = 2; +pub const CFS_FORCE_POSITION: u32 = 32; +pub const CFS_CANDIDATEPOS: u32 = 64; +pub const CFS_EXCLUDE: u32 = 128; +pub const GCL_CONVERSION: u32 = 1; +pub const GCL_REVERSECONVERSION: u32 = 2; +pub const GCL_REVERSE_LENGTH: u32 = 3; +pub const IME_CMODE_ALPHANUMERIC: u32 = 0; +pub const IME_CMODE_NATIVE: u32 = 1; +pub const IME_CMODE_CHINESE: u32 = 1; +pub const IME_CMODE_HANGEUL: u32 = 1; +pub const IME_CMODE_HANGUL: u32 = 1; +pub const IME_CMODE_JAPANESE: u32 = 1; +pub const IME_CMODE_KATAKANA: u32 = 2; +pub const IME_CMODE_LANGUAGE: u32 = 3; +pub const IME_CMODE_FULLSHAPE: u32 = 8; +pub const IME_CMODE_ROMAN: u32 = 16; +pub const IME_CMODE_CHARCODE: u32 = 32; +pub const IME_CMODE_HANJACONVERT: u32 = 64; +pub const IME_CMODE_SOFTKBD: u32 = 128; +pub const IME_CMODE_NOCONVERSION: u32 = 256; +pub const IME_CMODE_EUDC: u32 = 512; +pub const IME_CMODE_SYMBOL: u32 = 1024; +pub const IME_CMODE_FIXED: u32 = 2048; +pub const IME_CMODE_RESERVED: u32 = 4026531840; +pub const IME_SMODE_NONE: u32 = 0; +pub const IME_SMODE_PLAURALCLAUSE: u32 = 1; +pub const IME_SMODE_SINGLECONVERT: u32 = 2; +pub const IME_SMODE_AUTOMATIC: u32 = 4; +pub const IME_SMODE_PHRASEPREDICT: u32 = 8; +pub const IME_SMODE_CONVERSATION: u32 = 16; +pub const IME_SMODE_RESERVED: u32 = 61440; +pub const IME_CAND_UNKNOWN: u32 = 0; +pub const IME_CAND_READ: u32 = 1; +pub const IME_CAND_CODE: u32 = 2; +pub const IME_CAND_MEANING: u32 = 3; +pub const IME_CAND_RADICAL: u32 = 4; +pub const IME_CAND_STROKE: u32 = 5; +pub const IMN_CLOSESTATUSWINDOW: u32 = 1; +pub const IMN_OPENSTATUSWINDOW: u32 = 2; +pub const IMN_CHANGECANDIDATE: u32 = 3; +pub const IMN_CLOSECANDIDATE: u32 = 4; +pub const IMN_OPENCANDIDATE: u32 = 5; +pub const IMN_SETCONVERSIONMODE: u32 = 6; +pub const IMN_SETSENTENCEMODE: u32 = 7; +pub const IMN_SETOPENSTATUS: u32 = 8; +pub const IMN_SETCANDIDATEPOS: u32 = 9; +pub const IMN_SETCOMPOSITIONFONT: u32 = 10; +pub const IMN_SETCOMPOSITIONWINDOW: u32 = 11; +pub const IMN_SETSTATUSWINDOWPOS: u32 = 12; +pub const IMN_GUIDELINE: u32 = 13; +pub const IMN_PRIVATE: u32 = 14; +pub const IMR_COMPOSITIONWINDOW: u32 = 1; +pub const IMR_CANDIDATEWINDOW: u32 = 2; +pub const IMR_COMPOSITIONFONT: u32 = 3; +pub const IMR_RECONVERTSTRING: u32 = 4; +pub const IMR_CONFIRMRECONVERTSTRING: u32 = 5; +pub const IMR_QUERYCHARPOSITION: u32 = 6; +pub const IMR_DOCUMENTFEED: u32 = 7; +pub const IMM_ERROR_NODATA: i32 = -1; +pub const IMM_ERROR_GENERAL: i32 = -2; +pub const IME_CONFIG_GENERAL: u32 = 1; +pub const IME_CONFIG_REGISTERWORD: u32 = 2; +pub const IME_CONFIG_SELECTDICTIONARY: u32 = 3; +pub const IME_ESC_QUERY_SUPPORT: u32 = 3; +pub const IME_ESC_RESERVED_FIRST: u32 = 4; +pub const IME_ESC_RESERVED_LAST: u32 = 2047; +pub const IME_ESC_PRIVATE_FIRST: u32 = 2048; +pub const IME_ESC_PRIVATE_LAST: u32 = 4095; +pub const IME_ESC_SEQUENCE_TO_INTERNAL: u32 = 4097; +pub const IME_ESC_GET_EUDC_DICTIONARY: u32 = 4099; +pub const IME_ESC_SET_EUDC_DICTIONARY: u32 = 4100; +pub const IME_ESC_MAX_KEY: u32 = 4101; +pub const IME_ESC_IME_NAME: u32 = 4102; +pub const IME_ESC_SYNC_HOTKEY: u32 = 4103; +pub const IME_ESC_HANJA_MODE: u32 = 4104; +pub const IME_ESC_AUTOMATA: u32 = 4105; +pub const IME_ESC_PRIVATE_HOTKEY: u32 = 4106; +pub const IME_ESC_GETHELPFILENAME: u32 = 4107; +pub const IME_REGWORD_STYLE_EUDC: u32 = 1; +pub const IME_REGWORD_STYLE_USER_FIRST: u32 = 2147483648; +pub const IME_REGWORD_STYLE_USER_LAST: u32 = 4294967295; +pub const IACE_CHILDREN: u32 = 1; +pub const IACE_DEFAULT: u32 = 16; +pub const IACE_IGNORENOCONTEXT: u32 = 32; +pub const IGIMIF_RIGHTMENU: u32 = 1; +pub const IGIMII_CMODE: u32 = 1; +pub const IGIMII_SMODE: u32 = 2; +pub const IGIMII_CONFIGURE: u32 = 4; +pub const IGIMII_TOOLS: u32 = 8; +pub const IGIMII_HELP: u32 = 16; +pub const IGIMII_OTHER: u32 = 32; +pub const IGIMII_INPUTTOOLS: u32 = 64; +pub const IMFT_RADIOCHECK: u32 = 1; +pub const IMFT_SEPARATOR: u32 = 2; +pub const IMFT_SUBMENU: u32 = 4; +pub const SOFTKEYBOARD_TYPE_T1: u32 = 1; +pub const SOFTKEYBOARD_TYPE_C1: u32 = 2; +pub const WM_CTLCOLOR: u32 = 25; +pub const ABM_NEW: u32 = 0; +pub const ABM_REMOVE: u32 = 1; +pub const ABM_QUERYPOS: u32 = 2; +pub const ABM_SETPOS: u32 = 3; +pub const ABM_GETSTATE: u32 = 4; +pub const ABM_GETTASKBARPOS: u32 = 5; +pub const ABM_ACTIVATE: u32 = 6; +pub const ABM_GETAUTOHIDEBAR: u32 = 7; +pub const ABM_SETAUTOHIDEBAR: u32 = 8; +pub const ABM_WINDOWPOSCHANGED: u32 = 9; +pub const ABM_SETSTATE: u32 = 10; +pub const ABN_STATECHANGE: u32 = 0; +pub const ABN_POSCHANGED: u32 = 1; +pub const ABN_FULLSCREENAPP: u32 = 2; +pub const ABN_WINDOWARRANGE: u32 = 3; +pub const ABS_AUTOHIDE: u32 = 1; +pub const ABS_ALWAYSONTOP: u32 = 2; +pub const ABE_LEFT: u32 = 0; +pub const ABE_TOP: u32 = 1; +pub const ABE_RIGHT: u32 = 2; +pub const ABE_BOTTOM: u32 = 3; +pub const FO_MOVE: u32 = 1; +pub const FO_COPY: u32 = 2; +pub const FO_DELETE: u32 = 3; +pub const FO_RENAME: u32 = 4; +pub const FOF_MULTIDESTFILES: u32 = 1; +pub const FOF_CONFIRMMOUSE: u32 = 2; +pub const FOF_SILENT: u32 = 4; +pub const FOF_RENAMEONCOLLISION: u32 = 8; +pub const FOF_NOCONFIRMATION: u32 = 16; +pub const FOF_WANTMAPPINGHANDLE: u32 = 32; +pub const FOF_ALLOWUNDO: u32 = 64; +pub const FOF_FILESONLY: u32 = 128; +pub const FOF_SIMPLEPROGRESS: u32 = 256; +pub const FOF_NOCONFIRMMKDIR: u32 = 512; +pub const FOF_NOERRORUI: u32 = 1024; +pub const FOF_NOCOPYSECURITYATTRIBS: u32 = 2048; +pub const FOF_NORECURSION: u32 = 4096; +pub const FOF_NO_CONNECTED_ELEMENTS: u32 = 8192; +pub const FOF_WANTNUKEWARNING: u32 = 16384; +pub const FOF_NORECURSEREPARSE: u32 = 32768; +pub const FOF_NO_UI: u32 = 1556; +pub const PO_DELETE: u32 = 19; +pub const PO_RENAME: u32 = 20; +pub const PO_PORTCHANGE: u32 = 32; +pub const PO_REN_PORT: u32 = 52; +pub const SE_ERR_FNF: u32 = 2; +pub const SE_ERR_PNF: u32 = 3; +pub const SE_ERR_ACCESSDENIED: u32 = 5; +pub const SE_ERR_OOM: u32 = 8; +pub const SE_ERR_DLLNOTFOUND: u32 = 32; +pub const SE_ERR_SHARE: u32 = 26; +pub const SE_ERR_ASSOCINCOMPLETE: u32 = 27; +pub const SE_ERR_DDETIMEOUT: u32 = 28; +pub const SE_ERR_DDEFAIL: u32 = 29; +pub const SE_ERR_DDEBUSY: u32 = 30; +pub const SE_ERR_NOASSOC: u32 = 31; +pub const SEE_MASK_DEFAULT: u32 = 0; +pub const SEE_MASK_CLASSNAME: u32 = 1; +pub const SEE_MASK_CLASSKEY: u32 = 3; +pub const SEE_MASK_IDLIST: u32 = 4; +pub const SEE_MASK_INVOKEIDLIST: u32 = 12; +pub const SEE_MASK_ICON: u32 = 16; +pub const SEE_MASK_HOTKEY: u32 = 32; +pub const SEE_MASK_NOCLOSEPROCESS: u32 = 64; +pub const SEE_MASK_CONNECTNETDRV: u32 = 128; +pub const SEE_MASK_NOASYNC: u32 = 256; +pub const SEE_MASK_FLAG_DDEWAIT: u32 = 256; +pub const SEE_MASK_DOENVSUBST: u32 = 512; +pub const SEE_MASK_FLAG_NO_UI: u32 = 1024; +pub const SEE_MASK_UNICODE: u32 = 16384; +pub const SEE_MASK_NO_CONSOLE: u32 = 32768; +pub const SEE_MASK_ASYNCOK: u32 = 1048576; +pub const SEE_MASK_HMONITOR: u32 = 2097152; +pub const SEE_MASK_NOZONECHECKS: u32 = 8388608; +pub const SEE_MASK_NOQUERYCLASSSTORE: u32 = 16777216; +pub const SEE_MASK_WAITFORINPUTIDLE: u32 = 33554432; +pub const SEE_MASK_FLAG_LOG_USAGE: u32 = 67108864; +pub const SHERB_NOCONFIRMATION: u32 = 1; +pub const SHERB_NOPROGRESSUI: u32 = 2; +pub const SHERB_NOSOUND: u32 = 4; +pub const NIN_SELECT: u32 = 1024; +pub const NINF_KEY: u32 = 1; +pub const NIN_KEYSELECT: u32 = 1025; +pub const NIN_BALLOONSHOW: u32 = 1026; +pub const NIN_BALLOONHIDE: u32 = 1027; +pub const NIN_BALLOONTIMEOUT: u32 = 1028; +pub const NIN_BALLOONUSERCLICK: u32 = 1029; +pub const NIM_ADD: u32 = 0; +pub const NIM_MODIFY: u32 = 1; +pub const NIM_DELETE: u32 = 2; +pub const NIM_SETFOCUS: u32 = 3; +pub const NIM_SETVERSION: u32 = 4; +pub const NOTIFYICON_VERSION: u32 = 3; +pub const NIF_MESSAGE: u32 = 1; +pub const NIF_ICON: u32 = 2; +pub const NIF_TIP: u32 = 4; +pub const NIF_STATE: u32 = 8; +pub const NIF_INFO: u32 = 16; +pub const NIF_GUID: u32 = 32; +pub const NIS_HIDDEN: u32 = 1; +pub const NIS_SHAREDICON: u32 = 2; +pub const NIIF_NONE: u32 = 0; +pub const NIIF_INFO: u32 = 1; +pub const NIIF_WARNING: u32 = 2; +pub const NIIF_ERROR: u32 = 3; +pub const NIIF_USER: u32 = 4; +pub const NIIF_ICON_MASK: u32 = 15; +pub const NIIF_NOSOUND: u32 = 16; +pub const SHGFI_ICON: u32 = 256; +pub const SHGFI_DISPLAYNAME: u32 = 512; +pub const SHGFI_TYPENAME: u32 = 1024; +pub const SHGFI_ATTRIBUTES: u32 = 2048; +pub const SHGFI_ICONLOCATION: u32 = 4096; +pub const SHGFI_EXETYPE: u32 = 8192; +pub const SHGFI_SYSICONINDEX: u32 = 16384; +pub const SHGFI_LINKOVERLAY: u32 = 32768; +pub const SHGFI_SELECTED: u32 = 65536; +pub const SHGFI_ATTR_SPECIFIED: u32 = 131072; +pub const SHGFI_LARGEICON: u32 = 0; +pub const SHGFI_SMALLICON: u32 = 1; +pub const SHGFI_OPENICON: u32 = 2; +pub const SHGFI_SHELLICONSIZE: u32 = 4; +pub const SHGFI_PIDL: u32 = 8; +pub const SHGFI_USEFILEATTRIBUTES: u32 = 16; +pub const SHGFI_ADDOVERLAYS: u32 = 32; +pub const SHGFI_OVERLAYINDEX: u32 = 64; +pub const SHGNLI_PIDL: u32 = 1; +pub const SHGNLI_PREFIXNAME: u32 = 2; +pub const SHGNLI_NOUNIQUE: u32 = 4; +pub const SHGNLI_NOLNK: u32 = 8; +pub const SHGNLI_NOLOCNAME: u32 = 16; +pub const PRINTACTION_OPEN: u32 = 0; +pub const PRINTACTION_PROPERTIES: u32 = 1; +pub const PRINTACTION_NETINSTALL: u32 = 2; +pub const PRINTACTION_NETINSTALLLINK: u32 = 3; +pub const PRINTACTION_TESTPAGE: u32 = 4; +pub const PRINTACTION_OPENNETPRN: u32 = 5; +pub const PRINTACTION_DOCUMENTDEFAULTS: u32 = 6; +pub const PRINTACTION_SERVERPROPERTIES: u32 = 7; +pub const OFFLINE_STATUS_LOCAL: u32 = 1; +pub const OFFLINE_STATUS_REMOTE: u32 = 2; +pub const OFFLINE_STATUS_INCOMPLETE: u32 = 4; +pub const SHIL_LARGE: u32 = 0; +pub const SHIL_SMALL: u32 = 1; +pub const SHIL_EXTRALARGE: u32 = 2; +pub const SHIL_SYSSMALL: u32 = 3; +pub const SHIL_LAST: u32 = 3; +pub const WM_MOUSEHWHEEL: u32 = 526; +pub const WGL_NUMBER_PIXEL_FORMATS_ARB: u32 = 8192; +pub const WGL_SUPPORT_OPENGL_ARB: u32 = 8208; +pub const WGL_DRAW_TO_WINDOW_ARB: u32 = 8193; +pub const WGL_PIXEL_TYPE_ARB: u32 = 8211; +pub const WGL_TYPE_RGBA_ARB: u32 = 8235; +pub const WGL_ACCELERATION_ARB: u32 = 8195; +pub const WGL_NO_ACCELERATION_ARB: u32 = 8229; +pub const WGL_RED_BITS_ARB: u32 = 8213; +pub const WGL_RED_SHIFT_ARB: u32 = 8214; +pub const WGL_GREEN_BITS_ARB: u32 = 8215; +pub const WGL_GREEN_SHIFT_ARB: u32 = 8216; +pub const WGL_BLUE_BITS_ARB: u32 = 8217; +pub const WGL_BLUE_SHIFT_ARB: u32 = 8218; +pub const WGL_ALPHA_BITS_ARB: u32 = 8219; +pub const WGL_ALPHA_SHIFT_ARB: u32 = 8220; +pub const WGL_ACCUM_BITS_ARB: u32 = 8221; +pub const WGL_ACCUM_RED_BITS_ARB: u32 = 8222; +pub const WGL_ACCUM_GREEN_BITS_ARB: u32 = 8223; +pub const WGL_ACCUM_BLUE_BITS_ARB: u32 = 8224; +pub const WGL_ACCUM_ALPHA_BITS_ARB: u32 = 8225; +pub const WGL_DEPTH_BITS_ARB: u32 = 8226; +pub const WGL_STENCIL_BITS_ARB: u32 = 8227; +pub const WGL_AUX_BUFFERS_ARB: u32 = 8228; +pub const WGL_STEREO_ARB: u32 = 8210; +pub const WGL_DOUBLE_BUFFER_ARB: u32 = 8209; +pub const WGL_SAMPLES_ARB: u32 = 8258; +pub const WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB: u32 = 8361; +pub const WGL_CONTEXT_DEBUG_BIT_ARB: u32 = 1; +pub const WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB: u32 = 2; +pub const WGL_CONTEXT_PROFILE_MASK_ARB: u32 = 37158; +pub const WGL_CONTEXT_CORE_PROFILE_BIT_ARB: u32 = 1; +pub const WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: u32 = 2; +pub const WGL_CONTEXT_MAJOR_VERSION_ARB: u32 = 8337; +pub const WGL_CONTEXT_MINOR_VERSION_ARB: u32 = 8338; +pub const WGL_CONTEXT_FLAGS_ARB: u32 = 8340; +pub const WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB: u32 = 4; +pub const WGL_LOSE_CONTEXT_ON_RESET_ARB: u32 = 33362; +pub const WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB: u32 = 33366; +pub const WGL_NO_RESET_NOTIFICATION_ARB: u32 = 33377; +pub const WGL_CONTEXT_RELEASE_BEHAVIOR_ARB: u32 = 8343; +pub const WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB: u32 = 0; +pub const WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB: u32 = 8344; +pub const WGL_COLORSPACE_EXT: u32 = 12445; +pub const WGL_COLORSPACE_SRGB_EXT: u32 = 12425; +pub const ERROR_INVALID_VERSION_ARB: u32 = 8341; +pub const ERROR_INVALID_PROFILE_ARB: u32 = 8342; +pub const ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB: u32 = 8276; +pub const __gl_h_: u32 = 1; +pub const __gl32_h_: u32 = 1; +pub const __gl31_h_: u32 = 1; +pub const __GL_H__: u32 = 1; +pub const __glext_h_: u32 = 1; +pub const __GLEXT_H_: u32 = 1; +pub const __gltypes_h_: u32 = 1; +pub const __glcorearb_h_: u32 = 1; +pub const __gl_glcorearb_h_: u32 = 1; +pub const GL_INT_2_10_10_10_REV: u32 = 36255; +pub const GL_R32F: u32 = 33326; +pub const GL_PROGRAM_POINT_SIZE: u32 = 34370; +pub const GL_STENCIL_ATTACHMENT: u32 = 36128; +pub const GL_DEPTH_ATTACHMENT: u32 = 36096; +pub const GL_COLOR_ATTACHMENT2: u32 = 36066; +pub const GL_COLOR_ATTACHMENT0: u32 = 36064; +pub const GL_R16F: u32 = 33325; +pub const GL_COLOR_ATTACHMENT22: u32 = 36086; +pub const GL_DRAW_FRAMEBUFFER: u32 = 36009; +pub const GL_FRAMEBUFFER_COMPLETE: u32 = 36053; +pub const GL_NUM_EXTENSIONS: u32 = 33309; +pub const GL_INFO_LOG_LENGTH: u32 = 35716; +pub const GL_VERTEX_SHADER: u32 = 35633; +pub const GL_INCR: u32 = 7682; +pub const GL_DYNAMIC_DRAW: u32 = 35048; +pub const GL_STATIC_DRAW: u32 = 35044; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Z: u32 = 34073; +pub const GL_TEXTURE_CUBE_MAP: u32 = 34067; +pub const GL_FUNC_SUBTRACT: u32 = 32778; +pub const GL_FUNC_REVERSE_SUBTRACT: u32 = 32779; +pub const GL_CONSTANT_COLOR: u32 = 32769; +pub const GL_DECR_WRAP: u32 = 34056; +pub const GL_R8: u32 = 33321; +pub const GL_LINEAR_MIPMAP_LINEAR: u32 = 9987; +pub const GL_ELEMENT_ARRAY_BUFFER: u32 = 34963; +pub const GL_SHORT: u32 = 5122; +pub const GL_DEPTH_TEST: u32 = 2929; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: u32 = 34072; +pub const GL_LINK_STATUS: u32 = 35714; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_Y: u32 = 34071; +pub const GL_SAMPLE_ALPHA_TO_COVERAGE: u32 = 32926; +pub const GL_RGBA16F: u32 = 34842; +pub const GL_CONSTANT_ALPHA: u32 = 32771; +pub const GL_READ_FRAMEBUFFER: u32 = 36008; +pub const GL_TEXTURE0: u32 = 33984; +pub const GL_TEXTURE_MIN_LOD: u32 = 33082; +pub const GL_CLAMP_TO_EDGE: u32 = 33071; +pub const GL_UNSIGNED_SHORT_5_6_5: u32 = 33635; +pub const GL_TEXTURE_WRAP_R: u32 = 32882; +pub const GL_UNSIGNED_SHORT_5_5_5_1: u32 = 32820; +pub const GL_NEAREST_MIPMAP_NEAREST: u32 = 9984; +pub const GL_UNSIGNED_SHORT_4_4_4_4: u32 = 32819; +pub const GL_SRC_ALPHA_SATURATE: u32 = 776; +pub const GL_STREAM_DRAW: u32 = 35040; +pub const GL_ONE: u32 = 1; +pub const GL_NEAREST_MIPMAP_LINEAR: u32 = 9986; +pub const GL_RGB10_A2: u32 = 32857; +pub const GL_RGBA8: u32 = 32856; +pub const GL_COLOR_ATTACHMENT1: u32 = 36065; +pub const GL_RGBA4: u32 = 32854; +pub const GL_RGB8: u32 = 32849; +pub const GL_ARRAY_BUFFER: u32 = 34962; +pub const GL_STENCIL: u32 = 6146; +pub const GL_TEXTURE_2D: u32 = 3553; +pub const GL_DEPTH: u32 = 6145; +pub const GL_FRONT: u32 = 1028; +pub const GL_STENCIL_BUFFER_BIT: u32 = 1024; +pub const GL_REPEAT: u32 = 10497; +pub const GL_RGBA: u32 = 6408; +pub const GL_TEXTURE_CUBE_MAP_POSITIVE_X: u32 = 34069; +pub const GL_DECR: u32 = 7683; +pub const GL_FRAGMENT_SHADER: u32 = 35632; +pub const GL_FLOAT: u32 = 5126; +pub const GL_TEXTURE_MAX_LOD: u32 = 33083; +pub const GL_DEPTH_COMPONENT: u32 = 6402; +pub const GL_ONE_MINUS_DST_ALPHA: u32 = 773; +pub const GL_COLOR: u32 = 6144; +pub const GL_TEXTURE_2D_ARRAY: u32 = 35866; +pub const GL_TRIANGLES: u32 = 4; +pub const GL_UNSIGNED_BYTE: u32 = 5121; +pub const GL_TEXTURE_MAG_FILTER: u32 = 10240; +pub const GL_ONE_MINUS_CONSTANT_ALPHA: u32 = 32772; +pub const GL_NONE: u32 = 0; +pub const GL_SRC_COLOR: u32 = 768; +pub const GL_BYTE: u32 = 5120; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: u32 = 34074; +pub const GL_LINE_STRIP: u32 = 3; +pub const GL_TEXTURE_3D: u32 = 32879; +pub const GL_CW: u32 = 2304; +pub const GL_LINEAR: u32 = 9729; +pub const GL_RENDERBUFFER: u32 = 36161; +pub const GL_GEQUAL: u32 = 518; +pub const GL_COLOR_BUFFER_BIT: u32 = 16384; +pub const GL_RGBA32F: u32 = 34836; +pub const GL_BLEND: u32 = 3042; +pub const GL_ONE_MINUS_SRC_ALPHA: u32 = 771; +pub const GL_ONE_MINUS_CONSTANT_COLOR: u32 = 32770; +pub const GL_TEXTURE_WRAP_T: u32 = 10243; +pub const GL_TEXTURE_WRAP_S: u32 = 10242; +pub const GL_TEXTURE_MIN_FILTER: u32 = 10241; +pub const GL_LINEAR_MIPMAP_NEAREST: u32 = 9985; +pub const GL_EXTENSIONS: u32 = 7939; +pub const GL_NO_ERROR: u32 = 0; +pub const GL_REPLACE: u32 = 7681; +pub const GL_KEEP: u32 = 7680; +pub const GL_CCW: u32 = 2305; +pub const GL_TEXTURE_CUBE_MAP_NEGATIVE_X: u32 = 34070; +pub const GL_RGB: u32 = 6407; +pub const GL_TRIANGLE_STRIP: u32 = 5; +pub const GL_FALSE: u32 = 0; +pub const GL_ZERO: u32 = 0; +pub const GL_CULL_FACE: u32 = 2884; +pub const GL_INVERT: u32 = 5386; +pub const GL_INT: u32 = 5124; +pub const GL_UNSIGNED_INT: u32 = 5125; +pub const GL_UNSIGNED_SHORT: u32 = 5123; +pub const GL_NEAREST: u32 = 9728; +pub const GL_SCISSOR_TEST: u32 = 3089; +pub const GL_LEQUAL: u32 = 515; +pub const GL_STENCIL_TEST: u32 = 2960; +pub const GL_DITHER: u32 = 3024; +pub const GL_DEPTH_COMPONENT16: u32 = 33189; +pub const GL_EQUAL: u32 = 514; +pub const GL_FRAMEBUFFER: u32 = 36160; +pub const GL_RGB5: u32 = 32848; +pub const GL_LINES: u32 = 1; +pub const GL_DEPTH_BUFFER_BIT: u32 = 256; +pub const GL_SRC_ALPHA: u32 = 770; +pub const GL_INCR_WRAP: u32 = 34055; +pub const GL_LESS: u32 = 513; +pub const GL_MULTISAMPLE: u32 = 32925; +pub const GL_FRAMEBUFFER_BINDING: u32 = 36006; +pub const GL_BACK: u32 = 1029; +pub const GL_ALWAYS: u32 = 519; +pub const GL_FUNC_ADD: u32 = 32774; +pub const GL_ONE_MINUS_DST_COLOR: u32 = 775; +pub const GL_NOTEQUAL: u32 = 517; +pub const GL_DST_COLOR: u32 = 774; +pub const GL_COMPILE_STATUS: u32 = 35713; +pub const GL_RED: u32 = 6403; +pub const GL_COLOR_ATTACHMENT3: u32 = 36067; +pub const GL_DST_ALPHA: u32 = 772; +pub const GL_RGB5_A1: u32 = 32855; +pub const GL_GREATER: u32 = 516; +pub const GL_POLYGON_OFFSET_FILL: u32 = 32823; +pub const GL_TRUE: u32 = 1; +pub const GL_NEVER: u32 = 512; +pub const GL_POINTS: u32 = 0; +pub const GL_ONE_MINUS_SRC_COLOR: u32 = 769; +pub const GL_MIRRORED_REPEAT: u32 = 33648; +pub const GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: u32 = 35661; +pub const GL_R11F_G11F_B10F: u32 = 35898; +pub const GL_UNSIGNED_INT_10F_11F_11F_REV: u32 = 35899; +pub const GL_RGBA32UI: u32 = 36208; +pub const GL_RGB32UI: u32 = 36209; +pub const GL_RGBA16UI: u32 = 36214; +pub const GL_RGB16UI: u32 = 36215; +pub const GL_RGBA8UI: u32 = 36220; +pub const GL_RGB8UI: u32 = 36221; +pub const GL_RGBA32I: u32 = 36226; +pub const GL_RGB32I: u32 = 36227; +pub const GL_RGBA16I: u32 = 36232; +pub const GL_RGB16I: u32 = 36233; +pub const GL_RGBA8I: u32 = 36238; +pub const GL_RGB8I: u32 = 36239; +pub const GL_RED_INTEGER: u32 = 36244; +pub const GL_RG: u32 = 33319; +pub const GL_RG_INTEGER: u32 = 33320; +pub const GL_R16: u32 = 33322; +pub const GL_RG8: u32 = 33323; +pub const GL_RG16: u32 = 33324; +pub const GL_RG16F: u32 = 33327; +pub const GL_RG32F: u32 = 33328; +pub const GL_R8I: u32 = 33329; +pub const GL_R8UI: u32 = 33330; +pub const GL_R16I: u32 = 33331; +pub const GL_R16UI: u32 = 33332; +pub const GL_R32I: u32 = 33333; +pub const GL_R32UI: u32 = 33334; +pub const GL_RG8I: u32 = 33335; +pub const GL_RG8UI: u32 = 33336; +pub const GL_RG16I: u32 = 33337; +pub const GL_RG16UI: u32 = 33338; +pub const GL_RG32I: u32 = 33339; +pub const GL_RG32UI: u32 = 33340; +pub const GL_RGBA_INTEGER: u32 = 36249; +pub const GL_R8_SNORM: u32 = 36756; +pub const GL_RG8_SNORM: u32 = 36757; +pub const GL_RGB8_SNORM: u32 = 36758; +pub const GL_RGBA8_SNORM: u32 = 36759; +pub const GL_R16_SNORM: u32 = 36760; +pub const GL_RG16_SNORM: u32 = 36761; +pub const GL_RGB16_SNORM: u32 = 36762; +pub const GL_RGBA16_SNORM: u32 = 36763; +pub const GL_RGBA16: u32 = 32859; +pub const GL_MAX_TEXTURE_SIZE: u32 = 3379; +pub const GL_MAX_CUBE_MAP_TEXTURE_SIZE: u32 = 34076; +pub const GL_MAX_3D_TEXTURE_SIZE: u32 = 32883; +pub const GL_MAX_ARRAY_TEXTURE_LAYERS: u32 = 35071; +pub const GL_MAX_VERTEX_ATTRIBS: u32 = 34921; +pub const GL_CLAMP_TO_BORDER: u32 = 33069; +pub const GL_TEXTURE_BORDER_COLOR: u32 = 4100; +pub type __gnuc_va_list = __builtin_va_list; +pub type va_list = __gnuc_va_list; +extern "C" { + pub fn __debugbreak(); +} +extern "C" { + pub fn __mingw_get_crt_info() -> *const ::std::os::raw::c_char; +} +pub type rsize_t = usize; +pub type wchar_t = ::std::os::raw::c_ushort; +pub type wint_t = ::std::os::raw::c_ushort; +pub type wctype_t = ::std::os::raw::c_ushort; +pub type errno_t = ::std::os::raw::c_int; +pub type __time32_t = ::std::os::raw::c_long; +pub type __time64_t = ::std::os::raw::c_longlong; +pub type time_t = __time64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct threadmbcinfostruct { + _unused: [u8; 0], +} +pub type pthreadlocinfo = *mut threadlocaleinfostruct; +pub type pthreadmbcinfo = *mut threadmbcinfostruct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __lc_time_data { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct localeinfo_struct { + pub locinfo: pthreadlocinfo, + pub mbcinfo: pthreadmbcinfo, +} +pub type _locale_tstruct = localeinfo_struct; +pub type _locale_t = *mut localeinfo_struct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLC_ID { + pub wLanguage: ::std::os::raw::c_ushort, + pub wCountry: ::std::os::raw::c_ushort, + pub wCodePage: ::std::os::raw::c_ushort, +} +pub type LC_ID = tagLC_ID; +pub type LPLC_ID = *mut tagLC_ID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct threadlocaleinfostruct { + pub refcount: ::std::os::raw::c_int, + pub lc_codepage: ::std::os::raw::c_uint, + pub lc_collate_cp: ::std::os::raw::c_uint, + pub lc_handle: [::std::os::raw::c_ulong; 6usize], + pub lc_id: [LC_ID; 6usize], + pub lc_category: [threadlocaleinfostruct__bindgen_ty_1; 6usize], + pub lc_clike: ::std::os::raw::c_int, + pub mb_cur_max: ::std::os::raw::c_int, + pub lconv_intl_refcount: *mut ::std::os::raw::c_int, + pub lconv_num_refcount: *mut ::std::os::raw::c_int, + pub lconv_mon_refcount: *mut ::std::os::raw::c_int, + pub lconv: *mut lconv, + pub ctype1_refcount: *mut ::std::os::raw::c_int, + pub ctype1: *mut ::std::os::raw::c_ushort, + pub pctype: *const ::std::os::raw::c_ushort, + pub pclmap: *const ::std::os::raw::c_uchar, + pub pcumap: *const ::std::os::raw::c_uchar, + pub lc_time_curr: *mut __lc_time_data, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct threadlocaleinfostruct__bindgen_ty_1 { + pub locale: *mut ::std::os::raw::c_char, + pub wlocale: *mut wchar_t, + pub refcount: *mut ::std::os::raw::c_int, + pub wrefcount: *mut ::std::os::raw::c_int, +} +pub type threadlocinfo = threadlocaleinfostruct; +pub type int_least8_t = ::std::os::raw::c_schar; +pub type uint_least8_t = ::std::os::raw::c_uchar; +pub type int_least16_t = ::std::os::raw::c_short; +pub type uint_least16_t = ::std::os::raw::c_ushort; +pub type int_least32_t = ::std::os::raw::c_int; +pub type uint_least32_t = ::std::os::raw::c_uint; +pub type int_least64_t = ::std::os::raw::c_longlong; +pub type uint_least64_t = ::std::os::raw::c_ulonglong; +pub type int_fast8_t = ::std::os::raw::c_schar; +pub type uint_fast8_t = ::std::os::raw::c_uchar; +pub type int_fast16_t = ::std::os::raw::c_short; +pub type uint_fast16_t = ::std::os::raw::c_ushort; +pub type int_fast32_t = ::std::os::raw::c_int; +pub type uint_fast32_t = ::std::os::raw::c_uint; +pub type int_fast64_t = ::std::os::raw::c_longlong; +pub type uint_fast64_t = ::std::os::raw::c_ulonglong; +pub type intmax_t = ::std::os::raw::c_longlong; +pub type uintmax_t = ::std::os::raw::c_ulonglong; +pub const SAPP_MAX_TOUCHPOINTS: _bindgen_ty_1 = 8; +pub const SAPP_MAX_MOUSEBUTTONS: _bindgen_ty_1 = 3; +pub const SAPP_MAX_KEYCODES: _bindgen_ty_1 = 512; +pub type _bindgen_ty_1 = u32; +pub const sapp_event_type_SAPP_EVENTTYPE_INVALID: sapp_event_type = 0; +pub const sapp_event_type_SAPP_EVENTTYPE_KEY_DOWN: sapp_event_type = 1; +pub const sapp_event_type_SAPP_EVENTTYPE_KEY_UP: sapp_event_type = 2; +pub const sapp_event_type_SAPP_EVENTTYPE_CHAR: sapp_event_type = 3; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_DOWN: sapp_event_type = 4; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_UP: sapp_event_type = 5; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_SCROLL: sapp_event_type = 6; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_MOVE: sapp_event_type = 7; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_ENTER: sapp_event_type = 8; +pub const sapp_event_type_SAPP_EVENTTYPE_MOUSE_LEAVE: sapp_event_type = 9; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_BEGAN: sapp_event_type = 10; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_MOVED: sapp_event_type = 11; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_ENDED: sapp_event_type = 12; +pub const sapp_event_type_SAPP_EVENTTYPE_TOUCHES_CANCELLED: sapp_event_type = 13; +pub const sapp_event_type_SAPP_EVENTTYPE_RESIZED: sapp_event_type = 14; +pub const sapp_event_type_SAPP_EVENTTYPE_ICONIFIED: sapp_event_type = 15; +pub const sapp_event_type_SAPP_EVENTTYPE_RESTORED: sapp_event_type = 16; +pub const sapp_event_type_SAPP_EVENTTYPE_SUSPENDED: sapp_event_type = 17; +pub const sapp_event_type_SAPP_EVENTTYPE_RESUMED: sapp_event_type = 18; +pub const sapp_event_type_SAPP_EVENTTYPE_UPDATE_CURSOR: sapp_event_type = 19; +pub const sapp_event_type_SAPP_EVENTTYPE_QUIT_REQUESTED: sapp_event_type = 20; +pub const sapp_event_type__SAPP_EVENTTYPE_NUM: sapp_event_type = 21; +pub const sapp_event_type__SAPP_EVENTTYPE_FORCE_U32: sapp_event_type = 2147483647; +pub type sapp_event_type = u32; +pub const sapp_keycode_SAPP_KEYCODE_INVALID: sapp_keycode = 0; +pub const sapp_keycode_SAPP_KEYCODE_SPACE: sapp_keycode = 32; +pub const sapp_keycode_SAPP_KEYCODE_APOSTROPHE: sapp_keycode = 39; +pub const sapp_keycode_SAPP_KEYCODE_COMMA: sapp_keycode = 44; +pub const sapp_keycode_SAPP_KEYCODE_MINUS: sapp_keycode = 45; +pub const sapp_keycode_SAPP_KEYCODE_PERIOD: sapp_keycode = 46; +pub const sapp_keycode_SAPP_KEYCODE_SLASH: sapp_keycode = 47; +pub const sapp_keycode_SAPP_KEYCODE_0: sapp_keycode = 48; +pub const sapp_keycode_SAPP_KEYCODE_1: sapp_keycode = 49; +pub const sapp_keycode_SAPP_KEYCODE_2: sapp_keycode = 50; +pub const sapp_keycode_SAPP_KEYCODE_3: sapp_keycode = 51; +pub const sapp_keycode_SAPP_KEYCODE_4: sapp_keycode = 52; +pub const sapp_keycode_SAPP_KEYCODE_5: sapp_keycode = 53; +pub const sapp_keycode_SAPP_KEYCODE_6: sapp_keycode = 54; +pub const sapp_keycode_SAPP_KEYCODE_7: sapp_keycode = 55; +pub const sapp_keycode_SAPP_KEYCODE_8: sapp_keycode = 56; +pub const sapp_keycode_SAPP_KEYCODE_9: sapp_keycode = 57; +pub const sapp_keycode_SAPP_KEYCODE_SEMICOLON: sapp_keycode = 59; +pub const sapp_keycode_SAPP_KEYCODE_EQUAL: sapp_keycode = 61; +pub const sapp_keycode_SAPP_KEYCODE_A: sapp_keycode = 65; +pub const sapp_keycode_SAPP_KEYCODE_B: sapp_keycode = 66; +pub const sapp_keycode_SAPP_KEYCODE_C: sapp_keycode = 67; +pub const sapp_keycode_SAPP_KEYCODE_D: sapp_keycode = 68; +pub const sapp_keycode_SAPP_KEYCODE_E: sapp_keycode = 69; +pub const sapp_keycode_SAPP_KEYCODE_F: sapp_keycode = 70; +pub const sapp_keycode_SAPP_KEYCODE_G: sapp_keycode = 71; +pub const sapp_keycode_SAPP_KEYCODE_H: sapp_keycode = 72; +pub const sapp_keycode_SAPP_KEYCODE_I: sapp_keycode = 73; +pub const sapp_keycode_SAPP_KEYCODE_J: sapp_keycode = 74; +pub const sapp_keycode_SAPP_KEYCODE_K: sapp_keycode = 75; +pub const sapp_keycode_SAPP_KEYCODE_L: sapp_keycode = 76; +pub const sapp_keycode_SAPP_KEYCODE_M: sapp_keycode = 77; +pub const sapp_keycode_SAPP_KEYCODE_N: sapp_keycode = 78; +pub const sapp_keycode_SAPP_KEYCODE_O: sapp_keycode = 79; +pub const sapp_keycode_SAPP_KEYCODE_P: sapp_keycode = 80; +pub const sapp_keycode_SAPP_KEYCODE_Q: sapp_keycode = 81; +pub const sapp_keycode_SAPP_KEYCODE_R: sapp_keycode = 82; +pub const sapp_keycode_SAPP_KEYCODE_S: sapp_keycode = 83; +pub const sapp_keycode_SAPP_KEYCODE_T: sapp_keycode = 84; +pub const sapp_keycode_SAPP_KEYCODE_U: sapp_keycode = 85; +pub const sapp_keycode_SAPP_KEYCODE_V: sapp_keycode = 86; +pub const sapp_keycode_SAPP_KEYCODE_W: sapp_keycode = 87; +pub const sapp_keycode_SAPP_KEYCODE_X: sapp_keycode = 88; +pub const sapp_keycode_SAPP_KEYCODE_Y: sapp_keycode = 89; +pub const sapp_keycode_SAPP_KEYCODE_Z: sapp_keycode = 90; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_BRACKET: sapp_keycode = 91; +pub const sapp_keycode_SAPP_KEYCODE_BACKSLASH: sapp_keycode = 92; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_BRACKET: sapp_keycode = 93; +pub const sapp_keycode_SAPP_KEYCODE_GRAVE_ACCENT: sapp_keycode = 96; +pub const sapp_keycode_SAPP_KEYCODE_WORLD_1: sapp_keycode = 161; +pub const sapp_keycode_SAPP_KEYCODE_WORLD_2: sapp_keycode = 162; +pub const sapp_keycode_SAPP_KEYCODE_ESCAPE: sapp_keycode = 256; +pub const sapp_keycode_SAPP_KEYCODE_ENTER: sapp_keycode = 257; +pub const sapp_keycode_SAPP_KEYCODE_TAB: sapp_keycode = 258; +pub const sapp_keycode_SAPP_KEYCODE_BACKSPACE: sapp_keycode = 259; +pub const sapp_keycode_SAPP_KEYCODE_INSERT: sapp_keycode = 260; +pub const sapp_keycode_SAPP_KEYCODE_DELETE: sapp_keycode = 261; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT: sapp_keycode = 262; +pub const sapp_keycode_SAPP_KEYCODE_LEFT: sapp_keycode = 263; +pub const sapp_keycode_SAPP_KEYCODE_DOWN: sapp_keycode = 264; +pub const sapp_keycode_SAPP_KEYCODE_UP: sapp_keycode = 265; +pub const sapp_keycode_SAPP_KEYCODE_PAGE_UP: sapp_keycode = 266; +pub const sapp_keycode_SAPP_KEYCODE_PAGE_DOWN: sapp_keycode = 267; +pub const sapp_keycode_SAPP_KEYCODE_HOME: sapp_keycode = 268; +pub const sapp_keycode_SAPP_KEYCODE_END: sapp_keycode = 269; +pub const sapp_keycode_SAPP_KEYCODE_CAPS_LOCK: sapp_keycode = 280; +pub const sapp_keycode_SAPP_KEYCODE_SCROLL_LOCK: sapp_keycode = 281; +pub const sapp_keycode_SAPP_KEYCODE_NUM_LOCK: sapp_keycode = 282; +pub const sapp_keycode_SAPP_KEYCODE_PRINT_SCREEN: sapp_keycode = 283; +pub const sapp_keycode_SAPP_KEYCODE_PAUSE: sapp_keycode = 284; +pub const sapp_keycode_SAPP_KEYCODE_F1: sapp_keycode = 290; +pub const sapp_keycode_SAPP_KEYCODE_F2: sapp_keycode = 291; +pub const sapp_keycode_SAPP_KEYCODE_F3: sapp_keycode = 292; +pub const sapp_keycode_SAPP_KEYCODE_F4: sapp_keycode = 293; +pub const sapp_keycode_SAPP_KEYCODE_F5: sapp_keycode = 294; +pub const sapp_keycode_SAPP_KEYCODE_F6: sapp_keycode = 295; +pub const sapp_keycode_SAPP_KEYCODE_F7: sapp_keycode = 296; +pub const sapp_keycode_SAPP_KEYCODE_F8: sapp_keycode = 297; +pub const sapp_keycode_SAPP_KEYCODE_F9: sapp_keycode = 298; +pub const sapp_keycode_SAPP_KEYCODE_F10: sapp_keycode = 299; +pub const sapp_keycode_SAPP_KEYCODE_F11: sapp_keycode = 300; +pub const sapp_keycode_SAPP_KEYCODE_F12: sapp_keycode = 301; +pub const sapp_keycode_SAPP_KEYCODE_F13: sapp_keycode = 302; +pub const sapp_keycode_SAPP_KEYCODE_F14: sapp_keycode = 303; +pub const sapp_keycode_SAPP_KEYCODE_F15: sapp_keycode = 304; +pub const sapp_keycode_SAPP_KEYCODE_F16: sapp_keycode = 305; +pub const sapp_keycode_SAPP_KEYCODE_F17: sapp_keycode = 306; +pub const sapp_keycode_SAPP_KEYCODE_F18: sapp_keycode = 307; +pub const sapp_keycode_SAPP_KEYCODE_F19: sapp_keycode = 308; +pub const sapp_keycode_SAPP_KEYCODE_F20: sapp_keycode = 309; +pub const sapp_keycode_SAPP_KEYCODE_F21: sapp_keycode = 310; +pub const sapp_keycode_SAPP_KEYCODE_F22: sapp_keycode = 311; +pub const sapp_keycode_SAPP_KEYCODE_F23: sapp_keycode = 312; +pub const sapp_keycode_SAPP_KEYCODE_F24: sapp_keycode = 313; +pub const sapp_keycode_SAPP_KEYCODE_F25: sapp_keycode = 314; +pub const sapp_keycode_SAPP_KEYCODE_KP_0: sapp_keycode = 320; +pub const sapp_keycode_SAPP_KEYCODE_KP_1: sapp_keycode = 321; +pub const sapp_keycode_SAPP_KEYCODE_KP_2: sapp_keycode = 322; +pub const sapp_keycode_SAPP_KEYCODE_KP_3: sapp_keycode = 323; +pub const sapp_keycode_SAPP_KEYCODE_KP_4: sapp_keycode = 324; +pub const sapp_keycode_SAPP_KEYCODE_KP_5: sapp_keycode = 325; +pub const sapp_keycode_SAPP_KEYCODE_KP_6: sapp_keycode = 326; +pub const sapp_keycode_SAPP_KEYCODE_KP_7: sapp_keycode = 327; +pub const sapp_keycode_SAPP_KEYCODE_KP_8: sapp_keycode = 328; +pub const sapp_keycode_SAPP_KEYCODE_KP_9: sapp_keycode = 329; +pub const sapp_keycode_SAPP_KEYCODE_KP_DECIMAL: sapp_keycode = 330; +pub const sapp_keycode_SAPP_KEYCODE_KP_DIVIDE: sapp_keycode = 331; +pub const sapp_keycode_SAPP_KEYCODE_KP_MULTIPLY: sapp_keycode = 332; +pub const sapp_keycode_SAPP_KEYCODE_KP_SUBTRACT: sapp_keycode = 333; +pub const sapp_keycode_SAPP_KEYCODE_KP_ADD: sapp_keycode = 334; +pub const sapp_keycode_SAPP_KEYCODE_KP_ENTER: sapp_keycode = 335; +pub const sapp_keycode_SAPP_KEYCODE_KP_EQUAL: sapp_keycode = 336; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_SHIFT: sapp_keycode = 340; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_CONTROL: sapp_keycode = 341; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_ALT: sapp_keycode = 342; +pub const sapp_keycode_SAPP_KEYCODE_LEFT_SUPER: sapp_keycode = 343; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_SHIFT: sapp_keycode = 344; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_CONTROL: sapp_keycode = 345; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_ALT: sapp_keycode = 346; +pub const sapp_keycode_SAPP_KEYCODE_RIGHT_SUPER: sapp_keycode = 347; +pub const sapp_keycode_SAPP_KEYCODE_MENU: sapp_keycode = 348; +pub type sapp_keycode = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_touchpoint { + pub identifier: usize, + pub pos_x: f32, + pub pos_y: f32, + pub changed: bool, +} +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_INVALID: sapp_mousebutton = -1; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_LEFT: sapp_mousebutton = 0; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_RIGHT: sapp_mousebutton = 1; +pub const sapp_mousebutton_SAPP_MOUSEBUTTON_MIDDLE: sapp_mousebutton = 2; +pub type sapp_mousebutton = i32; +pub const SAPP_MODIFIER_SHIFT: _bindgen_ty_2 = 1; +pub const SAPP_MODIFIER_CTRL: _bindgen_ty_2 = 2; +pub const SAPP_MODIFIER_ALT: _bindgen_ty_2 = 4; +pub const SAPP_MODIFIER_SUPER: _bindgen_ty_2 = 8; +pub type _bindgen_ty_2 = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_event { + pub frame_count: u64, + pub type_: sapp_event_type, + pub key_code: sapp_keycode, + pub char_code: u32, + pub key_repeat: bool, + pub modifiers: u32, + pub mouse_button: sapp_mousebutton, + pub mouse_x: f32, + pub mouse_y: f32, + pub scroll_x: f32, + pub scroll_y: f32, + pub num_touches: ::std::os::raw::c_int, + pub touches: [sapp_touchpoint; 8usize], + pub window_width: ::std::os::raw::c_int, + pub window_height: ::std::os::raw::c_int, + pub framebuffer_width: ::std::os::raw::c_int, + pub framebuffer_height: ::std::os::raw::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sapp_desc { + pub init_cb: ::std::option::Option, + pub frame_cb: ::std::option::Option, + pub cleanup_cb: ::std::option::Option, + pub event_cb: ::std::option::Option, + pub fail_cb: ::std::option::Option, + pub user_data: *mut ::std::os::raw::c_void, + pub init_userdata_cb: + ::std::option::Option, + pub frame_userdata_cb: + ::std::option::Option, + pub cleanup_userdata_cb: + ::std::option::Option, + pub event_userdata_cb: ::std::option::Option< + unsafe extern "C" fn(arg1: *const sapp_event, arg2: *mut ::std::os::raw::c_void), + >, + pub fail_userdata_cb: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_void, + ), + >, + pub width: ::std::os::raw::c_int, + pub height: ::std::os::raw::c_int, + pub sample_count: ::std::os::raw::c_int, + pub swap_interval: ::std::os::raw::c_int, + pub high_dpi: bool, + pub fullscreen: bool, + pub alpha: bool, + pub window_title: *const ::std::os::raw::c_char, + pub user_cursor: bool, + pub html5_canvas_name: *const ::std::os::raw::c_char, + pub html5_canvas_resize: bool, + pub html5_preserve_drawing_buffer: bool, + pub html5_premultiplied_alpha: bool, + pub html5_ask_leave_site: bool, + pub ios_keyboard_resizes_canvas: bool, + pub gl_force_gles2: bool, +} +extern "C" { + pub fn sokol_main( + argc: ::std::os::raw::c_int, + argv: *mut *mut ::std::os::raw::c_char, + ) -> sapp_desc; +} +extern "C" { + pub fn sapp_isvalid() -> bool; +} +extern "C" { + pub fn sapp_width() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sapp_height() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sapp_high_dpi() -> bool; +} +extern "C" { + pub fn sapp_dpi_scale() -> f32; +} +extern "C" { + pub fn sapp_show_keyboard(visible: bool); +} +extern "C" { + pub fn sapp_keyboard_shown() -> bool; +} +extern "C" { + pub fn sapp_show_mouse(visible: bool); +} +extern "C" { + pub fn sapp_mouse_shown() -> bool; +} +extern "C" { + pub fn sapp_userdata() -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_query_desc() -> sapp_desc; +} +extern "C" { + pub fn sapp_request_quit(); +} +extern "C" { + pub fn sapp_cancel_quit(); +} +extern "C" { + pub fn sapp_quit(); +} +extern "C" { + pub fn sapp_frame_count() -> u64; +} +extern "C" { + pub fn sapp_run(desc: *const sapp_desc) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sapp_gles2() -> bool; +} +extern "C" { + pub fn sapp_html5_ask_leave_site(ask: bool); +} +extern "C" { + pub fn sapp_metal_get_device() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_metal_get_renderpass_descriptor() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_metal_get_drawable() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_macos_get_window() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_ios_get_window() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_device() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_device_context() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_render_target_view() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_d3d11_get_depth_stencil_view() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_win32_get_hwnd() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn sapp_android_get_native_activity() -> *const ::std::os::raw::c_void; +} +extern "C" { + pub fn _memccpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _MaxCount: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memchr( + _Buf: *const ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _memicmp( + _Buf1: *const ::std::os::raw::c_void, + _Buf2: *const ::std::os::raw::c_void, + _Size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _memicmp_l( + _Buf1: *const ::std::os::raw::c_void, + _Buf2: *const ::std::os::raw::c_void, + _Size: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn memcmp( + _Buf1: *const ::std::os::raw::c_void, + _Buf2: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn memcpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memcpy_s( + _dest: *mut ::std::os::raw::c_void, + _numberOfElements: usize, + _src: *const ::std::os::raw::c_void, + _count: usize, + ) -> errno_t; +} +extern "C" { + pub fn mempcpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memset( + _Dst: *mut ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _Size: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memccpy( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Val: ::std::os::raw::c_int, + _Size: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn memicmp( + _Buf1: *const ::std::os::raw::c_void, + _Buf2: *const ::std::os::raw::c_void, + _Size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strset( + _Str: *mut ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strset_l( + _Str: *mut ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcpy( + _Dest: *mut ::std::os::raw::c_char, + _Source: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcat( + _Dest: *mut ::std::os::raw::c_char, + _Source: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcmp( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strlen(_Str: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn strnlen(_Str: *const ::std::os::raw::c_char, _MaxCount: usize) -> usize; +} +extern "C" { + pub fn memmove( + _Dst: *mut ::std::os::raw::c_void, + _Src: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _strdup(_Src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strchr( + _Str: *const ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _stricmp( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strcmpi( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stricmp_l( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcoll( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strcoll_l( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stricoll( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _stricoll_l( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strncoll( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strncoll_l( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strnicoll( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strnicoll_l( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcspn( + _Str: *const ::std::os::raw::c_char, + _Control: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _strerror(_ErrMsg: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strerror(arg1: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strlwr(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strlwr_l( + _String: *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strncat( + _Dest: *mut ::std::os::raw::c_char, + _Source: *const ::std::os::raw::c_char, + _Count: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strncmp( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strnicmp( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strnicmp_l( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strncpy( + _Dest: *mut ::std::os::raw::c_char, + _Source: *const ::std::os::raw::c_char, + _Count: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strnset( + _Str: *mut ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + _MaxCount: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strnset_l( + str: *mut ::std::os::raw::c_char, + c: ::std::os::raw::c_int, + count: usize, + _Locale: _locale_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strpbrk( + _Str: *const ::std::os::raw::c_char, + _Control: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strrchr( + _Str: *const ::std::os::raw::c_char, + _Ch: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strrev(_Str: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strspn( + _Str: *const ::std::os::raw::c_char, + _Control: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn strstr( + _Str: *const ::std::os::raw::c_char, + _SubStr: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strtok( + _Str: *mut ::std::os::raw::c_char, + _Delim: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strtok_r( + _Str: *mut ::std::os::raw::c_char, + _Delim: *const ::std::os::raw::c_char, + __last: *mut *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strupr(_String: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strupr_l( + _String: *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strxfrm( + _Dst: *mut ::std::os::raw::c_char, + _Src: *const ::std::os::raw::c_char, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _strxfrm_l( + _Dst: *mut ::std::os::raw::c_char, + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn strdup(_Src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcmpi( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn stricmp( + _Str1: *const ::std::os::raw::c_char, + _Str2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strlwr(_Str: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strnicmp( + _Str1: *const ::std::os::raw::c_char, + _Str: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strncasecmp( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcasecmp( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strnset( + _Str: *mut ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + _MaxCount: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strrev(_Str: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strset( + _Str: *mut ::std::os::raw::c_char, + _Val: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strupr(_Str: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _wcsdup(_Str: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscat(_Dest: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcschr( + _Str: *const ::std::os::raw::c_ushort, + _Ch: ::std::os::raw::c_ushort, + ) -> *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub fn wcscmp( + _Str1: *const ::std::os::raw::c_ushort, + _Str2: *const ::std::os::raw::c_ushort, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcscpy(_Dest: *mut wchar_t, _Source: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcscspn(_Str: *const wchar_t, _Control: *const wchar_t) -> usize; +} +extern "C" { + pub fn wcslen(_Str: *const ::std::os::raw::c_ushort) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn wcsnlen(_Src: *const wchar_t, _MaxCount: usize) -> usize; +} +extern "C" { + pub fn wcsncat(_Dest: *mut wchar_t, _Source: *const wchar_t, _Count: usize) -> *mut wchar_t; +} +extern "C" { + pub fn wcsncmp( + _Str1: *const ::std::os::raw::c_ushort, + _Str2: *const ::std::os::raw::c_ushort, + _MaxCount: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsncpy(_Dest: *mut wchar_t, _Source: *const wchar_t, _Count: usize) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsncpy_l( + _Dest: *mut wchar_t, + _Source: *const wchar_t, + _Count: usize, + _Locale: _locale_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn wcspbrk(_Str: *const wchar_t, _Control: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrchr(_Str: *const wchar_t, _Ch: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsspn(_Str: *const wchar_t, _Control: *const wchar_t) -> usize; +} +extern "C" { + pub fn wcsstr(_Str: *const wchar_t, _SubStr: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcstok(_Str: *mut wchar_t, _Delim: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror(_ErrNum: ::std::os::raw::c_int) -> *mut wchar_t; +} +extern "C" { + pub fn __wcserror(_Str: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsicmp(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicmp_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicmp_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnset(_Str: *mut wchar_t, _Val: wchar_t, _MaxCount: usize) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsrev(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsset(_Str: *mut wchar_t, _Val: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcslwr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsupr_l(_String: *mut wchar_t, _Locale: _locale_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsxfrm(_Dst: *mut wchar_t, _Src: *const wchar_t, _MaxCount: usize) -> usize; +} +extern "C" { + pub fn _wcsxfrm_l( + _Dst: *mut wchar_t, + _Src: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn wcscoll(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcscoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsicoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsncoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wcsnicoll_l( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsdup(_Str: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicmp(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnicmp( + _Str1: *const wchar_t, + _Str2: *const wchar_t, + _MaxCount: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcsnset(_Str: *mut wchar_t, _Val: wchar_t, _MaxCount: usize) -> *mut wchar_t; +} +extern "C" { + pub fn wcsrev(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsset(_Str: *mut wchar_t, _Val: wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcslwr(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsupr(_Str: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn wcsicoll(_Str1: *const wchar_t, _Str2: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _strset_s( + _Dst: *mut ::std::os::raw::c_char, + _DstSize: usize, + _Value: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _strerror_s( + _Buf: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _ErrMsg: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn strerror_s( + _Buf: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _ErrNum: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _strlwr_s(_Str: *mut ::std::os::raw::c_char, _Size: usize) -> errno_t; +} +extern "C" { + pub fn _strlwr_s_l( + _Str: *mut ::std::os::raw::c_char, + _Size: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _strnset_s( + _Str: *mut ::std::os::raw::c_char, + _Size: usize, + _Val: ::std::os::raw::c_int, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _strupr_s(_Str: *mut ::std::os::raw::c_char, _Size: usize) -> errno_t; +} +extern "C" { + pub fn _strupr_s_l( + _Str: *mut ::std::os::raw::c_char, + _Size: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn strncat_s( + _Dst: *mut ::std::os::raw::c_char, + _DstSizeInChars: usize, + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _strncat_s_l( + _Dst: *mut ::std::os::raw::c_char, + _DstSizeInChars: usize, + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn strcpy_s( + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: rsize_t, + _Src: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn strncpy_s( + _Dst: *mut ::std::os::raw::c_char, + _DstSizeInChars: usize, + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _strncpy_s_l( + _Dst: *mut ::std::os::raw::c_char, + _DstSizeInChars: usize, + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn strtok_s( + _Str: *mut ::std::os::raw::c_char, + _Delim: *const ::std::os::raw::c_char, + _Context: *mut *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _strtok_s_l( + _Str: *mut ::std::os::raw::c_char, + _Delim: *const ::std::os::raw::c_char, + _Context: *mut *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strcat_s( + _Dst: *mut ::std::os::raw::c_char, + _SizeInBytes: rsize_t, + _Src: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn memmove_s( + _dest: *mut ::std::os::raw::c_void, + _numberOfElements: usize, + _src: *const ::std::os::raw::c_void, + _count: usize, + ) -> errno_t; +} +extern "C" { + pub fn wcstok_s( + _Str: *mut wchar_t, + _Delim: *const wchar_t, + _Context: *mut *mut wchar_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcserror_s( + _Buf: *mut wchar_t, + _SizeInWords: usize, + _ErrNum: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn __wcserror_s( + _Buffer: *mut wchar_t, + _SizeInWords: usize, + _ErrMsg: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsnset_s( + _Dst: *mut wchar_t, + _DstSizeInWords: usize, + _Val: wchar_t, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _wcsset_s(_Str: *mut wchar_t, _SizeInWords: usize, _Val: wchar_t) -> errno_t; +} +extern "C" { + pub fn _wcslwr_s(_Str: *mut wchar_t, _SizeInWords: usize) -> errno_t; +} +extern "C" { + pub fn _wcslwr_s_l(_Str: *mut wchar_t, _SizeInWords: usize, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn _wcsupr_s(_Str: *mut wchar_t, _Size: usize) -> errno_t; +} +extern "C" { + pub fn _wcsupr_s_l(_Str: *mut wchar_t, _Size: usize, _Locale: _locale_t) -> errno_t; +} +extern "C" { + pub fn wcscpy_s(_Dst: *mut wchar_t, _SizeInWords: rsize_t, _Src: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn wcscat_s(_Dst: *mut wchar_t, _SizeInWords: rsize_t, _Src: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn wcsncat_s( + _Dst: *mut wchar_t, + _DstSizeInChars: usize, + _Src: *const wchar_t, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _wcsncat_s_l( + _Dst: *mut wchar_t, + _DstSizeInChars: usize, + _Src: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn wcsncpy_s( + _Dst: *mut wchar_t, + _DstSizeInChars: usize, + _Src: *const wchar_t, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _wcsncpy_s_l( + _Dst: *mut wchar_t, + _DstSizeInChars: usize, + _Src: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcstok_s_l( + _Str: *mut wchar_t, + _Delim: *const wchar_t, + _Context: *mut *mut wchar_t, + _Locale: _locale_t, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wcsset_s_l( + _Str: *mut wchar_t, + _SizeInChars: usize, + _Val: ::std::os::raw::c_uint, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _wcsnset_s_l( + _Str: *mut wchar_t, + _SizeInChars: usize, + _Val: ::std::os::raw::c_uint, + _Count: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn exit(_Code: ::std::os::raw::c_int); +} +extern "C" { + pub fn _exit(_Code: ::std::os::raw::c_int); +} +extern "C" { + pub fn _Exit(arg1: ::std::os::raw::c_int); +} +extern "C" { + pub fn abort(); +} +extern "C" { + pub fn _wassert(_Message: *const wchar_t, _File: *const wchar_t, _Line: ::std::os::raw::c_uint); +} +extern "C" { + pub fn _assert( + _Message: *const ::std::os::raw::c_char, + _File: *const ::std::os::raw::c_char, + _Line: ::std::os::raw::c_uint, + ); +} +extern "C" { + pub fn _itow_s( + _Val: ::std::os::raw::c_int, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ltow_s( + _Val: ::std::os::raw::c_long, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ultow_s( + _Val: ::std::os::raw::c_ulong, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wgetenv_s( + _ReturnSize: *mut usize, + _DstBuf: *mut wchar_t, + _DstSizeInWords: usize, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wdupenv_s( + _Buffer: *mut *mut wchar_t, + _BufferSizeInWords: *mut usize, + _VarName: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _i64tow_s( + _Val: ::std::os::raw::c_longlong, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ui64tow_s( + _Val: ::std::os::raw::c_ulonglong, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wmakepath_s( + _PathResult: *mut wchar_t, + _SizeInWords: usize, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wputenv_s(_Name: *const wchar_t, _Value: *const wchar_t) -> errno_t; +} +extern "C" { + pub fn _wsearchenv_s( + _Filename: *const wchar_t, + _EnvVar: *const wchar_t, + _ResultPath: *mut wchar_t, + _SizeInWords: usize, + ) -> errno_t; +} +extern "C" { + pub fn _wsplitpath_s( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _DriveSizeInWords: usize, + _Dir: *mut wchar_t, + _DirSizeInWords: usize, + _Filename: *mut wchar_t, + _FilenameSizeInWords: usize, + _Ext: *mut wchar_t, + _ExtSizeInWords: usize, + ) -> errno_t; +} +pub type _onexit_t = ::std::option::Option ::std::os::raw::c_int>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _div_t { + pub quot: ::std::os::raw::c_int, + pub rem: ::std::os::raw::c_int, +} +pub type div_t = _div_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ldiv_t { + pub quot: ::std::os::raw::c_long, + pub rem: ::std::os::raw::c_long, +} +pub type ldiv_t = _ldiv_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LDOUBLE { + pub ld: [::std::os::raw::c_uchar; 10usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CRT_DOUBLE { + pub x: f64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CRT_FLOAT { + pub f: f32, +} +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _LONGDOUBLE { + pub x: u128, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LDBL12 { + pub ld12: [::std::os::raw::c_uchar; 12usize], +} +extern "C" { + pub static mut __imp___mb_cur_max: *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn ___mb_cur_max_func() -> ::std::os::raw::c_int; +} +pub type _purecall_handler = ::std::option::Option; +extern "C" { + pub fn _set_purecall_handler(_Handler: _purecall_handler) -> _purecall_handler; +} +extern "C" { + pub fn _get_purecall_handler() -> _purecall_handler; +} +pub type _invalid_parameter_handler = ::std::option::Option< + unsafe extern "C" fn( + arg1: *const wchar_t, + arg2: *const wchar_t, + arg3: *const wchar_t, + arg4: ::std::os::raw::c_uint, + arg5: usize, + ), +>; +extern "C" { + pub fn _set_invalid_parameter_handler( + _Handler: _invalid_parameter_handler, + ) -> _invalid_parameter_handler; +} +extern "C" { + pub fn _get_invalid_parameter_handler() -> _invalid_parameter_handler; +} +extern "C" { + pub fn _errno() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_errno(_Value: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_errno(_Value: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn __doserrno() -> *mut ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _set_doserrno(_Value: ::std::os::raw::c_ulong) -> errno_t; +} +extern "C" { + pub fn _get_doserrno(_Value: *mut ::std::os::raw::c_ulong) -> errno_t; +} +extern "C" { + pub static mut _sys_errlist: [*mut ::std::os::raw::c_char; 1usize]; +} +extern "C" { + pub static mut _sys_nerr: ::std::os::raw::c_int; +} +extern "C" { + pub fn __p___argv() -> *mut *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn __p__fmode() -> *mut ::std::os::raw::c_int; +} +extern "C" { + pub fn _get_pgmptr(_Value: *mut *mut ::std::os::raw::c_char) -> errno_t; +} +extern "C" { + pub fn _get_wpgmptr(_Value: *mut *mut wchar_t) -> errno_t; +} +extern "C" { + pub fn _set_fmode(_Mode: ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub fn _get_fmode(_PMode: *mut ::std::os::raw::c_int) -> errno_t; +} +extern "C" { + pub static mut __imp___argc: *mut ::std::os::raw::c_int; +} +extern "C" { + pub static mut __imp___argv: *mut *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub static mut __imp___wargv: *mut *mut *mut wchar_t; +} +extern "C" { + pub static mut __imp__environ: *mut *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub static mut __imp__wenviron: *mut *mut *mut wchar_t; +} +extern "C" { + pub static mut __imp__pgmptr: *mut *mut ::std::os::raw::c_char; +} +extern "C" { + pub static mut __imp__wpgmptr: *mut *mut wchar_t; +} +extern "C" { + pub static mut __imp__osplatform: *mut ::std::os::raw::c_uint; +} +extern "C" { + pub static mut __imp__osver: *mut ::std::os::raw::c_uint; +} +extern "C" { + pub static mut __imp__winver: *mut ::std::os::raw::c_uint; +} +extern "C" { + pub static mut __imp__winmajor: *mut ::std::os::raw::c_uint; +} +extern "C" { + pub static mut __imp__winminor: *mut ::std::os::raw::c_uint; +} +extern "C" { + pub fn _get_osplatform(_Value: *mut ::std::os::raw::c_uint) -> errno_t; +} +extern "C" { + pub fn _get_osver(_Value: *mut ::std::os::raw::c_uint) -> errno_t; +} +extern "C" { + pub fn _get_winver(_Value: *mut ::std::os::raw::c_uint) -> errno_t; +} +extern "C" { + pub fn _get_winmajor(_Value: *mut ::std::os::raw::c_uint) -> errno_t; +} +extern "C" { + pub fn _get_winminor(_Value: *mut ::std::os::raw::c_uint) -> errno_t; +} +extern "C" { + pub fn _set_abort_behavior( + _Flags: ::std::os::raw::c_uint, + _Mask: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn abs(_X: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn labs(_X: ::std::os::raw::c_long) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _abs64(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn atexit(arg1: ::std::option::Option) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atof(_String: *const ::std::os::raw::c_char) -> f64; +} +extern "C" { + pub fn _atof_l(_String: *const ::std::os::raw::c_char, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn atoi(_Str: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _atoi_l( + _Str: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atol(_Str: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _atol_l( + _Str: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn bsearch( + _Key: *const ::std::os::raw::c_void, + _Base: *const ::std::os::raw::c_void, + _NumOfElements: usize, + _SizeOfElements: usize, + _PtFuncCompare: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn qsort( + _Base: *mut ::std::os::raw::c_void, + _NumOfElements: usize, + _SizeOfElements: usize, + _PtFuncCompare: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ); +} +extern "C" { + pub fn _byteswap_ushort(_Short: ::std::os::raw::c_ushort) -> ::std::os::raw::c_ushort; +} +extern "C" { + pub fn _byteswap_ulong(_Long: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _byteswap_uint64(_Int64: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn div(_Numerator: ::std::os::raw::c_int, _Denominator: ::std::os::raw::c_int) -> div_t; +} +extern "C" { + pub fn getenv(_VarName: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _itoa( + _Value: ::std::os::raw::c_int, + _Dest: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _i64toa( + _Val: ::std::os::raw::c_longlong, + _DstBuf: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _ui64toa( + _Val: ::std::os::raw::c_ulonglong, + _DstBuf: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _atoi64(_String: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _atoi64_l( + _String: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _strtoi64( + _String: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _strtoi64_l( + _String: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _strtoui64( + _String: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _strtoui64_l( + _String: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn ldiv(_Numerator: ::std::os::raw::c_long, _Denominator: ::std::os::raw::c_long) + -> ldiv_t; +} +extern "C" { + pub fn _ltoa( + _Value: ::std::os::raw::c_long, + _Dest: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn mblen(_Ch: *const ::std::os::raw::c_char, _MaxCount: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _mblen_l( + _Ch: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _mbstrlen(_Str: *const ::std::os::raw::c_char) -> usize; +} +extern "C" { + pub fn _mbstrlen_l(_Str: *const ::std::os::raw::c_char, _Locale: _locale_t) -> usize; +} +extern "C" { + pub fn _mbstrnlen(_Str: *const ::std::os::raw::c_char, _MaxCount: usize) -> usize; +} +extern "C" { + pub fn _mbstrnlen_l( + _Str: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn mbtowc( + _DstCh: *mut wchar_t, + _SrcCh: *const ::std::os::raw::c_char, + _SrcSizeInBytes: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _mbtowc_l( + _DstCh: *mut wchar_t, + _SrcCh: *const ::std::os::raw::c_char, + _SrcSizeInBytes: usize, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn mbstowcs( + _Dest: *mut wchar_t, + _Source: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> usize; +} +extern "C" { + pub fn _mbstowcs_l( + _Dest: *mut wchar_t, + _Source: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn mkstemp(template_name: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rand() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_error_mode(_Mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn srand(_Seed: ::std::os::raw::c_uint); +} +extern "C" { + pub fn strtod( + _Str: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + ) -> f64; +} +extern "C" { + pub fn strtof( + nptr: *const ::std::os::raw::c_char, + endptr: *mut *mut ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn strtold( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> u128; +} +extern "C" { + pub fn __strtod( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> f64; +} +extern "C" { + pub fn __mingw_strtof( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> f32; +} +extern "C" { + pub fn __mingw_strtod( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> f64; +} +extern "C" { + pub fn __mingw_strtold( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> u128; +} +extern "C" { + pub fn _strtod_l( + _Str: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> f64; +} +extern "C" { + pub fn strtol( + _Str: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _strtol_l( + _Str: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn strtoul( + _Str: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _strtoul_l( + _Str: *const ::std::os::raw::c_char, + _EndPtr: *mut *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn system(_Command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ultoa( + _Value: ::std::os::raw::c_ulong, + _Dest: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn wctomb(_MbCh: *mut ::std::os::raw::c_char, _WCh: wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wctomb_l( + _MbCh: *mut ::std::os::raw::c_char, + _WCh: wchar_t, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wcstombs( + _Dest: *mut ::std::os::raw::c_char, + _Source: *const wchar_t, + _MaxCount: usize, + ) -> usize; +} +extern "C" { + pub fn _wcstombs_l( + _Dest: *mut ::std::os::raw::c_char, + _Source: *const wchar_t, + _MaxCount: usize, + _Locale: _locale_t, + ) -> usize; +} +extern "C" { + pub fn calloc( + _NumOfElements: ::std::os::raw::c_ulonglong, + _SizeOfElements: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn free(_Memory: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn malloc(_Size: ::std::os::raw::c_ulonglong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn realloc( + _Memory: *mut ::std::os::raw::c_void, + _NewSize: ::std::os::raw::c_ulonglong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _recalloc( + _Memory: *mut ::std::os::raw::c_void, + _Count: usize, + _Size: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _aligned_free(_Memory: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn _aligned_malloc(_Size: usize, _Alignment: usize) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _aligned_offset_malloc( + _Size: usize, + _Alignment: usize, + _Offset: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _aligned_realloc( + _Memory: *mut ::std::os::raw::c_void, + _Size: usize, + _Alignment: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _aligned_recalloc( + _Memory: *mut ::std::os::raw::c_void, + _Count: usize, + _Size: usize, + _Alignment: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _aligned_offset_realloc( + _Memory: *mut ::std::os::raw::c_void, + _Size: usize, + _Alignment: usize, + _Offset: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _aligned_offset_recalloc( + _Memory: *mut ::std::os::raw::c_void, + _Count: usize, + _Size: usize, + _Alignment: usize, + _Offset: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _itow( + _Value: ::std::os::raw::c_int, + _Dest: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ltow( + _Value: ::std::os::raw::c_long, + _Dest: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ultow( + _Value: ::std::os::raw::c_ulong, + _Dest: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn __mingw_wcstod(_Str: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn __mingw_wcstof(nptr: *const wchar_t, endptr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn __mingw_wcstold(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> u128; +} +extern "C" { + pub fn wcstod(_Str: *const wchar_t, _EndPtr: *mut *mut wchar_t) -> f64; +} +extern "C" { + pub fn wcstof(nptr: *const wchar_t, endptr: *mut *mut wchar_t) -> f32; +} +extern "C" { + pub fn wcstold(arg1: *const wchar_t, arg2: *mut *mut wchar_t) -> u128; +} +extern "C" { + pub fn _wcstod_l(_Str: *const wchar_t, _EndPtr: *mut *mut wchar_t, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn wcstol( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wcstol_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn wcstoul( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _wcstoul_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _wgetenv(_VarName: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _wsystem(_Command: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtof(_Str: *const wchar_t) -> f64; +} +extern "C" { + pub fn _wtof_l(_Str: *const wchar_t, _Locale: _locale_t) -> f64; +} +extern "C" { + pub fn _wtoi(_Str: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtoi_l(_Str: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtol(_Str: *const wchar_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _wtol_l(_Str: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _i64tow( + _Val: ::std::os::raw::c_longlong, + _DstBuf: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _ui64tow( + _Val: ::std::os::raw::c_ulonglong, + _DstBuf: *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wtoi64(_Str: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wtoi64_l(_Str: *const wchar_t, _Locale: _locale_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoi64_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _wcstoui64( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _wcstoui64_l( + _Str: *const wchar_t, + _EndPtr: *mut *mut wchar_t, + _Radix: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _putenv(_EnvString: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wputenv(_EnvString: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fullpath( + _FullPath: *mut ::std::os::raw::c_char, + _Path: *const ::std::os::raw::c_char, + _SizeInBytes: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _ecvt( + _Val: f64, + _NumOfDigits: ::std::os::raw::c_int, + _PtDec: *mut ::std::os::raw::c_int, + _PtSign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _fcvt( + _Val: f64, + _NumOfDec: ::std::os::raw::c_int, + _PtDec: *mut ::std::os::raw::c_int, + _PtSign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _gcvt( + _Val: f64, + _NumOfDigits: ::std::os::raw::c_int, + _DstBuf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _atodbl( + _Result: *mut _CRT_DOUBLE, + _Str: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _atoldbl( + _Result: *mut _LDOUBLE, + _Str: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _atoflt( + _Result: *mut _CRT_FLOAT, + _Str: *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _atodbl_l( + _Result: *mut _CRT_DOUBLE, + _Str: *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _atoldbl_l( + _Result: *mut _LDOUBLE, + _Str: *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _atoflt_l( + _Result: *mut _CRT_FLOAT, + _Str: *mut ::std::os::raw::c_char, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _lrotl( + arg1: ::std::os::raw::c_ulong, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _lrotr( + arg1: ::std::os::raw::c_ulong, + arg2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _makepath( + _Path: *mut ::std::os::raw::c_char, + _Drive: *const ::std::os::raw::c_char, + _Dir: *const ::std::os::raw::c_char, + _Filename: *const ::std::os::raw::c_char, + _Ext: *const ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn _onexit(_Func: _onexit_t) -> _onexit_t; +} +extern "C" { + pub fn perror(_ErrMsg: *const ::std::os::raw::c_char); +} +extern "C" { + pub fn _rotl64( + _Val: ::std::os::raw::c_ulonglong, + _Shift: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _rotr64( + Value: ::std::os::raw::c_ulonglong, + Shift: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn _rotr( + _Val: ::std::os::raw::c_uint, + _Shift: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn _rotl( + _Val: ::std::os::raw::c_uint, + _Shift: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn _searchenv( + _Filename: *const ::std::os::raw::c_char, + _EnvVar: *const ::std::os::raw::c_char, + _ResultPath: *mut ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn _splitpath( + _FullPath: *const ::std::os::raw::c_char, + _Drive: *mut ::std::os::raw::c_char, + _Dir: *mut ::std::os::raw::c_char, + _Filename: *mut ::std::os::raw::c_char, + _Ext: *mut ::std::os::raw::c_char, + ); +} +extern "C" { + pub fn _swab( + _Buf1: *mut ::std::os::raw::c_char, + _Buf2: *mut ::std::os::raw::c_char, + _SizeInBytes: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn _wfullpath( + _FullPath: *mut wchar_t, + _Path: *const wchar_t, + _SizeInWords: usize, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _wmakepath( + _ResultPath: *mut wchar_t, + _Drive: *const wchar_t, + _Dir: *const wchar_t, + _Filename: *const wchar_t, + _Ext: *const wchar_t, + ); +} +extern "C" { + pub fn _wperror(_ErrMsg: *const wchar_t); +} +extern "C" { + pub fn _wsearchenv( + _Filename: *const wchar_t, + _EnvVar: *const wchar_t, + _ResultPath: *mut wchar_t, + ); +} +extern "C" { + pub fn _wsplitpath( + _FullPath: *const wchar_t, + _Drive: *mut wchar_t, + _Dir: *mut wchar_t, + _Filename: *mut wchar_t, + _Ext: *mut wchar_t, + ); +} +extern "C" { + pub fn _beep(_Frequency: ::std::os::raw::c_uint, _Duration: ::std::os::raw::c_uint); +} +extern "C" { + pub fn _seterrormode(_Mode: ::std::os::raw::c_int); +} +extern "C" { + pub fn _sleep(_Duration: ::std::os::raw::c_ulong); +} +extern "C" { + pub fn ecvt( + _Val: f64, + _NumOfDigits: ::std::os::raw::c_int, + _PtDec: *mut ::std::os::raw::c_int, + _PtSign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fcvt( + _Val: f64, + _NumOfDec: ::std::os::raw::c_int, + _PtDec: *mut ::std::os::raw::c_int, + _PtSign: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn gcvt( + _Val: f64, + _NumOfDigits: ::std::os::raw::c_int, + _DstBuf: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn itoa( + _Val: ::std::os::raw::c_int, + _DstBuf: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ltoa( + _Val: ::std::os::raw::c_long, + _DstBuf: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn putenv(_EnvString: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swab( + _Buf1: *mut ::std::os::raw::c_char, + _Buf2: *mut ::std::os::raw::c_char, + _SizeInBytes: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn ultoa( + _Val: ::std::os::raw::c_ulong, + _Dstbuf: *mut ::std::os::raw::c_char, + _Radix: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn onexit(_Func: _onexit_t) -> _onexit_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct lldiv_t { + pub quot: ::std::os::raw::c_longlong, + pub rem: ::std::os::raw::c_longlong, +} +extern "C" { + pub fn lldiv(arg1: ::std::os::raw::c_longlong, arg2: ::std::os::raw::c_longlong) -> lldiv_t; +} +extern "C" { + pub fn llabs(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtoll( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn strtoull( + arg1: *const ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn atoll(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn wtoll(arg1: *const wchar_t) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn lltoa( + arg1: ::std::os::raw::c_longlong, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ulltoa( + arg1: ::std::os::raw::c_ulonglong, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn lltow( + arg1: ::std::os::raw::c_longlong, + arg2: *mut wchar_t, + arg3: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn ulltow( + arg1: ::std::os::raw::c_ulonglong, + arg2: *mut wchar_t, + arg3: ::std::os::raw::c_int, + ) -> *mut wchar_t; +} +extern "C" { + pub fn _dupenv_s( + _PBuffer: *mut *mut ::std::os::raw::c_char, + _PBufferSizeInBytes: *mut usize, + _VarName: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn _itoa_s( + _Value: ::std::os::raw::c_int, + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _i64toa_s( + _Val: ::std::os::raw::c_longlong, + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ui64toa_s( + _Val: ::std::os::raw::c_ulonglong, + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _ltoa_s( + _Val: ::std::os::raw::c_long, + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn mbstowcs_s( + _PtNumOfCharConverted: *mut usize, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _SrcBuf: *const ::std::os::raw::c_char, + _MaxCount: usize, + ) -> errno_t; +} +extern "C" { + pub fn _mbstowcs_s_l( + _PtNumOfCharConverted: *mut usize, + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _SrcBuf: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _ultoa_s( + _Val: ::std::os::raw::c_ulong, + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Radix: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _wctomb_s_l( + _SizeConverted: *mut ::std::os::raw::c_int, + _MbCh: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + _WCh: wchar_t, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn wcstombs_s( + _PtNumOfCharConverted: *mut usize, + _Dst: *mut ::std::os::raw::c_char, + _DstSizeInBytes: usize, + _Src: *const wchar_t, + _MaxCountInBytes: usize, + ) -> errno_t; +} +extern "C" { + pub fn _wcstombs_s_l( + _PtNumOfCharConverted: *mut usize, + _Dst: *mut ::std::os::raw::c_char, + _DstSizeInBytes: usize, + _Src: *const wchar_t, + _MaxCountInBytes: usize, + _Locale: _locale_t, + ) -> errno_t; +} +extern "C" { + pub fn _ecvt_s( + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Val: f64, + _NumOfDights: ::std::os::raw::c_int, + _PtDec: *mut ::std::os::raw::c_int, + _PtSign: *mut ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _fcvt_s( + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Val: f64, + _NumOfDec: ::std::os::raw::c_int, + _PtDec: *mut ::std::os::raw::c_int, + _PtSign: *mut ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _gcvt_s( + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Val: f64, + _NumOfDigits: ::std::os::raw::c_int, + ) -> errno_t; +} +extern "C" { + pub fn _makepath_s( + _PathResult: *mut ::std::os::raw::c_char, + _Size: usize, + _Drive: *const ::std::os::raw::c_char, + _Dir: *const ::std::os::raw::c_char, + _Filename: *const ::std::os::raw::c_char, + _Ext: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn _putenv_s( + _Name: *const ::std::os::raw::c_char, + _Value: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn _searchenv_s( + _Filename: *const ::std::os::raw::c_char, + _EnvVar: *const ::std::os::raw::c_char, + _ResultPath: *mut ::std::os::raw::c_char, + _SizeInBytes: usize, + ) -> errno_t; +} +extern "C" { + pub fn _splitpath_s( + _FullPath: *const ::std::os::raw::c_char, + _Drive: *mut ::std::os::raw::c_char, + _DriveSize: usize, + _Dir: *mut ::std::os::raw::c_char, + _DirSize: usize, + _Filename: *mut ::std::os::raw::c_char, + _FilenameSize: usize, + _Ext: *mut ::std::os::raw::c_char, + _ExtSize: usize, + ) -> errno_t; +} +extern "C" { + pub fn qsort_s( + _Base: *mut ::std::os::raw::c_void, + _NumOfElements: usize, + _SizeOfElements: usize, + _PtFuncCompare: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + arg3: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + _Context: *mut ::std::os::raw::c_void, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _heapinfo { + pub _pentry: *mut ::std::os::raw::c_int, + pub _size: usize, + pub _useflag: ::std::os::raw::c_int, +} +pub type _HEAPINFO = _heapinfo; +extern "C" { + pub static mut _amblksiz: ::std::os::raw::c_uint; +} +extern "C" { + pub fn __mingw_aligned_malloc(_Size: usize, _Alignment: usize) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn __mingw_aligned_free(_Memory: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn __mingw_aligned_offset_realloc( + _Memory: *mut ::std::os::raw::c_void, + _Size: usize, + _Alignment: usize, + _Offset: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn __mingw_aligned_realloc( + _Memory: *mut ::std::os::raw::c_void, + _Size: usize, + _Offset: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _resetstkoflw() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_malloc_crt_max_wait(_NewValue: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _expand( + _Memory: *mut ::std::os::raw::c_void, + _NewSize: usize, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _msize(_Memory: *mut ::std::os::raw::c_void) -> usize; +} +extern "C" { + pub fn _get_sbh_threshold() -> usize; +} +extern "C" { + pub fn _set_sbh_threshold(_NewValue: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_amblksiz(_Value: usize) -> errno_t; +} +extern "C" { + pub fn _get_amblksiz(_Value: *mut usize) -> errno_t; +} +extern "C" { + pub fn _heapadd(_Memory: *mut ::std::os::raw::c_void, _Size: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _heapchk() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _heapmin() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _heapset(_Fill: ::std::os::raw::c_uint) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _heapwalk(_EntryInfo: *mut _HEAPINFO) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _heapused(_Used: *mut usize, _Commit: *mut usize) -> usize; +} +extern "C" { + pub fn _get_heap_handle() -> isize; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _iobuf { + pub _ptr: *mut ::std::os::raw::c_char, + pub _cnt: ::std::os::raw::c_int, + pub _base: *mut ::std::os::raw::c_char, + pub _flag: ::std::os::raw::c_int, + pub _file: ::std::os::raw::c_int, + pub _charbuf: ::std::os::raw::c_int, + pub _bufsiz: ::std::os::raw::c_int, + pub _tmpfname: *mut ::std::os::raw::c_char, +} +pub type FILE = _iobuf; +pub type _off_t = ::std::os::raw::c_long; +pub type off32_t = ::std::os::raw::c_long; +pub type _off64_t = ::std::os::raw::c_longlong; +pub type off64_t = ::std::os::raw::c_longlong; +pub type off_t = off32_t; +extern "C" { + pub fn __acrt_iob_func(index: ::std::os::raw::c_uint) -> *mut FILE; +} +extern "C" { + pub fn __iob_func() -> *mut FILE; +} +pub type fpos_t = ::std::os::raw::c_longlong; +extern "C" { + pub fn __mingw_sscanf( + _Src: *const ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vsscanf( + _Str: *const ::std::os::raw::c_char, + Format: *const ::std::os::raw::c_char, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_scanf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vscanf( + Format: *const ::std::os::raw::c_char, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_fscanf( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vfscanf( + fp: *mut FILE, + Format: *const ::std::os::raw::c_char, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vsnprintf( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_snprintf( + s: *mut ::std::os::raw::c_char, + n: usize, + format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_printf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vprintf( + arg1: *const ::std::os::raw::c_char, + arg2: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_fprintf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vfprintf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_sprintf( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vsprintf( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_asprintf( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vasprintf( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fprintf( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn printf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sprintf( + _Dest: *mut ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfprintf( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _ArgList: __builtin_va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vprintf( + _Format: *const ::std::os::raw::c_char, + _ArgList: __builtin_va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsprintf( + _Dest: *mut ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + _Args: __builtin_va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fscanf( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn scanf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sscanf( + _Src: *const ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vscanf( + Format: *const ::std::os::raw::c_char, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vfscanf( + fp: *mut FILE, + Format: *const ::std::os::raw::c_char, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vsscanf( + _Str: *const ::std::os::raw::c_char, + Format: *const ::std::os::raw::c_char, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _filbuf(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _flsbuf(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fsopen( + _Filename: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn clearerr(_File: *mut FILE); +} +extern "C" { + pub fn fclose(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fcloseall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fdopen( + _FileHandle: ::std::os::raw::c_int, + _Mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn feof(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ferror(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fflush(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetc(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fgetchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetpos(_File: *mut FILE, _Pos: *mut fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgetpos64(_File: *mut FILE, _Pos: *mut fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fgets( + _Buf: *mut ::std::os::raw::c_char, + _MaxCount: ::std::os::raw::c_int, + _File: *mut FILE, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _fileno(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _tempnam( + _DirName: *const ::std::os::raw::c_char, + _FilePrefix: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _flushall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fopen( + _Filename: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn fopen64( + filename: *const ::std::os::raw::c_char, + mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn fputc(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fputchar(_Ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputs(_Str: *const ::std::os::raw::c_char, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fread( + _DstBuf: *mut ::std::os::raw::c_void, + _ElementSize: ::std::os::raw::c_ulonglong, + _Count: ::std::os::raw::c_ulonglong, + _File: *mut FILE, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn freopen( + _Filename: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + _File: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn fsetpos(_File: *mut FILE, _Pos: *const fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fsetpos64(_File: *mut FILE, _Pos: *const fpos_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fseek( + _File: *mut FILE, + _Offset: ::std::os::raw::c_long, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftell(_File: *mut FILE) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _fseeki64( + _File: *mut FILE, + _Offset: ::std::os::raw::c_longlong, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ftelli64(_File: *mut FILE) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn fseeko64( + stream: *mut FILE, + offset: _off64_t, + whence: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fseeko( + stream: *mut FILE, + offset: _off_t, + whence: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ftello(stream: *mut FILE) -> _off_t; +} +extern "C" { + pub fn ftello64(stream: *mut FILE) -> _off64_t; +} +extern "C" { + pub fn fwrite( + _Str: *const ::std::os::raw::c_void, + _Size: ::std::os::raw::c_ulonglong, + _Count: ::std::os::raw::c_ulonglong, + _File: *mut FILE, + ) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn getc(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getmaxstdio() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn gets(_Buffer: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn _getw(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _pclose(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _popen( + _Command: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn putc(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putchar(_Ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn puts(_Str: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _putw(_Word: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn remove(_Filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rename( + _OldFilename: *const ::std::os::raw::c_char, + _NewFilename: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _unlink(_Filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn unlink(_Filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rewind(_File: *mut FILE); +} +extern "C" { + pub fn _rmtmp() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setbuf(_File: *mut FILE, _Buffer: *mut ::std::os::raw::c_char); +} +extern "C" { + pub fn _setmaxstdio(_Max: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_output_format(_Format: ::std::os::raw::c_uint) -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn _get_output_format() -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn setvbuf( + _File: *mut FILE, + _Buf: *mut ::std::os::raw::c_char, + _Mode: ::std::os::raw::c_int, + _Size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scprintf(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snscanf( + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tmpfile() -> *mut FILE; +} +extern "C" { + pub fn tmpnam(_Buffer: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ungetc(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snprintf( + _Dest: *mut ::std::os::raw::c_char, + _Count: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnprintf( + _Dest: *mut ::std::os::raw::c_char, + _Count: usize, + _Format: *const ::std::os::raw::c_char, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vsnprintf( + d: *mut ::std::os::raw::c_char, + n: usize, + format: *const ::std::os::raw::c_char, + arg: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_snprintf( + s: *mut ::std::os::raw::c_char, + n: usize, + format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscprintf( + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _set_printf_count_output(_Value: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _get_printf_count_output() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_swscanf( + _Src: *const wchar_t, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vswscanf( + _Str: *const wchar_t, + Format: *const wchar_t, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_wscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vwscanf(Format: *const wchar_t, argp: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_fwscanf(_File: *mut FILE, _Format: *const wchar_t, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vfwscanf( + fp: *mut FILE, + Format: *const wchar_t, + argp: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_fwprintf( + _File: *mut FILE, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_wprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vfwprintf( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_snwprintf( + s: *mut wchar_t, + n: usize, + format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vsnwprintf( + arg1: *mut wchar_t, + arg2: usize, + arg3: *const wchar_t, + arg4: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_swprintf(arg1: *mut wchar_t, arg2: *const wchar_t, ...) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_vswprintf( + arg1: *mut wchar_t, + arg2: *const wchar_t, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwscanf(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swscanf(_Src: *const wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wscanf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vwscanf(arg1: *const wchar_t, arg2: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vfwscanf( + arg1: *mut FILE, + arg2: *const wchar_t, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vswscanf( + arg1: *const wchar_t, + arg2: *const wchar_t, + arg3: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fwprintf(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwprintf( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfsopen( + _Filename: *const wchar_t, + _Mode: *const wchar_t, + _ShFlag: ::std::os::raw::c_int, + ) -> *mut FILE; +} +extern "C" { + pub fn fgetwc(_File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fgetwchar() -> wint_t; +} +extern "C" { + pub fn fputwc(_Ch: wchar_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwchar(_Ch: wchar_t) -> wint_t; +} +extern "C" { + pub fn getwc(_File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn getwchar() -> wint_t; +} +extern "C" { + pub fn putwc(_Ch: wchar_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn putwchar(_Ch: wchar_t) -> wint_t; +} +extern "C" { + pub fn ungetwc(_Ch: wint_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn fgetws( + _Dst: *mut wchar_t, + _SizeInWords: ::std::os::raw::c_int, + _File: *mut FILE, + ) -> *mut wchar_t; +} +extern "C" { + pub fn fputws(_Str: *const wchar_t, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _getws(_String: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _putws(_Str: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_c( + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_c( + _DstBuf: *mut wchar_t, + _SizeInWords: usize, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf( + _Dest: *mut wchar_t, + _Count: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf( + _Dest: *mut wchar_t, + _Count: usize, + _Format: *const wchar_t, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_snwprintf( + s: *mut wchar_t, + n: usize, + format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __ms_vsnwprintf( + arg1: *mut wchar_t, + arg2: usize, + arg3: *const wchar_t, + arg4: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf(_Dest: *mut wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf( + _Dest: *mut wchar_t, + _Format: *const wchar_t, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtempnam(_Directory: *const wchar_t, _FilePrefix: *const wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _snwscanf( + _Src: *const wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfdopen(_FileHandle: ::std::os::raw::c_int, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfopen(_Filename: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wfreopen( + _Filename: *const wchar_t, + _Mode: *const wchar_t, + _OldFile: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _wpopen(_Command: *const wchar_t, _Mode: *const wchar_t) -> *mut FILE; +} +extern "C" { + pub fn _wremove(_Filename: *const wchar_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wtmpnam(_Buffer: *mut wchar_t) -> *mut wchar_t; +} +extern "C" { + pub fn _fgetwc_nolock(_File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _fputwc_nolock(_Ch: wchar_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _ungetwc_nolock(_Ch: wint_t, _File: *mut FILE) -> wint_t; +} +extern "C" { + pub fn _lock_file(_File: *mut FILE); +} +extern "C" { + pub fn _unlock_file(_File: *mut FILE); +} +extern "C" { + pub fn _fclose_nolock(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fflush_nolock(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fread_nolock( + _DstBuf: *mut ::std::os::raw::c_void, + _ElementSize: usize, + _Count: usize, + _File: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _fseek_nolock( + _File: *mut FILE, + _Offset: ::std::os::raw::c_long, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ftell_nolock(_File: *mut FILE) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _fseeki64_nolock( + _File: *mut FILE, + _Offset: ::std::os::raw::c_longlong, + _Origin: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ftelli64_nolock(_File: *mut FILE) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _fwrite_nolock( + _DstBuf: *const ::std::os::raw::c_void, + _Size: usize, + _Count: usize, + _File: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _ungetc_nolock(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tempnam( + _Directory: *const ::std::os::raw::c_char, + _FilePrefix: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn fcloseall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fdopen( + _FileHandle: ::std::os::raw::c_int, + _Format: *const ::std::os::raw::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn fgetchar() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fileno(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn flushall() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fputchar(_Ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getw(_File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn putw(_Ch: ::std::os::raw::c_int, _File: *mut FILE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn rmtmp() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_str_wide_utf8( + wptr: *const wchar_t, + mbptr: *mut *mut ::std::os::raw::c_char, + buflen: *mut usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_str_utf8_wide( + mbptr: *const ::std::os::raw::c_char, + wptr: *mut *mut wchar_t, + buflen: *mut usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __mingw_str_free(ptr: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn _wspawnl( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnle( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlp( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnlpe( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const wchar_t, + ... + ) -> isize; +} +extern "C" { + pub fn _wspawnv( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnve( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvp( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _wspawnvpe( + _Mode: ::std::os::raw::c_int, + _Filename: *const wchar_t, + _ArgList: *const *const wchar_t, + _Env: *const *const wchar_t, + ) -> isize; +} +extern "C" { + pub fn _spawnv( + _Mode: ::std::os::raw::c_int, + _Filename: *const ::std::os::raw::c_char, + _ArgList: *const *const ::std::os::raw::c_char, + ) -> isize; +} +extern "C" { + pub fn _spawnve( + _Mode: ::std::os::raw::c_int, + _Filename: *const ::std::os::raw::c_char, + _ArgList: *const *const ::std::os::raw::c_char, + _Env: *const *const ::std::os::raw::c_char, + ) -> isize; +} +extern "C" { + pub fn _spawnvp( + _Mode: ::std::os::raw::c_int, + _Filename: *const ::std::os::raw::c_char, + _ArgList: *const *const ::std::os::raw::c_char, + ) -> isize; +} +extern "C" { + pub fn _spawnvpe( + _Mode: ::std::os::raw::c_int, + _Filename: *const ::std::os::raw::c_char, + _ArgList: *const *const ::std::os::raw::c_char, + _Env: *const *const ::std::os::raw::c_char, + ) -> isize; +} +extern "C" { + pub fn clearerr_s(_File: *mut FILE) -> errno_t; +} +extern "C" { + pub fn fread_s( + _DstBuf: *mut ::std::os::raw::c_void, + _DstSize: usize, + _ElementSize: usize, + _Count: usize, + _File: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn fprintf_s( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fscanf_s_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn printf_s(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scanf_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scanf_s_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snprintf_c( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnprintf_c( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fscanf_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _sscanf_l( + _Src: *const ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _sscanf_s_l( + _Src: *const ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sscanf_s( + _Src: *const ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snscanf_s( + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snscanf_l( + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snscanf_s_l( + _Src: *const ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfprintf_s( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vprintf_s( + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsnprintf_s( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnprintf_s( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vsprintf_s( + _DstBuf: *mut ::std::os::raw::c_char, + _Size: usize, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn sprintf_s( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snprintf_s( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fprintf_p( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _printf_p(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _sprintf_p( + _Dst: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfprintf_p( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vprintf_p( + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsprintf_p( + _Dst: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scprintf_p(_Format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscprintf_p( + _Format: *const ::std::os::raw::c_char, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _printf_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _printf_p_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vprintf_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vprintf_p_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fprintf_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fprintf_p_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfprintf_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfprintf_p_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _sprintf_l( + _DstBuf: *mut ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _sprintf_p_l( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsprintf_l( + _DstBuf: *mut ::std::os::raw::c_char, + _Format: *const ::std::os::raw::c_char, + arg1: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsprintf_p_l( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scprintf_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scprintf_p_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscprintf_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscprintf_p_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _printf_s_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vprintf_s_l( + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fprintf_s_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfprintf_s_l( + _File: *mut FILE, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _sprintf_s_l( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsprintf_s_l( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snprintf_s_l( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnprintf_s_l( + _DstBuf: *mut ::std::os::raw::c_char, + _DstSize: usize, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snprintf_l( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snprintf_c_l( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnprintf_l( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + _Format: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnprintf_c_l( + _DstBuf: *mut ::std::os::raw::c_char, + _MaxCount: usize, + arg1: *const ::std::os::raw::c_char, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fopen_s( + _File: *mut *mut FILE, + _Filename: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + ) -> errno_t; +} +extern "C" { + pub fn freopen_s( + _File: *mut *mut FILE, + _Filename: *const ::std::os::raw::c_char, + _Mode: *const ::std::os::raw::c_char, + _Stream: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn gets_s(arg1: *mut ::std::os::raw::c_char, arg2: rsize_t) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn tmpnam_s(arg1: *mut ::std::os::raw::c_char, arg2: rsize_t) -> errno_t; +} +extern "C" { + pub fn _getws_s(_Str: *mut wchar_t, _SizeInWords: usize) -> *mut wchar_t; +} +extern "C" { + pub fn fwprintf_s(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wprintf_s(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vfwprintf_s( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vwprintf_s(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn vswprintf_s( + _Dst: *mut wchar_t, + _SizeInWords: usize, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swprintf_s( + _Dst: *mut wchar_t, + _SizeInWords: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf_s( + _DstBuf: *mut wchar_t, + _DstSizeInWords: usize, + _MaxCount: usize, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf_s( + _DstBuf: *mut wchar_t, + _DstSizeInWords: usize, + _MaxCount: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_s_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_s_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_s_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: usize, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf_s_l( + _DstBuf: *mut wchar_t, + _DstSize: usize, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwscanf_s_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swscanf_s_l( + _Src: *const wchar_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn swscanf_s(_Src: *const wchar_t, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf_s( + _Src: *const wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf_s_l( + _Src: *const wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wscanf_s_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wfopen_s( + _File: *mut *mut FILE, + _Filename: *const wchar_t, + _Mode: *const wchar_t, + ) -> errno_t; +} +extern "C" { + pub fn _wfreopen_s( + _File: *mut *mut FILE, + _Filename: *const wchar_t, + _Mode: *const wchar_t, + _OldFile: *mut FILE, + ) -> errno_t; +} +extern "C" { + pub fn _wtmpnam_s(_DstBuf: *mut wchar_t, _SizeInWords: usize) -> errno_t; +} +extern "C" { + pub fn _fwprintf_p(_File: *mut FILE, _Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_p( + _File: *mut FILE, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_p( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_p( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf_p(_Format: *const wchar_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf_p(_Format: *const wchar_t, _ArgList: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wprintf_p_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwprintf_p_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vfwprintf_p_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_c_l( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swprintf_p_l( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_c_l( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vswprintf_p_l( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _scwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf_p_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwprintf_l( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vsnwprintf_l( + _DstBuf: *mut wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __swprintf_l( + _Dest: *mut wchar_t, + _Format: *const wchar_t, + _Plocinfo: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __vswprintf_l( + _Dest: *mut wchar_t, + _Format: *const wchar_t, + _Plocinfo: _locale_t, + _Args: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _vscwprintf_l( + _Format: *const wchar_t, + _Locale: _locale_t, + _ArgList: va_list, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fwscanf_l( + _File: *mut FILE, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _swscanf_l( + _Src: *const wchar_t, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _snwscanf_l( + _Src: *const wchar_t, + _MaxCount: usize, + _Format: *const wchar_t, + _Locale: _locale_t, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _wscanf_l(_Format: *const wchar_t, _Locale: _locale_t, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _fread_nolock_s( + _DstBuf: *mut ::std::os::raw::c_void, + _DstSize: usize, + _ElementSize: usize, + _Count: usize, + _File: *mut FILE, + ) -> usize; +} +pub const _SAPP_MAX_TITLE_LENGTH: _bindgen_ty_3 = 128; +pub type _bindgen_ty_3 = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _sapp_state { + pub valid: bool, + pub window_width: ::std::os::raw::c_int, + pub window_height: ::std::os::raw::c_int, + pub framebuffer_width: ::std::os::raw::c_int, + pub framebuffer_height: ::std::os::raw::c_int, + pub sample_count: ::std::os::raw::c_int, + pub swap_interval: ::std::os::raw::c_int, + pub dpi_scale: f32, + pub gles2_fallback: bool, + pub first_frame: bool, + pub init_called: bool, + pub cleanup_called: bool, + pub quit_requested: bool, + pub quit_ordered: bool, + pub html5_canvas_name: *const ::std::os::raw::c_char, + pub html5_ask_leave_site: bool, + pub window_title: [::std::os::raw::c_char; 128usize], + pub window_title_wide: [wchar_t; 128usize], + pub frame_count: u64, + pub mouse_x: f32, + pub mouse_y: f32, + pub win32_mouse_tracked: bool, + pub onscreen_keyboard_shown: bool, + pub event: sapp_event, + pub desc: sapp_desc, + pub keycodes: [sapp_keycode; 512usize], +} +extern "C" { + pub static mut _sapp: _sapp_state; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _sapp_gl_fbconfig { + pub red_bits: ::std::os::raw::c_int, + pub green_bits: ::std::os::raw::c_int, + pub blue_bits: ::std::os::raw::c_int, + pub alpha_bits: ::std::os::raw::c_int, + pub depth_bits: ::std::os::raw::c_int, + pub stencil_bits: ::std::os::raw::c_int, + pub samples: ::std::os::raw::c_int, + pub doublebuffer: bool, + pub handle: usize, +} +extern "C" { + pub fn __C_specific_handler( + _ExceptionRecord: *mut _EXCEPTION_RECORD, + _EstablisherFrame: *mut ::std::os::raw::c_void, + _ContextRecord: *mut _CONTEXT, + _DispatcherContext: *mut _DISPATCHER_CONTEXT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _exception_code() -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn _exception_info() -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _abnormal_termination() -> ::std::os::raw::c_int; +} +pub type _PHNDLR = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XCPT_ACTION { + pub XcptNum: ::std::os::raw::c_ulong, + pub SigNum: ::std::os::raw::c_int, + pub XcptAction: _PHNDLR, +} +extern "C" { + pub static mut _XcptActTab: [_XCPT_ACTION; 0usize]; +} +extern "C" { + pub static mut _XcptActTabCount: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _XcptActTabSize: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _First_FPE_Indx: ::std::os::raw::c_int; +} +extern "C" { + pub static mut _Num_FPE: ::std::os::raw::c_int; +} +extern "C" { + pub fn __CppXcptFilter( + _ExceptionNum: ::std::os::raw::c_ulong, + _ExceptionPtr: *mut _EXCEPTION_POINTERS, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _XcptFilter( + _ExceptionNum: ::std::os::raw::c_ulong, + _ExceptionPtr: *mut _EXCEPTION_POINTERS, + ) -> ::std::os::raw::c_int; +} +pub type PEXCEPTION_HANDLER = ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut _EXCEPTION_RECORD, + arg2: *mut ::std::os::raw::c_void, + arg3: *mut _CONTEXT, + arg4: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +pub type ULONG = ::std::os::raw::c_ulong; +pub type PULONG = *mut ULONG; +pub type USHORT = ::std::os::raw::c_ushort; +pub type PUSHORT = *mut USHORT; +pub type UCHAR = ::std::os::raw::c_uchar; +pub type PUCHAR = *mut UCHAR; +pub type PSZ = *mut ::std::os::raw::c_char; +pub type WINBOOL = ::std::os::raw::c_int; +pub type BOOL = ::std::os::raw::c_int; +pub type PBOOL = *mut WINBOOL; +pub type LPBOOL = *mut WINBOOL; +pub type BYTE = ::std::os::raw::c_uchar; +pub type WORD = ::std::os::raw::c_ushort; +pub type DWORD = ::std::os::raw::c_ulong; +pub type FLOAT = f32; +pub type PFLOAT = *mut FLOAT; +pub type PBYTE = *mut BYTE; +pub type LPBYTE = *mut BYTE; +pub type PINT = *mut ::std::os::raw::c_int; +pub type LPINT = *mut ::std::os::raw::c_int; +pub type PWORD = *mut WORD; +pub type LPWORD = *mut WORD; +pub type LPLONG = *mut ::std::os::raw::c_long; +pub type PDWORD = *mut DWORD; +pub type LPDWORD = *mut DWORD; +pub type LPVOID = *mut ::std::os::raw::c_void; +pub type LPCVOID = *const ::std::os::raw::c_void; +pub type INT = ::std::os::raw::c_int; +pub type UINT = ::std::os::raw::c_uint; +pub type PUINT = *mut ::std::os::raw::c_uint; +extern "C" { + pub static mut __imp__pctype: *mut *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub static mut __imp__wctype: *mut *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub static mut __imp__pwctype: *mut *mut ::std::os::raw::c_ushort; +} +extern "C" { + pub static mut __newclmap: [::std::os::raw::c_uchar; 0usize]; +} +extern "C" { + pub static mut __newcumap: [::std::os::raw::c_uchar; 0usize]; +} +extern "C" { + pub static mut __ptlocinfo: pthreadlocinfo; +} +extern "C" { + pub static mut __ptmbcinfo: pthreadmbcinfo; +} +extern "C" { + pub static mut __globallocalestatus: ::std::os::raw::c_int; +} +extern "C" { + pub static mut __locale_changed: ::std::os::raw::c_int; +} +extern "C" { + pub static mut __initiallocinfo: threadlocaleinfostruct; +} +extern "C" { + pub static mut __initiallocalestructinfo: _locale_tstruct; +} +extern "C" { + pub fn __updatetlocinfo() -> pthreadlocinfo; +} +extern "C" { + pub fn __updatetmbcinfo() -> pthreadmbcinfo; +} +extern "C" { + pub fn _isctype( + _C: ::std::os::raw::c_int, + _Type: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isctype_l( + _C: ::std::os::raw::c_int, + _Type: ::std::os::raw::c_int, + _Locale: _locale_t, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isalpha(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isalpha_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isupper(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isupper_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn islower(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _islower_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isdigit(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isdigit_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isxdigit(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isxdigit_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isspace(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isspace_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ispunct(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _ispunct_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isalnum(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isalnum_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isprint(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isprint_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isgraph(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isgraph_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iscntrl(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iscntrl_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn toupper(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn tolower(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _tolower(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _tolower_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _toupper(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _toupper_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __isascii(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __toascii(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iscsymf(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iscsym(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isblank(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswalpha(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalpha_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswupper(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswupper_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswlower(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswlower_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswxdigit(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswxdigit_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswspace(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswspace_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswpunct(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswpunct_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswalnum(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswalnum_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswprint(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswprint_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswgraph(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswgraph_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswcntrl(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcntrl_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswascii(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn isleadbyte(_C: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _isleadbyte_l(_C: ::std::os::raw::c_int, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn towupper(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn _towupper_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn towlower(_C: wint_t) -> wint_t; +} +extern "C" { + pub fn _towlower_l(_C: wint_t, _Locale: _locale_t) -> wint_t; +} +extern "C" { + pub fn iswctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswctype_l(_C: wint_t, _Type: wctype_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsymf(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsymf_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __iswcsym(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn _iswcsym_l(_C: wint_t, _Locale: _locale_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn is_wctype(_C: wint_t, _Type: wctype_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn iswblank(_C: wint_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn __faststorefence(); +} +extern "C" { + pub fn __stosq( + arg1: *mut ::std::os::raw::c_ulonglong, + arg2: ::std::os::raw::c_ulonglong, + arg3: usize, + ); +} +extern "C" { + pub fn _interlockedbittestandset64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _interlockedbittestandreset64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _interlockedbittestandcomplement64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn InterlockedBitTestAndSet64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn InterlockedBitTestAndReset64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn InterlockedBitTestAndComplement64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _InterlockedAnd64( + arg1: *mut ::std::os::raw::c_longlong, + arg2: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedOr64( + arg1: *mut ::std::os::raw::c_longlong, + arg2: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedXor64( + arg1: *mut ::std::os::raw::c_longlong, + arg2: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedIncrement64( + Addend: *mut ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedDecrement64( + Addend: *mut ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedExchange64( + Target: *mut ::std::os::raw::c_longlong, + Value: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedExchangeAdd64( + Addend: *mut ::std::os::raw::c_longlong, + Value: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn __readgsbyte(Offset: ::std::os::raw::c_ulong) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn __readgsword(Offset: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ushort; +} +extern "C" { + pub fn __readgsdword(Offset: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn __readgsqword(Offset: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulonglong; +} +extern "C" { + pub fn __writegsbyte(Offset: ::std::os::raw::c_ulong, Data: ::std::os::raw::c_uchar); +} +extern "C" { + pub fn __writegsword(Offset: ::std::os::raw::c_ulong, Data: ::std::os::raw::c_ushort); +} +extern "C" { + pub fn __writegsdword(Offset: ::std::os::raw::c_ulong, Data: ::std::os::raw::c_ulong); +} +extern "C" { + pub fn __writegsqword(Offset: ::std::os::raw::c_ulong, Data: ::std::os::raw::c_ulonglong); +} +extern "C" { + pub fn _BitScanForward64( + Index: *mut ::std::os::raw::c_ulong, + Mask: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _BitScanReverse64( + Index: *mut ::std::os::raw::c_ulong, + Mask: ::std::os::raw::c_ulonglong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittest64( + a: *const ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittestandset64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittestandreset64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittestandcomplement64( + a: *mut ::std::os::raw::c_longlong, + b: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn __movsq( + Dest: *mut ::std::os::raw::c_ulonglong, + Source: *const ::std::os::raw::c_ulonglong, + Count: usize, + ); +} +extern "C" { + pub fn _InterlockedAnd( + arg1: *mut ::std::os::raw::c_long, + arg2: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedOr( + arg1: *mut ::std::os::raw::c_long, + arg2: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedXor( + arg1: *mut ::std::os::raw::c_long, + arg2: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedIncrement16(Addend: *mut ::std::os::raw::c_short) + -> ::std::os::raw::c_short; +} +extern "C" { + pub fn _InterlockedDecrement16(Addend: *mut ::std::os::raw::c_short) + -> ::std::os::raw::c_short; +} +extern "C" { + pub fn _InterlockedCompareExchange16( + Destination: *mut ::std::os::raw::c_short, + ExChange: ::std::os::raw::c_short, + Comperand: ::std::os::raw::c_short, + ) -> ::std::os::raw::c_short; +} +extern "C" { + pub fn _InterlockedExchangeAdd( + Addend: *mut ::std::os::raw::c_long, + Value: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedCompareExchange( + Destination: *mut ::std::os::raw::c_long, + ExChange: ::std::os::raw::c_long, + Comperand: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedIncrement(Addend: *mut ::std::os::raw::c_long) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedDecrement(Addend: *mut ::std::os::raw::c_long) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedAdd( + Addend: *mut ::std::os::raw::c_long, + Value: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedAdd64( + Addend: *mut ::std::os::raw::c_longlong, + Value: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedExchange( + Target: *mut ::std::os::raw::c_long, + Value: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _InterlockedCompareExchange64( + Destination: *mut ::std::os::raw::c_longlong, + ExChange: ::std::os::raw::c_longlong, + Comperand: ::std::os::raw::c_longlong, + ) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn _InterlockedCompareExchangePointer( + Destination: *mut *mut ::std::os::raw::c_void, + ExChange: *mut ::std::os::raw::c_void, + Comperand: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn _InterlockedExchangePointer( + Target: *mut *mut ::std::os::raw::c_void, + Value: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn __int2c(); +} +extern "C" { + pub fn __stosb(arg1: *mut ::std::os::raw::c_uchar, arg2: ::std::os::raw::c_uchar, arg3: usize); +} +extern "C" { + pub fn __stosw( + arg1: *mut ::std::os::raw::c_ushort, + arg2: ::std::os::raw::c_ushort, + arg3: usize, + ); +} +extern "C" { + pub fn __stosd(arg1: *mut ::std::os::raw::c_ulong, arg2: ::std::os::raw::c_ulong, arg3: usize); +} +extern "C" { + pub fn _interlockedbittestandset( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _interlockedbittestandreset( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _interlockedbittestandcomplement( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn InterlockedBitTestAndSet( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn InterlockedBitTestAndReset( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn InterlockedBitTestAndComplement( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _BitScanForward( + Index: *mut ::std::os::raw::c_ulong, + Mask: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _BitScanReverse( + Index: *mut ::std::os::raw::c_ulong, + Mask: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittest( + a: *const ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittestandset( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittestandreset( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _bittestandcomplement( + a: *mut ::std::os::raw::c_long, + b: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn __movsb( + Destination: *mut ::std::os::raw::c_uchar, + Source: *const ::std::os::raw::c_uchar, + Count: usize, + ); +} +extern "C" { + pub fn __movsw( + Dest: *mut ::std::os::raw::c_ushort, + Source: *const ::std::os::raw::c_ushort, + Count: usize, + ); +} +extern "C" { + pub fn __movsd( + Dest: *mut ::std::os::raw::c_ulong, + Source: *const ::std::os::raw::c_ulong, + Count: usize, + ); +} +pub type POINTER_64_INT = ::std::os::raw::c_ulonglong; +pub type INT8 = ::std::os::raw::c_schar; +pub type PINT8 = *mut ::std::os::raw::c_schar; +pub type INT16 = ::std::os::raw::c_short; +pub type PINT16 = *mut ::std::os::raw::c_short; +pub type INT32 = ::std::os::raw::c_int; +pub type PINT32 = *mut ::std::os::raw::c_int; +pub type INT64 = ::std::os::raw::c_longlong; +pub type PINT64 = *mut ::std::os::raw::c_longlong; +pub type UINT8 = ::std::os::raw::c_uchar; +pub type PUINT8 = *mut ::std::os::raw::c_uchar; +pub type UINT16 = ::std::os::raw::c_ushort; +pub type PUINT16 = *mut ::std::os::raw::c_ushort; +pub type UINT32 = ::std::os::raw::c_uint; +pub type PUINT32 = *mut ::std::os::raw::c_uint; +pub type UINT64 = ::std::os::raw::c_ulonglong; +pub type PUINT64 = *mut ::std::os::raw::c_ulonglong; +pub type LONG32 = ::std::os::raw::c_int; +pub type PLONG32 = *mut ::std::os::raw::c_int; +pub type ULONG32 = ::std::os::raw::c_uint; +pub type PULONG32 = *mut ::std::os::raw::c_uint; +pub type DWORD32 = ::std::os::raw::c_uint; +pub type PDWORD32 = *mut ::std::os::raw::c_uint; +pub type INT_PTR = ::std::os::raw::c_longlong; +pub type PINT_PTR = *mut ::std::os::raw::c_longlong; +pub type UINT_PTR = ::std::os::raw::c_ulonglong; +pub type PUINT_PTR = *mut ::std::os::raw::c_ulonglong; +pub type LONG_PTR = ::std::os::raw::c_longlong; +pub type PLONG_PTR = *mut ::std::os::raw::c_longlong; +pub type ULONG_PTR = ::std::os::raw::c_ulonglong; +pub type PULONG_PTR = *mut ::std::os::raw::c_ulonglong; +pub type SHANDLE_PTR = ::std::os::raw::c_longlong; +pub type HANDLE_PTR = ::std::os::raw::c_ulonglong; +pub type UHALF_PTR = ::std::os::raw::c_uint; +pub type PUHALF_PTR = *mut ::std::os::raw::c_uint; +pub type HALF_PTR = ::std::os::raw::c_int; +pub type PHALF_PTR = *mut ::std::os::raw::c_int; +pub type SIZE_T = ULONG_PTR; +pub type PSIZE_T = *mut ULONG_PTR; +pub type SSIZE_T = LONG_PTR; +pub type PSSIZE_T = *mut LONG_PTR; +pub type DWORD_PTR = ULONG_PTR; +pub type PDWORD_PTR = *mut ULONG_PTR; +pub type LONG64 = ::std::os::raw::c_longlong; +pub type PLONG64 = *mut ::std::os::raw::c_longlong; +pub type ULONG64 = ::std::os::raw::c_ulonglong; +pub type PULONG64 = *mut ::std::os::raw::c_ulonglong; +pub type DWORD64 = ::std::os::raw::c_ulonglong; +pub type PDWORD64 = *mut ::std::os::raw::c_ulonglong; +pub type KAFFINITY = ULONG_PTR; +pub type PKAFFINITY = *mut KAFFINITY; +pub type PVOID = *mut ::std::os::raw::c_void; +pub type PVOID64 = *mut ::std::os::raw::c_void; +pub type CHAR = ::std::os::raw::c_char; +pub type SHORT = ::std::os::raw::c_short; +pub type LONG = ::std::os::raw::c_long; +pub type WCHAR = wchar_t; +pub type PWCHAR = *mut WCHAR; +pub type LPWCH = *mut WCHAR; +pub type PWCH = *mut WCHAR; +pub type LPCWCH = *const WCHAR; +pub type PCWCH = *const WCHAR; +pub type NWPSTR = *mut WCHAR; +pub type LPWSTR = *mut WCHAR; +pub type PWSTR = *mut WCHAR; +pub type PZPWSTR = *mut PWSTR; +pub type PCZPWSTR = *const PWSTR; +pub type LPUWSTR = *mut WCHAR; +pub type PUWSTR = *mut WCHAR; +pub type LPCWSTR = *const WCHAR; +pub type PCWSTR = *const WCHAR; +pub type PZPCWSTR = *mut PCWSTR; +pub type LPCUWSTR = *const WCHAR; +pub type PCUWSTR = *const WCHAR; +pub type PZZWSTR = *mut WCHAR; +pub type PCZZWSTR = *const WCHAR; +pub type PUZZWSTR = *mut WCHAR; +pub type PCUZZWSTR = *const WCHAR; +pub type PNZWCH = *mut WCHAR; +pub type PCNZWCH = *const WCHAR; +pub type PUNZWCH = *mut WCHAR; +pub type PCUNZWCH = *const WCHAR; +pub type PCHAR = *mut CHAR; +pub type LPCH = *mut CHAR; +pub type PCH = *mut CHAR; +pub type LPCCH = *const CHAR; +pub type PCCH = *const CHAR; +pub type NPSTR = *mut CHAR; +pub type LPSTR = *mut CHAR; +pub type PSTR = *mut CHAR; +pub type PZPSTR = *mut PSTR; +pub type PCZPSTR = *const PSTR; +pub type LPCSTR = *const CHAR; +pub type PCSTR = *const CHAR; +pub type PZPCSTR = *mut PCSTR; +pub type PZZSTR = *mut CHAR; +pub type PCZZSTR = *const CHAR; +pub type PNZCH = *mut CHAR; +pub type PCNZCH = *const CHAR; +pub type TCHAR = ::std::os::raw::c_char; +pub type PTCHAR = *mut ::std::os::raw::c_char; +pub type TBYTE = ::std::os::raw::c_uchar; +pub type PTBYTE = *mut ::std::os::raw::c_uchar; +pub type LPTCH = LPSTR; +pub type PTCH = LPSTR; +pub type LPCTCH = LPCCH; +pub type PCTCH = LPCCH; +pub type PTSTR = LPSTR; +pub type LPTSTR = LPSTR; +pub type PUTSTR = LPSTR; +pub type LPUTSTR = LPSTR; +pub type PCTSTR = LPCSTR; +pub type LPCTSTR = LPCSTR; +pub type PCUTSTR = LPCSTR; +pub type LPCUTSTR = LPCSTR; +pub type PZZTSTR = PZZSTR; +pub type PUZZTSTR = PZZSTR; +pub type PCZZTSTR = PCZZSTR; +pub type PCUZZTSTR = PCZZSTR; +pub type PZPTSTR = PZPSTR; +pub type PNZTCH = PNZCH; +pub type PUNZTCH = PNZCH; +pub type PCNZTCH = PCNZCH; +pub type PCUNZTCH = PCNZCH; +pub type PSHORT = *mut SHORT; +pub type PLONG = *mut LONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GROUP_AFFINITY { + pub Mask: KAFFINITY, + pub Group: WORD, + pub Reserved: [WORD; 3usize], +} +pub type GROUP_AFFINITY = _GROUP_AFFINITY; +pub type PGROUP_AFFINITY = *mut _GROUP_AFFINITY; +pub type HANDLE = *mut ::std::os::raw::c_void; +pub type PHANDLE = *mut HANDLE; +pub type FCHAR = BYTE; +pub type FSHORT = WORD; +pub type FLONG = DWORD; +pub type HRESULT = LONG; +pub type CCHAR = ::std::os::raw::c_char; +pub type LCID = DWORD; +pub type PLCID = PDWORD; +pub type LANGID = WORD; +pub const COMPARTMENT_ID_UNSPECIFIED_COMPARTMENT_ID: COMPARTMENT_ID = 0; +pub const COMPARTMENT_ID_DEFAULT_COMPARTMENT_ID: COMPARTMENT_ID = 1; +pub type COMPARTMENT_ID = u32; +pub type PCOMPARTMENT_ID = *mut COMPARTMENT_ID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FLOAT128 { + pub LowPart: ::std::os::raw::c_longlong, + pub HighPart: ::std::os::raw::c_longlong, +} +pub type FLOAT128 = _FLOAT128; +pub type PFLOAT128 = *mut FLOAT128; +pub type LONGLONG = ::std::os::raw::c_longlong; +pub type ULONGLONG = ::std::os::raw::c_ulonglong; +pub type PLONGLONG = *mut LONGLONG; +pub type PULONGLONG = *mut ULONGLONG; +pub type USN = LONGLONG; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _LARGE_INTEGER { + pub __bindgen_anon_1: _LARGE_INTEGER__bindgen_ty_1, + pub u: _LARGE_INTEGER__bindgen_ty_2, + pub QuadPart: LONGLONG, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LARGE_INTEGER__bindgen_ty_1 { + pub LowPart: DWORD, + pub HighPart: LONG, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LARGE_INTEGER__bindgen_ty_2 { + pub LowPart: DWORD, + pub HighPart: LONG, +} +pub type LARGE_INTEGER = _LARGE_INTEGER; +pub type PLARGE_INTEGER = *mut LARGE_INTEGER; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _ULARGE_INTEGER { + pub __bindgen_anon_1: _ULARGE_INTEGER__bindgen_ty_1, + pub u: _ULARGE_INTEGER__bindgen_ty_2, + pub QuadPart: ULONGLONG, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ULARGE_INTEGER__bindgen_ty_1 { + pub LowPart: DWORD, + pub HighPart: DWORD, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ULARGE_INTEGER__bindgen_ty_2 { + pub LowPart: DWORD, + pub HighPart: DWORD, +} +pub type ULARGE_INTEGER = _ULARGE_INTEGER; +pub type PULARGE_INTEGER = *mut ULARGE_INTEGER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LUID { + pub LowPart: DWORD, + pub HighPart: LONG, +} +pub type LUID = _LUID; +pub type PLUID = *mut _LUID; +pub type DWORDLONG = ULONGLONG; +pub type PDWORDLONG = *mut DWORDLONG; +extern "C" { + pub fn _rotl8( + Value: ::std::os::raw::c_uchar, + Shift: ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _rotl16( + Value: ::std::os::raw::c_ushort, + Shift: ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_ushort; +} +extern "C" { + pub fn _rotr8( + Value: ::std::os::raw::c_uchar, + Shift: ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_uchar; +} +extern "C" { + pub fn _rotr16( + Value: ::std::os::raw::c_ushort, + Shift: ::std::os::raw::c_uchar, + ) -> ::std::os::raw::c_ushort; +} +pub type BOOLEAN = BYTE; +pub type PBOOLEAN = *mut BOOLEAN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LIST_ENTRY { + pub Flink: *mut _LIST_ENTRY, + pub Blink: *mut _LIST_ENTRY, +} +pub type LIST_ENTRY = _LIST_ENTRY; +pub type PLIST_ENTRY = *mut _LIST_ENTRY; +pub type PRLIST_ENTRY = *mut _LIST_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SINGLE_LIST_ENTRY { + pub Next: *mut _SINGLE_LIST_ENTRY, +} +pub type SINGLE_LIST_ENTRY = _SINGLE_LIST_ENTRY; +pub type PSINGLE_LIST_ENTRY = *mut _SINGLE_LIST_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LIST_ENTRY32 { + pub Flink: DWORD, + pub Blink: DWORD, +} +pub type PLIST_ENTRY32 = *mut LIST_ENTRY32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LIST_ENTRY64 { + pub Flink: ULONGLONG, + pub Blink: ULONGLONG, +} +pub type PLIST_ENTRY64 = *mut LIST_ENTRY64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GUID { + pub Data1: ::std::os::raw::c_ulong, + pub Data2: ::std::os::raw::c_ushort, + pub Data3: ::std::os::raw::c_ushort, + pub Data4: [::std::os::raw::c_uchar; 8usize], +} +pub type GUID = _GUID; +pub type LPGUID = *mut GUID; +pub type LPCGUID = *const GUID; +pub type IID = GUID; +pub type LPIID = *mut IID; +pub type CLSID = GUID; +pub type LPCLSID = *mut CLSID; +pub type FMTID = GUID; +pub type LPFMTID = *mut FMTID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OBJECTID { + pub Lineage: GUID, + pub Uniquifier: DWORD, +} +pub type OBJECTID = _OBJECTID; +pub type EXCEPTION_ROUTINE = ::std::option::Option< + unsafe extern "C" fn( + ExceptionRecord: *mut _EXCEPTION_RECORD, + EstablisherFrame: PVOID, + ContextRecord: *mut _CONTEXT, + DispatcherContext: PVOID, + ) -> ::std::os::raw::c_int, +>; +pub type PEXCEPTION_ROUTINE = EXCEPTION_ROUTINE; +pub type KSPIN_LOCK = ULONG_PTR; +pub type PKSPIN_LOCK = *mut KSPIN_LOCK; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _M128A { + pub Low: ULONGLONG, + pub High: LONGLONG, +} +pub type M128A = _M128A; +pub type PM128A = *mut _M128A; +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct _XSAVE_FORMAT { + pub ControlWord: WORD, + pub StatusWord: WORD, + pub TagWord: BYTE, + pub Reserved1: BYTE, + pub ErrorOpcode: WORD, + pub ErrorOffset: DWORD, + pub ErrorSelector: WORD, + pub Reserved2: WORD, + pub DataOffset: DWORD, + pub DataSelector: WORD, + pub Reserved3: WORD, + pub MxCsr: DWORD, + pub MxCsr_Mask: DWORD, + pub FloatRegisters: [M128A; 8usize], + pub XmmRegisters: [M128A; 16usize], + pub Reserved4: [BYTE; 96usize], +} +pub type XSAVE_FORMAT = _XSAVE_FORMAT; +pub type PXSAVE_FORMAT = *mut _XSAVE_FORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XSAVE_AREA_HEADER { + pub Mask: DWORD64, + pub Reserved: [DWORD64; 7usize], +} +pub type XSAVE_AREA_HEADER = _XSAVE_AREA_HEADER; +pub type PXSAVE_AREA_HEADER = *mut _XSAVE_AREA_HEADER; +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct _XSAVE_AREA { + pub LegacyState: XSAVE_FORMAT, + pub Header: XSAVE_AREA_HEADER, +} +pub type XSAVE_AREA = _XSAVE_AREA; +pub type PXSAVE_AREA = *mut _XSAVE_AREA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XSTATE_CONTEXT { + pub Mask: DWORD64, + pub Length: DWORD, + pub Reserved1: DWORD, + pub Area: PXSAVE_AREA, + pub Buffer: PVOID, +} +pub type XSTATE_CONTEXT = _XSTATE_CONTEXT; +pub type PXSTATE_CONTEXT = *mut _XSTATE_CONTEXT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SCOPE_TABLE_AMD64 { + pub Count: DWORD, + pub ScopeRecord: [_SCOPE_TABLE_AMD64__bindgen_ty_1; 1usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SCOPE_TABLE_AMD64__bindgen_ty_1 { + pub BeginAddress: DWORD, + pub EndAddress: DWORD, + pub HandlerAddress: DWORD, + pub JumpTarget: DWORD, +} +pub type SCOPE_TABLE_AMD64 = _SCOPE_TABLE_AMD64; +pub type PSCOPE_TABLE_AMD64 = *mut _SCOPE_TABLE_AMD64; +pub type __m64 = [::std::os::raw::c_longlong; 1usize]; +pub type __v1di = [::std::os::raw::c_longlong; 1usize]; +pub type __v2si = [::std::os::raw::c_int; 2usize]; +pub type __v4hi = [::std::os::raw::c_short; 4usize]; +pub type __v8qi = [::std::os::raw::c_char; 8usize]; +pub type __v4si = [::std::os::raw::c_int; 4usize]; +pub type __v4sf = [f32; 4usize]; +pub type __m128 = [f32; 4usize]; +pub type __m128_u = [f32; 4usize]; +pub type __v4su = [::std::os::raw::c_uint; 4usize]; +extern "C" { + pub fn _mm_sfence(); +} +extern "C" { + pub fn _mm_getcsr() -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn _mm_setcsr(__i: ::std::os::raw::c_uint); +} +pub type __m128d = [f64; 2usize]; +pub type __m128i = [::std::os::raw::c_longlong; 2usize]; +pub type __m128d_u = [f64; 2usize]; +pub type __m128i_u = [::std::os::raw::c_longlong; 2usize]; +pub type __v2df = [f64; 2usize]; +pub type __v2di = [::std::os::raw::c_longlong; 2usize]; +pub type __v8hi = [::std::os::raw::c_short; 8usize]; +pub type __v16qi = [::std::os::raw::c_char; 16usize]; +pub type __v2du = [::std::os::raw::c_ulonglong; 2usize]; +pub type __v8hu = [::std::os::raw::c_ushort; 8usize]; +pub type __v16qu = [::std::os::raw::c_uchar; 16usize]; +pub type __v16qs = [::std::os::raw::c_schar; 16usize]; +extern "C" { + pub fn _mm_clflush(__p: *const ::std::os::raw::c_void); +} +extern "C" { + pub fn _mm_lfence(); +} +extern "C" { + pub fn _mm_mfence(); +} +extern "C" { + pub fn _mm_pause(); +} +pub type __v4df = [f64; 4usize]; +pub type __v8sf = [f32; 8usize]; +pub type __v4di = [::std::os::raw::c_longlong; 4usize]; +pub type __v8si = [::std::os::raw::c_int; 8usize]; +pub type __v16hi = [::std::os::raw::c_short; 16usize]; +pub type __v32qi = [::std::os::raw::c_char; 32usize]; +pub type __v4du = [::std::os::raw::c_ulonglong; 4usize]; +pub type __v8su = [::std::os::raw::c_uint; 8usize]; +pub type __v16hu = [::std::os::raw::c_ushort; 16usize]; +pub type __v32qu = [::std::os::raw::c_uchar; 32usize]; +pub type __v32qs = [::std::os::raw::c_schar; 32usize]; +pub type __m256 = [f32; 8usize]; +pub type __m256d = [f64; 4usize]; +pub type __m256i = [::std::os::raw::c_longlong; 4usize]; +pub type __m256_u = [f32; 8usize]; +pub type __m256d_u = [f64; 4usize]; +pub type __m256i_u = [::std::os::raw::c_longlong; 4usize]; +pub type __v64qi = [::std::os::raw::c_char; 64usize]; +pub type __v32hi = [::std::os::raw::c_short; 32usize]; +pub type __v8df = [f64; 8usize]; +pub type __v16sf = [f32; 16usize]; +pub type __v8di = [::std::os::raw::c_longlong; 8usize]; +pub type __v16si = [::std::os::raw::c_int; 16usize]; +pub type __v64qu = [::std::os::raw::c_uchar; 64usize]; +pub type __v32hu = [::std::os::raw::c_ushort; 32usize]; +pub type __v8du = [::std::os::raw::c_ulonglong; 8usize]; +pub type __v16su = [::std::os::raw::c_uint; 16usize]; +pub type __m512 = [f32; 16usize]; +pub type __m512d = [f64; 8usize]; +pub type __m512i = [::std::os::raw::c_longlong; 8usize]; +pub type __m512_u = [f32; 16usize]; +pub type __m512d_u = [f64; 8usize]; +pub type __m512i_u = [::std::os::raw::c_longlong; 8usize]; +pub type __mmask8 = ::std::os::raw::c_uchar; +pub type __mmask16 = ::std::os::raw::c_ushort; +pub const _MM_CMPINT_ENUM__MM_CMPINT_EQ: _MM_CMPINT_ENUM = 0; +pub const _MM_CMPINT_ENUM__MM_CMPINT_LT: _MM_CMPINT_ENUM = 1; +pub const _MM_CMPINT_ENUM__MM_CMPINT_LE: _MM_CMPINT_ENUM = 2; +pub const _MM_CMPINT_ENUM__MM_CMPINT_UNUSED: _MM_CMPINT_ENUM = 3; +pub const _MM_CMPINT_ENUM__MM_CMPINT_NE: _MM_CMPINT_ENUM = 4; +pub const _MM_CMPINT_ENUM__MM_CMPINT_NLT: _MM_CMPINT_ENUM = 5; +pub const _MM_CMPINT_ENUM__MM_CMPINT_NLE: _MM_CMPINT_ENUM = 6; +pub type _MM_CMPINT_ENUM = u32; +pub const _MM_PERM_ENUM__MM_PERM_AAAA: _MM_PERM_ENUM = 0; +pub const _MM_PERM_ENUM__MM_PERM_AAAB: _MM_PERM_ENUM = 1; +pub const _MM_PERM_ENUM__MM_PERM_AAAC: _MM_PERM_ENUM = 2; +pub const _MM_PERM_ENUM__MM_PERM_AAAD: _MM_PERM_ENUM = 3; +pub const _MM_PERM_ENUM__MM_PERM_AABA: _MM_PERM_ENUM = 4; +pub const _MM_PERM_ENUM__MM_PERM_AABB: _MM_PERM_ENUM = 5; +pub const _MM_PERM_ENUM__MM_PERM_AABC: _MM_PERM_ENUM = 6; +pub const _MM_PERM_ENUM__MM_PERM_AABD: _MM_PERM_ENUM = 7; +pub const _MM_PERM_ENUM__MM_PERM_AACA: _MM_PERM_ENUM = 8; +pub const _MM_PERM_ENUM__MM_PERM_AACB: _MM_PERM_ENUM = 9; +pub const _MM_PERM_ENUM__MM_PERM_AACC: _MM_PERM_ENUM = 10; +pub const _MM_PERM_ENUM__MM_PERM_AACD: _MM_PERM_ENUM = 11; +pub const _MM_PERM_ENUM__MM_PERM_AADA: _MM_PERM_ENUM = 12; +pub const _MM_PERM_ENUM__MM_PERM_AADB: _MM_PERM_ENUM = 13; +pub const _MM_PERM_ENUM__MM_PERM_AADC: _MM_PERM_ENUM = 14; +pub const _MM_PERM_ENUM__MM_PERM_AADD: _MM_PERM_ENUM = 15; +pub const _MM_PERM_ENUM__MM_PERM_ABAA: _MM_PERM_ENUM = 16; +pub const _MM_PERM_ENUM__MM_PERM_ABAB: _MM_PERM_ENUM = 17; +pub const _MM_PERM_ENUM__MM_PERM_ABAC: _MM_PERM_ENUM = 18; +pub const _MM_PERM_ENUM__MM_PERM_ABAD: _MM_PERM_ENUM = 19; +pub const _MM_PERM_ENUM__MM_PERM_ABBA: _MM_PERM_ENUM = 20; +pub const _MM_PERM_ENUM__MM_PERM_ABBB: _MM_PERM_ENUM = 21; +pub const _MM_PERM_ENUM__MM_PERM_ABBC: _MM_PERM_ENUM = 22; +pub const _MM_PERM_ENUM__MM_PERM_ABBD: _MM_PERM_ENUM = 23; +pub const _MM_PERM_ENUM__MM_PERM_ABCA: _MM_PERM_ENUM = 24; +pub const _MM_PERM_ENUM__MM_PERM_ABCB: _MM_PERM_ENUM = 25; +pub const _MM_PERM_ENUM__MM_PERM_ABCC: _MM_PERM_ENUM = 26; +pub const _MM_PERM_ENUM__MM_PERM_ABCD: _MM_PERM_ENUM = 27; +pub const _MM_PERM_ENUM__MM_PERM_ABDA: _MM_PERM_ENUM = 28; +pub const _MM_PERM_ENUM__MM_PERM_ABDB: _MM_PERM_ENUM = 29; +pub const _MM_PERM_ENUM__MM_PERM_ABDC: _MM_PERM_ENUM = 30; +pub const _MM_PERM_ENUM__MM_PERM_ABDD: _MM_PERM_ENUM = 31; +pub const _MM_PERM_ENUM__MM_PERM_ACAA: _MM_PERM_ENUM = 32; +pub const _MM_PERM_ENUM__MM_PERM_ACAB: _MM_PERM_ENUM = 33; +pub const _MM_PERM_ENUM__MM_PERM_ACAC: _MM_PERM_ENUM = 34; +pub const _MM_PERM_ENUM__MM_PERM_ACAD: _MM_PERM_ENUM = 35; +pub const _MM_PERM_ENUM__MM_PERM_ACBA: _MM_PERM_ENUM = 36; +pub const _MM_PERM_ENUM__MM_PERM_ACBB: _MM_PERM_ENUM = 37; +pub const _MM_PERM_ENUM__MM_PERM_ACBC: _MM_PERM_ENUM = 38; +pub const _MM_PERM_ENUM__MM_PERM_ACBD: _MM_PERM_ENUM = 39; +pub const _MM_PERM_ENUM__MM_PERM_ACCA: _MM_PERM_ENUM = 40; +pub const _MM_PERM_ENUM__MM_PERM_ACCB: _MM_PERM_ENUM = 41; +pub const _MM_PERM_ENUM__MM_PERM_ACCC: _MM_PERM_ENUM = 42; +pub const _MM_PERM_ENUM__MM_PERM_ACCD: _MM_PERM_ENUM = 43; +pub const _MM_PERM_ENUM__MM_PERM_ACDA: _MM_PERM_ENUM = 44; +pub const _MM_PERM_ENUM__MM_PERM_ACDB: _MM_PERM_ENUM = 45; +pub const _MM_PERM_ENUM__MM_PERM_ACDC: _MM_PERM_ENUM = 46; +pub const _MM_PERM_ENUM__MM_PERM_ACDD: _MM_PERM_ENUM = 47; +pub const _MM_PERM_ENUM__MM_PERM_ADAA: _MM_PERM_ENUM = 48; +pub const _MM_PERM_ENUM__MM_PERM_ADAB: _MM_PERM_ENUM = 49; +pub const _MM_PERM_ENUM__MM_PERM_ADAC: _MM_PERM_ENUM = 50; +pub const _MM_PERM_ENUM__MM_PERM_ADAD: _MM_PERM_ENUM = 51; +pub const _MM_PERM_ENUM__MM_PERM_ADBA: _MM_PERM_ENUM = 52; +pub const _MM_PERM_ENUM__MM_PERM_ADBB: _MM_PERM_ENUM = 53; +pub const _MM_PERM_ENUM__MM_PERM_ADBC: _MM_PERM_ENUM = 54; +pub const _MM_PERM_ENUM__MM_PERM_ADBD: _MM_PERM_ENUM = 55; +pub const _MM_PERM_ENUM__MM_PERM_ADCA: _MM_PERM_ENUM = 56; +pub const _MM_PERM_ENUM__MM_PERM_ADCB: _MM_PERM_ENUM = 57; +pub const _MM_PERM_ENUM__MM_PERM_ADCC: _MM_PERM_ENUM = 58; +pub const _MM_PERM_ENUM__MM_PERM_ADCD: _MM_PERM_ENUM = 59; +pub const _MM_PERM_ENUM__MM_PERM_ADDA: _MM_PERM_ENUM = 60; +pub const _MM_PERM_ENUM__MM_PERM_ADDB: _MM_PERM_ENUM = 61; +pub const _MM_PERM_ENUM__MM_PERM_ADDC: _MM_PERM_ENUM = 62; +pub const _MM_PERM_ENUM__MM_PERM_ADDD: _MM_PERM_ENUM = 63; +pub const _MM_PERM_ENUM__MM_PERM_BAAA: _MM_PERM_ENUM = 64; +pub const _MM_PERM_ENUM__MM_PERM_BAAB: _MM_PERM_ENUM = 65; +pub const _MM_PERM_ENUM__MM_PERM_BAAC: _MM_PERM_ENUM = 66; +pub const _MM_PERM_ENUM__MM_PERM_BAAD: _MM_PERM_ENUM = 67; +pub const _MM_PERM_ENUM__MM_PERM_BABA: _MM_PERM_ENUM = 68; +pub const _MM_PERM_ENUM__MM_PERM_BABB: _MM_PERM_ENUM = 69; +pub const _MM_PERM_ENUM__MM_PERM_BABC: _MM_PERM_ENUM = 70; +pub const _MM_PERM_ENUM__MM_PERM_BABD: _MM_PERM_ENUM = 71; +pub const _MM_PERM_ENUM__MM_PERM_BACA: _MM_PERM_ENUM = 72; +pub const _MM_PERM_ENUM__MM_PERM_BACB: _MM_PERM_ENUM = 73; +pub const _MM_PERM_ENUM__MM_PERM_BACC: _MM_PERM_ENUM = 74; +pub const _MM_PERM_ENUM__MM_PERM_BACD: _MM_PERM_ENUM = 75; +pub const _MM_PERM_ENUM__MM_PERM_BADA: _MM_PERM_ENUM = 76; +pub const _MM_PERM_ENUM__MM_PERM_BADB: _MM_PERM_ENUM = 77; +pub const _MM_PERM_ENUM__MM_PERM_BADC: _MM_PERM_ENUM = 78; +pub const _MM_PERM_ENUM__MM_PERM_BADD: _MM_PERM_ENUM = 79; +pub const _MM_PERM_ENUM__MM_PERM_BBAA: _MM_PERM_ENUM = 80; +pub const _MM_PERM_ENUM__MM_PERM_BBAB: _MM_PERM_ENUM = 81; +pub const _MM_PERM_ENUM__MM_PERM_BBAC: _MM_PERM_ENUM = 82; +pub const _MM_PERM_ENUM__MM_PERM_BBAD: _MM_PERM_ENUM = 83; +pub const _MM_PERM_ENUM__MM_PERM_BBBA: _MM_PERM_ENUM = 84; +pub const _MM_PERM_ENUM__MM_PERM_BBBB: _MM_PERM_ENUM = 85; +pub const _MM_PERM_ENUM__MM_PERM_BBBC: _MM_PERM_ENUM = 86; +pub const _MM_PERM_ENUM__MM_PERM_BBBD: _MM_PERM_ENUM = 87; +pub const _MM_PERM_ENUM__MM_PERM_BBCA: _MM_PERM_ENUM = 88; +pub const _MM_PERM_ENUM__MM_PERM_BBCB: _MM_PERM_ENUM = 89; +pub const _MM_PERM_ENUM__MM_PERM_BBCC: _MM_PERM_ENUM = 90; +pub const _MM_PERM_ENUM__MM_PERM_BBCD: _MM_PERM_ENUM = 91; +pub const _MM_PERM_ENUM__MM_PERM_BBDA: _MM_PERM_ENUM = 92; +pub const _MM_PERM_ENUM__MM_PERM_BBDB: _MM_PERM_ENUM = 93; +pub const _MM_PERM_ENUM__MM_PERM_BBDC: _MM_PERM_ENUM = 94; +pub const _MM_PERM_ENUM__MM_PERM_BBDD: _MM_PERM_ENUM = 95; +pub const _MM_PERM_ENUM__MM_PERM_BCAA: _MM_PERM_ENUM = 96; +pub const _MM_PERM_ENUM__MM_PERM_BCAB: _MM_PERM_ENUM = 97; +pub const _MM_PERM_ENUM__MM_PERM_BCAC: _MM_PERM_ENUM = 98; +pub const _MM_PERM_ENUM__MM_PERM_BCAD: _MM_PERM_ENUM = 99; +pub const _MM_PERM_ENUM__MM_PERM_BCBA: _MM_PERM_ENUM = 100; +pub const _MM_PERM_ENUM__MM_PERM_BCBB: _MM_PERM_ENUM = 101; +pub const _MM_PERM_ENUM__MM_PERM_BCBC: _MM_PERM_ENUM = 102; +pub const _MM_PERM_ENUM__MM_PERM_BCBD: _MM_PERM_ENUM = 103; +pub const _MM_PERM_ENUM__MM_PERM_BCCA: _MM_PERM_ENUM = 104; +pub const _MM_PERM_ENUM__MM_PERM_BCCB: _MM_PERM_ENUM = 105; +pub const _MM_PERM_ENUM__MM_PERM_BCCC: _MM_PERM_ENUM = 106; +pub const _MM_PERM_ENUM__MM_PERM_BCCD: _MM_PERM_ENUM = 107; +pub const _MM_PERM_ENUM__MM_PERM_BCDA: _MM_PERM_ENUM = 108; +pub const _MM_PERM_ENUM__MM_PERM_BCDB: _MM_PERM_ENUM = 109; +pub const _MM_PERM_ENUM__MM_PERM_BCDC: _MM_PERM_ENUM = 110; +pub const _MM_PERM_ENUM__MM_PERM_BCDD: _MM_PERM_ENUM = 111; +pub const _MM_PERM_ENUM__MM_PERM_BDAA: _MM_PERM_ENUM = 112; +pub const _MM_PERM_ENUM__MM_PERM_BDAB: _MM_PERM_ENUM = 113; +pub const _MM_PERM_ENUM__MM_PERM_BDAC: _MM_PERM_ENUM = 114; +pub const _MM_PERM_ENUM__MM_PERM_BDAD: _MM_PERM_ENUM = 115; +pub const _MM_PERM_ENUM__MM_PERM_BDBA: _MM_PERM_ENUM = 116; +pub const _MM_PERM_ENUM__MM_PERM_BDBB: _MM_PERM_ENUM = 117; +pub const _MM_PERM_ENUM__MM_PERM_BDBC: _MM_PERM_ENUM = 118; +pub const _MM_PERM_ENUM__MM_PERM_BDBD: _MM_PERM_ENUM = 119; +pub const _MM_PERM_ENUM__MM_PERM_BDCA: _MM_PERM_ENUM = 120; +pub const _MM_PERM_ENUM__MM_PERM_BDCB: _MM_PERM_ENUM = 121; +pub const _MM_PERM_ENUM__MM_PERM_BDCC: _MM_PERM_ENUM = 122; +pub const _MM_PERM_ENUM__MM_PERM_BDCD: _MM_PERM_ENUM = 123; +pub const _MM_PERM_ENUM__MM_PERM_BDDA: _MM_PERM_ENUM = 124; +pub const _MM_PERM_ENUM__MM_PERM_BDDB: _MM_PERM_ENUM = 125; +pub const _MM_PERM_ENUM__MM_PERM_BDDC: _MM_PERM_ENUM = 126; +pub const _MM_PERM_ENUM__MM_PERM_BDDD: _MM_PERM_ENUM = 127; +pub const _MM_PERM_ENUM__MM_PERM_CAAA: _MM_PERM_ENUM = 128; +pub const _MM_PERM_ENUM__MM_PERM_CAAB: _MM_PERM_ENUM = 129; +pub const _MM_PERM_ENUM__MM_PERM_CAAC: _MM_PERM_ENUM = 130; +pub const _MM_PERM_ENUM__MM_PERM_CAAD: _MM_PERM_ENUM = 131; +pub const _MM_PERM_ENUM__MM_PERM_CABA: _MM_PERM_ENUM = 132; +pub const _MM_PERM_ENUM__MM_PERM_CABB: _MM_PERM_ENUM = 133; +pub const _MM_PERM_ENUM__MM_PERM_CABC: _MM_PERM_ENUM = 134; +pub const _MM_PERM_ENUM__MM_PERM_CABD: _MM_PERM_ENUM = 135; +pub const _MM_PERM_ENUM__MM_PERM_CACA: _MM_PERM_ENUM = 136; +pub const _MM_PERM_ENUM__MM_PERM_CACB: _MM_PERM_ENUM = 137; +pub const _MM_PERM_ENUM__MM_PERM_CACC: _MM_PERM_ENUM = 138; +pub const _MM_PERM_ENUM__MM_PERM_CACD: _MM_PERM_ENUM = 139; +pub const _MM_PERM_ENUM__MM_PERM_CADA: _MM_PERM_ENUM = 140; +pub const _MM_PERM_ENUM__MM_PERM_CADB: _MM_PERM_ENUM = 141; +pub const _MM_PERM_ENUM__MM_PERM_CADC: _MM_PERM_ENUM = 142; +pub const _MM_PERM_ENUM__MM_PERM_CADD: _MM_PERM_ENUM = 143; +pub const _MM_PERM_ENUM__MM_PERM_CBAA: _MM_PERM_ENUM = 144; +pub const _MM_PERM_ENUM__MM_PERM_CBAB: _MM_PERM_ENUM = 145; +pub const _MM_PERM_ENUM__MM_PERM_CBAC: _MM_PERM_ENUM = 146; +pub const _MM_PERM_ENUM__MM_PERM_CBAD: _MM_PERM_ENUM = 147; +pub const _MM_PERM_ENUM__MM_PERM_CBBA: _MM_PERM_ENUM = 148; +pub const _MM_PERM_ENUM__MM_PERM_CBBB: _MM_PERM_ENUM = 149; +pub const _MM_PERM_ENUM__MM_PERM_CBBC: _MM_PERM_ENUM = 150; +pub const _MM_PERM_ENUM__MM_PERM_CBBD: _MM_PERM_ENUM = 151; +pub const _MM_PERM_ENUM__MM_PERM_CBCA: _MM_PERM_ENUM = 152; +pub const _MM_PERM_ENUM__MM_PERM_CBCB: _MM_PERM_ENUM = 153; +pub const _MM_PERM_ENUM__MM_PERM_CBCC: _MM_PERM_ENUM = 154; +pub const _MM_PERM_ENUM__MM_PERM_CBCD: _MM_PERM_ENUM = 155; +pub const _MM_PERM_ENUM__MM_PERM_CBDA: _MM_PERM_ENUM = 156; +pub const _MM_PERM_ENUM__MM_PERM_CBDB: _MM_PERM_ENUM = 157; +pub const _MM_PERM_ENUM__MM_PERM_CBDC: _MM_PERM_ENUM = 158; +pub const _MM_PERM_ENUM__MM_PERM_CBDD: _MM_PERM_ENUM = 159; +pub const _MM_PERM_ENUM__MM_PERM_CCAA: _MM_PERM_ENUM = 160; +pub const _MM_PERM_ENUM__MM_PERM_CCAB: _MM_PERM_ENUM = 161; +pub const _MM_PERM_ENUM__MM_PERM_CCAC: _MM_PERM_ENUM = 162; +pub const _MM_PERM_ENUM__MM_PERM_CCAD: _MM_PERM_ENUM = 163; +pub const _MM_PERM_ENUM__MM_PERM_CCBA: _MM_PERM_ENUM = 164; +pub const _MM_PERM_ENUM__MM_PERM_CCBB: _MM_PERM_ENUM = 165; +pub const _MM_PERM_ENUM__MM_PERM_CCBC: _MM_PERM_ENUM = 166; +pub const _MM_PERM_ENUM__MM_PERM_CCBD: _MM_PERM_ENUM = 167; +pub const _MM_PERM_ENUM__MM_PERM_CCCA: _MM_PERM_ENUM = 168; +pub const _MM_PERM_ENUM__MM_PERM_CCCB: _MM_PERM_ENUM = 169; +pub const _MM_PERM_ENUM__MM_PERM_CCCC: _MM_PERM_ENUM = 170; +pub const _MM_PERM_ENUM__MM_PERM_CCCD: _MM_PERM_ENUM = 171; +pub const _MM_PERM_ENUM__MM_PERM_CCDA: _MM_PERM_ENUM = 172; +pub const _MM_PERM_ENUM__MM_PERM_CCDB: _MM_PERM_ENUM = 173; +pub const _MM_PERM_ENUM__MM_PERM_CCDC: _MM_PERM_ENUM = 174; +pub const _MM_PERM_ENUM__MM_PERM_CCDD: _MM_PERM_ENUM = 175; +pub const _MM_PERM_ENUM__MM_PERM_CDAA: _MM_PERM_ENUM = 176; +pub const _MM_PERM_ENUM__MM_PERM_CDAB: _MM_PERM_ENUM = 177; +pub const _MM_PERM_ENUM__MM_PERM_CDAC: _MM_PERM_ENUM = 178; +pub const _MM_PERM_ENUM__MM_PERM_CDAD: _MM_PERM_ENUM = 179; +pub const _MM_PERM_ENUM__MM_PERM_CDBA: _MM_PERM_ENUM = 180; +pub const _MM_PERM_ENUM__MM_PERM_CDBB: _MM_PERM_ENUM = 181; +pub const _MM_PERM_ENUM__MM_PERM_CDBC: _MM_PERM_ENUM = 182; +pub const _MM_PERM_ENUM__MM_PERM_CDBD: _MM_PERM_ENUM = 183; +pub const _MM_PERM_ENUM__MM_PERM_CDCA: _MM_PERM_ENUM = 184; +pub const _MM_PERM_ENUM__MM_PERM_CDCB: _MM_PERM_ENUM = 185; +pub const _MM_PERM_ENUM__MM_PERM_CDCC: _MM_PERM_ENUM = 186; +pub const _MM_PERM_ENUM__MM_PERM_CDCD: _MM_PERM_ENUM = 187; +pub const _MM_PERM_ENUM__MM_PERM_CDDA: _MM_PERM_ENUM = 188; +pub const _MM_PERM_ENUM__MM_PERM_CDDB: _MM_PERM_ENUM = 189; +pub const _MM_PERM_ENUM__MM_PERM_CDDC: _MM_PERM_ENUM = 190; +pub const _MM_PERM_ENUM__MM_PERM_CDDD: _MM_PERM_ENUM = 191; +pub const _MM_PERM_ENUM__MM_PERM_DAAA: _MM_PERM_ENUM = 192; +pub const _MM_PERM_ENUM__MM_PERM_DAAB: _MM_PERM_ENUM = 193; +pub const _MM_PERM_ENUM__MM_PERM_DAAC: _MM_PERM_ENUM = 194; +pub const _MM_PERM_ENUM__MM_PERM_DAAD: _MM_PERM_ENUM = 195; +pub const _MM_PERM_ENUM__MM_PERM_DABA: _MM_PERM_ENUM = 196; +pub const _MM_PERM_ENUM__MM_PERM_DABB: _MM_PERM_ENUM = 197; +pub const _MM_PERM_ENUM__MM_PERM_DABC: _MM_PERM_ENUM = 198; +pub const _MM_PERM_ENUM__MM_PERM_DABD: _MM_PERM_ENUM = 199; +pub const _MM_PERM_ENUM__MM_PERM_DACA: _MM_PERM_ENUM = 200; +pub const _MM_PERM_ENUM__MM_PERM_DACB: _MM_PERM_ENUM = 201; +pub const _MM_PERM_ENUM__MM_PERM_DACC: _MM_PERM_ENUM = 202; +pub const _MM_PERM_ENUM__MM_PERM_DACD: _MM_PERM_ENUM = 203; +pub const _MM_PERM_ENUM__MM_PERM_DADA: _MM_PERM_ENUM = 204; +pub const _MM_PERM_ENUM__MM_PERM_DADB: _MM_PERM_ENUM = 205; +pub const _MM_PERM_ENUM__MM_PERM_DADC: _MM_PERM_ENUM = 206; +pub const _MM_PERM_ENUM__MM_PERM_DADD: _MM_PERM_ENUM = 207; +pub const _MM_PERM_ENUM__MM_PERM_DBAA: _MM_PERM_ENUM = 208; +pub const _MM_PERM_ENUM__MM_PERM_DBAB: _MM_PERM_ENUM = 209; +pub const _MM_PERM_ENUM__MM_PERM_DBAC: _MM_PERM_ENUM = 210; +pub const _MM_PERM_ENUM__MM_PERM_DBAD: _MM_PERM_ENUM = 211; +pub const _MM_PERM_ENUM__MM_PERM_DBBA: _MM_PERM_ENUM = 212; +pub const _MM_PERM_ENUM__MM_PERM_DBBB: _MM_PERM_ENUM = 213; +pub const _MM_PERM_ENUM__MM_PERM_DBBC: _MM_PERM_ENUM = 214; +pub const _MM_PERM_ENUM__MM_PERM_DBBD: _MM_PERM_ENUM = 215; +pub const _MM_PERM_ENUM__MM_PERM_DBCA: _MM_PERM_ENUM = 216; +pub const _MM_PERM_ENUM__MM_PERM_DBCB: _MM_PERM_ENUM = 217; +pub const _MM_PERM_ENUM__MM_PERM_DBCC: _MM_PERM_ENUM = 218; +pub const _MM_PERM_ENUM__MM_PERM_DBCD: _MM_PERM_ENUM = 219; +pub const _MM_PERM_ENUM__MM_PERM_DBDA: _MM_PERM_ENUM = 220; +pub const _MM_PERM_ENUM__MM_PERM_DBDB: _MM_PERM_ENUM = 221; +pub const _MM_PERM_ENUM__MM_PERM_DBDC: _MM_PERM_ENUM = 222; +pub const _MM_PERM_ENUM__MM_PERM_DBDD: _MM_PERM_ENUM = 223; +pub const _MM_PERM_ENUM__MM_PERM_DCAA: _MM_PERM_ENUM = 224; +pub const _MM_PERM_ENUM__MM_PERM_DCAB: _MM_PERM_ENUM = 225; +pub const _MM_PERM_ENUM__MM_PERM_DCAC: _MM_PERM_ENUM = 226; +pub const _MM_PERM_ENUM__MM_PERM_DCAD: _MM_PERM_ENUM = 227; +pub const _MM_PERM_ENUM__MM_PERM_DCBA: _MM_PERM_ENUM = 228; +pub const _MM_PERM_ENUM__MM_PERM_DCBB: _MM_PERM_ENUM = 229; +pub const _MM_PERM_ENUM__MM_PERM_DCBC: _MM_PERM_ENUM = 230; +pub const _MM_PERM_ENUM__MM_PERM_DCBD: _MM_PERM_ENUM = 231; +pub const _MM_PERM_ENUM__MM_PERM_DCCA: _MM_PERM_ENUM = 232; +pub const _MM_PERM_ENUM__MM_PERM_DCCB: _MM_PERM_ENUM = 233; +pub const _MM_PERM_ENUM__MM_PERM_DCCC: _MM_PERM_ENUM = 234; +pub const _MM_PERM_ENUM__MM_PERM_DCCD: _MM_PERM_ENUM = 235; +pub const _MM_PERM_ENUM__MM_PERM_DCDA: _MM_PERM_ENUM = 236; +pub const _MM_PERM_ENUM__MM_PERM_DCDB: _MM_PERM_ENUM = 237; +pub const _MM_PERM_ENUM__MM_PERM_DCDC: _MM_PERM_ENUM = 238; +pub const _MM_PERM_ENUM__MM_PERM_DCDD: _MM_PERM_ENUM = 239; +pub const _MM_PERM_ENUM__MM_PERM_DDAA: _MM_PERM_ENUM = 240; +pub const _MM_PERM_ENUM__MM_PERM_DDAB: _MM_PERM_ENUM = 241; +pub const _MM_PERM_ENUM__MM_PERM_DDAC: _MM_PERM_ENUM = 242; +pub const _MM_PERM_ENUM__MM_PERM_DDAD: _MM_PERM_ENUM = 243; +pub const _MM_PERM_ENUM__MM_PERM_DDBA: _MM_PERM_ENUM = 244; +pub const _MM_PERM_ENUM__MM_PERM_DDBB: _MM_PERM_ENUM = 245; +pub const _MM_PERM_ENUM__MM_PERM_DDBC: _MM_PERM_ENUM = 246; +pub const _MM_PERM_ENUM__MM_PERM_DDBD: _MM_PERM_ENUM = 247; +pub const _MM_PERM_ENUM__MM_PERM_DDCA: _MM_PERM_ENUM = 248; +pub const _MM_PERM_ENUM__MM_PERM_DDCB: _MM_PERM_ENUM = 249; +pub const _MM_PERM_ENUM__MM_PERM_DDCC: _MM_PERM_ENUM = 250; +pub const _MM_PERM_ENUM__MM_PERM_DDCD: _MM_PERM_ENUM = 251; +pub const _MM_PERM_ENUM__MM_PERM_DDDA: _MM_PERM_ENUM = 252; +pub const _MM_PERM_ENUM__MM_PERM_DDDB: _MM_PERM_ENUM = 253; +pub const _MM_PERM_ENUM__MM_PERM_DDDC: _MM_PERM_ENUM = 254; +pub const _MM_PERM_ENUM__MM_PERM_DDDD: _MM_PERM_ENUM = 255; +pub type _MM_PERM_ENUM = u32; +pub const _MM_MANTISSA_NORM_ENUM__MM_MANT_NORM_1_2: _MM_MANTISSA_NORM_ENUM = 0; +pub const _MM_MANTISSA_NORM_ENUM__MM_MANT_NORM_p5_2: _MM_MANTISSA_NORM_ENUM = 1; +pub const _MM_MANTISSA_NORM_ENUM__MM_MANT_NORM_p5_1: _MM_MANTISSA_NORM_ENUM = 2; +pub const _MM_MANTISSA_NORM_ENUM__MM_MANT_NORM_p75_1p5: _MM_MANTISSA_NORM_ENUM = 3; +pub type _MM_MANTISSA_NORM_ENUM = u32; +pub const _MM_MANTISSA_SIGN_ENUM__MM_MANT_SIGN_src: _MM_MANTISSA_SIGN_ENUM = 0; +pub const _MM_MANTISSA_SIGN_ENUM__MM_MANT_SIGN_zero: _MM_MANTISSA_SIGN_ENUM = 1; +pub const _MM_MANTISSA_SIGN_ENUM__MM_MANT_SIGN_nan: _MM_MANTISSA_SIGN_ENUM = 2; +pub type _MM_MANTISSA_SIGN_ENUM = u32; +pub type __v2hi = [::std::os::raw::c_short; 2usize]; +pub type __v4qi = [::std::os::raw::c_char; 4usize]; +pub type __v2qi = [::std::os::raw::c_char; 2usize]; +pub type __mmask32 = ::std::os::raw::c_uint; +pub type __mmask64 = ::std::os::raw::c_ulonglong; +pub type __m512bh = [::std::os::raw::c_short; 32usize]; +pub type __m256bh = [::std::os::raw::c_short; 16usize]; +pub type __bfloat16 = ::std::os::raw::c_ushort; +pub type __m128bh = [::std::os::raw::c_short; 8usize]; +pub type __v2sf = [f32; 2usize]; +extern "C" { + pub fn __getcallerseflags() -> ::std::os::raw::c_uint; +} +extern "C" { + pub fn __segmentlimit(Selector: DWORD) -> DWORD; +} +extern "C" { + pub fn __mulh(Multiplier: LONGLONG, Multiplicand: LONGLONG) -> LONGLONG; +} +extern "C" { + pub fn __umulh(Multiplier: ULONGLONG, Multiplicand: ULONGLONG) -> ULONGLONG; +} +extern "C" { + pub fn __shiftleft128(LowPart: DWORD64, HighPart: DWORD64, Shift: BYTE) -> DWORD64; +} +extern "C" { + pub fn __shiftright128(LowPart: DWORD64, HighPart: DWORD64, Shift: BYTE) -> DWORD64; +} +extern "C" { + pub fn _mul128(Multiplier: LONG64, Multiplicand: LONG64, HighProduct: *mut LONG64) -> LONG64; +} +extern "C" { + pub fn _umul128( + Multiplier: DWORD64, + Multiplicand: DWORD64, + HighProduct: *mut DWORD64, + ) -> DWORD64; +} +extern "C" { + pub fn MultiplyExtract128(Multiplier: LONG64, Multiplicand: LONG64, Shift: BYTE) -> LONG64; +} +extern "C" { + pub fn UnsignedMultiplyExtract128( + Multiplier: DWORD64, + Multiplicand: DWORD64, + Shift: BYTE, + ) -> DWORD64; +} +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct _XMM_SAVE_AREA32 { + pub ControlWord: WORD, + pub StatusWord: WORD, + pub TagWord: BYTE, + pub Reserved1: BYTE, + pub ErrorOpcode: WORD, + pub ErrorOffset: DWORD, + pub ErrorSelector: WORD, + pub Reserved2: WORD, + pub DataOffset: DWORD, + pub DataSelector: WORD, + pub Reserved3: WORD, + pub MxCsr: DWORD, + pub MxCsr_Mask: DWORD, + pub FloatRegisters: [M128A; 8usize], + pub XmmRegisters: [M128A; 16usize], + pub Reserved4: [BYTE; 96usize], +} +pub type XMM_SAVE_AREA32 = _XMM_SAVE_AREA32; +pub type PXMM_SAVE_AREA32 = *mut _XMM_SAVE_AREA32; +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct _CONTEXT { + pub P1Home: DWORD64, + pub P2Home: DWORD64, + pub P3Home: DWORD64, + pub P4Home: DWORD64, + pub P5Home: DWORD64, + pub P6Home: DWORD64, + pub ContextFlags: DWORD, + pub MxCsr: DWORD, + pub SegCs: WORD, + pub SegDs: WORD, + pub SegEs: WORD, + pub SegFs: WORD, + pub SegGs: WORD, + pub SegSs: WORD, + pub EFlags: DWORD, + pub Dr0: DWORD64, + pub Dr1: DWORD64, + pub Dr2: DWORD64, + pub Dr3: DWORD64, + pub Dr6: DWORD64, + pub Dr7: DWORD64, + pub Rax: DWORD64, + pub Rcx: DWORD64, + pub Rdx: DWORD64, + pub Rbx: DWORD64, + pub Rsp: DWORD64, + pub Rbp: DWORD64, + pub Rsi: DWORD64, + pub Rdi: DWORD64, + pub R8: DWORD64, + pub R9: DWORD64, + pub R10: DWORD64, + pub R11: DWORD64, + pub R12: DWORD64, + pub R13: DWORD64, + pub R14: DWORD64, + pub R15: DWORD64, + pub Rip: DWORD64, + pub __bindgen_anon_1: _CONTEXT__bindgen_ty_1, + pub VectorRegister: [M128A; 26usize], + pub VectorControl: DWORD64, + pub DebugControl: DWORD64, + pub LastBranchToRip: DWORD64, + pub LastBranchFromRip: DWORD64, + pub LastExceptionToRip: DWORD64, + pub LastExceptionFromRip: DWORD64, +} +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub union _CONTEXT__bindgen_ty_1 { + pub FltSave: XMM_SAVE_AREA32, + pub FloatSave: XMM_SAVE_AREA32, + pub __bindgen_anon_1: _CONTEXT__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: [u128; 32usize], +} +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _CONTEXT__bindgen_ty_1__bindgen_ty_1 { + pub Header: [M128A; 2usize], + pub Legacy: [M128A; 8usize], + pub Xmm0: M128A, + pub Xmm1: M128A, + pub Xmm2: M128A, + pub Xmm3: M128A, + pub Xmm4: M128A, + pub Xmm5: M128A, + pub Xmm6: M128A, + pub Xmm7: M128A, + pub Xmm8: M128A, + pub Xmm9: M128A, + pub Xmm10: M128A, + pub Xmm11: M128A, + pub Xmm12: M128A, + pub Xmm13: M128A, + pub Xmm14: M128A, + pub Xmm15: M128A, +} +pub type CONTEXT = _CONTEXT; +pub type PCONTEXT = *mut _CONTEXT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RUNTIME_FUNCTION { + pub BeginAddress: DWORD, + pub EndAddress: DWORD, + pub UnwindData: DWORD, +} +pub type RUNTIME_FUNCTION = _RUNTIME_FUNCTION; +pub type PRUNTIME_FUNCTION = *mut _RUNTIME_FUNCTION; +pub type PGET_RUNTIME_FUNCTION_CALLBACK = ::std::option::Option< + unsafe extern "C" fn(ControlPc: DWORD64, Context: PVOID) -> PRUNTIME_FUNCTION, +>; +pub type POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + Process: HANDLE, + TableAddress: PVOID, + Entries: PDWORD, + Functions: *mut PRUNTIME_FUNCTION, + ) -> DWORD, +>; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _LDT_ENTRY { + pub LimitLow: WORD, + pub BaseLow: WORD, + pub HighWord: _LDT_ENTRY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _LDT_ENTRY__bindgen_ty_1 { + pub Bytes: _LDT_ENTRY__bindgen_ty_1__bindgen_ty_1, + pub Bits: _LDT_ENTRY__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LDT_ENTRY__bindgen_ty_1__bindgen_ty_1 { + pub BaseMid: BYTE, + pub Flags1: BYTE, + pub Flags2: BYTE, + pub BaseHi: BYTE, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _LDT_ENTRY__bindgen_ty_1__bindgen_ty_2 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, +} +impl _LDT_ENTRY__bindgen_ty_1__bindgen_ty_2 { + #[inline] + pub fn BaseMid(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_BaseMid(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn Type(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 5u8) as u32) } + } + #[inline] + pub fn set_Type(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 5u8, val as u64) + } + } + #[inline] + pub fn Dpl(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 2u8) as u32) } + } + #[inline] + pub fn set_Dpl(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 2u8, val as u64) + } + } + #[inline] + pub fn Pres(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) } + } + #[inline] + pub fn set_Pres(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub fn LimitHi(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) } + } + #[inline] + pub fn set_LimitHi(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 4u8, val as u64) + } + } + #[inline] + pub fn Sys(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) } + } + #[inline] + pub fn set_Sys(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved_0(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) } + } + #[inline] + pub fn set_Reserved_0(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub fn Default_Big(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) } + } + #[inline] + pub fn set_Default_Big(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 1u8, val as u64) + } + } + #[inline] + pub fn Granularity(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) } + } + #[inline] + pub fn set_Granularity(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub fn BaseHi(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_BaseHi(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + BaseMid: DWORD, + Type: DWORD, + Dpl: DWORD, + Pres: DWORD, + LimitHi: DWORD, + Sys: DWORD, + Reserved_0: DWORD, + Default_Big: DWORD, + Granularity: DWORD, + BaseHi: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let BaseMid: u32 = unsafe { ::std::mem::transmute(BaseMid) }; + BaseMid as u64 + }); + __bindgen_bitfield_unit.set(8usize, 5u8, { + let Type: u32 = unsafe { ::std::mem::transmute(Type) }; + Type as u64 + }); + __bindgen_bitfield_unit.set(13usize, 2u8, { + let Dpl: u32 = unsafe { ::std::mem::transmute(Dpl) }; + Dpl as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let Pres: u32 = unsafe { ::std::mem::transmute(Pres) }; + Pres as u64 + }); + __bindgen_bitfield_unit.set(16usize, 4u8, { + let LimitHi: u32 = unsafe { ::std::mem::transmute(LimitHi) }; + LimitHi as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let Sys: u32 = unsafe { ::std::mem::transmute(Sys) }; + Sys as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let Reserved_0: u32 = unsafe { ::std::mem::transmute(Reserved_0) }; + Reserved_0 as u64 + }); + __bindgen_bitfield_unit.set(22usize, 1u8, { + let Default_Big: u32 = unsafe { ::std::mem::transmute(Default_Big) }; + Default_Big as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let Granularity: u32 = unsafe { ::std::mem::transmute(Granularity) }; + Granularity as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let BaseHi: u32 = unsafe { ::std::mem::transmute(BaseHi) }; + BaseHi as u64 + }); + __bindgen_bitfield_unit + } +} +pub type LDT_ENTRY = _LDT_ENTRY; +pub type PLDT_ENTRY = *mut _LDT_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXCEPTION_RECORD { + pub ExceptionCode: DWORD, + pub ExceptionFlags: DWORD, + pub ExceptionRecord: *mut _EXCEPTION_RECORD, + pub ExceptionAddress: PVOID, + pub NumberParameters: DWORD, + pub ExceptionInformation: [ULONG_PTR; 15usize], +} +pub type EXCEPTION_RECORD = _EXCEPTION_RECORD; +pub type PEXCEPTION_RECORD = *mut EXCEPTION_RECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXCEPTION_RECORD32 { + pub ExceptionCode: DWORD, + pub ExceptionFlags: DWORD, + pub ExceptionRecord: DWORD, + pub ExceptionAddress: DWORD, + pub NumberParameters: DWORD, + pub ExceptionInformation: [DWORD; 15usize], +} +pub type EXCEPTION_RECORD32 = _EXCEPTION_RECORD32; +pub type PEXCEPTION_RECORD32 = *mut _EXCEPTION_RECORD32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXCEPTION_RECORD64 { + pub ExceptionCode: DWORD, + pub ExceptionFlags: DWORD, + pub ExceptionRecord: DWORD64, + pub ExceptionAddress: DWORD64, + pub NumberParameters: DWORD, + pub __unusedAlignment: DWORD, + pub ExceptionInformation: [DWORD64; 15usize], +} +pub type EXCEPTION_RECORD64 = _EXCEPTION_RECORD64; +pub type PEXCEPTION_RECORD64 = *mut _EXCEPTION_RECORD64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXCEPTION_POINTERS { + pub ExceptionRecord: PEXCEPTION_RECORD, + pub ContextRecord: PCONTEXT, +} +pub type EXCEPTION_POINTERS = _EXCEPTION_POINTERS; +pub type PEXCEPTION_POINTERS = *mut _EXCEPTION_POINTERS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _UNWIND_HISTORY_TABLE_ENTRY { + pub ImageBase: ULONG64, + pub FunctionEntry: PRUNTIME_FUNCTION, +} +pub type UNWIND_HISTORY_TABLE_ENTRY = _UNWIND_HISTORY_TABLE_ENTRY; +pub type PUNWIND_HISTORY_TABLE_ENTRY = *mut _UNWIND_HISTORY_TABLE_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _UNWIND_HISTORY_TABLE { + pub Count: ULONG, + pub LocalHint: BYTE, + pub GlobalHint: BYTE, + pub Search: BYTE, + pub Once: BYTE, + pub LowAddress: ULONG64, + pub HighAddress: ULONG64, + pub Entry: [UNWIND_HISTORY_TABLE_ENTRY; 12usize], +} +pub type UNWIND_HISTORY_TABLE = _UNWIND_HISTORY_TABLE; +pub type PUNWIND_HISTORY_TABLE = *mut _UNWIND_HISTORY_TABLE; +pub type DISPATCHER_CONTEXT = _DISPATCHER_CONTEXT; +pub type PDISPATCHER_CONTEXT = *mut _DISPATCHER_CONTEXT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DISPATCHER_CONTEXT { + pub ControlPc: ULONG64, + pub ImageBase: ULONG64, + pub FunctionEntry: PRUNTIME_FUNCTION, + pub EstablisherFrame: ULONG64, + pub TargetIp: ULONG64, + pub ContextRecord: PCONTEXT, + pub LanguageHandler: PEXCEPTION_ROUTINE, + pub HandlerData: PVOID, + pub HistoryTable: PUNWIND_HISTORY_TABLE, + pub ScopeIndex: ULONG, + pub Fill0: ULONG, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _KNONVOLATILE_CONTEXT_POINTERS { + pub FloatingContext: [PM128A; 16usize], + pub IntegerContext: [PULONG64; 16usize], +} +pub type KNONVOLATILE_CONTEXT_POINTERS = _KNONVOLATILE_CONTEXT_POINTERS; +pub type PKNONVOLATILE_CONTEXT_POINTERS = *mut _KNONVOLATILE_CONTEXT_POINTERS; +pub type PACCESS_TOKEN = PVOID; +pub type PSECURITY_DESCRIPTOR = PVOID; +pub type PSID = PVOID; +pub type PCLAIMS_BLOB = PVOID; +pub type ACCESS_MASK = DWORD; +pub type PACCESS_MASK = *mut ACCESS_MASK; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GENERIC_MAPPING { + pub GenericRead: ACCESS_MASK, + pub GenericWrite: ACCESS_MASK, + pub GenericExecute: ACCESS_MASK, + pub GenericAll: ACCESS_MASK, +} +pub type GENERIC_MAPPING = _GENERIC_MAPPING; +pub type PGENERIC_MAPPING = *mut GENERIC_MAPPING; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LUID_AND_ATTRIBUTES { + pub Luid: LUID, + pub Attributes: DWORD, +} +pub type LUID_AND_ATTRIBUTES = _LUID_AND_ATTRIBUTES; +pub type PLUID_AND_ATTRIBUTES = *mut _LUID_AND_ATTRIBUTES; +pub type LUID_AND_ATTRIBUTES_ARRAY = [LUID_AND_ATTRIBUTES; 1usize]; +pub type PLUID_AND_ATTRIBUTES_ARRAY = *mut LUID_AND_ATTRIBUTES_ARRAY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SID_IDENTIFIER_AUTHORITY { + pub Value: [BYTE; 6usize], +} +pub type SID_IDENTIFIER_AUTHORITY = _SID_IDENTIFIER_AUTHORITY; +pub type PSID_IDENTIFIER_AUTHORITY = *mut _SID_IDENTIFIER_AUTHORITY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SID { + pub Revision: BYTE, + pub SubAuthorityCount: BYTE, + pub IdentifierAuthority: SID_IDENTIFIER_AUTHORITY, + pub SubAuthority: [DWORD; 1usize], +} +pub type SID = _SID; +pub type PISID = *mut _SID; +pub const _SID_NAME_USE_SidTypeUser: _SID_NAME_USE = 1; +pub const _SID_NAME_USE_SidTypeGroup: _SID_NAME_USE = 2; +pub const _SID_NAME_USE_SidTypeDomain: _SID_NAME_USE = 3; +pub const _SID_NAME_USE_SidTypeAlias: _SID_NAME_USE = 4; +pub const _SID_NAME_USE_SidTypeWellKnownGroup: _SID_NAME_USE = 5; +pub const _SID_NAME_USE_SidTypeDeletedAccount: _SID_NAME_USE = 6; +pub const _SID_NAME_USE_SidTypeInvalid: _SID_NAME_USE = 7; +pub const _SID_NAME_USE_SidTypeUnknown: _SID_NAME_USE = 8; +pub const _SID_NAME_USE_SidTypeComputer: _SID_NAME_USE = 9; +pub const _SID_NAME_USE_SidTypeLabel: _SID_NAME_USE = 10; +pub const _SID_NAME_USE_SidTypeLogonSession: _SID_NAME_USE = 11; +pub type _SID_NAME_USE = u32; +pub use self::_SID_NAME_USE as SID_NAME_USE; +pub type PSID_NAME_USE = *mut _SID_NAME_USE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SID_AND_ATTRIBUTES { + pub Sid: PSID, + pub Attributes: DWORD, +} +pub type SID_AND_ATTRIBUTES = _SID_AND_ATTRIBUTES; +pub type PSID_AND_ATTRIBUTES = *mut _SID_AND_ATTRIBUTES; +pub type SID_AND_ATTRIBUTES_ARRAY = [SID_AND_ATTRIBUTES; 1usize]; +pub type PSID_AND_ATTRIBUTES_ARRAY = *mut SID_AND_ATTRIBUTES_ARRAY; +pub type SID_HASH_ENTRY = ULONG_PTR; +pub type PSID_HASH_ENTRY = *mut ULONG_PTR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SID_AND_ATTRIBUTES_HASH { + pub SidCount: DWORD, + pub SidAttr: PSID_AND_ATTRIBUTES, + pub Hash: [SID_HASH_ENTRY; 32usize], +} +pub type SID_AND_ATTRIBUTES_HASH = _SID_AND_ATTRIBUTES_HASH; +pub type PSID_AND_ATTRIBUTES_HASH = *mut _SID_AND_ATTRIBUTES_HASH; +pub const WELL_KNOWN_SID_TYPE_WinNullSid: WELL_KNOWN_SID_TYPE = 0; +pub const WELL_KNOWN_SID_TYPE_WinWorldSid: WELL_KNOWN_SID_TYPE = 1; +pub const WELL_KNOWN_SID_TYPE_WinLocalSid: WELL_KNOWN_SID_TYPE = 2; +pub const WELL_KNOWN_SID_TYPE_WinCreatorOwnerSid: WELL_KNOWN_SID_TYPE = 3; +pub const WELL_KNOWN_SID_TYPE_WinCreatorGroupSid: WELL_KNOWN_SID_TYPE = 4; +pub const WELL_KNOWN_SID_TYPE_WinCreatorOwnerServerSid: WELL_KNOWN_SID_TYPE = 5; +pub const WELL_KNOWN_SID_TYPE_WinCreatorGroupServerSid: WELL_KNOWN_SID_TYPE = 6; +pub const WELL_KNOWN_SID_TYPE_WinNtAuthoritySid: WELL_KNOWN_SID_TYPE = 7; +pub const WELL_KNOWN_SID_TYPE_WinDialupSid: WELL_KNOWN_SID_TYPE = 8; +pub const WELL_KNOWN_SID_TYPE_WinNetworkSid: WELL_KNOWN_SID_TYPE = 9; +pub const WELL_KNOWN_SID_TYPE_WinBatchSid: WELL_KNOWN_SID_TYPE = 10; +pub const WELL_KNOWN_SID_TYPE_WinInteractiveSid: WELL_KNOWN_SID_TYPE = 11; +pub const WELL_KNOWN_SID_TYPE_WinServiceSid: WELL_KNOWN_SID_TYPE = 12; +pub const WELL_KNOWN_SID_TYPE_WinAnonymousSid: WELL_KNOWN_SID_TYPE = 13; +pub const WELL_KNOWN_SID_TYPE_WinProxySid: WELL_KNOWN_SID_TYPE = 14; +pub const WELL_KNOWN_SID_TYPE_WinEnterpriseControllersSid: WELL_KNOWN_SID_TYPE = 15; +pub const WELL_KNOWN_SID_TYPE_WinSelfSid: WELL_KNOWN_SID_TYPE = 16; +pub const WELL_KNOWN_SID_TYPE_WinAuthenticatedUserSid: WELL_KNOWN_SID_TYPE = 17; +pub const WELL_KNOWN_SID_TYPE_WinRestrictedCodeSid: WELL_KNOWN_SID_TYPE = 18; +pub const WELL_KNOWN_SID_TYPE_WinTerminalServerSid: WELL_KNOWN_SID_TYPE = 19; +pub const WELL_KNOWN_SID_TYPE_WinRemoteLogonIdSid: WELL_KNOWN_SID_TYPE = 20; +pub const WELL_KNOWN_SID_TYPE_WinLogonIdsSid: WELL_KNOWN_SID_TYPE = 21; +pub const WELL_KNOWN_SID_TYPE_WinLocalSystemSid: WELL_KNOWN_SID_TYPE = 22; +pub const WELL_KNOWN_SID_TYPE_WinLocalServiceSid: WELL_KNOWN_SID_TYPE = 23; +pub const WELL_KNOWN_SID_TYPE_WinNetworkServiceSid: WELL_KNOWN_SID_TYPE = 24; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinDomainSid: WELL_KNOWN_SID_TYPE = 25; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinAdministratorsSid: WELL_KNOWN_SID_TYPE = 26; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinUsersSid: WELL_KNOWN_SID_TYPE = 27; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinGuestsSid: WELL_KNOWN_SID_TYPE = 28; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinPowerUsersSid: WELL_KNOWN_SID_TYPE = 29; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinAccountOperatorsSid: WELL_KNOWN_SID_TYPE = 30; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinSystemOperatorsSid: WELL_KNOWN_SID_TYPE = 31; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinPrintOperatorsSid: WELL_KNOWN_SID_TYPE = 32; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinBackupOperatorsSid: WELL_KNOWN_SID_TYPE = 33; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinReplicatorSid: WELL_KNOWN_SID_TYPE = 34; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinPreWindows2000CompatibleAccessSid: WELL_KNOWN_SID_TYPE = 35; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinRemoteDesktopUsersSid: WELL_KNOWN_SID_TYPE = 36; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinNetworkConfigurationOperatorsSid: WELL_KNOWN_SID_TYPE = 37; +pub const WELL_KNOWN_SID_TYPE_WinAccountAdministratorSid: WELL_KNOWN_SID_TYPE = 38; +pub const WELL_KNOWN_SID_TYPE_WinAccountGuestSid: WELL_KNOWN_SID_TYPE = 39; +pub const WELL_KNOWN_SID_TYPE_WinAccountKrbtgtSid: WELL_KNOWN_SID_TYPE = 40; +pub const WELL_KNOWN_SID_TYPE_WinAccountDomainAdminsSid: WELL_KNOWN_SID_TYPE = 41; +pub const WELL_KNOWN_SID_TYPE_WinAccountDomainUsersSid: WELL_KNOWN_SID_TYPE = 42; +pub const WELL_KNOWN_SID_TYPE_WinAccountDomainGuestsSid: WELL_KNOWN_SID_TYPE = 43; +pub const WELL_KNOWN_SID_TYPE_WinAccountComputersSid: WELL_KNOWN_SID_TYPE = 44; +pub const WELL_KNOWN_SID_TYPE_WinAccountControllersSid: WELL_KNOWN_SID_TYPE = 45; +pub const WELL_KNOWN_SID_TYPE_WinAccountCertAdminsSid: WELL_KNOWN_SID_TYPE = 46; +pub const WELL_KNOWN_SID_TYPE_WinAccountSchemaAdminsSid: WELL_KNOWN_SID_TYPE = 47; +pub const WELL_KNOWN_SID_TYPE_WinAccountEnterpriseAdminsSid: WELL_KNOWN_SID_TYPE = 48; +pub const WELL_KNOWN_SID_TYPE_WinAccountPolicyAdminsSid: WELL_KNOWN_SID_TYPE = 49; +pub const WELL_KNOWN_SID_TYPE_WinAccountRasAndIasServersSid: WELL_KNOWN_SID_TYPE = 50; +pub const WELL_KNOWN_SID_TYPE_WinNTLMAuthenticationSid: WELL_KNOWN_SID_TYPE = 51; +pub const WELL_KNOWN_SID_TYPE_WinDigestAuthenticationSid: WELL_KNOWN_SID_TYPE = 52; +pub const WELL_KNOWN_SID_TYPE_WinSChannelAuthenticationSid: WELL_KNOWN_SID_TYPE = 53; +pub const WELL_KNOWN_SID_TYPE_WinThisOrganizationSid: WELL_KNOWN_SID_TYPE = 54; +pub const WELL_KNOWN_SID_TYPE_WinOtherOrganizationSid: WELL_KNOWN_SID_TYPE = 55; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinIncomingForestTrustBuildersSid: WELL_KNOWN_SID_TYPE = 56; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinPerfMonitoringUsersSid: WELL_KNOWN_SID_TYPE = 57; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinPerfLoggingUsersSid: WELL_KNOWN_SID_TYPE = 58; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinAuthorizationAccessSid: WELL_KNOWN_SID_TYPE = 59; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinTerminalServerLicenseServersSid: WELL_KNOWN_SID_TYPE = 60; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinDCOMUsersSid: WELL_KNOWN_SID_TYPE = 61; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinIUsersSid: WELL_KNOWN_SID_TYPE = 62; +pub const WELL_KNOWN_SID_TYPE_WinIUserSid: WELL_KNOWN_SID_TYPE = 63; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinCryptoOperatorsSid: WELL_KNOWN_SID_TYPE = 64; +pub const WELL_KNOWN_SID_TYPE_WinUntrustedLabelSid: WELL_KNOWN_SID_TYPE = 65; +pub const WELL_KNOWN_SID_TYPE_WinLowLabelSid: WELL_KNOWN_SID_TYPE = 66; +pub const WELL_KNOWN_SID_TYPE_WinMediumLabelSid: WELL_KNOWN_SID_TYPE = 67; +pub const WELL_KNOWN_SID_TYPE_WinHighLabelSid: WELL_KNOWN_SID_TYPE = 68; +pub const WELL_KNOWN_SID_TYPE_WinSystemLabelSid: WELL_KNOWN_SID_TYPE = 69; +pub const WELL_KNOWN_SID_TYPE_WinWriteRestrictedCodeSid: WELL_KNOWN_SID_TYPE = 70; +pub const WELL_KNOWN_SID_TYPE_WinCreatorOwnerRightsSid: WELL_KNOWN_SID_TYPE = 71; +pub const WELL_KNOWN_SID_TYPE_WinCacheablePrincipalsGroupSid: WELL_KNOWN_SID_TYPE = 72; +pub const WELL_KNOWN_SID_TYPE_WinNonCacheablePrincipalsGroupSid: WELL_KNOWN_SID_TYPE = 73; +pub const WELL_KNOWN_SID_TYPE_WinEnterpriseReadonlyControllersSid: WELL_KNOWN_SID_TYPE = 74; +pub const WELL_KNOWN_SID_TYPE_WinAccountReadonlyControllersSid: WELL_KNOWN_SID_TYPE = 75; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinEventLogReadersGroup: WELL_KNOWN_SID_TYPE = 76; +pub const WELL_KNOWN_SID_TYPE_WinNewEnterpriseReadonlyControllersSid: WELL_KNOWN_SID_TYPE = 77; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinCertSvcDComAccessGroup: WELL_KNOWN_SID_TYPE = 78; +pub const WELL_KNOWN_SID_TYPE_WinMediumPlusLabelSid: WELL_KNOWN_SID_TYPE = 79; +pub const WELL_KNOWN_SID_TYPE_WinLocalLogonSid: WELL_KNOWN_SID_TYPE = 80; +pub const WELL_KNOWN_SID_TYPE_WinConsoleLogonSid: WELL_KNOWN_SID_TYPE = 81; +pub const WELL_KNOWN_SID_TYPE_WinThisOrganizationCertificateSid: WELL_KNOWN_SID_TYPE = 82; +pub const WELL_KNOWN_SID_TYPE_WinApplicationPackageAuthoritySid: WELL_KNOWN_SID_TYPE = 83; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinAnyPackageSid: WELL_KNOWN_SID_TYPE = 84; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityInternetClientSid: WELL_KNOWN_SID_TYPE = 85; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityInternetClientServerSid: WELL_KNOWN_SID_TYPE = 86; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityPrivateNetworkClientServerSid: WELL_KNOWN_SID_TYPE = 87; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityPicturesLibrarySid: WELL_KNOWN_SID_TYPE = 88; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityVideosLibrarySid: WELL_KNOWN_SID_TYPE = 89; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityMusicLibrarySid: WELL_KNOWN_SID_TYPE = 90; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityDocumentsLibrarySid: WELL_KNOWN_SID_TYPE = 91; +pub const WELL_KNOWN_SID_TYPE_WinCapabilitySharedUserCertificatesSid: WELL_KNOWN_SID_TYPE = 92; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityEnterpriseAuthenticationSid: WELL_KNOWN_SID_TYPE = 93; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityRemovableStorageSid: WELL_KNOWN_SID_TYPE = 94; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinRDSRemoteAccessServersSid: WELL_KNOWN_SID_TYPE = 95; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinRDSEndpointServersSid: WELL_KNOWN_SID_TYPE = 96; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinRDSManagementServersSid: WELL_KNOWN_SID_TYPE = 97; +pub const WELL_KNOWN_SID_TYPE_WinUserModeDriversSid: WELL_KNOWN_SID_TYPE = 98; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinHyperVAdminsSid: WELL_KNOWN_SID_TYPE = 99; +pub const WELL_KNOWN_SID_TYPE_WinAccountCloneableControllersSid: WELL_KNOWN_SID_TYPE = 100; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinAccessControlAssistanceOperatorsSid: WELL_KNOWN_SID_TYPE = + 101; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinRemoteManagementUsersSid: WELL_KNOWN_SID_TYPE = 102; +pub const WELL_KNOWN_SID_TYPE_WinAuthenticationAuthorityAssertedSid: WELL_KNOWN_SID_TYPE = 103; +pub const WELL_KNOWN_SID_TYPE_WinAuthenticationServiceAssertedSid: WELL_KNOWN_SID_TYPE = 104; +pub const WELL_KNOWN_SID_TYPE_WinLocalAccountSid: WELL_KNOWN_SID_TYPE = 105; +pub const WELL_KNOWN_SID_TYPE_WinLocalAccountAndAdministratorSid: WELL_KNOWN_SID_TYPE = 106; +pub const WELL_KNOWN_SID_TYPE_WinAccountProtectedUsersSid: WELL_KNOWN_SID_TYPE = 107; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityAppointmentsSid: WELL_KNOWN_SID_TYPE = 108; +pub const WELL_KNOWN_SID_TYPE_WinCapabilityContactsSid: WELL_KNOWN_SID_TYPE = 109; +pub const WELL_KNOWN_SID_TYPE_WinAccountDefaultSystemManagedSid: WELL_KNOWN_SID_TYPE = 110; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinDefaultSystemManagedGroupSid: WELL_KNOWN_SID_TYPE = 111; +pub const WELL_KNOWN_SID_TYPE_WinBuiltinStorageReplicaAdminsSid: WELL_KNOWN_SID_TYPE = 112; +pub const WELL_KNOWN_SID_TYPE_WinAccountKeyAdminsSid: WELL_KNOWN_SID_TYPE = 113; +pub const WELL_KNOWN_SID_TYPE_WinAccountEnterpriseKeyAdminsSid: WELL_KNOWN_SID_TYPE = 114; +pub const WELL_KNOWN_SID_TYPE_WinAuthenticationKeyTrustSid: WELL_KNOWN_SID_TYPE = 115; +pub const WELL_KNOWN_SID_TYPE_WinAuthenticationKeyPropertyMFASid: WELL_KNOWN_SID_TYPE = 116; +pub const WELL_KNOWN_SID_TYPE_WinAuthenticationKeyPropertyAttestationSid: WELL_KNOWN_SID_TYPE = 117; +pub type WELL_KNOWN_SID_TYPE = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACL { + pub AclRevision: BYTE, + pub Sbz1: BYTE, + pub AclSize: WORD, + pub AceCount: WORD, + pub Sbz2: WORD, +} +pub type ACL = _ACL; +pub type PACL = *mut ACL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACE_HEADER { + pub AceType: BYTE, + pub AceFlags: BYTE, + pub AceSize: WORD, +} +pub type ACE_HEADER = _ACE_HEADER; +pub type PACE_HEADER = *mut ACE_HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_ALLOWED_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type ACCESS_ALLOWED_ACE = _ACCESS_ALLOWED_ACE; +pub type PACCESS_ALLOWED_ACE = *mut ACCESS_ALLOWED_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_DENIED_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type ACCESS_DENIED_ACE = _ACCESS_DENIED_ACE; +pub type PACCESS_DENIED_ACE = *mut ACCESS_DENIED_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_AUDIT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_AUDIT_ACE = _SYSTEM_AUDIT_ACE; +pub type PSYSTEM_AUDIT_ACE = *mut SYSTEM_AUDIT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_ALARM_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_ALARM_ACE = _SYSTEM_ALARM_ACE; +pub type PSYSTEM_ALARM_ACE = *mut SYSTEM_ALARM_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_RESOURCE_ATTRIBUTE_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_RESOURCE_ATTRIBUTE_ACE = _SYSTEM_RESOURCE_ATTRIBUTE_ACE; +pub type PSYSTEM_RESOURCE_ATTRIBUTE_ACE = *mut _SYSTEM_RESOURCE_ATTRIBUTE_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_SCOPED_POLICY_ID_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_SCOPED_POLICY_ID_ACE = _SYSTEM_SCOPED_POLICY_ID_ACE; +pub type PSYSTEM_SCOPED_POLICY_ID_ACE = *mut _SYSTEM_SCOPED_POLICY_ID_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_MANDATORY_LABEL_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_MANDATORY_LABEL_ACE = _SYSTEM_MANDATORY_LABEL_ACE; +pub type PSYSTEM_MANDATORY_LABEL_ACE = *mut _SYSTEM_MANDATORY_LABEL_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_ALLOWED_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type ACCESS_ALLOWED_OBJECT_ACE = _ACCESS_ALLOWED_OBJECT_ACE; +pub type PACCESS_ALLOWED_OBJECT_ACE = *mut _ACCESS_ALLOWED_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_DENIED_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type ACCESS_DENIED_OBJECT_ACE = _ACCESS_DENIED_OBJECT_ACE; +pub type PACCESS_DENIED_OBJECT_ACE = *mut _ACCESS_DENIED_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_AUDIT_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type SYSTEM_AUDIT_OBJECT_ACE = _SYSTEM_AUDIT_OBJECT_ACE; +pub type PSYSTEM_AUDIT_OBJECT_ACE = *mut _SYSTEM_AUDIT_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_ALARM_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type SYSTEM_ALARM_OBJECT_ACE = _SYSTEM_ALARM_OBJECT_ACE; +pub type PSYSTEM_ALARM_OBJECT_ACE = *mut _SYSTEM_ALARM_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_ALLOWED_CALLBACK_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type ACCESS_ALLOWED_CALLBACK_ACE = _ACCESS_ALLOWED_CALLBACK_ACE; +pub type PACCESS_ALLOWED_CALLBACK_ACE = *mut _ACCESS_ALLOWED_CALLBACK_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_DENIED_CALLBACK_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type ACCESS_DENIED_CALLBACK_ACE = _ACCESS_DENIED_CALLBACK_ACE; +pub type PACCESS_DENIED_CALLBACK_ACE = *mut _ACCESS_DENIED_CALLBACK_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_AUDIT_CALLBACK_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_AUDIT_CALLBACK_ACE = _SYSTEM_AUDIT_CALLBACK_ACE; +pub type PSYSTEM_AUDIT_CALLBACK_ACE = *mut _SYSTEM_AUDIT_CALLBACK_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_ALARM_CALLBACK_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub SidStart: DWORD, +} +pub type SYSTEM_ALARM_CALLBACK_ACE = _SYSTEM_ALARM_CALLBACK_ACE; +pub type PSYSTEM_ALARM_CALLBACK_ACE = *mut _SYSTEM_ALARM_CALLBACK_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type ACCESS_ALLOWED_CALLBACK_OBJECT_ACE = _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE; +pub type PACCESS_ALLOWED_CALLBACK_OBJECT_ACE = *mut _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_DENIED_CALLBACK_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type ACCESS_DENIED_CALLBACK_OBJECT_ACE = _ACCESS_DENIED_CALLBACK_OBJECT_ACE; +pub type PACCESS_DENIED_CALLBACK_OBJECT_ACE = *mut _ACCESS_DENIED_CALLBACK_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type SYSTEM_AUDIT_CALLBACK_OBJECT_ACE = _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE; +pub type PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE = *mut _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_ALARM_CALLBACK_OBJECT_ACE { + pub Header: ACE_HEADER, + pub Mask: ACCESS_MASK, + pub Flags: DWORD, + pub ObjectType: GUID, + pub InheritedObjectType: GUID, + pub SidStart: DWORD, +} +pub type SYSTEM_ALARM_CALLBACK_OBJECT_ACE = _SYSTEM_ALARM_CALLBACK_OBJECT_ACE; +pub type PSYSTEM_ALARM_CALLBACK_OBJECT_ACE = *mut _SYSTEM_ALARM_CALLBACK_OBJECT_ACE; +pub const _ACL_INFORMATION_CLASS_AclRevisionInformation: _ACL_INFORMATION_CLASS = 1; +pub const _ACL_INFORMATION_CLASS_AclSizeInformation: _ACL_INFORMATION_CLASS = 2; +pub type _ACL_INFORMATION_CLASS = u32; +pub use self::_ACL_INFORMATION_CLASS as ACL_INFORMATION_CLASS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACL_REVISION_INFORMATION { + pub AclRevision: DWORD, +} +pub type ACL_REVISION_INFORMATION = _ACL_REVISION_INFORMATION; +pub type PACL_REVISION_INFORMATION = *mut ACL_REVISION_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACL_SIZE_INFORMATION { + pub AceCount: DWORD, + pub AclBytesInUse: DWORD, + pub AclBytesFree: DWORD, +} +pub type ACL_SIZE_INFORMATION = _ACL_SIZE_INFORMATION; +pub type PACL_SIZE_INFORMATION = *mut ACL_SIZE_INFORMATION; +pub type SECURITY_DESCRIPTOR_CONTROL = WORD; +pub type PSECURITY_DESCRIPTOR_CONTROL = *mut WORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SECURITY_DESCRIPTOR_RELATIVE { + pub Revision: BYTE, + pub Sbz1: BYTE, + pub Control: SECURITY_DESCRIPTOR_CONTROL, + pub Owner: DWORD, + pub Group: DWORD, + pub Sacl: DWORD, + pub Dacl: DWORD, +} +pub type SECURITY_DESCRIPTOR_RELATIVE = _SECURITY_DESCRIPTOR_RELATIVE; +pub type PISECURITY_DESCRIPTOR_RELATIVE = *mut _SECURITY_DESCRIPTOR_RELATIVE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SECURITY_DESCRIPTOR { + pub Revision: BYTE, + pub Sbz1: BYTE, + pub Control: SECURITY_DESCRIPTOR_CONTROL, + pub Owner: PSID, + pub Group: PSID, + pub Sacl: PACL, + pub Dacl: PACL, +} +pub type SECURITY_DESCRIPTOR = _SECURITY_DESCRIPTOR; +pub type PISECURITY_DESCRIPTOR = *mut _SECURITY_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OBJECT_TYPE_LIST { + pub Level: WORD, + pub Sbz: WORD, + pub ObjectType: *mut GUID, +} +pub type OBJECT_TYPE_LIST = _OBJECT_TYPE_LIST; +pub type POBJECT_TYPE_LIST = *mut _OBJECT_TYPE_LIST; +pub const _AUDIT_EVENT_TYPE_AuditEventObjectAccess: _AUDIT_EVENT_TYPE = 0; +pub const _AUDIT_EVENT_TYPE_AuditEventDirectoryServiceAccess: _AUDIT_EVENT_TYPE = 1; +pub type _AUDIT_EVENT_TYPE = u32; +pub use self::_AUDIT_EVENT_TYPE as AUDIT_EVENT_TYPE; +pub type PAUDIT_EVENT_TYPE = *mut _AUDIT_EVENT_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PRIVILEGE_SET { + pub PrivilegeCount: DWORD, + pub Control: DWORD, + pub Privilege: [LUID_AND_ATTRIBUTES; 1usize], +} +pub type PRIVILEGE_SET = _PRIVILEGE_SET; +pub type PPRIVILEGE_SET = *mut _PRIVILEGE_SET; +pub const _ACCESS_REASON_TYPE_AccessReasonNone: _ACCESS_REASON_TYPE = 0; +pub const _ACCESS_REASON_TYPE_AccessReasonAllowedAce: _ACCESS_REASON_TYPE = 65536; +pub const _ACCESS_REASON_TYPE_AccessReasonDeniedAce: _ACCESS_REASON_TYPE = 131072; +pub const _ACCESS_REASON_TYPE_AccessReasonAllowedParentAce: _ACCESS_REASON_TYPE = 196608; +pub const _ACCESS_REASON_TYPE_AccessReasonDeniedParentAce: _ACCESS_REASON_TYPE = 262144; +pub const _ACCESS_REASON_TYPE_AccessReasonNotGrantedByCape: _ACCESS_REASON_TYPE = 327680; +pub const _ACCESS_REASON_TYPE_AccessReasonNotGrantedByParentCape: _ACCESS_REASON_TYPE = 393216; +pub const _ACCESS_REASON_TYPE_AccessReasonNotGrantedToAppContainer: _ACCESS_REASON_TYPE = 458752; +pub const _ACCESS_REASON_TYPE_AccessReasonMissingPrivilege: _ACCESS_REASON_TYPE = 1048576; +pub const _ACCESS_REASON_TYPE_AccessReasonFromPrivilege: _ACCESS_REASON_TYPE = 2097152; +pub const _ACCESS_REASON_TYPE_AccessReasonIntegrityLevel: _ACCESS_REASON_TYPE = 3145728; +pub const _ACCESS_REASON_TYPE_AccessReasonOwnership: _ACCESS_REASON_TYPE = 4194304; +pub const _ACCESS_REASON_TYPE_AccessReasonNullDacl: _ACCESS_REASON_TYPE = 5242880; +pub const _ACCESS_REASON_TYPE_AccessReasonEmptyDacl: _ACCESS_REASON_TYPE = 6291456; +pub const _ACCESS_REASON_TYPE_AccessReasonNoSD: _ACCESS_REASON_TYPE = 7340032; +pub const _ACCESS_REASON_TYPE_AccessReasonNoGrant: _ACCESS_REASON_TYPE = 8388608; +pub type _ACCESS_REASON_TYPE = u32; +pub use self::_ACCESS_REASON_TYPE as ACCESS_REASON_TYPE; +pub type ACCESS_REASON = DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACCESS_REASONS { + pub Data: [ACCESS_REASON; 32usize], +} +pub type ACCESS_REASONS = _ACCESS_REASONS; +pub type PACCESS_REASONS = *mut _ACCESS_REASONS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SE_SECURITY_DESCRIPTOR { + pub Size: DWORD, + pub Flags: DWORD, + pub SecurityDescriptor: PSECURITY_DESCRIPTOR, +} +pub type SE_SECURITY_DESCRIPTOR = _SE_SECURITY_DESCRIPTOR; +pub type PSE_SECURITY_DESCRIPTOR = *mut _SE_SECURITY_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SE_ACCESS_REQUEST { + pub Size: DWORD, + pub SeSecurityDescriptor: PSE_SECURITY_DESCRIPTOR, + pub DesiredAccess: ACCESS_MASK, + pub PreviouslyGrantedAccess: ACCESS_MASK, + pub PrincipalSelfSid: PSID, + pub GenericMapping: PGENERIC_MAPPING, + pub ObjectTypeListCount: DWORD, + pub ObjectTypeList: POBJECT_TYPE_LIST, +} +pub type SE_ACCESS_REQUEST = _SE_ACCESS_REQUEST; +pub type PSE_ACCESS_REQUEST = *mut _SE_ACCESS_REQUEST; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SE_ACCESS_REPLY { + pub Size: DWORD, + pub ResultListCount: DWORD, + pub GrantedAccess: PACCESS_MASK, + pub AccessStatus: PDWORD, + pub AccessReason: PACCESS_REASONS, + pub Privileges: *mut PPRIVILEGE_SET, +} +pub type SE_ACCESS_REPLY = _SE_ACCESS_REPLY; +pub type PSE_ACCESS_REPLY = *mut _SE_ACCESS_REPLY; +pub const _SECURITY_IMPERSONATION_LEVEL_SecurityAnonymous: _SECURITY_IMPERSONATION_LEVEL = 0; +pub const _SECURITY_IMPERSONATION_LEVEL_SecurityIdentification: _SECURITY_IMPERSONATION_LEVEL = 1; +pub const _SECURITY_IMPERSONATION_LEVEL_SecurityImpersonation: _SECURITY_IMPERSONATION_LEVEL = 2; +pub const _SECURITY_IMPERSONATION_LEVEL_SecurityDelegation: _SECURITY_IMPERSONATION_LEVEL = 3; +pub type _SECURITY_IMPERSONATION_LEVEL = u32; +pub use self::_SECURITY_IMPERSONATION_LEVEL as SECURITY_IMPERSONATION_LEVEL; +pub type PSECURITY_IMPERSONATION_LEVEL = *mut _SECURITY_IMPERSONATION_LEVEL; +pub const _TOKEN_TYPE_TokenPrimary: _TOKEN_TYPE = 1; +pub const _TOKEN_TYPE_TokenImpersonation: _TOKEN_TYPE = 2; +pub type _TOKEN_TYPE = u32; +pub use self::_TOKEN_TYPE as TOKEN_TYPE; +pub type PTOKEN_TYPE = *mut TOKEN_TYPE; +pub const _TOKEN_ELEVATION_TYPE_TokenElevationTypeDefault: _TOKEN_ELEVATION_TYPE = 1; +pub const _TOKEN_ELEVATION_TYPE_TokenElevationTypeFull: _TOKEN_ELEVATION_TYPE = 2; +pub const _TOKEN_ELEVATION_TYPE_TokenElevationTypeLimited: _TOKEN_ELEVATION_TYPE = 3; +pub type _TOKEN_ELEVATION_TYPE = u32; +pub use self::_TOKEN_ELEVATION_TYPE as TOKEN_ELEVATION_TYPE; +pub type PTOKEN_ELEVATION_TYPE = *mut _TOKEN_ELEVATION_TYPE; +pub const _TOKEN_INFORMATION_CLASS_TokenUser: _TOKEN_INFORMATION_CLASS = 1; +pub const _TOKEN_INFORMATION_CLASS_TokenGroups: _TOKEN_INFORMATION_CLASS = 2; +pub const _TOKEN_INFORMATION_CLASS_TokenPrivileges: _TOKEN_INFORMATION_CLASS = 3; +pub const _TOKEN_INFORMATION_CLASS_TokenOwner: _TOKEN_INFORMATION_CLASS = 4; +pub const _TOKEN_INFORMATION_CLASS_TokenPrimaryGroup: _TOKEN_INFORMATION_CLASS = 5; +pub const _TOKEN_INFORMATION_CLASS_TokenDefaultDacl: _TOKEN_INFORMATION_CLASS = 6; +pub const _TOKEN_INFORMATION_CLASS_TokenSource: _TOKEN_INFORMATION_CLASS = 7; +pub const _TOKEN_INFORMATION_CLASS_TokenType: _TOKEN_INFORMATION_CLASS = 8; +pub const _TOKEN_INFORMATION_CLASS_TokenImpersonationLevel: _TOKEN_INFORMATION_CLASS = 9; +pub const _TOKEN_INFORMATION_CLASS_TokenStatistics: _TOKEN_INFORMATION_CLASS = 10; +pub const _TOKEN_INFORMATION_CLASS_TokenRestrictedSids: _TOKEN_INFORMATION_CLASS = 11; +pub const _TOKEN_INFORMATION_CLASS_TokenSessionId: _TOKEN_INFORMATION_CLASS = 12; +pub const _TOKEN_INFORMATION_CLASS_TokenGroupsAndPrivileges: _TOKEN_INFORMATION_CLASS = 13; +pub const _TOKEN_INFORMATION_CLASS_TokenSessionReference: _TOKEN_INFORMATION_CLASS = 14; +pub const _TOKEN_INFORMATION_CLASS_TokenSandBoxInert: _TOKEN_INFORMATION_CLASS = 15; +pub const _TOKEN_INFORMATION_CLASS_TokenAuditPolicy: _TOKEN_INFORMATION_CLASS = 16; +pub const _TOKEN_INFORMATION_CLASS_TokenOrigin: _TOKEN_INFORMATION_CLASS = 17; +pub const _TOKEN_INFORMATION_CLASS_TokenElevationType: _TOKEN_INFORMATION_CLASS = 18; +pub const _TOKEN_INFORMATION_CLASS_TokenLinkedToken: _TOKEN_INFORMATION_CLASS = 19; +pub const _TOKEN_INFORMATION_CLASS_TokenElevation: _TOKEN_INFORMATION_CLASS = 20; +pub const _TOKEN_INFORMATION_CLASS_TokenHasRestrictions: _TOKEN_INFORMATION_CLASS = 21; +pub const _TOKEN_INFORMATION_CLASS_TokenAccessInformation: _TOKEN_INFORMATION_CLASS = 22; +pub const _TOKEN_INFORMATION_CLASS_TokenVirtualizationAllowed: _TOKEN_INFORMATION_CLASS = 23; +pub const _TOKEN_INFORMATION_CLASS_TokenVirtualizationEnabled: _TOKEN_INFORMATION_CLASS = 24; +pub const _TOKEN_INFORMATION_CLASS_TokenIntegrityLevel: _TOKEN_INFORMATION_CLASS = 25; +pub const _TOKEN_INFORMATION_CLASS_TokenUIAccess: _TOKEN_INFORMATION_CLASS = 26; +pub const _TOKEN_INFORMATION_CLASS_TokenMandatoryPolicy: _TOKEN_INFORMATION_CLASS = 27; +pub const _TOKEN_INFORMATION_CLASS_TokenLogonSid: _TOKEN_INFORMATION_CLASS = 28; +pub const _TOKEN_INFORMATION_CLASS_TokenIsAppContainer: _TOKEN_INFORMATION_CLASS = 29; +pub const _TOKEN_INFORMATION_CLASS_TokenCapabilities: _TOKEN_INFORMATION_CLASS = 30; +pub const _TOKEN_INFORMATION_CLASS_TokenAppContainerSid: _TOKEN_INFORMATION_CLASS = 31; +pub const _TOKEN_INFORMATION_CLASS_TokenAppContainerNumber: _TOKEN_INFORMATION_CLASS = 32; +pub const _TOKEN_INFORMATION_CLASS_TokenUserClaimAttributes: _TOKEN_INFORMATION_CLASS = 33; +pub const _TOKEN_INFORMATION_CLASS_TokenDeviceClaimAttributes: _TOKEN_INFORMATION_CLASS = 34; +pub const _TOKEN_INFORMATION_CLASS_TokenRestrictedUserClaimAttributes: _TOKEN_INFORMATION_CLASS = + 35; +pub const _TOKEN_INFORMATION_CLASS_TokenRestrictedDeviceClaimAttributes: _TOKEN_INFORMATION_CLASS = + 36; +pub const _TOKEN_INFORMATION_CLASS_TokenDeviceGroups: _TOKEN_INFORMATION_CLASS = 37; +pub const _TOKEN_INFORMATION_CLASS_TokenRestrictedDeviceGroups: _TOKEN_INFORMATION_CLASS = 38; +pub const _TOKEN_INFORMATION_CLASS_TokenSecurityAttributes: _TOKEN_INFORMATION_CLASS = 39; +pub const _TOKEN_INFORMATION_CLASS_TokenIsRestricted: _TOKEN_INFORMATION_CLASS = 40; +pub const _TOKEN_INFORMATION_CLASS_MaxTokenInfoClass: _TOKEN_INFORMATION_CLASS = 41; +pub type _TOKEN_INFORMATION_CLASS = u32; +pub use self::_TOKEN_INFORMATION_CLASS as TOKEN_INFORMATION_CLASS; +pub type PTOKEN_INFORMATION_CLASS = *mut _TOKEN_INFORMATION_CLASS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_USER { + pub User: SID_AND_ATTRIBUTES, +} +pub type TOKEN_USER = _TOKEN_USER; +pub type PTOKEN_USER = *mut _TOKEN_USER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_GROUPS { + pub GroupCount: DWORD, + pub Groups: [SID_AND_ATTRIBUTES; 1usize], +} +pub type TOKEN_GROUPS = _TOKEN_GROUPS; +pub type PTOKEN_GROUPS = *mut _TOKEN_GROUPS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_PRIVILEGES { + pub PrivilegeCount: DWORD, + pub Privileges: [LUID_AND_ATTRIBUTES; 1usize], +} +pub type TOKEN_PRIVILEGES = _TOKEN_PRIVILEGES; +pub type PTOKEN_PRIVILEGES = *mut _TOKEN_PRIVILEGES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_OWNER { + pub Owner: PSID, +} +pub type TOKEN_OWNER = _TOKEN_OWNER; +pub type PTOKEN_OWNER = *mut _TOKEN_OWNER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_PRIMARY_GROUP { + pub PrimaryGroup: PSID, +} +pub type TOKEN_PRIMARY_GROUP = _TOKEN_PRIMARY_GROUP; +pub type PTOKEN_PRIMARY_GROUP = *mut _TOKEN_PRIMARY_GROUP; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_DEFAULT_DACL { + pub DefaultDacl: PACL, +} +pub type TOKEN_DEFAULT_DACL = _TOKEN_DEFAULT_DACL; +pub type PTOKEN_DEFAULT_DACL = *mut _TOKEN_DEFAULT_DACL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_USER_CLAIMS { + pub UserClaims: PCLAIMS_BLOB, +} +pub type TOKEN_USER_CLAIMS = _TOKEN_USER_CLAIMS; +pub type PTOKEN_USER_CLAIMS = *mut _TOKEN_USER_CLAIMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_DEVICE_CLAIMS { + pub DeviceClaims: PCLAIMS_BLOB, +} +pub type TOKEN_DEVICE_CLAIMS = _TOKEN_DEVICE_CLAIMS; +pub type PTOKEN_DEVICE_CLAIMS = *mut _TOKEN_DEVICE_CLAIMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_GROUPS_AND_PRIVILEGES { + pub SidCount: DWORD, + pub SidLength: DWORD, + pub Sids: PSID_AND_ATTRIBUTES, + pub RestrictedSidCount: DWORD, + pub RestrictedSidLength: DWORD, + pub RestrictedSids: PSID_AND_ATTRIBUTES, + pub PrivilegeCount: DWORD, + pub PrivilegeLength: DWORD, + pub Privileges: PLUID_AND_ATTRIBUTES, + pub AuthenticationId: LUID, +} +pub type TOKEN_GROUPS_AND_PRIVILEGES = _TOKEN_GROUPS_AND_PRIVILEGES; +pub type PTOKEN_GROUPS_AND_PRIVILEGES = *mut _TOKEN_GROUPS_AND_PRIVILEGES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_LINKED_TOKEN { + pub LinkedToken: HANDLE, +} +pub type TOKEN_LINKED_TOKEN = _TOKEN_LINKED_TOKEN; +pub type PTOKEN_LINKED_TOKEN = *mut _TOKEN_LINKED_TOKEN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_ELEVATION { + pub TokenIsElevated: DWORD, +} +pub type TOKEN_ELEVATION = _TOKEN_ELEVATION; +pub type PTOKEN_ELEVATION = *mut _TOKEN_ELEVATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_MANDATORY_LABEL { + pub Label: SID_AND_ATTRIBUTES, +} +pub type TOKEN_MANDATORY_LABEL = _TOKEN_MANDATORY_LABEL; +pub type PTOKEN_MANDATORY_LABEL = *mut _TOKEN_MANDATORY_LABEL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_MANDATORY_POLICY { + pub Policy: DWORD, +} +pub type TOKEN_MANDATORY_POLICY = _TOKEN_MANDATORY_POLICY; +pub type PTOKEN_MANDATORY_POLICY = *mut _TOKEN_MANDATORY_POLICY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_ACCESS_INFORMATION { + pub SidHash: PSID_AND_ATTRIBUTES_HASH, + pub RestrictedSidHash: PSID_AND_ATTRIBUTES_HASH, + pub Privileges: PTOKEN_PRIVILEGES, + pub AuthenticationId: LUID, + pub TokenType: TOKEN_TYPE, + pub ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + pub MandatoryPolicy: TOKEN_MANDATORY_POLICY, + pub Flags: DWORD, + pub AppContainerNumber: DWORD, + pub PackageSid: PSID, + pub CapabilitiesHash: PSID_AND_ATTRIBUTES_HASH, +} +pub type TOKEN_ACCESS_INFORMATION = _TOKEN_ACCESS_INFORMATION; +pub type PTOKEN_ACCESS_INFORMATION = *mut _TOKEN_ACCESS_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_AUDIT_POLICY { + pub PerUserPolicy: [UCHAR; 29usize], +} +pub type TOKEN_AUDIT_POLICY = _TOKEN_AUDIT_POLICY; +pub type PTOKEN_AUDIT_POLICY = *mut _TOKEN_AUDIT_POLICY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_SOURCE { + pub SourceName: [CHAR; 8usize], + pub SourceIdentifier: LUID, +} +pub type TOKEN_SOURCE = _TOKEN_SOURCE; +pub type PTOKEN_SOURCE = *mut _TOKEN_SOURCE; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TOKEN_STATISTICS { + pub TokenId: LUID, + pub AuthenticationId: LUID, + pub ExpirationTime: LARGE_INTEGER, + pub TokenType: TOKEN_TYPE, + pub ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + pub DynamicCharged: DWORD, + pub DynamicAvailable: DWORD, + pub GroupCount: DWORD, + pub PrivilegeCount: DWORD, + pub ModifiedId: LUID, +} +pub type TOKEN_STATISTICS = _TOKEN_STATISTICS; +pub type PTOKEN_STATISTICS = *mut _TOKEN_STATISTICS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_CONTROL { + pub TokenId: LUID, + pub AuthenticationId: LUID, + pub ModifiedId: LUID, + pub TokenSource: TOKEN_SOURCE, +} +pub type TOKEN_CONTROL = _TOKEN_CONTROL; +pub type PTOKEN_CONTROL = *mut _TOKEN_CONTROL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_ORIGIN { + pub OriginatingLogonSession: LUID, +} +pub type TOKEN_ORIGIN = _TOKEN_ORIGIN; +pub type PTOKEN_ORIGIN = *mut _TOKEN_ORIGIN; +pub const _MANDATORY_LEVEL_MandatoryLevelUntrusted: _MANDATORY_LEVEL = 0; +pub const _MANDATORY_LEVEL_MandatoryLevelLow: _MANDATORY_LEVEL = 1; +pub const _MANDATORY_LEVEL_MandatoryLevelMedium: _MANDATORY_LEVEL = 2; +pub const _MANDATORY_LEVEL_MandatoryLevelHigh: _MANDATORY_LEVEL = 3; +pub const _MANDATORY_LEVEL_MandatoryLevelSystem: _MANDATORY_LEVEL = 4; +pub const _MANDATORY_LEVEL_MandatoryLevelSecureProcess: _MANDATORY_LEVEL = 5; +pub const _MANDATORY_LEVEL_MandatoryLevelCount: _MANDATORY_LEVEL = 6; +pub type _MANDATORY_LEVEL = u32; +pub use self::_MANDATORY_LEVEL as MANDATORY_LEVEL; +pub type PMANDATORY_LEVEL = *mut _MANDATORY_LEVEL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TOKEN_APPCONTAINER_INFORMATION { + pub TokenAppContainer: PSID, +} +pub type TOKEN_APPCONTAINER_INFORMATION = _TOKEN_APPCONTAINER_INFORMATION; +pub type PTOKEN_APPCONTAINER_INFORMATION = *mut _TOKEN_APPCONTAINER_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE { + pub Version: DWORD64, + pub Name: PWSTR, +} +pub type CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = _CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE; +pub type PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE = *mut _CLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE { + pub pValue: PVOID, + pub ValueLength: DWORD, +} +pub type CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE = _CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE; +pub type PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE = + *mut _CLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _CLAIM_SECURITY_ATTRIBUTE_V1 { + pub Name: PWSTR, + pub ValueType: WORD, + pub Reserved: WORD, + pub Flags: DWORD, + pub ValueCount: DWORD, + pub Values: _CLAIM_SECURITY_ATTRIBUTE_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _CLAIM_SECURITY_ATTRIBUTE_V1__bindgen_ty_1 { + pub pInt64: PLONG64, + pub pUint64: PDWORD64, + pub ppString: *mut PWSTR, + pub pFqbn: PCLAIM_SECURITY_ATTRIBUTE_FQBN_VALUE, + pub pOctetString: PCLAIM_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE, + _bindgen_union_align: u64, +} +pub type CLAIM_SECURITY_ATTRIBUTE_V1 = _CLAIM_SECURITY_ATTRIBUTE_V1; +pub type PCLAIM_SECURITY_ATTRIBUTE_V1 = *mut _CLAIM_SECURITY_ATTRIBUTE_V1; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 { + pub Name: DWORD, + pub ValueType: WORD, + pub Reserved: WORD, + pub Flags: DWORD, + pub ValueCount: DWORD, + pub Values: _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1__bindgen_ty_1 { + pub pInt64: [DWORD; 1usize], + pub pUint64: [DWORD; 1usize], + pub ppString: [DWORD; 1usize], + pub pFqbn: [DWORD; 1usize], + pub pOctetString: [DWORD; 1usize], + _bindgen_union_align: u32, +} +pub type CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1; +pub type PCLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1 = *mut _CLAIM_SECURITY_ATTRIBUTE_RELATIVE_V1; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _CLAIM_SECURITY_ATTRIBUTES_INFORMATION { + pub Version: WORD, + pub Reserved: WORD, + pub AttributeCount: DWORD, + pub Attribute: _CLAIM_SECURITY_ATTRIBUTES_INFORMATION__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _CLAIM_SECURITY_ATTRIBUTES_INFORMATION__bindgen_ty_1 { + pub pAttributeV1: PCLAIM_SECURITY_ATTRIBUTE_V1, + _bindgen_union_align: u64, +} +pub type CLAIM_SECURITY_ATTRIBUTES_INFORMATION = _CLAIM_SECURITY_ATTRIBUTES_INFORMATION; +pub type PCLAIM_SECURITY_ATTRIBUTES_INFORMATION = *mut _CLAIM_SECURITY_ATTRIBUTES_INFORMATION; +pub type SECURITY_CONTEXT_TRACKING_MODE = BOOLEAN; +pub type PSECURITY_CONTEXT_TRACKING_MODE = *mut BOOLEAN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SECURITY_QUALITY_OF_SERVICE { + pub Length: DWORD, + pub ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + pub ContextTrackingMode: SECURITY_CONTEXT_TRACKING_MODE, + pub EffectiveOnly: BOOLEAN, +} +pub type SECURITY_QUALITY_OF_SERVICE = _SECURITY_QUALITY_OF_SERVICE; +pub type PSECURITY_QUALITY_OF_SERVICE = *mut _SECURITY_QUALITY_OF_SERVICE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SE_IMPERSONATION_STATE { + pub Token: PACCESS_TOKEN, + pub CopyOnOpen: BOOLEAN, + pub EffectiveOnly: BOOLEAN, + pub Level: SECURITY_IMPERSONATION_LEVEL, +} +pub type SE_IMPERSONATION_STATE = _SE_IMPERSONATION_STATE; +pub type PSE_IMPERSONATION_STATE = *mut _SE_IMPERSONATION_STATE; +pub type SECURITY_INFORMATION = DWORD; +pub type PSECURITY_INFORMATION = *mut DWORD; +pub const _SE_LEARNING_MODE_DATA_TYPE_SeLearningModeInvalidType: _SE_LEARNING_MODE_DATA_TYPE = 0; +pub const _SE_LEARNING_MODE_DATA_TYPE_SeLearningModeSettings: _SE_LEARNING_MODE_DATA_TYPE = 1; +pub const _SE_LEARNING_MODE_DATA_TYPE_SeLearningModeMax: _SE_LEARNING_MODE_DATA_TYPE = 2; +pub type _SE_LEARNING_MODE_DATA_TYPE = u32; +pub use self::_SE_LEARNING_MODE_DATA_TYPE as SE_LEARNING_MODE_DATA_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SECURITY_CAPABILITIES { + pub AppContainerSid: PSID, + pub Capabilities: PSID_AND_ATTRIBUTES, + pub CapabilityCount: DWORD, + pub Reserved: DWORD, +} +pub type SECURITY_CAPABILITIES = _SECURITY_CAPABILITIES; +pub type PSECURITY_CAPABILITIES = *mut _SECURITY_CAPABILITIES; +pub type LPSECURITY_CAPABILITIES = *mut _SECURITY_CAPABILITIES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOB_SET_ARRAY { + pub JobHandle: HANDLE, + pub MemberLevel: DWORD, + pub Flags: DWORD, +} +pub type JOB_SET_ARRAY = _JOB_SET_ARRAY; +pub type PJOB_SET_ARRAY = *mut _JOB_SET_ARRAY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _EXCEPTION_REGISTRATION_RECORD { + pub __bindgen_anon_1: _EXCEPTION_REGISTRATION_RECORD__bindgen_ty_1, + pub __bindgen_anon_2: _EXCEPTION_REGISTRATION_RECORD__bindgen_ty_2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _EXCEPTION_REGISTRATION_RECORD__bindgen_ty_1 { + pub Next: *mut _EXCEPTION_REGISTRATION_RECORD, + pub prev: *mut _EXCEPTION_REGISTRATION_RECORD, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _EXCEPTION_REGISTRATION_RECORD__bindgen_ty_2 { + pub Handler: PEXCEPTION_ROUTINE, + pub handler: PEXCEPTION_ROUTINE, + _bindgen_union_align: u64, +} +pub type EXCEPTION_REGISTRATION_RECORD = _EXCEPTION_REGISTRATION_RECORD; +pub type PEXCEPTION_REGISTRATION_RECORD = *mut EXCEPTION_REGISTRATION_RECORD; +pub type EXCEPTION_REGISTRATION = EXCEPTION_REGISTRATION_RECORD; +pub type PEXCEPTION_REGISTRATION = PEXCEPTION_REGISTRATION_RECORD; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NT_TIB { + pub ExceptionList: *mut _EXCEPTION_REGISTRATION_RECORD, + pub StackBase: PVOID, + pub StackLimit: PVOID, + pub SubSystemTib: PVOID, + pub __bindgen_anon_1: _NT_TIB__bindgen_ty_1, + pub ArbitraryUserPointer: PVOID, + pub Self_: *mut _NT_TIB, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NT_TIB__bindgen_ty_1 { + pub FiberData: PVOID, + pub Version: DWORD, + _bindgen_union_align: u64, +} +pub type NT_TIB = _NT_TIB; +pub type PNT_TIB = *mut NT_TIB; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NT_TIB32 { + pub ExceptionList: DWORD, + pub StackBase: DWORD, + pub StackLimit: DWORD, + pub SubSystemTib: DWORD, + pub __bindgen_anon_1: _NT_TIB32__bindgen_ty_1, + pub ArbitraryUserPointer: DWORD, + pub Self_: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NT_TIB32__bindgen_ty_1 { + pub FiberData: DWORD, + pub Version: DWORD, + _bindgen_union_align: u32, +} +pub type NT_TIB32 = _NT_TIB32; +pub type PNT_TIB32 = *mut _NT_TIB32; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NT_TIB64 { + pub ExceptionList: DWORD64, + pub StackBase: DWORD64, + pub StackLimit: DWORD64, + pub SubSystemTib: DWORD64, + pub __bindgen_anon_1: _NT_TIB64__bindgen_ty_1, + pub ArbitraryUserPointer: DWORD64, + pub Self_: DWORD64, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NT_TIB64__bindgen_ty_1 { + pub FiberData: DWORD64, + pub Version: DWORD, + _bindgen_union_align: u64, +} +pub type NT_TIB64 = _NT_TIB64; +pub type PNT_TIB64 = *mut _NT_TIB64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _UMS_CREATE_THREAD_ATTRIBUTES { + pub UmsVersion: DWORD, + pub UmsContext: PVOID, + pub UmsCompletionList: PVOID, +} +pub type UMS_CREATE_THREAD_ATTRIBUTES = _UMS_CREATE_THREAD_ATTRIBUTES; +pub type PUMS_CREATE_THREAD_ATTRIBUTES = *mut _UMS_CREATE_THREAD_ATTRIBUTES; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _QUOTA_LIMITS { + pub PagedPoolLimit: SIZE_T, + pub NonPagedPoolLimit: SIZE_T, + pub MinimumWorkingSetSize: SIZE_T, + pub MaximumWorkingSetSize: SIZE_T, + pub PagefileLimit: SIZE_T, + pub TimeLimit: LARGE_INTEGER, +} +pub type QUOTA_LIMITS = _QUOTA_LIMITS; +pub type PQUOTA_LIMITS = *mut _QUOTA_LIMITS; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _RATE_QUOTA_LIMIT { + pub RateData: DWORD, + pub __bindgen_anon_1: _RATE_QUOTA_LIMIT__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _RATE_QUOTA_LIMIT__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _RATE_QUOTA_LIMIT__bindgen_ty_1 { + #[inline] + pub fn RatePercent(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) } + } + #[inline] + pub fn set_RatePercent(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 7u8, val as u64) + } + } + #[inline] + pub fn Reserved0(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) } + } + #[inline] + pub fn set_Reserved0(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 25u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + RatePercent: DWORD, + Reserved0: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 7u8, { + let RatePercent: u32 = unsafe { ::std::mem::transmute(RatePercent) }; + RatePercent as u64 + }); + __bindgen_bitfield_unit.set(7usize, 25u8, { + let Reserved0: u32 = unsafe { ::std::mem::transmute(Reserved0) }; + Reserved0 as u64 + }); + __bindgen_bitfield_unit + } +} +pub type RATE_QUOTA_LIMIT = _RATE_QUOTA_LIMIT; +pub type PRATE_QUOTA_LIMIT = *mut _RATE_QUOTA_LIMIT; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _QUOTA_LIMITS_EX { + pub PagedPoolLimit: SIZE_T, + pub NonPagedPoolLimit: SIZE_T, + pub MinimumWorkingSetSize: SIZE_T, + pub MaximumWorkingSetSize: SIZE_T, + pub PagefileLimit: SIZE_T, + pub TimeLimit: LARGE_INTEGER, + pub WorkingSetLimit: SIZE_T, + pub Reserved2: SIZE_T, + pub Reserved3: SIZE_T, + pub Reserved4: SIZE_T, + pub Flags: DWORD, + pub CpuRateLimit: RATE_QUOTA_LIMIT, +} +pub type QUOTA_LIMITS_EX = _QUOTA_LIMITS_EX; +pub type PQUOTA_LIMITS_EX = *mut _QUOTA_LIMITS_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_COUNTERS { + pub ReadOperationCount: ULONGLONG, + pub WriteOperationCount: ULONGLONG, + pub OtherOperationCount: ULONGLONG, + pub ReadTransferCount: ULONGLONG, + pub WriteTransferCount: ULONGLONG, + pub OtherTransferCount: ULONGLONG, +} +pub type IO_COUNTERS = _IO_COUNTERS; +pub type PIO_COUNTERS = *mut IO_COUNTERS; +pub const _HARDWARE_COUNTER_TYPE_PMCCounter: _HARDWARE_COUNTER_TYPE = 0; +pub const _HARDWARE_COUNTER_TYPE_MaxHardwareCounterType: _HARDWARE_COUNTER_TYPE = 1; +pub type _HARDWARE_COUNTER_TYPE = u32; +pub use self::_HARDWARE_COUNTER_TYPE as HARDWARE_COUNTER_TYPE; +pub type PHARDWARE_COUNTER_TYPE = *mut _HARDWARE_COUNTER_TYPE; +pub const _PROCESS_MITIGATION_POLICY_ProcessDEPPolicy: _PROCESS_MITIGATION_POLICY = 0; +pub const _PROCESS_MITIGATION_POLICY_ProcessASLRPolicy: _PROCESS_MITIGATION_POLICY = 1; +pub const _PROCESS_MITIGATION_POLICY_ProcessDynamicCodePolicy: _PROCESS_MITIGATION_POLICY = 2; +pub const _PROCESS_MITIGATION_POLICY_ProcessStrictHandleCheckPolicy: _PROCESS_MITIGATION_POLICY = 3; +pub const _PROCESS_MITIGATION_POLICY_ProcessSystemCallDisablePolicy: _PROCESS_MITIGATION_POLICY = 4; +pub const _PROCESS_MITIGATION_POLICY_ProcessMitigationOptionsMask: _PROCESS_MITIGATION_POLICY = 5; +pub const _PROCESS_MITIGATION_POLICY_ProcessExtensionPointDisablePolicy: + _PROCESS_MITIGATION_POLICY = 6; +pub const _PROCESS_MITIGATION_POLICY_ProcessControlFlowGuardPolicy: _PROCESS_MITIGATION_POLICY = 7; +pub const _PROCESS_MITIGATION_POLICY_ProcessSignaturePolicy: _PROCESS_MITIGATION_POLICY = 8; +pub const _PROCESS_MITIGATION_POLICY_ProcessFontDisablePolicy: _PROCESS_MITIGATION_POLICY = 9; +pub const _PROCESS_MITIGATION_POLICY_ProcessImageLoadPolicy: _PROCESS_MITIGATION_POLICY = 10; +pub const _PROCESS_MITIGATION_POLICY_MaxProcessMitigationPolicy: _PROCESS_MITIGATION_POLICY = 11; +pub type _PROCESS_MITIGATION_POLICY = u32; +pub use self::_PROCESS_MITIGATION_POLICY as PROCESS_MITIGATION_POLICY; +pub type PPROCESS_MITIGATION_POLICY = *mut _PROCESS_MITIGATION_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_ASLR_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_ASLR_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_ASLR_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_ASLR_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_ASLR_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_ASLR_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn EnableBottomUpRandomization(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_EnableBottomUpRandomization(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn EnableForceRelocateImages(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_EnableForceRelocateImages(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn EnableHighEntropy(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_EnableHighEntropy(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn DisallowStrippedImages(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_DisallowStrippedImages(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 28u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + EnableBottomUpRandomization: DWORD, + EnableForceRelocateImages: DWORD, + EnableHighEntropy: DWORD, + DisallowStrippedImages: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let EnableBottomUpRandomization: u32 = + unsafe { ::std::mem::transmute(EnableBottomUpRandomization) }; + EnableBottomUpRandomization as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let EnableForceRelocateImages: u32 = + unsafe { ::std::mem::transmute(EnableForceRelocateImages) }; + EnableForceRelocateImages as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let EnableHighEntropy: u32 = unsafe { ::std::mem::transmute(EnableHighEntropy) }; + EnableHighEntropy as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let DisallowStrippedImages: u32 = + unsafe { ::std::mem::transmute(DisallowStrippedImages) }; + DisallowStrippedImages as u64 + }); + __bindgen_bitfield_unit.set(4usize, 28u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_ASLR_POLICY = _PROCESS_MITIGATION_ASLR_POLICY; +pub type PPROCESS_MITIGATION_ASLR_POLICY = *mut _PROCESS_MITIGATION_ASLR_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_DEP_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_DEP_POLICY__bindgen_ty_1, + pub Permanent: BOOLEAN, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_DEP_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_DEP_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_DEP_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_DEP_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn Enable(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_Enable(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn DisableAtlThunkEmulation(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_DisableAtlThunkEmulation(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + Enable: DWORD, + DisableAtlThunkEmulation: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let Enable: u32 = unsafe { ::std::mem::transmute(Enable) }; + Enable as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let DisableAtlThunkEmulation: u32 = + unsafe { ::std::mem::transmute(DisableAtlThunkEmulation) }; + DisableAtlThunkEmulation as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_DEP_POLICY = _PROCESS_MITIGATION_DEP_POLICY; +pub type PPROCESS_MITIGATION_DEP_POLICY = *mut _PROCESS_MITIGATION_DEP_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: + _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn RaiseExceptionOnInvalidHandleReference(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_RaiseExceptionOnInvalidHandleReference(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn HandleExceptionsPermanentlyEnabled(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_HandleExceptionsPermanentlyEnabled(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + RaiseExceptionOnInvalidHandleReference: DWORD, + HandleExceptionsPermanentlyEnabled: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let RaiseExceptionOnInvalidHandleReference: u32 = + unsafe { ::std::mem::transmute(RaiseExceptionOnInvalidHandleReference) }; + RaiseExceptionOnInvalidHandleReference as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let HandleExceptionsPermanentlyEnabled: u32 = + unsafe { ::std::mem::transmute(HandleExceptionsPermanentlyEnabled) }; + HandleExceptionsPermanentlyEnabled as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY = + _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY; +pub type PPROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY = + *mut _PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: + _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn DisallowWin32kSystemCalls(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_DisallowWin32kSystemCalls(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + DisallowWin32kSystemCalls: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let DisallowWin32kSystemCalls: u32 = + unsafe { ::std::mem::transmute(DisallowWin32kSystemCalls) }; + DisallowWin32kSystemCalls as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY = + _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY; +pub type PPROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY = + *mut _PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: + _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn DisableExtensionPoints(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_DisableExtensionPoints(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + DisableExtensionPoints: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let DisableExtensionPoints: u32 = + unsafe { ::std::mem::transmute(DisableExtensionPoints) }; + DisableExtensionPoints as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY = + _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY; +pub type PPROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY = + *mut _PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn EnableControlFlowGuard(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_EnableControlFlowGuard(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn EnableExportSuppression(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_EnableExportSuppression(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn StrictMode(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_StrictMode(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 29u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + EnableControlFlowGuard: DWORD, + EnableExportSuppression: DWORD, + StrictMode: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let EnableControlFlowGuard: u32 = + unsafe { ::std::mem::transmute(EnableControlFlowGuard) }; + EnableControlFlowGuard as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let EnableExportSuppression: u32 = + unsafe { ::std::mem::transmute(EnableExportSuppression) }; + EnableExportSuppression as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let StrictMode: u32 = unsafe { ::std::mem::transmute(StrictMode) }; + StrictMode as u64 + }); + __bindgen_bitfield_unit.set(3usize, 29u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY = + _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY; +pub type PPROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY = + *mut _PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn MicrosoftSignedOnly(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_MicrosoftSignedOnly(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn StoreSignedOnly(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_StoreSignedOnly(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn MitigationOptIn(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_MitigationOptIn(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 29u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + MicrosoftSignedOnly: DWORD, + StoreSignedOnly: DWORD, + MitigationOptIn: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let MicrosoftSignedOnly: u32 = unsafe { ::std::mem::transmute(MicrosoftSignedOnly) }; + MicrosoftSignedOnly as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let StoreSignedOnly: u32 = unsafe { ::std::mem::transmute(StoreSignedOnly) }; + StoreSignedOnly as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let MitigationOptIn: u32 = unsafe { ::std::mem::transmute(MitigationOptIn) }; + MitigationOptIn as u64 + }); + __bindgen_bitfield_unit.set(3usize, 29u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY = _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY; +pub type PPROCESS_MITIGATION_BINARY_SIGNATURE_POLICY = + *mut _PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: [u32; 2usize], +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u32>, +} +impl _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn ProhibitDynamicCode(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_ProhibitDynamicCode(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn AllowThreadOptOut(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_AllowThreadOptOut(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn AllowRemoteDowngrade(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_AllowRemoteDowngrade(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 30u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + ProhibitDynamicCode: DWORD, + AllowThreadOptOut: DWORD, + AllowRemoteDowngrade: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 8usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let ProhibitDynamicCode: u32 = unsafe { ::std::mem::transmute(ProhibitDynamicCode) }; + ProhibitDynamicCode as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let AllowThreadOptOut: u32 = unsafe { ::std::mem::transmute(AllowThreadOptOut) }; + AllowThreadOptOut as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let AllowRemoteDowngrade: u32 = unsafe { ::std::mem::transmute(AllowRemoteDowngrade) }; + AllowRemoteDowngrade as u64 + }); + __bindgen_bitfield_unit.set(32usize, 30u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_DYNAMIC_CODE_POLICY = _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY; +pub type PPROCESS_MITIGATION_DYNAMIC_CODE_POLICY = *mut _PROCESS_MITIGATION_DYNAMIC_CODE_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_FONT_DISABLE_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_FONT_DISABLE_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_FONT_DISABLE_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_FONT_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_FONT_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_FONT_DISABLE_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn DisableNonSystemFonts(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_DisableNonSystemFonts(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn AuditNonSystemFontLoading(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_AuditNonSystemFontLoading(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + DisableNonSystemFonts: DWORD, + AuditNonSystemFontLoading: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let DisableNonSystemFonts: u32 = + unsafe { ::std::mem::transmute(DisableNonSystemFonts) }; + DisableNonSystemFonts as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let AuditNonSystemFontLoading: u32 = + unsafe { ::std::mem::transmute(AuditNonSystemFontLoading) }; + AuditNonSystemFontLoading as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_FONT_DISABLE_POLICY = _PROCESS_MITIGATION_FONT_DISABLE_POLICY; +pub type PPROCESS_MITIGATION_FONT_DISABLE_POLICY = *mut _PROCESS_MITIGATION_FONT_DISABLE_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_MITIGATION_IMAGE_LOAD_POLICY { + pub __bindgen_anon_1: _PROCESS_MITIGATION_IMAGE_LOAD_POLICY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_MITIGATION_IMAGE_LOAD_POLICY__bindgen_ty_1 { + pub Flags: DWORD, + pub __bindgen_anon_1: _PROCESS_MITIGATION_IMAGE_LOAD_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_MITIGATION_IMAGE_LOAD_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESS_MITIGATION_IMAGE_LOAD_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn NoRemoteImages(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_NoRemoteImages(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn NoLowMandatoryLabelImages(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_NoLowMandatoryLabelImages(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn PreferSystem32Images(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_PreferSystem32Images(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedFlags(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) } + } + #[inline] + pub fn set_ReservedFlags(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 29u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + NoRemoteImages: DWORD, + NoLowMandatoryLabelImages: DWORD, + PreferSystem32Images: DWORD, + ReservedFlags: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let NoRemoteImages: u32 = unsafe { ::std::mem::transmute(NoRemoteImages) }; + NoRemoteImages as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let NoLowMandatoryLabelImages: u32 = + unsafe { ::std::mem::transmute(NoLowMandatoryLabelImages) }; + NoLowMandatoryLabelImages as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let PreferSystem32Images: u32 = unsafe { ::std::mem::transmute(PreferSystem32Images) }; + PreferSystem32Images as u64 + }); + __bindgen_bitfield_unit.set(3usize, 29u8, { + let ReservedFlags: u32 = unsafe { ::std::mem::transmute(ReservedFlags) }; + ReservedFlags as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESS_MITIGATION_IMAGE_LOAD_POLICY = _PROCESS_MITIGATION_IMAGE_LOAD_POLICY; +pub type PPROCESS_MITIGATION_IMAGE_LOAD_POLICY = *mut _PROCESS_MITIGATION_IMAGE_LOAD_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION { + pub TotalUserTime: LARGE_INTEGER, + pub TotalKernelTime: LARGE_INTEGER, + pub ThisPeriodTotalUserTime: LARGE_INTEGER, + pub ThisPeriodTotalKernelTime: LARGE_INTEGER, + pub TotalPageFaultCount: DWORD, + pub TotalProcesses: DWORD, + pub ActiveProcesses: DWORD, + pub TotalTerminatedProcesses: DWORD, +} +pub type JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION; +pub type PJOBOBJECT_BASIC_ACCOUNTING_INFORMATION = *mut _JOBOBJECT_BASIC_ACCOUNTING_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_BASIC_LIMIT_INFORMATION { + pub PerProcessUserTimeLimit: LARGE_INTEGER, + pub PerJobUserTimeLimit: LARGE_INTEGER, + pub LimitFlags: DWORD, + pub MinimumWorkingSetSize: SIZE_T, + pub MaximumWorkingSetSize: SIZE_T, + pub ActiveProcessLimit: DWORD, + pub Affinity: ULONG_PTR, + pub PriorityClass: DWORD, + pub SchedulingClass: DWORD, +} +pub type JOBOBJECT_BASIC_LIMIT_INFORMATION = _JOBOBJECT_BASIC_LIMIT_INFORMATION; +pub type PJOBOBJECT_BASIC_LIMIT_INFORMATION = *mut _JOBOBJECT_BASIC_LIMIT_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_EXTENDED_LIMIT_INFORMATION { + pub BasicLimitInformation: JOBOBJECT_BASIC_LIMIT_INFORMATION, + pub IoInfo: IO_COUNTERS, + pub ProcessMemoryLimit: SIZE_T, + pub JobMemoryLimit: SIZE_T, + pub PeakProcessMemoryUsed: SIZE_T, + pub PeakJobMemoryUsed: SIZE_T, +} +pub type JOBOBJECT_EXTENDED_LIMIT_INFORMATION = _JOBOBJECT_EXTENDED_LIMIT_INFORMATION; +pub type PJOBOBJECT_EXTENDED_LIMIT_INFORMATION = *mut _JOBOBJECT_EXTENDED_LIMIT_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOBOBJECT_BASIC_PROCESS_ID_LIST { + pub NumberOfAssignedProcesses: DWORD, + pub NumberOfProcessIdsInList: DWORD, + pub ProcessIdList: [ULONG_PTR; 1usize], +} +pub type JOBOBJECT_BASIC_PROCESS_ID_LIST = _JOBOBJECT_BASIC_PROCESS_ID_LIST; +pub type PJOBOBJECT_BASIC_PROCESS_ID_LIST = *mut _JOBOBJECT_BASIC_PROCESS_ID_LIST; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOBOBJECT_BASIC_UI_RESTRICTIONS { + pub UIRestrictionsClass: DWORD, +} +pub type JOBOBJECT_BASIC_UI_RESTRICTIONS = _JOBOBJECT_BASIC_UI_RESTRICTIONS; +pub type PJOBOBJECT_BASIC_UI_RESTRICTIONS = *mut _JOBOBJECT_BASIC_UI_RESTRICTIONS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOBOBJECT_SECURITY_LIMIT_INFORMATION { + pub SecurityLimitFlags: DWORD, + pub JobToken: HANDLE, + pub SidsToDisable: PTOKEN_GROUPS, + pub PrivilegesToDelete: PTOKEN_PRIVILEGES, + pub RestrictedSids: PTOKEN_GROUPS, +} +pub type JOBOBJECT_SECURITY_LIMIT_INFORMATION = _JOBOBJECT_SECURITY_LIMIT_INFORMATION; +pub type PJOBOBJECT_SECURITY_LIMIT_INFORMATION = *mut _JOBOBJECT_SECURITY_LIMIT_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOBOBJECT_END_OF_JOB_TIME_INFORMATION { + pub EndOfJobTimeAction: DWORD, +} +pub type JOBOBJECT_END_OF_JOB_TIME_INFORMATION = _JOBOBJECT_END_OF_JOB_TIME_INFORMATION; +pub type PJOBOBJECT_END_OF_JOB_TIME_INFORMATION = *mut _JOBOBJECT_END_OF_JOB_TIME_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOBOBJECT_ASSOCIATE_COMPLETION_PORT { + pub CompletionKey: PVOID, + pub CompletionPort: HANDLE, +} +pub type JOBOBJECT_ASSOCIATE_COMPLETION_PORT = _JOBOBJECT_ASSOCIATE_COMPLETION_PORT; +pub type PJOBOBJECT_ASSOCIATE_COMPLETION_PORT = *mut _JOBOBJECT_ASSOCIATE_COMPLETION_PORT; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION { + pub BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION, + pub IoInfo: IO_COUNTERS, +} +pub type JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = + _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION; +pub type PJOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = + *mut _JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JOBOBJECT_JOBSET_INFORMATION { + pub MemberLevel: DWORD, +} +pub type JOBOBJECT_JOBSET_INFORMATION = _JOBOBJECT_JOBSET_INFORMATION; +pub type PJOBOBJECT_JOBSET_INFORMATION = *mut _JOBOBJECT_JOBSET_INFORMATION; +pub const _JOBOBJECT_RATE_CONTROL_TOLERANCE_ToleranceLow: _JOBOBJECT_RATE_CONTROL_TOLERANCE = 1; +pub const _JOBOBJECT_RATE_CONTROL_TOLERANCE_ToleranceMedium: _JOBOBJECT_RATE_CONTROL_TOLERANCE = 2; +pub const _JOBOBJECT_RATE_CONTROL_TOLERANCE_ToleranceHigh: _JOBOBJECT_RATE_CONTROL_TOLERANCE = 3; +pub type _JOBOBJECT_RATE_CONTROL_TOLERANCE = u32; +pub use self::_JOBOBJECT_RATE_CONTROL_TOLERANCE as JOBOBJECT_RATE_CONTROL_TOLERANCE; +pub const _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL_ToleranceIntervalShort: + _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL = 1; +pub const _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL_ToleranceIntervalMedium: + _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL = 2; +pub const _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL_ToleranceIntervalLong: + _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL = 3; +pub type _JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL = u32; +pub use self::_JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL as JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION { + pub IoReadBytesLimit: DWORD64, + pub IoWriteBytesLimit: DWORD64, + pub PerJobUserTimeLimit: LARGE_INTEGER, + pub JobMemoryLimit: DWORD64, + pub RateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + pub RateControlToleranceInterval: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, + pub LimitFlags: DWORD, +} +pub type JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = _JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION; +pub type PJOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = *mut _JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_LIMIT_VIOLATION_INFORMATION { + pub LimitFlags: DWORD, + pub ViolationLimitFlags: DWORD, + pub IoReadBytes: DWORD64, + pub IoReadBytesLimit: DWORD64, + pub IoWriteBytes: DWORD64, + pub IoWriteBytesLimit: DWORD64, + pub PerJobUserTime: LARGE_INTEGER, + pub PerJobUserTimeLimit: LARGE_INTEGER, + pub JobMemory: DWORD64, + pub JobMemoryLimit: DWORD64, + pub RateControlTolerance: JOBOBJECT_RATE_CONTROL_TOLERANCE, + pub RateControlToleranceLimit: JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL, +} +pub type JOBOBJECT_LIMIT_VIOLATION_INFORMATION = _JOBOBJECT_LIMIT_VIOLATION_INFORMATION; +pub type PJOBOBJECT_LIMIT_VIOLATION_INFORMATION = *mut _JOBOBJECT_LIMIT_VIOLATION_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION { + pub ControlFlags: DWORD, + pub __bindgen_anon_1: _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION__bindgen_ty_1 { + pub CpuRate: DWORD, + pub Weight: DWORD, + _bindgen_union_align: u32, +} +pub type JOBOBJECT_CPU_RATE_CONTROL_INFORMATION = _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION; +pub type PJOBOBJECT_CPU_RATE_CONTROL_INFORMATION = *mut _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION; +pub const _JOBOBJECTINFOCLASS_JobObjectBasicAccountingInformation: _JOBOBJECTINFOCLASS = 1; +pub const _JOBOBJECTINFOCLASS_JobObjectBasicLimitInformation: _JOBOBJECTINFOCLASS = 2; +pub const _JOBOBJECTINFOCLASS_JobObjectBasicProcessIdList: _JOBOBJECTINFOCLASS = 3; +pub const _JOBOBJECTINFOCLASS_JobObjectBasicUIRestrictions: _JOBOBJECTINFOCLASS = 4; +pub const _JOBOBJECTINFOCLASS_JobObjectSecurityLimitInformation: _JOBOBJECTINFOCLASS = 5; +pub const _JOBOBJECTINFOCLASS_JobObjectEndOfJobTimeInformation: _JOBOBJECTINFOCLASS = 6; +pub const _JOBOBJECTINFOCLASS_JobObjectAssociateCompletionPortInformation: _JOBOBJECTINFOCLASS = 7; +pub const _JOBOBJECTINFOCLASS_JobObjectBasicAndIoAccountingInformation: _JOBOBJECTINFOCLASS = 8; +pub const _JOBOBJECTINFOCLASS_JobObjectExtendedLimitInformation: _JOBOBJECTINFOCLASS = 9; +pub const _JOBOBJECTINFOCLASS_JobObjectJobSetInformation: _JOBOBJECTINFOCLASS = 10; +pub const _JOBOBJECTINFOCLASS_JobObjectGroupInformation: _JOBOBJECTINFOCLASS = 11; +pub const _JOBOBJECTINFOCLASS_JobObjectNotificationLimitInformation: _JOBOBJECTINFOCLASS = 12; +pub const _JOBOBJECTINFOCLASS_JobObjectLimitViolationInformation: _JOBOBJECTINFOCLASS = 13; +pub const _JOBOBJECTINFOCLASS_JobObjectGroupInformationEx: _JOBOBJECTINFOCLASS = 14; +pub const _JOBOBJECTINFOCLASS_JobObjectCpuRateControlInformation: _JOBOBJECTINFOCLASS = 15; +pub const _JOBOBJECTINFOCLASS_JobObjectCompletionFilter: _JOBOBJECTINFOCLASS = 16; +pub const _JOBOBJECTINFOCLASS_JobObjectCompletionCounter: _JOBOBJECTINFOCLASS = 17; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved1Information: _JOBOBJECTINFOCLASS = 18; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved2Information: _JOBOBJECTINFOCLASS = 19; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved3Information: _JOBOBJECTINFOCLASS = 20; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved4Information: _JOBOBJECTINFOCLASS = 21; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved5Information: _JOBOBJECTINFOCLASS = 22; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved6Information: _JOBOBJECTINFOCLASS = 23; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved7Information: _JOBOBJECTINFOCLASS = 24; +pub const _JOBOBJECTINFOCLASS_JobObjectReserved8Information: _JOBOBJECTINFOCLASS = 25; +pub const _JOBOBJECTINFOCLASS_MaxJobObjectInfoClass: _JOBOBJECTINFOCLASS = 26; +pub type _JOBOBJECTINFOCLASS = u32; +pub use self::_JOBOBJECTINFOCLASS as JOBOBJECTINFOCLASS; +pub const _FIRMWARE_TYPE_FirmwareTypeUnknown: _FIRMWARE_TYPE = 0; +pub const _FIRMWARE_TYPE_FirmwareTypeBios: _FIRMWARE_TYPE = 1; +pub const _FIRMWARE_TYPE_FirmwareTypeUefi: _FIRMWARE_TYPE = 2; +pub const _FIRMWARE_TYPE_FirmwareTypeMax: _FIRMWARE_TYPE = 3; +pub type _FIRMWARE_TYPE = u32; +pub use self::_FIRMWARE_TYPE as FIRMWARE_TYPE; +pub type PFIRMWARE_TYPE = *mut _FIRMWARE_TYPE; +pub const _LOGICAL_PROCESSOR_RELATIONSHIP_RelationProcessorCore: _LOGICAL_PROCESSOR_RELATIONSHIP = + 0; +pub const _LOGICAL_PROCESSOR_RELATIONSHIP_RelationNumaNode: _LOGICAL_PROCESSOR_RELATIONSHIP = 1; +pub const _LOGICAL_PROCESSOR_RELATIONSHIP_RelationCache: _LOGICAL_PROCESSOR_RELATIONSHIP = 2; +pub const _LOGICAL_PROCESSOR_RELATIONSHIP_RelationProcessorPackage: + _LOGICAL_PROCESSOR_RELATIONSHIP = 3; +pub const _LOGICAL_PROCESSOR_RELATIONSHIP_RelationGroup: _LOGICAL_PROCESSOR_RELATIONSHIP = 4; +pub const _LOGICAL_PROCESSOR_RELATIONSHIP_RelationAll: _LOGICAL_PROCESSOR_RELATIONSHIP = 65535; +pub type _LOGICAL_PROCESSOR_RELATIONSHIP = u32; +pub use self::_LOGICAL_PROCESSOR_RELATIONSHIP as LOGICAL_PROCESSOR_RELATIONSHIP; +pub const _PROCESSOR_CACHE_TYPE_CacheUnified: _PROCESSOR_CACHE_TYPE = 0; +pub const _PROCESSOR_CACHE_TYPE_CacheInstruction: _PROCESSOR_CACHE_TYPE = 1; +pub const _PROCESSOR_CACHE_TYPE_CacheData: _PROCESSOR_CACHE_TYPE = 2; +pub const _PROCESSOR_CACHE_TYPE_CacheTrace: _PROCESSOR_CACHE_TYPE = 3; +pub type _PROCESSOR_CACHE_TYPE = u32; +pub use self::_PROCESSOR_CACHE_TYPE as PROCESSOR_CACHE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CACHE_DESCRIPTOR { + pub Level: BYTE, + pub Associativity: BYTE, + pub LineSize: WORD, + pub Size: DWORD, + pub Type: PROCESSOR_CACHE_TYPE, +} +pub type CACHE_DESCRIPTOR = _CACHE_DESCRIPTOR; +pub type PCACHE_DESCRIPTOR = *mut _CACHE_DESCRIPTOR; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION { + pub ProcessorMask: ULONG_PTR, + pub Relationship: LOGICAL_PROCESSOR_RELATIONSHIP, + pub __bindgen_anon_1: _SYSTEM_LOGICAL_PROCESSOR_INFORMATION__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _SYSTEM_LOGICAL_PROCESSOR_INFORMATION__bindgen_ty_1 { + pub ProcessorCore: _SYSTEM_LOGICAL_PROCESSOR_INFORMATION__bindgen_ty_1__bindgen_ty_1, + pub NumaNode: _SYSTEM_LOGICAL_PROCESSOR_INFORMATION__bindgen_ty_1__bindgen_ty_2, + pub Cache: CACHE_DESCRIPTOR, + pub Reserved: [ULONGLONG; 2usize], + _bindgen_union_align: [u64; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION__bindgen_ty_1__bindgen_ty_1 { + pub Flags: BYTE, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION__bindgen_ty_1__bindgen_ty_2 { + pub NodeNumber: DWORD, +} +pub type SYSTEM_LOGICAL_PROCESSOR_INFORMATION = _SYSTEM_LOGICAL_PROCESSOR_INFORMATION; +pub type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION = *mut _SYSTEM_LOGICAL_PROCESSOR_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESSOR_RELATIONSHIP { + pub Flags: BYTE, + pub Reserved: [BYTE; 21usize], + pub GroupCount: WORD, + pub GroupMask: [GROUP_AFFINITY; 1usize], +} +pub type PROCESSOR_RELATIONSHIP = _PROCESSOR_RELATIONSHIP; +pub type PPROCESSOR_RELATIONSHIP = *mut _PROCESSOR_RELATIONSHIP; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NUMA_NODE_RELATIONSHIP { + pub NodeNumber: DWORD, + pub Reserved: [BYTE; 20usize], + pub GroupMask: GROUP_AFFINITY, +} +pub type NUMA_NODE_RELATIONSHIP = _NUMA_NODE_RELATIONSHIP; +pub type PNUMA_NODE_RELATIONSHIP = *mut _NUMA_NODE_RELATIONSHIP; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CACHE_RELATIONSHIP { + pub Level: BYTE, + pub Associativity: BYTE, + pub LineSize: WORD, + pub CacheSize: DWORD, + pub Type: PROCESSOR_CACHE_TYPE, + pub Reserved: [BYTE; 20usize], + pub GroupMask: GROUP_AFFINITY, +} +pub type CACHE_RELATIONSHIP = _CACHE_RELATIONSHIP; +pub type PCACHE_RELATIONSHIP = *mut _CACHE_RELATIONSHIP; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESSOR_GROUP_INFO { + pub MaximumProcessorCount: BYTE, + pub ActiveProcessorCount: BYTE, + pub Reserved: [BYTE; 38usize], + pub ActiveProcessorMask: KAFFINITY, +} +pub type PROCESSOR_GROUP_INFO = _PROCESSOR_GROUP_INFO; +pub type PPROCESSOR_GROUP_INFO = *mut _PROCESSOR_GROUP_INFO; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _GROUP_RELATIONSHIP { + pub MaximumGroupCount: WORD, + pub ActiveGroupCount: WORD, + pub Reserved: [BYTE; 20usize], + pub GroupInfo: [PROCESSOR_GROUP_INFO; 1usize], +} +pub type GROUP_RELATIONSHIP = _GROUP_RELATIONSHIP; +pub type PGROUP_RELATIONSHIP = *mut _GROUP_RELATIONSHIP; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX { + pub Relationship: LOGICAL_PROCESSOR_RELATIONSHIP, + pub Size: DWORD, + pub __bindgen_anon_1: _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX__bindgen_ty_1 { + pub Processor: PROCESSOR_RELATIONSHIP, + pub NumaNode: NUMA_NODE_RELATIONSHIP, + pub Cache: CACHE_RELATIONSHIP, + pub Group: GROUP_RELATIONSHIP, + _bindgen_union_align: [u64; 9usize], +} +pub type SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX; +pub type PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX = *mut _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION { + pub CycleTime: DWORD64, +} +pub type SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = _SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION; +pub type PSYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION = *mut _SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _XSTATE_FEATURE { + pub Offset: DWORD, + pub Size: DWORD, +} +pub type XSTATE_FEATURE = _XSTATE_FEATURE; +pub type PXSTATE_FEATURE = *mut _XSTATE_FEATURE; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _XSTATE_CONFIGURATION { + pub EnabledFeatures: DWORD64, + pub EnabledVolatileFeatures: DWORD64, + pub Size: DWORD, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub Features: [XSTATE_FEATURE; 64usize], +} +impl _XSTATE_CONFIGURATION { + #[inline] + pub fn OptimizedSave(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_OptimizedSave(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(OptimizedSave: DWORD) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let OptimizedSave: u32 = unsafe { ::std::mem::transmute(OptimizedSave) }; + OptimizedSave as u64 + }); + __bindgen_bitfield_unit + } +} +pub type XSTATE_CONFIGURATION = _XSTATE_CONFIGURATION; +pub type PXSTATE_CONFIGURATION = *mut _XSTATE_CONFIGURATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MEMORY_BASIC_INFORMATION { + pub BaseAddress: PVOID, + pub AllocationBase: PVOID, + pub AllocationProtect: DWORD, + pub RegionSize: SIZE_T, + pub State: DWORD, + pub Protect: DWORD, + pub Type: DWORD, +} +pub type MEMORY_BASIC_INFORMATION = _MEMORY_BASIC_INFORMATION; +pub type PMEMORY_BASIC_INFORMATION = *mut _MEMORY_BASIC_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MEMORY_BASIC_INFORMATION32 { + pub BaseAddress: DWORD, + pub AllocationBase: DWORD, + pub AllocationProtect: DWORD, + pub RegionSize: DWORD, + pub State: DWORD, + pub Protect: DWORD, + pub Type: DWORD, +} +pub type MEMORY_BASIC_INFORMATION32 = _MEMORY_BASIC_INFORMATION32; +pub type PMEMORY_BASIC_INFORMATION32 = *mut _MEMORY_BASIC_INFORMATION32; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _MEMORY_BASIC_INFORMATION64 { + pub BaseAddress: ULONGLONG, + pub AllocationBase: ULONGLONG, + pub AllocationProtect: DWORD, + pub __alignment1: DWORD, + pub RegionSize: ULONGLONG, + pub State: DWORD, + pub Protect: DWORD, + pub Type: DWORD, + pub __alignment2: DWORD, +} +pub type MEMORY_BASIC_INFORMATION64 = _MEMORY_BASIC_INFORMATION64; +pub type PMEMORY_BASIC_INFORMATION64 = *mut _MEMORY_BASIC_INFORMATION64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FILE_ID_128 { + pub Identifier: [BYTE; 16usize], +} +pub type PFILE_ID_128 = *mut FILE_ID_128; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FILE_NOTIFY_INFORMATION { + pub NextEntryOffset: DWORD, + pub Action: DWORD, + pub FileNameLength: DWORD, + pub FileName: [WCHAR; 1usize], +} +pub type FILE_NOTIFY_INFORMATION = _FILE_NOTIFY_INFORMATION; +pub type PFILE_NOTIFY_INFORMATION = *mut _FILE_NOTIFY_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _FILE_SEGMENT_ELEMENT { + pub Buffer: PVOID64, + pub Alignment: ULONGLONG, + _bindgen_union_align: u64, +} +pub type FILE_SEGMENT_ELEMENT = _FILE_SEGMENT_ELEMENT; +pub type PFILE_SEGMENT_ELEMENT = *mut _FILE_SEGMENT_ELEMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REPARSE_GUID_DATA_BUFFER { + pub ReparseTag: DWORD, + pub ReparseDataLength: WORD, + pub Reserved: WORD, + pub ReparseGuid: GUID, + pub GenericReparseBuffer: _REPARSE_GUID_DATA_BUFFER__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REPARSE_GUID_DATA_BUFFER__bindgen_ty_1 { + pub DataBuffer: [BYTE; 1usize], +} +pub type REPARSE_GUID_DATA_BUFFER = _REPARSE_GUID_DATA_BUFFER; +pub type PREPARSE_GUID_DATA_BUFFER = *mut _REPARSE_GUID_DATA_BUFFER; +extern "C" { + pub static GUID_MAX_POWER_SAVINGS: GUID; +} +extern "C" { + pub static GUID_MIN_POWER_SAVINGS: GUID; +} +extern "C" { + pub static GUID_TYPICAL_POWER_SAVINGS: GUID; +} +extern "C" { + pub static NO_SUBGROUP_GUID: GUID; +} +extern "C" { + pub static ALL_POWERSCHEMES_GUID: GUID; +} +extern "C" { + pub static GUID_POWERSCHEME_PERSONALITY: GUID; +} +extern "C" { + pub static GUID_ACTIVE_POWERSCHEME: GUID; +} +extern "C" { + pub static GUID_IDLE_RESILIENCY_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_IDLE_RESILIENCY_PERIOD: GUID; +} +extern "C" { + pub static GUID_DISK_COALESCING_POWERDOWN_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_EXECUTION_REQUIRED_REQUEST_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_VIDEO_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_VIDEO_POWERDOWN_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_VIDEO_ANNOYANCE_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_VIDEO_ADAPTIVE_PERCENT_INCREASE: GUID; +} +extern "C" { + pub static GUID_VIDEO_DIM_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_VIDEO_ADAPTIVE_POWERDOWN: GUID; +} +extern "C" { + pub static GUID_MONITOR_POWER_ON: GUID; +} +extern "C" { + pub static GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS: GUID; +} +extern "C" { + pub static GUID_DEVICE_POWER_POLICY_VIDEO_DIM_BRIGHTNESS: GUID; +} +extern "C" { + pub static GUID_VIDEO_CURRENT_MONITOR_BRIGHTNESS: GUID; +} +extern "C" { + pub static GUID_VIDEO_ADAPTIVE_DISPLAY_BRIGHTNESS: GUID; +} +extern "C" { + pub static GUID_CONSOLE_DISPLAY_STATE: GUID; +} +extern "C" { + pub static GUID_ALLOW_DISPLAY_REQUIRED: GUID; +} +extern "C" { + pub static GUID_VIDEO_CONSOLE_LOCK_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_ADAPTIVE_POWER_BEHAVIOR_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_NON_ADAPTIVE_INPUT_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_DISK_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_DISK_POWERDOWN_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_DISK_IDLE_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_DISK_BURST_IGNORE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_DISK_ADAPTIVE_POWERDOWN: GUID; +} +extern "C" { + pub static GUID_SLEEP_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_SLEEP_IDLE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_STANDBY_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_UNATTEND_SLEEP_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_HIBERNATE_TIMEOUT: GUID; +} +extern "C" { + pub static GUID_HIBERNATE_FASTS4_POLICY: GUID; +} +extern "C" { + pub static GUID_CRITICAL_POWER_TRANSITION: GUID; +} +extern "C" { + pub static GUID_SYSTEM_AWAYMODE: GUID; +} +extern "C" { + pub static GUID_ALLOW_AWAYMODE: GUID; +} +extern "C" { + pub static GUID_ALLOW_STANDBY_STATES: GUID; +} +extern "C" { + pub static GUID_ALLOW_RTC_WAKE: GUID; +} +extern "C" { + pub static GUID_ALLOW_SYSTEM_REQUIRED: GUID; +} +extern "C" { + pub static GUID_SYSTEM_BUTTON_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_POWERBUTTON_ACTION: GUID; +} +extern "C" { + pub static GUID_SLEEPBUTTON_ACTION: GUID; +} +extern "C" { + pub static GUID_USERINTERFACEBUTTON_ACTION: GUID; +} +extern "C" { + pub static GUID_LIDCLOSE_ACTION: GUID; +} +extern "C" { + pub static GUID_LIDOPEN_POWERSTATE: GUID; +} +extern "C" { + pub static GUID_BATTERY_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_ACTION_0: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_LEVEL_0: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_FLAGS_0: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_ACTION_1: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_LEVEL_1: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_FLAGS_1: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_ACTION_2: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_LEVEL_2: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_FLAGS_2: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_ACTION_3: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_LEVEL_3: GUID; +} +extern "C" { + pub static GUID_BATTERY_DISCHARGE_FLAGS_3: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_SETTINGS_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_THROTTLE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_THROTTLE_MAXIMUM: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_THROTTLE_MINIMUM: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_ALLOW_THROTTLING: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLESTATE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERFSTATE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_INCREASE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_DECREASE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_INCREASE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_DECREASE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_INCREASE_TIME: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_DECREASE_TIME: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_TIME_CHECK: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_BOOST_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_BOOST_MODE: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLE_ALLOW_SCALING: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLE_DISABLE: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLE_STATE_MAXIMUM: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLE_TIME_CHECK: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLE_DEMOTE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_IDLE_PROMOTE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_INCREASE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_INCREASE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_DECREASE_POLICY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_MAX_CORES: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_MIN_CORES: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_INCREASE_TIME: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_DECREASE_TIME: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_DECREASE_FACTOR: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_AFFINITY_WEIGHTING: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_DECREASE_FACTOR: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_WEIGHTING: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PARKING_CORE_OVERRIDE: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PARKING_PERF_STATE: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PARKING_CONCURRENCY_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PARKING_HEADROOM_THRESHOLD: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_HISTORY: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_PERF_LATENCY_HINT: GUID; +} +extern "C" { + pub static GUID_PROCESSOR_DISTRIBUTE_UTILITY: GUID; +} +extern "C" { + pub static GUID_SYSTEM_COOLING_POLICY: GUID; +} +extern "C" { + pub static GUID_LOCK_CONSOLE_ON_WAKE: GUID; +} +extern "C" { + pub static GUID_DEVICE_IDLE_POLICY: GUID; +} +extern "C" { + pub static GUID_ACDC_POWER_SOURCE: GUID; +} +extern "C" { + pub static GUID_LIDSWITCH_STATE_CHANGE: GUID; +} +extern "C" { + pub static GUID_BATTERY_PERCENTAGE_REMAINING: GUID; +} +extern "C" { + pub static GUID_GLOBAL_USER_PRESENCE: GUID; +} +extern "C" { + pub static GUID_SESSION_DISPLAY_STATUS: GUID; +} +extern "C" { + pub static GUID_SESSION_USER_PRESENCE: GUID; +} +extern "C" { + pub static GUID_IDLE_BACKGROUND_TASK: GUID; +} +extern "C" { + pub static GUID_BACKGROUND_TASK_NOTIFICATION: GUID; +} +extern "C" { + pub static GUID_APPLAUNCH_BUTTON: GUID; +} +extern "C" { + pub static GUID_PCIEXPRESS_SETTINGS_SUBGROUP: GUID; +} +extern "C" { + pub static GUID_PCIEXPRESS_ASPM_POLICY: GUID; +} +extern "C" { + pub static GUID_ENABLE_SWITCH_FORCED_SHUTDOWN: GUID; +} +pub const _SYSTEM_POWER_STATE_PowerSystemUnspecified: _SYSTEM_POWER_STATE = 0; +pub const _SYSTEM_POWER_STATE_PowerSystemWorking: _SYSTEM_POWER_STATE = 1; +pub const _SYSTEM_POWER_STATE_PowerSystemSleeping1: _SYSTEM_POWER_STATE = 2; +pub const _SYSTEM_POWER_STATE_PowerSystemSleeping2: _SYSTEM_POWER_STATE = 3; +pub const _SYSTEM_POWER_STATE_PowerSystemSleeping3: _SYSTEM_POWER_STATE = 4; +pub const _SYSTEM_POWER_STATE_PowerSystemHibernate: _SYSTEM_POWER_STATE = 5; +pub const _SYSTEM_POWER_STATE_PowerSystemShutdown: _SYSTEM_POWER_STATE = 6; +pub const _SYSTEM_POWER_STATE_PowerSystemMaximum: _SYSTEM_POWER_STATE = 7; +pub type _SYSTEM_POWER_STATE = u32; +pub use self::_SYSTEM_POWER_STATE as SYSTEM_POWER_STATE; +pub type PSYSTEM_POWER_STATE = *mut _SYSTEM_POWER_STATE; +pub const POWER_ACTION_PowerActionNone: POWER_ACTION = 0; +pub const POWER_ACTION_PowerActionReserved: POWER_ACTION = 1; +pub const POWER_ACTION_PowerActionSleep: POWER_ACTION = 2; +pub const POWER_ACTION_PowerActionHibernate: POWER_ACTION = 3; +pub const POWER_ACTION_PowerActionShutdown: POWER_ACTION = 4; +pub const POWER_ACTION_PowerActionShutdownReset: POWER_ACTION = 5; +pub const POWER_ACTION_PowerActionShutdownOff: POWER_ACTION = 6; +pub const POWER_ACTION_PowerActionWarmEject: POWER_ACTION = 7; +pub type POWER_ACTION = u32; +pub type PPOWER_ACTION = *mut POWER_ACTION; +pub const _DEVICE_POWER_STATE_PowerDeviceUnspecified: _DEVICE_POWER_STATE = 0; +pub const _DEVICE_POWER_STATE_PowerDeviceD0: _DEVICE_POWER_STATE = 1; +pub const _DEVICE_POWER_STATE_PowerDeviceD1: _DEVICE_POWER_STATE = 2; +pub const _DEVICE_POWER_STATE_PowerDeviceD2: _DEVICE_POWER_STATE = 3; +pub const _DEVICE_POWER_STATE_PowerDeviceD3: _DEVICE_POWER_STATE = 4; +pub const _DEVICE_POWER_STATE_PowerDeviceMaximum: _DEVICE_POWER_STATE = 5; +pub type _DEVICE_POWER_STATE = u32; +pub use self::_DEVICE_POWER_STATE as DEVICE_POWER_STATE; +pub type PDEVICE_POWER_STATE = *mut _DEVICE_POWER_STATE; +pub const _MONITOR_DISPLAY_STATE_PowerMonitorOff: _MONITOR_DISPLAY_STATE = 0; +pub const _MONITOR_DISPLAY_STATE_PowerMonitorOn: _MONITOR_DISPLAY_STATE = 1; +pub const _MONITOR_DISPLAY_STATE_PowerMonitorDim: _MONITOR_DISPLAY_STATE = 2; +pub type _MONITOR_DISPLAY_STATE = u32; +pub use self::_MONITOR_DISPLAY_STATE as MONITOR_DISPLAY_STATE; +pub type PMONITOR_DISPLAY_STATE = *mut _MONITOR_DISPLAY_STATE; +pub const _USER_ACTIVITY_PRESENCE_PowerUserPresent: _USER_ACTIVITY_PRESENCE = 0; +pub const _USER_ACTIVITY_PRESENCE_PowerUserNotPresent: _USER_ACTIVITY_PRESENCE = 1; +pub const _USER_ACTIVITY_PRESENCE_PowerUserInactive: _USER_ACTIVITY_PRESENCE = 2; +pub const _USER_ACTIVITY_PRESENCE_PowerUserMaximum: _USER_ACTIVITY_PRESENCE = 3; +pub const _USER_ACTIVITY_PRESENCE_PowerUserInvalid: _USER_ACTIVITY_PRESENCE = 3; +pub type _USER_ACTIVITY_PRESENCE = u32; +pub use self::_USER_ACTIVITY_PRESENCE as USER_ACTIVITY_PRESENCE; +pub type PUSER_ACTIVITY_PRESENCE = *mut _USER_ACTIVITY_PRESENCE; +pub type EXECUTION_STATE = DWORD; +pub type PEXECUTION_STATE = *mut DWORD; +pub const LATENCY_TIME_LT_DONT_CARE: LATENCY_TIME = 0; +pub const LATENCY_TIME_LT_LOWEST_LATENCY: LATENCY_TIME = 1; +pub type LATENCY_TIME = u32; +pub const _POWER_REQUEST_TYPE_PowerRequestDisplayRequired: _POWER_REQUEST_TYPE = 0; +pub const _POWER_REQUEST_TYPE_PowerRequestSystemRequired: _POWER_REQUEST_TYPE = 1; +pub const _POWER_REQUEST_TYPE_PowerRequestAwayModeRequired: _POWER_REQUEST_TYPE = 2; +pub const _POWER_REQUEST_TYPE_PowerRequestExecutionRequired: _POWER_REQUEST_TYPE = 3; +pub type _POWER_REQUEST_TYPE = u32; +pub use self::_POWER_REQUEST_TYPE as POWER_REQUEST_TYPE; +pub type PPOWER_REQUEST_TYPE = *mut _POWER_REQUEST_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CM_Power_Data_s { + pub PD_Size: DWORD, + pub PD_MostRecentPowerState: DEVICE_POWER_STATE, + pub PD_Capabilities: DWORD, + pub PD_D1Latency: DWORD, + pub PD_D2Latency: DWORD, + pub PD_D3Latency: DWORD, + pub PD_PowerStateMapping: [DEVICE_POWER_STATE; 7usize], + pub PD_DeepestSystemWake: SYSTEM_POWER_STATE, +} +pub type CM_POWER_DATA = CM_Power_Data_s; +pub type PCM_POWER_DATA = *mut CM_Power_Data_s; +pub const POWER_INFORMATION_LEVEL_SystemPowerPolicyAc: POWER_INFORMATION_LEVEL = 0; +pub const POWER_INFORMATION_LEVEL_SystemPowerPolicyDc: POWER_INFORMATION_LEVEL = 1; +pub const POWER_INFORMATION_LEVEL_VerifySystemPolicyAc: POWER_INFORMATION_LEVEL = 2; +pub const POWER_INFORMATION_LEVEL_VerifySystemPolicyDc: POWER_INFORMATION_LEVEL = 3; +pub const POWER_INFORMATION_LEVEL_SystemPowerCapabilities: POWER_INFORMATION_LEVEL = 4; +pub const POWER_INFORMATION_LEVEL_SystemBatteryState: POWER_INFORMATION_LEVEL = 5; +pub const POWER_INFORMATION_LEVEL_SystemPowerStateHandler: POWER_INFORMATION_LEVEL = 6; +pub const POWER_INFORMATION_LEVEL_ProcessorStateHandler: POWER_INFORMATION_LEVEL = 7; +pub const POWER_INFORMATION_LEVEL_SystemPowerPolicyCurrent: POWER_INFORMATION_LEVEL = 8; +pub const POWER_INFORMATION_LEVEL_AdministratorPowerPolicy: POWER_INFORMATION_LEVEL = 9; +pub const POWER_INFORMATION_LEVEL_SystemReserveHiberFile: POWER_INFORMATION_LEVEL = 10; +pub const POWER_INFORMATION_LEVEL_ProcessorInformation: POWER_INFORMATION_LEVEL = 11; +pub const POWER_INFORMATION_LEVEL_SystemPowerInformation: POWER_INFORMATION_LEVEL = 12; +pub const POWER_INFORMATION_LEVEL_ProcessorStateHandler2: POWER_INFORMATION_LEVEL = 13; +pub const POWER_INFORMATION_LEVEL_LastWakeTime: POWER_INFORMATION_LEVEL = 14; +pub const POWER_INFORMATION_LEVEL_LastSleepTime: POWER_INFORMATION_LEVEL = 15; +pub const POWER_INFORMATION_LEVEL_SystemExecutionState: POWER_INFORMATION_LEVEL = 16; +pub const POWER_INFORMATION_LEVEL_SystemPowerStateNotifyHandler: POWER_INFORMATION_LEVEL = 17; +pub const POWER_INFORMATION_LEVEL_ProcessorPowerPolicyAc: POWER_INFORMATION_LEVEL = 18; +pub const POWER_INFORMATION_LEVEL_ProcessorPowerPolicyDc: POWER_INFORMATION_LEVEL = 19; +pub const POWER_INFORMATION_LEVEL_VerifyProcessorPowerPolicyAc: POWER_INFORMATION_LEVEL = 20; +pub const POWER_INFORMATION_LEVEL_VerifyProcessorPowerPolicyDc: POWER_INFORMATION_LEVEL = 21; +pub const POWER_INFORMATION_LEVEL_ProcessorPowerPolicyCurrent: POWER_INFORMATION_LEVEL = 22; +pub const POWER_INFORMATION_LEVEL_SystemPowerStateLogging: POWER_INFORMATION_LEVEL = 23; +pub const POWER_INFORMATION_LEVEL_SystemPowerLoggingEntry: POWER_INFORMATION_LEVEL = 24; +pub const POWER_INFORMATION_LEVEL_SetPowerSettingValue: POWER_INFORMATION_LEVEL = 25; +pub const POWER_INFORMATION_LEVEL_NotifyUserPowerSetting: POWER_INFORMATION_LEVEL = 26; +pub const POWER_INFORMATION_LEVEL_PowerInformationLevelUnused0: POWER_INFORMATION_LEVEL = 27; +pub const POWER_INFORMATION_LEVEL_SystemMonitorHiberBootPowerOff: POWER_INFORMATION_LEVEL = 28; +pub const POWER_INFORMATION_LEVEL_SystemVideoState: POWER_INFORMATION_LEVEL = 29; +pub const POWER_INFORMATION_LEVEL_TraceApplicationPowerMessage: POWER_INFORMATION_LEVEL = 30; +pub const POWER_INFORMATION_LEVEL_TraceApplicationPowerMessageEnd: POWER_INFORMATION_LEVEL = 31; +pub const POWER_INFORMATION_LEVEL_ProcessorPerfStates: POWER_INFORMATION_LEVEL = 32; +pub const POWER_INFORMATION_LEVEL_ProcessorIdleStates: POWER_INFORMATION_LEVEL = 33; +pub const POWER_INFORMATION_LEVEL_ProcessorCap: POWER_INFORMATION_LEVEL = 34; +pub const POWER_INFORMATION_LEVEL_SystemWakeSource: POWER_INFORMATION_LEVEL = 35; +pub const POWER_INFORMATION_LEVEL_SystemHiberFileInformation: POWER_INFORMATION_LEVEL = 36; +pub const POWER_INFORMATION_LEVEL_TraceServicePowerMessage: POWER_INFORMATION_LEVEL = 37; +pub const POWER_INFORMATION_LEVEL_ProcessorLoad: POWER_INFORMATION_LEVEL = 38; +pub const POWER_INFORMATION_LEVEL_PowerShutdownNotification: POWER_INFORMATION_LEVEL = 39; +pub const POWER_INFORMATION_LEVEL_MonitorCapabilities: POWER_INFORMATION_LEVEL = 40; +pub const POWER_INFORMATION_LEVEL_SessionPowerInit: POWER_INFORMATION_LEVEL = 41; +pub const POWER_INFORMATION_LEVEL_SessionDisplayState: POWER_INFORMATION_LEVEL = 42; +pub const POWER_INFORMATION_LEVEL_PowerRequestCreate: POWER_INFORMATION_LEVEL = 43; +pub const POWER_INFORMATION_LEVEL_PowerRequestAction: POWER_INFORMATION_LEVEL = 44; +pub const POWER_INFORMATION_LEVEL_GetPowerRequestList: POWER_INFORMATION_LEVEL = 45; +pub const POWER_INFORMATION_LEVEL_ProcessorInformationEx: POWER_INFORMATION_LEVEL = 46; +pub const POWER_INFORMATION_LEVEL_NotifyUserModeLegacyPowerEvent: POWER_INFORMATION_LEVEL = 47; +pub const POWER_INFORMATION_LEVEL_GroupPark: POWER_INFORMATION_LEVEL = 48; +pub const POWER_INFORMATION_LEVEL_ProcessorIdleDomains: POWER_INFORMATION_LEVEL = 49; +pub const POWER_INFORMATION_LEVEL_WakeTimerList: POWER_INFORMATION_LEVEL = 50; +pub const POWER_INFORMATION_LEVEL_SystemHiberFileSize: POWER_INFORMATION_LEVEL = 51; +pub const POWER_INFORMATION_LEVEL_ProcessorIdleStatesHv: POWER_INFORMATION_LEVEL = 52; +pub const POWER_INFORMATION_LEVEL_ProcessorPerfStatesHv: POWER_INFORMATION_LEVEL = 53; +pub const POWER_INFORMATION_LEVEL_ProcessorPerfCapHv: POWER_INFORMATION_LEVEL = 54; +pub const POWER_INFORMATION_LEVEL_ProcessorSetIdle: POWER_INFORMATION_LEVEL = 55; +pub const POWER_INFORMATION_LEVEL_LogicalProcessorIdling: POWER_INFORMATION_LEVEL = 56; +pub const POWER_INFORMATION_LEVEL_UserPresence: POWER_INFORMATION_LEVEL = 57; +pub const POWER_INFORMATION_LEVEL_PowerSettingNotificationName: POWER_INFORMATION_LEVEL = 58; +pub const POWER_INFORMATION_LEVEL_GetPowerSettingValue: POWER_INFORMATION_LEVEL = 59; +pub const POWER_INFORMATION_LEVEL_IdleResiliency: POWER_INFORMATION_LEVEL = 60; +pub const POWER_INFORMATION_LEVEL_SessionRITState: POWER_INFORMATION_LEVEL = 61; +pub const POWER_INFORMATION_LEVEL_SessionConnectNotification: POWER_INFORMATION_LEVEL = 62; +pub const POWER_INFORMATION_LEVEL_SessionPowerCleanup: POWER_INFORMATION_LEVEL = 63; +pub const POWER_INFORMATION_LEVEL_SessionLockState: POWER_INFORMATION_LEVEL = 64; +pub const POWER_INFORMATION_LEVEL_SystemHiberbootState: POWER_INFORMATION_LEVEL = 65; +pub const POWER_INFORMATION_LEVEL_PlatformInformation: POWER_INFORMATION_LEVEL = 66; +pub const POWER_INFORMATION_LEVEL_PdcInvocation: POWER_INFORMATION_LEVEL = 67; +pub const POWER_INFORMATION_LEVEL_MonitorInvocation: POWER_INFORMATION_LEVEL = 68; +pub const POWER_INFORMATION_LEVEL_FirmwareTableInformationRegistered: POWER_INFORMATION_LEVEL = 69; +pub const POWER_INFORMATION_LEVEL_SetShutdownSelectedTime: POWER_INFORMATION_LEVEL = 70; +pub const POWER_INFORMATION_LEVEL_SuspendResumeInvocation: POWER_INFORMATION_LEVEL = 71; +pub const POWER_INFORMATION_LEVEL_PlmPowerRequestCreate: POWER_INFORMATION_LEVEL = 72; +pub const POWER_INFORMATION_LEVEL_ScreenOff: POWER_INFORMATION_LEVEL = 73; +pub const POWER_INFORMATION_LEVEL_CsDeviceNotification: POWER_INFORMATION_LEVEL = 74; +pub const POWER_INFORMATION_LEVEL_PlatformRole: POWER_INFORMATION_LEVEL = 75; +pub const POWER_INFORMATION_LEVEL_LastResumePerformance: POWER_INFORMATION_LEVEL = 76; +pub const POWER_INFORMATION_LEVEL_DisplayBurst: POWER_INFORMATION_LEVEL = 77; +pub const POWER_INFORMATION_LEVEL_ExitLatencySamplingPercentage: POWER_INFORMATION_LEVEL = 78; +pub const POWER_INFORMATION_LEVEL_ApplyLowPowerScenarioSettings: POWER_INFORMATION_LEVEL = 79; +pub const POWER_INFORMATION_LEVEL_PowerInformationLevelMaximum: POWER_INFORMATION_LEVEL = 80; +pub type POWER_INFORMATION_LEVEL = u32; +pub const POWER_USER_PRESENCE_TYPE_UserNotPresent: POWER_USER_PRESENCE_TYPE = 0; +pub const POWER_USER_PRESENCE_TYPE_UserPresent: POWER_USER_PRESENCE_TYPE = 1; +pub const POWER_USER_PRESENCE_TYPE_UserUnknown: POWER_USER_PRESENCE_TYPE = 255; +pub type POWER_USER_PRESENCE_TYPE = u32; +pub type PPOWER_USER_PRESENCE_TYPE = *mut POWER_USER_PRESENCE_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_USER_PRESENCE { + pub UserPresence: POWER_USER_PRESENCE_TYPE, +} +pub type POWER_USER_PRESENCE = _POWER_USER_PRESENCE; +pub type PPOWER_USER_PRESENCE = *mut _POWER_USER_PRESENCE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_SESSION_CONNECT { + pub Connected: BOOLEAN, + pub Console: BOOLEAN, +} +pub type POWER_SESSION_CONNECT = _POWER_SESSION_CONNECT; +pub type PPOWER_SESSION_CONNECT = *mut _POWER_SESSION_CONNECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_SESSION_TIMEOUTS { + pub InputTimeout: DWORD, + pub DisplayTimeout: DWORD, +} +pub type POWER_SESSION_TIMEOUTS = _POWER_SESSION_TIMEOUTS; +pub type PPOWER_SESSION_TIMEOUTS = *mut _POWER_SESSION_TIMEOUTS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_SESSION_RIT_STATE { + pub Active: BOOLEAN, + pub LastInputTime: DWORD, +} +pub type POWER_SESSION_RIT_STATE = _POWER_SESSION_RIT_STATE; +pub type PPOWER_SESSION_RIT_STATE = *mut _POWER_SESSION_RIT_STATE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_SESSION_WINLOGON { + pub SessionId: DWORD, + pub Console: BOOLEAN, + pub Locked: BOOLEAN, +} +pub type POWER_SESSION_WINLOGON = _POWER_SESSION_WINLOGON; +pub type PPOWER_SESSION_WINLOGON = *mut _POWER_SESSION_WINLOGON; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_IDLE_RESILIENCY { + pub CoalescingTimeout: DWORD, + pub IdleResiliencyPeriod: DWORD, +} +pub type POWER_IDLE_RESILIENCY = _POWER_IDLE_RESILIENCY; +pub type PPOWER_IDLE_RESILIENCY = *mut _POWER_IDLE_RESILIENCY; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonUnknown: POWER_MONITOR_REQUEST_REASON = + 0; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonPowerButton: + POWER_MONITOR_REQUEST_REASON = 1; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonRemoteConnection: + POWER_MONITOR_REQUEST_REASON = 2; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonScMonitorpower: + POWER_MONITOR_REQUEST_REASON = 3; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonUserInput: POWER_MONITOR_REQUEST_REASON = + 4; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonAcDcDisplayBurst: + POWER_MONITOR_REQUEST_REASON = 5; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonUserDisplayBurst: + POWER_MONITOR_REQUEST_REASON = 6; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonPoSetSystemState: + POWER_MONITOR_REQUEST_REASON = 7; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonSetThreadExecutionState: + POWER_MONITOR_REQUEST_REASON = 8; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonFullWake: POWER_MONITOR_REQUEST_REASON = + 9; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonSessionUnlock: + POWER_MONITOR_REQUEST_REASON = 10; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonScreenOffRequest: + POWER_MONITOR_REQUEST_REASON = 11; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonIdleTimeout: + POWER_MONITOR_REQUEST_REASON = 12; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonPolicyChange: + POWER_MONITOR_REQUEST_REASON = 13; +pub const POWER_MONITOR_REQUEST_REASON_MonitorRequestReasonMax: POWER_MONITOR_REQUEST_REASON = 14; +pub type POWER_MONITOR_REQUEST_REASON = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_MONITOR_INVOCATION { + pub On: BOOLEAN, + pub Console: BOOLEAN, + pub RequestReason: POWER_MONITOR_REQUEST_REASON, +} +pub type POWER_MONITOR_INVOCATION = _POWER_MONITOR_INVOCATION; +pub type PPOWER_MONITOR_INVOCATION = *mut _POWER_MONITOR_INVOCATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RESUME_PERFORMANCE { + pub PostTimeMs: DWORD, + pub TotalResumeTimeMs: ULONGLONG, + pub ResumeCompleteTimestamp: ULONGLONG, +} +pub type RESUME_PERFORMANCE = _RESUME_PERFORMANCE; +pub type PRESUME_PERFORMANCE = *mut _RESUME_PERFORMANCE; +pub const SYSTEM_POWER_CONDITION_PoAc: SYSTEM_POWER_CONDITION = 0; +pub const SYSTEM_POWER_CONDITION_PoDc: SYSTEM_POWER_CONDITION = 1; +pub const SYSTEM_POWER_CONDITION_PoHot: SYSTEM_POWER_CONDITION = 2; +pub const SYSTEM_POWER_CONDITION_PoConditionMaximum: SYSTEM_POWER_CONDITION = 3; +pub type SYSTEM_POWER_CONDITION = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SET_POWER_SETTING_VALUE { + pub Version: DWORD, + pub Guid: GUID, + pub PowerCondition: SYSTEM_POWER_CONDITION, + pub DataLength: DWORD, + pub Data: [BYTE; 1usize], +} +pub type PSET_POWER_SETTING_VALUE = *mut SET_POWER_SETTING_VALUE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NOTIFY_USER_POWER_SETTING { + pub Guid: GUID, +} +pub type PNOTIFY_USER_POWER_SETTING = *mut NOTIFY_USER_POWER_SETTING; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _APPLICATIONLAUNCH_SETTING_VALUE { + pub ActivationTime: LARGE_INTEGER, + pub Flags: DWORD, + pub ButtonInstanceID: DWORD, +} +pub type APPLICATIONLAUNCH_SETTING_VALUE = _APPLICATIONLAUNCH_SETTING_VALUE; +pub type PAPPLICATIONLAUNCH_SETTING_VALUE = *mut _APPLICATIONLAUNCH_SETTING_VALUE; +pub const _POWER_PLATFORM_ROLE_PlatformRoleUnspecified: _POWER_PLATFORM_ROLE = 0; +pub const _POWER_PLATFORM_ROLE_PlatformRoleDesktop: _POWER_PLATFORM_ROLE = 1; +pub const _POWER_PLATFORM_ROLE_PlatformRoleMobile: _POWER_PLATFORM_ROLE = 2; +pub const _POWER_PLATFORM_ROLE_PlatformRoleWorkstation: _POWER_PLATFORM_ROLE = 3; +pub const _POWER_PLATFORM_ROLE_PlatformRoleEnterpriseServer: _POWER_PLATFORM_ROLE = 4; +pub const _POWER_PLATFORM_ROLE_PlatformRoleSOHOServer: _POWER_PLATFORM_ROLE = 5; +pub const _POWER_PLATFORM_ROLE_PlatformRoleAppliancePC: _POWER_PLATFORM_ROLE = 6; +pub const _POWER_PLATFORM_ROLE_PlatformRolePerformanceServer: _POWER_PLATFORM_ROLE = 7; +pub const _POWER_PLATFORM_ROLE_PlatformRoleSlate: _POWER_PLATFORM_ROLE = 8; +pub const _POWER_PLATFORM_ROLE_PlatformRoleMaximum: _POWER_PLATFORM_ROLE = 9; +pub type _POWER_PLATFORM_ROLE = u32; +pub use self::_POWER_PLATFORM_ROLE as POWER_PLATFORM_ROLE; +pub type PPOWER_PLATFORM_ROLE = *mut _POWER_PLATFORM_ROLE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POWER_PLATFORM_INFORMATION { + pub AoAc: BOOLEAN, +} +pub type POWER_PLATFORM_INFORMATION = _POWER_PLATFORM_INFORMATION; +pub type PPOWER_PLATFORM_INFORMATION = *mut _POWER_PLATFORM_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct BATTERY_REPORTING_SCALE { + pub Granularity: DWORD, + pub Capacity: DWORD, +} +pub type PBATTERY_REPORTING_SCALE = *mut BATTERY_REPORTING_SCALE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_LEGACY_PERFSTATE { + pub Frequency: DWORD, + pub Flags: DWORD, + pub PercentFrequency: DWORD, +} +pub type PPPM_WMI_LEGACY_PERFSTATE = *mut PPM_WMI_LEGACY_PERFSTATE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_IDLE_STATE { + pub Latency: DWORD, + pub Power: DWORD, + pub TimeCheck: DWORD, + pub PromotePercent: BYTE, + pub DemotePercent: BYTE, + pub StateType: BYTE, + pub Reserved: BYTE, + pub StateFlags: DWORD, + pub Context: DWORD, + pub IdleHandler: DWORD, + pub Reserved1: DWORD, +} +pub type PPPM_WMI_IDLE_STATE = *mut PPM_WMI_IDLE_STATE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_IDLE_STATES { + pub Type: DWORD, + pub Count: DWORD, + pub TargetState: DWORD, + pub OldState: DWORD, + pub TargetProcessors: DWORD64, + pub State: [PPM_WMI_IDLE_STATE; 1usize], +} +pub type PPPM_WMI_IDLE_STATES = *mut PPM_WMI_IDLE_STATES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_IDLE_STATES_EX { + pub Type: DWORD, + pub Count: DWORD, + pub TargetState: DWORD, + pub OldState: DWORD, + pub TargetProcessors: PVOID, + pub State: [PPM_WMI_IDLE_STATE; 1usize], +} +pub type PPPM_WMI_IDLE_STATES_EX = *mut PPM_WMI_IDLE_STATES_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_PERF_STATE { + pub Frequency: DWORD, + pub Power: DWORD, + pub PercentFrequency: BYTE, + pub IncreaseLevel: BYTE, + pub DecreaseLevel: BYTE, + pub Type: BYTE, + pub IncreaseTime: DWORD, + pub DecreaseTime: DWORD, + pub Control: DWORD64, + pub Status: DWORD64, + pub HitCount: DWORD, + pub Reserved1: DWORD, + pub Reserved2: DWORD64, + pub Reserved3: DWORD64, +} +pub type PPPM_WMI_PERF_STATE = *mut PPM_WMI_PERF_STATE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_PERF_STATES { + pub Count: DWORD, + pub MaxFrequency: DWORD, + pub CurrentState: DWORD, + pub MaxPerfState: DWORD, + pub MinPerfState: DWORD, + pub LowestPerfState: DWORD, + pub ThermalConstraint: DWORD, + pub BusyAdjThreshold: BYTE, + pub PolicyType: BYTE, + pub Type: BYTE, + pub Reserved: BYTE, + pub TimerInterval: DWORD, + pub TargetProcessors: DWORD64, + pub PStateHandler: DWORD, + pub PStateContext: DWORD, + pub TStateHandler: DWORD, + pub TStateContext: DWORD, + pub FeedbackHandler: DWORD, + pub Reserved1: DWORD, + pub Reserved2: DWORD64, + pub State: [PPM_WMI_PERF_STATE; 1usize], +} +pub type PPPM_WMI_PERF_STATES = *mut PPM_WMI_PERF_STATES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_WMI_PERF_STATES_EX { + pub Count: DWORD, + pub MaxFrequency: DWORD, + pub CurrentState: DWORD, + pub MaxPerfState: DWORD, + pub MinPerfState: DWORD, + pub LowestPerfState: DWORD, + pub ThermalConstraint: DWORD, + pub BusyAdjThreshold: BYTE, + pub PolicyType: BYTE, + pub Type: BYTE, + pub Reserved: BYTE, + pub TimerInterval: DWORD, + pub TargetProcessors: PVOID, + pub PStateHandler: DWORD, + pub PStateContext: DWORD, + pub TStateHandler: DWORD, + pub TStateContext: DWORD, + pub FeedbackHandler: DWORD, + pub Reserved1: DWORD, + pub Reserved2: DWORD64, + pub State: [PPM_WMI_PERF_STATE; 1usize], +} +pub type PPPM_WMI_PERF_STATES_EX = *mut PPM_WMI_PERF_STATES_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_IDLE_STATE_ACCOUNTING { + pub IdleTransitions: DWORD, + pub FailedTransitions: DWORD, + pub InvalidBucketIndex: DWORD, + pub TotalTime: DWORD64, + pub IdleTimeBuckets: [DWORD; 6usize], +} +pub type PPPM_IDLE_STATE_ACCOUNTING = *mut PPM_IDLE_STATE_ACCOUNTING; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_IDLE_ACCOUNTING { + pub StateCount: DWORD, + pub TotalTransitions: DWORD, + pub ResetCount: DWORD, + pub StartTime: DWORD64, + pub State: [PPM_IDLE_STATE_ACCOUNTING; 1usize], +} +pub type PPPM_IDLE_ACCOUNTING = *mut PPM_IDLE_ACCOUNTING; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_IDLE_STATE_BUCKET_EX { + pub TotalTimeUs: DWORD64, + pub MinTimeUs: DWORD, + pub MaxTimeUs: DWORD, + pub Count: DWORD, +} +pub type PPPM_IDLE_STATE_BUCKET_EX = *mut PPM_IDLE_STATE_BUCKET_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_IDLE_STATE_ACCOUNTING_EX { + pub TotalTime: DWORD64, + pub IdleTransitions: DWORD, + pub FailedTransitions: DWORD, + pub InvalidBucketIndex: DWORD, + pub MinTimeUs: DWORD, + pub MaxTimeUs: DWORD, + pub CancelledTransitions: DWORD, + pub IdleTimeBuckets: [PPM_IDLE_STATE_BUCKET_EX; 16usize], +} +pub type PPPM_IDLE_STATE_ACCOUNTING_EX = *mut PPM_IDLE_STATE_ACCOUNTING_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_IDLE_ACCOUNTING_EX { + pub StateCount: DWORD, + pub TotalTransitions: DWORD, + pub ResetCount: DWORD, + pub AbortCount: DWORD, + pub StartTime: DWORD64, + pub State: [PPM_IDLE_STATE_ACCOUNTING_EX; 1usize], +} +pub type PPPM_IDLE_ACCOUNTING_EX = *mut PPM_IDLE_ACCOUNTING_EX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_PERFSTATE_EVENT { + pub State: DWORD, + pub Status: DWORD, + pub Latency: DWORD, + pub Speed: DWORD, + pub Processor: DWORD, +} +pub type PPPM_PERFSTATE_EVENT = *mut PPM_PERFSTATE_EVENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_PERFSTATE_DOMAIN_EVENT { + pub State: DWORD, + pub Latency: DWORD, + pub Speed: DWORD, + pub Processors: DWORD64, +} +pub type PPPM_PERFSTATE_DOMAIN_EVENT = *mut PPM_PERFSTATE_DOMAIN_EVENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_IDLESTATE_EVENT { + pub NewState: DWORD, + pub OldState: DWORD, + pub Processors: DWORD64, +} +pub type PPPM_IDLESTATE_EVENT = *mut PPM_IDLESTATE_EVENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_THERMALCHANGE_EVENT { + pub ThermalConstraint: DWORD, + pub Processors: DWORD64, +} +pub type PPPM_THERMALCHANGE_EVENT = *mut PPM_THERMALCHANGE_EVENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PPM_THERMAL_POLICY_EVENT { + pub Mode: BYTE, + pub Processors: DWORD64, +} +pub type PPPM_THERMAL_POLICY_EVENT = *mut PPM_THERMAL_POLICY_EVENT; +extern "C" { + pub static PPM_PERFSTATE_CHANGE_GUID: GUID; +} +extern "C" { + pub static PPM_PERFSTATE_DOMAIN_CHANGE_GUID: GUID; +} +extern "C" { + pub static PPM_IDLESTATE_CHANGE_GUID: GUID; +} +extern "C" { + pub static PPM_PERFSTATES_DATA_GUID: GUID; +} +extern "C" { + pub static PPM_IDLESTATES_DATA_GUID: GUID; +} +extern "C" { + pub static PPM_IDLE_ACCOUNTING_GUID: GUID; +} +extern "C" { + pub static PPM_IDLE_ACCOUNTING_EX_GUID: GUID; +} +extern "C" { + pub static PPM_THERMALCONSTRAINT_GUID: GUID; +} +extern "C" { + pub static PPM_PERFMON_PERFSTATE_GUID: GUID; +} +extern "C" { + pub static PPM_THERMAL_POLICY_CHANGE_GUID: GUID; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct POWER_ACTION_POLICY { + pub Action: POWER_ACTION, + pub Flags: DWORD, + pub EventCode: DWORD, +} +pub type PPOWER_ACTION_POLICY = *mut POWER_ACTION_POLICY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PROCESSOR_IDLESTATE_INFO { + pub TimeCheck: DWORD, + pub DemotePercent: BYTE, + pub PromotePercent: BYTE, + pub Spare: [BYTE; 2usize], +} +pub type PPROCESSOR_IDLESTATE_INFO = *mut PROCESSOR_IDLESTATE_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SYSTEM_POWER_LEVEL { + pub Enable: BOOLEAN, + pub Spare: [BYTE; 3usize], + pub BatteryLevel: DWORD, + pub PowerPolicy: POWER_ACTION_POLICY, + pub MinSystemState: SYSTEM_POWER_STATE, +} +pub type PSYSTEM_POWER_LEVEL = *mut SYSTEM_POWER_LEVEL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_POWER_POLICY { + pub Revision: DWORD, + pub PowerButton: POWER_ACTION_POLICY, + pub SleepButton: POWER_ACTION_POLICY, + pub LidClose: POWER_ACTION_POLICY, + pub LidOpenWake: SYSTEM_POWER_STATE, + pub Reserved: DWORD, + pub Idle: POWER_ACTION_POLICY, + pub IdleTimeout: DWORD, + pub IdleSensitivity: BYTE, + pub DynamicThrottle: BYTE, + pub Spare2: [BYTE; 2usize], + pub MinSleep: SYSTEM_POWER_STATE, + pub MaxSleep: SYSTEM_POWER_STATE, + pub ReducedLatencySleep: SYSTEM_POWER_STATE, + pub WinLogonFlags: DWORD, + pub Spare3: DWORD, + pub DozeS4Timeout: DWORD, + pub BroadcastCapacityResolution: DWORD, + pub DischargePolicy: [SYSTEM_POWER_LEVEL; 4usize], + pub VideoTimeout: DWORD, + pub VideoDimDisplay: BOOLEAN, + pub VideoReserved: [DWORD; 3usize], + pub SpindownTimeout: DWORD, + pub OptimizeForPower: BOOLEAN, + pub FanThrottleTolerance: BYTE, + pub ForcedThrottle: BYTE, + pub MinThrottle: BYTE, + pub OverThrottled: POWER_ACTION_POLICY, +} +pub type SYSTEM_POWER_POLICY = _SYSTEM_POWER_POLICY; +pub type PSYSTEM_POWER_POLICY = *mut _SYSTEM_POWER_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct PROCESSOR_IDLESTATE_POLICY { + pub Revision: WORD, + pub Flags: PROCESSOR_IDLESTATE_POLICY__bindgen_ty_1, + pub PolicyCount: DWORD, + pub Policy: [PROCESSOR_IDLESTATE_INFO; 3usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union PROCESSOR_IDLESTATE_POLICY__bindgen_ty_1 { + pub AsWORD: WORD, + pub __bindgen_anon_1: PROCESSOR_IDLESTATE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u16, +} +#[repr(C)] +#[repr(align(2))] +#[derive(Debug, Copy, Clone)] +pub struct PROCESSOR_IDLESTATE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u16>, +} +impl PROCESSOR_IDLESTATE_POLICY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn AllowScaling(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) } + } + #[inline] + pub fn set_AllowScaling(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn Disabled(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u16) } + } + #[inline] + pub fn set_Disabled(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 14u8) as u16) } + } + #[inline] + pub fn set_Reserved(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 14u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + AllowScaling: WORD, + Disabled: WORD, + Reserved: WORD, + ) -> __BindgenBitfieldUnit<[u8; 2usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AllowScaling: u16 = unsafe { ::std::mem::transmute(AllowScaling) }; + AllowScaling as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let Disabled: u16 = unsafe { ::std::mem::transmute(Disabled) }; + Disabled as u64 + }); + __bindgen_bitfield_unit.set(2usize, 14u8, { + let Reserved: u16 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PPROCESSOR_IDLESTATE_POLICY = *mut PROCESSOR_IDLESTATE_POLICY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESSOR_POWER_POLICY_INFO { + pub TimeCheck: DWORD, + pub DemoteLimit: DWORD, + pub PromoteLimit: DWORD, + pub DemotePercent: BYTE, + pub PromotePercent: BYTE, + pub Spare: [BYTE; 2usize], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _PROCESSOR_POWER_POLICY_INFO { + #[inline] + pub fn AllowDemotion(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_AllowDemotion(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn AllowPromotion(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_AllowPromotion(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_Reserved(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + AllowDemotion: DWORD, + AllowPromotion: DWORD, + Reserved: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AllowDemotion: u32 = unsafe { ::std::mem::transmute(AllowDemotion) }; + AllowDemotion as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let AllowPromotion: u32 = unsafe { ::std::mem::transmute(AllowPromotion) }; + AllowPromotion as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let Reserved: u32 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESSOR_POWER_POLICY_INFO = _PROCESSOR_POWER_POLICY_INFO; +pub type PPROCESSOR_POWER_POLICY_INFO = *mut _PROCESSOR_POWER_POLICY_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESSOR_POWER_POLICY { + pub Revision: DWORD, + pub DynamicThrottle: BYTE, + pub Spare: [BYTE; 3usize], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, + pub PolicyCount: DWORD, + pub Policy: [PROCESSOR_POWER_POLICY_INFO; 3usize], +} +impl _PROCESSOR_POWER_POLICY { + #[inline] + pub fn DisableCStates(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_DisableCStates(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_Reserved(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + DisableCStates: DWORD, + Reserved: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let DisableCStates: u32 = unsafe { ::std::mem::transmute(DisableCStates) }; + DisableCStates as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let Reserved: u32 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PROCESSOR_POWER_POLICY = _PROCESSOR_POWER_POLICY; +pub type PPROCESSOR_POWER_POLICY = *mut _PROCESSOR_POWER_POLICY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct PROCESSOR_PERFSTATE_POLICY { + pub Revision: DWORD, + pub MaxThrottle: BYTE, + pub MinThrottle: BYTE, + pub BusyAdjThreshold: BYTE, + pub __bindgen_anon_1: PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1, + pub TimeCheck: DWORD, + pub IncreaseTime: DWORD, + pub DecreaseTime: DWORD, + pub IncreasePercent: DWORD, + pub DecreasePercent: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1 { + pub Spare: BYTE, + pub Flags: PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u8, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1__bindgen_ty_1 { + pub AsBYTE: BYTE, + pub __bindgen_anon_1: PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u8, +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, +} +impl PROCESSOR_PERFSTATE_POLICY__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn NoDomainAccounting(&self) -> BYTE { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_NoDomainAccounting(&mut self, val: BYTE) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn IncreasePolicy(&self) -> BYTE { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u8) } + } + #[inline] + pub fn set_IncreasePolicy(&mut self, val: BYTE) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 2u8, val as u64) + } + } + #[inline] + pub fn DecreasePolicy(&self) -> BYTE { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 2u8) as u8) } + } + #[inline] + pub fn set_DecreasePolicy(&mut self, val: BYTE) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 2u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> BYTE { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u8) } + } + #[inline] + pub fn set_Reserved(&mut self, val: BYTE) { + unsafe { + let val: u8 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 3u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + NoDomainAccounting: BYTE, + IncreasePolicy: BYTE, + DecreasePolicy: BYTE, + Reserved: BYTE, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let NoDomainAccounting: u8 = unsafe { ::std::mem::transmute(NoDomainAccounting) }; + NoDomainAccounting as u64 + }); + __bindgen_bitfield_unit.set(1usize, 2u8, { + let IncreasePolicy: u8 = unsafe { ::std::mem::transmute(IncreasePolicy) }; + IncreasePolicy as u64 + }); + __bindgen_bitfield_unit.set(3usize, 2u8, { + let DecreasePolicy: u8 = unsafe { ::std::mem::transmute(DecreasePolicy) }; + DecreasePolicy as u64 + }); + __bindgen_bitfield_unit.set(5usize, 3u8, { + let Reserved: u8 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type PPROCESSOR_PERFSTATE_POLICY = *mut PROCESSOR_PERFSTATE_POLICY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ADMINISTRATOR_POWER_POLICY { + pub MinSleep: SYSTEM_POWER_STATE, + pub MaxSleep: SYSTEM_POWER_STATE, + pub MinVideoTimeout: DWORD, + pub MaxVideoTimeout: DWORD, + pub MinSpindownTimeout: DWORD, + pub MaxSpindownTimeout: DWORD, +} +pub type ADMINISTRATOR_POWER_POLICY = _ADMINISTRATOR_POWER_POLICY; +pub type PADMINISTRATOR_POWER_POLICY = *mut _ADMINISTRATOR_POWER_POLICY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SYSTEM_POWER_CAPABILITIES { + pub PowerButtonPresent: BOOLEAN, + pub SleepButtonPresent: BOOLEAN, + pub LidPresent: BOOLEAN, + pub SystemS1: BOOLEAN, + pub SystemS2: BOOLEAN, + pub SystemS3: BOOLEAN, + pub SystemS4: BOOLEAN, + pub SystemS5: BOOLEAN, + pub HiberFilePresent: BOOLEAN, + pub FullWake: BOOLEAN, + pub VideoDimPresent: BOOLEAN, + pub ApmPresent: BOOLEAN, + pub UpsPresent: BOOLEAN, + pub ThermalControl: BOOLEAN, + pub ProcessorThrottle: BOOLEAN, + pub ProcessorMinThrottle: BYTE, + pub ProcessorMaxThrottle: BYTE, + pub FastSystemS4: BOOLEAN, + pub spare2: [BYTE; 3usize], + pub DiskSpinDown: BOOLEAN, + pub spare3: [BYTE; 8usize], + pub SystemBatteriesPresent: BOOLEAN, + pub BatteriesAreShortTerm: BOOLEAN, + pub BatteryScale: [BATTERY_REPORTING_SCALE; 3usize], + pub AcOnLineWake: SYSTEM_POWER_STATE, + pub SoftLidWake: SYSTEM_POWER_STATE, + pub RtcWake: SYSTEM_POWER_STATE, + pub MinDeviceWakeState: SYSTEM_POWER_STATE, + pub DefaultLowLatencyWake: SYSTEM_POWER_STATE, +} +pub type PSYSTEM_POWER_CAPABILITIES = *mut SYSTEM_POWER_CAPABILITIES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SYSTEM_BATTERY_STATE { + pub AcOnLine: BOOLEAN, + pub BatteryPresent: BOOLEAN, + pub Charging: BOOLEAN, + pub Discharging: BOOLEAN, + pub Spare1: [BOOLEAN; 4usize], + pub MaxCapacity: DWORD, + pub RemainingCapacity: DWORD, + pub Rate: DWORD, + pub EstimatedTime: DWORD, + pub DefaultAlert1: DWORD, + pub DefaultAlert2: DWORD, +} +pub type PSYSTEM_BATTERY_STATE = *mut SYSTEM_BATTERY_STATE; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_DOS_HEADER { + pub e_magic: WORD, + pub e_cblp: WORD, + pub e_cp: WORD, + pub e_crlc: WORD, + pub e_cparhdr: WORD, + pub e_minalloc: WORD, + pub e_maxalloc: WORD, + pub e_ss: WORD, + pub e_sp: WORD, + pub e_csum: WORD, + pub e_ip: WORD, + pub e_cs: WORD, + pub e_lfarlc: WORD, + pub e_ovno: WORD, + pub e_res: [WORD; 4usize], + pub e_oemid: WORD, + pub e_oeminfo: WORD, + pub e_res2: [WORD; 10usize], + pub e_lfanew: LONG, +} +pub type IMAGE_DOS_HEADER = _IMAGE_DOS_HEADER; +pub type PIMAGE_DOS_HEADER = *mut _IMAGE_DOS_HEADER; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_OS2_HEADER { + pub ne_magic: WORD, + pub ne_ver: CHAR, + pub ne_rev: CHAR, + pub ne_enttab: WORD, + pub ne_cbenttab: WORD, + pub ne_crc: LONG, + pub ne_flags: WORD, + pub ne_autodata: WORD, + pub ne_heap: WORD, + pub ne_stack: WORD, + pub ne_csip: LONG, + pub ne_sssp: LONG, + pub ne_cseg: WORD, + pub ne_cmod: WORD, + pub ne_cbnrestab: WORD, + pub ne_segtab: WORD, + pub ne_rsrctab: WORD, + pub ne_restab: WORD, + pub ne_modtab: WORD, + pub ne_imptab: WORD, + pub ne_nrestab: LONG, + pub ne_cmovent: WORD, + pub ne_align: WORD, + pub ne_cres: WORD, + pub ne_exetyp: BYTE, + pub ne_flagsothers: BYTE, + pub ne_pretthunks: WORD, + pub ne_psegrefbytes: WORD, + pub ne_swaparea: WORD, + pub ne_expver: WORD, +} +pub type IMAGE_OS2_HEADER = _IMAGE_OS2_HEADER; +pub type PIMAGE_OS2_HEADER = *mut _IMAGE_OS2_HEADER; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_VXD_HEADER { + pub e32_magic: WORD, + pub e32_border: BYTE, + pub e32_worder: BYTE, + pub e32_level: DWORD, + pub e32_cpu: WORD, + pub e32_os: WORD, + pub e32_ver: DWORD, + pub e32_mflags: DWORD, + pub e32_mpages: DWORD, + pub e32_startobj: DWORD, + pub e32_eip: DWORD, + pub e32_stackobj: DWORD, + pub e32_esp: DWORD, + pub e32_pagesize: DWORD, + pub e32_lastpagesize: DWORD, + pub e32_fixupsize: DWORD, + pub e32_fixupsum: DWORD, + pub e32_ldrsize: DWORD, + pub e32_ldrsum: DWORD, + pub e32_objtab: DWORD, + pub e32_objcnt: DWORD, + pub e32_objmap: DWORD, + pub e32_itermap: DWORD, + pub e32_rsrctab: DWORD, + pub e32_rsrccnt: DWORD, + pub e32_restab: DWORD, + pub e32_enttab: DWORD, + pub e32_dirtab: DWORD, + pub e32_dircnt: DWORD, + pub e32_fpagetab: DWORD, + pub e32_frectab: DWORD, + pub e32_impmod: DWORD, + pub e32_impmodcnt: DWORD, + pub e32_impproc: DWORD, + pub e32_pagesum: DWORD, + pub e32_datapage: DWORD, + pub e32_preload: DWORD, + pub e32_nrestab: DWORD, + pub e32_cbnrestab: DWORD, + pub e32_nressum: DWORD, + pub e32_autodata: DWORD, + pub e32_debuginfo: DWORD, + pub e32_debuglen: DWORD, + pub e32_instpreload: DWORD, + pub e32_instdemand: DWORD, + pub e32_heapsize: DWORD, + pub e32_res3: [BYTE; 12usize], + pub e32_winresoff: DWORD, + pub e32_winreslen: DWORD, + pub e32_devid: WORD, + pub e32_ddkver: WORD, +} +pub type IMAGE_VXD_HEADER = _IMAGE_VXD_HEADER; +pub type PIMAGE_VXD_HEADER = *mut _IMAGE_VXD_HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_FILE_HEADER { + pub Machine: WORD, + pub NumberOfSections: WORD, + pub TimeDateStamp: DWORD, + pub PointerToSymbolTable: DWORD, + pub NumberOfSymbols: DWORD, + pub SizeOfOptionalHeader: WORD, + pub Characteristics: WORD, +} +pub type IMAGE_FILE_HEADER = _IMAGE_FILE_HEADER; +pub type PIMAGE_FILE_HEADER = *mut _IMAGE_FILE_HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_DATA_DIRECTORY { + pub VirtualAddress: DWORD, + pub Size: DWORD, +} +pub type IMAGE_DATA_DIRECTORY = _IMAGE_DATA_DIRECTORY; +pub type PIMAGE_DATA_DIRECTORY = *mut _IMAGE_DATA_DIRECTORY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_OPTIONAL_HEADER { + pub Magic: WORD, + pub MajorLinkerVersion: BYTE, + pub MinorLinkerVersion: BYTE, + pub SizeOfCode: DWORD, + pub SizeOfInitializedData: DWORD, + pub SizeOfUninitializedData: DWORD, + pub AddressOfEntryPoint: DWORD, + pub BaseOfCode: DWORD, + pub BaseOfData: DWORD, + pub ImageBase: DWORD, + pub SectionAlignment: DWORD, + pub FileAlignment: DWORD, + pub MajorOperatingSystemVersion: WORD, + pub MinorOperatingSystemVersion: WORD, + pub MajorImageVersion: WORD, + pub MinorImageVersion: WORD, + pub MajorSubsystemVersion: WORD, + pub MinorSubsystemVersion: WORD, + pub Win32VersionValue: DWORD, + pub SizeOfImage: DWORD, + pub SizeOfHeaders: DWORD, + pub CheckSum: DWORD, + pub Subsystem: WORD, + pub DllCharacteristics: WORD, + pub SizeOfStackReserve: DWORD, + pub SizeOfStackCommit: DWORD, + pub SizeOfHeapReserve: DWORD, + pub SizeOfHeapCommit: DWORD, + pub LoaderFlags: DWORD, + pub NumberOfRvaAndSizes: DWORD, + pub DataDirectory: [IMAGE_DATA_DIRECTORY; 16usize], +} +pub type IMAGE_OPTIONAL_HEADER32 = _IMAGE_OPTIONAL_HEADER; +pub type PIMAGE_OPTIONAL_HEADER32 = *mut _IMAGE_OPTIONAL_HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ROM_OPTIONAL_HEADER { + pub Magic: WORD, + pub MajorLinkerVersion: BYTE, + pub MinorLinkerVersion: BYTE, + pub SizeOfCode: DWORD, + pub SizeOfInitializedData: DWORD, + pub SizeOfUninitializedData: DWORD, + pub AddressOfEntryPoint: DWORD, + pub BaseOfCode: DWORD, + pub BaseOfData: DWORD, + pub BaseOfBss: DWORD, + pub GprMask: DWORD, + pub CprMask: [DWORD; 4usize], + pub GpValue: DWORD, +} +pub type IMAGE_ROM_OPTIONAL_HEADER = _IMAGE_ROM_OPTIONAL_HEADER; +pub type PIMAGE_ROM_OPTIONAL_HEADER = *mut _IMAGE_ROM_OPTIONAL_HEADER; +#[repr(C, packed(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_OPTIONAL_HEADER64 { + pub Magic: WORD, + pub MajorLinkerVersion: BYTE, + pub MinorLinkerVersion: BYTE, + pub SizeOfCode: DWORD, + pub SizeOfInitializedData: DWORD, + pub SizeOfUninitializedData: DWORD, + pub AddressOfEntryPoint: DWORD, + pub BaseOfCode: DWORD, + pub ImageBase: ULONGLONG, + pub SectionAlignment: DWORD, + pub FileAlignment: DWORD, + pub MajorOperatingSystemVersion: WORD, + pub MinorOperatingSystemVersion: WORD, + pub MajorImageVersion: WORD, + pub MinorImageVersion: WORD, + pub MajorSubsystemVersion: WORD, + pub MinorSubsystemVersion: WORD, + pub Win32VersionValue: DWORD, + pub SizeOfImage: DWORD, + pub SizeOfHeaders: DWORD, + pub CheckSum: DWORD, + pub Subsystem: WORD, + pub DllCharacteristics: WORD, + pub SizeOfStackReserve: ULONGLONG, + pub SizeOfStackCommit: ULONGLONG, + pub SizeOfHeapReserve: ULONGLONG, + pub SizeOfHeapCommit: ULONGLONG, + pub LoaderFlags: DWORD, + pub NumberOfRvaAndSizes: DWORD, + pub DataDirectory: [IMAGE_DATA_DIRECTORY; 16usize], +} +pub type IMAGE_OPTIONAL_HEADER64 = _IMAGE_OPTIONAL_HEADER64; +pub type PIMAGE_OPTIONAL_HEADER64 = *mut _IMAGE_OPTIONAL_HEADER64; +pub type IMAGE_OPTIONAL_HEADER = IMAGE_OPTIONAL_HEADER64; +pub type PIMAGE_OPTIONAL_HEADER = PIMAGE_OPTIONAL_HEADER64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_NT_HEADERS64 { + pub Signature: DWORD, + pub FileHeader: IMAGE_FILE_HEADER, + pub OptionalHeader: IMAGE_OPTIONAL_HEADER64, +} +pub type IMAGE_NT_HEADERS64 = _IMAGE_NT_HEADERS64; +pub type PIMAGE_NT_HEADERS64 = *mut _IMAGE_NT_HEADERS64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_NT_HEADERS { + pub Signature: DWORD, + pub FileHeader: IMAGE_FILE_HEADER, + pub OptionalHeader: IMAGE_OPTIONAL_HEADER32, +} +pub type IMAGE_NT_HEADERS32 = _IMAGE_NT_HEADERS; +pub type PIMAGE_NT_HEADERS32 = *mut _IMAGE_NT_HEADERS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ROM_HEADERS { + pub FileHeader: IMAGE_FILE_HEADER, + pub OptionalHeader: IMAGE_ROM_OPTIONAL_HEADER, +} +pub type IMAGE_ROM_HEADERS = _IMAGE_ROM_HEADERS; +pub type PIMAGE_ROM_HEADERS = *mut _IMAGE_ROM_HEADERS; +pub type IMAGE_NT_HEADERS = IMAGE_NT_HEADERS64; +pub type PIMAGE_NT_HEADERS = PIMAGE_NT_HEADERS64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ANON_OBJECT_HEADER { + pub Sig1: WORD, + pub Sig2: WORD, + pub Version: WORD, + pub Machine: WORD, + pub TimeDateStamp: DWORD, + pub ClassID: CLSID, + pub SizeOfData: DWORD, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ANON_OBJECT_HEADER_V2 { + pub Sig1: WORD, + pub Sig2: WORD, + pub Version: WORD, + pub Machine: WORD, + pub TimeDateStamp: DWORD, + pub ClassID: CLSID, + pub SizeOfData: DWORD, + pub Flags: DWORD, + pub MetaDataSize: DWORD, + pub MetaDataOffset: DWORD, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ANON_OBJECT_HEADER_BIGOBJ { + pub Sig1: WORD, + pub Sig2: WORD, + pub Version: WORD, + pub Machine: WORD, + pub TimeDateStamp: DWORD, + pub ClassID: CLSID, + pub SizeOfData: DWORD, + pub Flags: DWORD, + pub MetaDataSize: DWORD, + pub MetaDataOffset: DWORD, + pub NumberOfSections: DWORD, + pub PointerToSymbolTable: DWORD, + pub NumberOfSymbols: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_SECTION_HEADER { + pub Name: [BYTE; 8usize], + pub Misc: _IMAGE_SECTION_HEADER__bindgen_ty_1, + pub VirtualAddress: DWORD, + pub SizeOfRawData: DWORD, + pub PointerToRawData: DWORD, + pub PointerToRelocations: DWORD, + pub PointerToLinenumbers: DWORD, + pub NumberOfRelocations: WORD, + pub NumberOfLinenumbers: WORD, + pub Characteristics: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_SECTION_HEADER__bindgen_ty_1 { + pub PhysicalAddress: DWORD, + pub VirtualSize: DWORD, + _bindgen_union_align: u32, +} +pub type IMAGE_SECTION_HEADER = _IMAGE_SECTION_HEADER; +pub type PIMAGE_SECTION_HEADER = *mut _IMAGE_SECTION_HEADER; +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub struct _IMAGE_SYMBOL { + pub N: _IMAGE_SYMBOL__bindgen_ty_1, + pub Value: DWORD, + pub SectionNumber: SHORT, + pub Type: WORD, + pub StorageClass: BYTE, + pub NumberOfAuxSymbols: BYTE, +} +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub union _IMAGE_SYMBOL__bindgen_ty_1 { + pub ShortName: [BYTE; 8usize], + pub Name: _IMAGE_SYMBOL__bindgen_ty_1__bindgen_ty_1, + pub LongName: [DWORD; 2usize], + _bindgen_union_align: [u16; 4usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_SYMBOL__bindgen_ty_1__bindgen_ty_1 { + pub Short: DWORD, + pub Long: DWORD, +} +pub type IMAGE_SYMBOL = _IMAGE_SYMBOL; +pub type PIMAGE_SYMBOL = *mut IMAGE_SYMBOL; +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub struct _IMAGE_SYMBOL_EX { + pub N: _IMAGE_SYMBOL_EX__bindgen_ty_1, + pub Value: DWORD, + pub SectionNumber: LONG, + pub Type: WORD, + pub StorageClass: BYTE, + pub NumberOfAuxSymbols: BYTE, +} +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub union _IMAGE_SYMBOL_EX__bindgen_ty_1 { + pub ShortName: [BYTE; 8usize], + pub Name: _IMAGE_SYMBOL_EX__bindgen_ty_1__bindgen_ty_1, + pub LongName: [DWORD; 2usize], + _bindgen_union_align: [u16; 4usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_SYMBOL_EX__bindgen_ty_1__bindgen_ty_1 { + pub Short: DWORD, + pub Long: DWORD, +} +pub type IMAGE_SYMBOL_EX = _IMAGE_SYMBOL_EX; +pub type PIMAGE_SYMBOL_EX = *mut _IMAGE_SYMBOL_EX; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct IMAGE_AUX_SYMBOL_TOKEN_DEF { + pub bAuxType: BYTE, + pub bReserved: BYTE, + pub SymbolTableIndex: DWORD, + pub rgbReserved: [BYTE; 12usize], +} +pub type PIMAGE_AUX_SYMBOL_TOKEN_DEF = *mut IMAGE_AUX_SYMBOL_TOKEN_DEF; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_AUX_SYMBOL { + pub Sym: _IMAGE_AUX_SYMBOL__bindgen_ty_1, + pub File: _IMAGE_AUX_SYMBOL__bindgen_ty_2, + pub Section: _IMAGE_AUX_SYMBOL__bindgen_ty_3, + pub TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF, + pub CRC: _IMAGE_AUX_SYMBOL__bindgen_ty_4, + _bindgen_union_align: [u16; 9usize], +} +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_1 { + pub TagIndex: DWORD, + pub Misc: _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_1, + pub FcnAry: _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_2, + pub TvIndex: WORD, +} +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub union _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_1 { + pub LnSz: _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1, + pub TotalSize: DWORD, + _bindgen_union_align: [u16; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + pub Linenumber: WORD, + pub Size: WORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_2 { + pub Function: _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1, + pub Array: _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_2__bindgen_ty_2, + _bindgen_union_align: [u16; 4usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_2__bindgen_ty_1 { + pub PointerToLinenumber: DWORD, + pub PointerToNextFunction: DWORD, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_1__bindgen_ty_2__bindgen_ty_2 { + pub Dimension: [WORD; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_2 { + pub Name: [BYTE; 18usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_3 { + pub Length: DWORD, + pub NumberOfRelocations: WORD, + pub NumberOfLinenumbers: WORD, + pub CheckSum: DWORD, + pub Number: SHORT, + pub Selection: BYTE, +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL__bindgen_ty_4 { + pub crc: DWORD, + pub rgbReserved: [BYTE; 14usize], +} +pub type IMAGE_AUX_SYMBOL = _IMAGE_AUX_SYMBOL; +pub type PIMAGE_AUX_SYMBOL = *mut _IMAGE_AUX_SYMBOL; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_AUX_SYMBOL_EX { + pub Sym: _IMAGE_AUX_SYMBOL_EX__bindgen_ty_1, + pub File: _IMAGE_AUX_SYMBOL_EX__bindgen_ty_2, + pub Section: _IMAGE_AUX_SYMBOL_EX__bindgen_ty_3, + pub __bindgen_anon_1: _IMAGE_AUX_SYMBOL_EX__bindgen_ty_4, + pub CRC: _IMAGE_AUX_SYMBOL_EX__bindgen_ty_5, + _bindgen_union_align: [u16; 10usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL_EX__bindgen_ty_1 { + pub WeakDefaultSymIndex: DWORD, + pub WeakSearchType: DWORD, + pub rgbReserved: [BYTE; 12usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL_EX__bindgen_ty_2 { + pub Name: [BYTE; 20usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL_EX__bindgen_ty_3 { + pub Length: DWORD, + pub NumberOfRelocations: WORD, + pub NumberOfLinenumbers: WORD, + pub CheckSum: DWORD, + pub Number: SHORT, + pub Selection: BYTE, + pub bReserved: BYTE, + pub HighNumber: SHORT, + pub rgbReserved: [BYTE; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL_EX__bindgen_ty_4 { + pub TokenDef: IMAGE_AUX_SYMBOL_TOKEN_DEF, + pub rgbReserved: [BYTE; 2usize], +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_AUX_SYMBOL_EX__bindgen_ty_5 { + pub crc: DWORD, + pub rgbReserved: [BYTE; 16usize], +} +pub type IMAGE_AUX_SYMBOL_EX = _IMAGE_AUX_SYMBOL_EX; +pub type PIMAGE_AUX_SYMBOL_EX = *mut _IMAGE_AUX_SYMBOL_EX; +pub const IMAGE_AUX_SYMBOL_TYPE_IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF: IMAGE_AUX_SYMBOL_TYPE = 1; +pub type IMAGE_AUX_SYMBOL_TYPE = u32; +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub struct _IMAGE_RELOCATION { + pub __bindgen_anon_1: _IMAGE_RELOCATION__bindgen_ty_1, + pub SymbolTableIndex: DWORD, + pub Type: WORD, +} +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub union _IMAGE_RELOCATION__bindgen_ty_1 { + pub VirtualAddress: DWORD, + pub RelocCount: DWORD, + _bindgen_union_align: [u16; 2usize], +} +pub type IMAGE_RELOCATION = _IMAGE_RELOCATION; +pub type PIMAGE_RELOCATION = *mut IMAGE_RELOCATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_LINENUMBER { + pub Type: _IMAGE_LINENUMBER__bindgen_ty_1, + pub Linenumber: WORD, +} +#[repr(C, packed(2))] +#[derive(Copy, Clone)] +pub union _IMAGE_LINENUMBER__bindgen_ty_1 { + pub SymbolTableIndex: DWORD, + pub VirtualAddress: DWORD, + _bindgen_union_align: [u16; 2usize], +} +pub type IMAGE_LINENUMBER = _IMAGE_LINENUMBER; +pub type PIMAGE_LINENUMBER = *mut IMAGE_LINENUMBER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_BASE_RELOCATION { + pub VirtualAddress: DWORD, + pub SizeOfBlock: DWORD, +} +pub type IMAGE_BASE_RELOCATION = _IMAGE_BASE_RELOCATION; +pub type PIMAGE_BASE_RELOCATION = *mut IMAGE_BASE_RELOCATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ARCHIVE_MEMBER_HEADER { + pub Name: [BYTE; 16usize], + pub Date: [BYTE; 12usize], + pub UserID: [BYTE; 6usize], + pub GroupID: [BYTE; 6usize], + pub Mode: [BYTE; 8usize], + pub Size: [BYTE; 10usize], + pub EndHeader: [BYTE; 2usize], +} +pub type IMAGE_ARCHIVE_MEMBER_HEADER = _IMAGE_ARCHIVE_MEMBER_HEADER; +pub type PIMAGE_ARCHIVE_MEMBER_HEADER = *mut _IMAGE_ARCHIVE_MEMBER_HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_EXPORT_DIRECTORY { + pub Characteristics: DWORD, + pub TimeDateStamp: DWORD, + pub MajorVersion: WORD, + pub MinorVersion: WORD, + pub Name: DWORD, + pub Base: DWORD, + pub NumberOfFunctions: DWORD, + pub NumberOfNames: DWORD, + pub AddressOfFunctions: DWORD, + pub AddressOfNames: DWORD, + pub AddressOfNameOrdinals: DWORD, +} +pub type IMAGE_EXPORT_DIRECTORY = _IMAGE_EXPORT_DIRECTORY; +pub type PIMAGE_EXPORT_DIRECTORY = *mut _IMAGE_EXPORT_DIRECTORY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_IMPORT_BY_NAME { + pub Hint: WORD, + pub Name: [CHAR; 1usize], +} +pub type IMAGE_IMPORT_BY_NAME = _IMAGE_IMPORT_BY_NAME; +pub type PIMAGE_IMPORT_BY_NAME = *mut _IMAGE_IMPORT_BY_NAME; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_THUNK_DATA64 { + pub u1: _IMAGE_THUNK_DATA64__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_THUNK_DATA64__bindgen_ty_1 { + pub ForwarderString: ULONGLONG, + pub Function: ULONGLONG, + pub Ordinal: ULONGLONG, + pub AddressOfData: ULONGLONG, + _bindgen_union_align: u64, +} +pub type IMAGE_THUNK_DATA64 = _IMAGE_THUNK_DATA64; +pub type PIMAGE_THUNK_DATA64 = *mut IMAGE_THUNK_DATA64; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_THUNK_DATA32 { + pub u1: _IMAGE_THUNK_DATA32__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_THUNK_DATA32__bindgen_ty_1 { + pub ForwarderString: DWORD, + pub Function: DWORD, + pub Ordinal: DWORD, + pub AddressOfData: DWORD, + _bindgen_union_align: u32, +} +pub type IMAGE_THUNK_DATA32 = _IMAGE_THUNK_DATA32; +pub type PIMAGE_THUNK_DATA32 = *mut IMAGE_THUNK_DATA32; +pub type PIMAGE_TLS_CALLBACK = + ::std::option::Option; +#[repr(C, packed(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_TLS_DIRECTORY64 { + pub StartAddressOfRawData: ULONGLONG, + pub EndAddressOfRawData: ULONGLONG, + pub AddressOfIndex: ULONGLONG, + pub AddressOfCallBacks: ULONGLONG, + pub SizeOfZeroFill: DWORD, + pub Characteristics: DWORD, +} +pub type IMAGE_TLS_DIRECTORY64 = _IMAGE_TLS_DIRECTORY64; +pub type PIMAGE_TLS_DIRECTORY64 = *mut IMAGE_TLS_DIRECTORY64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_TLS_DIRECTORY32 { + pub StartAddressOfRawData: DWORD, + pub EndAddressOfRawData: DWORD, + pub AddressOfIndex: DWORD, + pub AddressOfCallBacks: DWORD, + pub SizeOfZeroFill: DWORD, + pub Characteristics: DWORD, +} +pub type IMAGE_TLS_DIRECTORY32 = _IMAGE_TLS_DIRECTORY32; +pub type PIMAGE_TLS_DIRECTORY32 = *mut IMAGE_TLS_DIRECTORY32; +pub type IMAGE_THUNK_DATA = IMAGE_THUNK_DATA64; +pub type PIMAGE_THUNK_DATA = PIMAGE_THUNK_DATA64; +pub type IMAGE_TLS_DIRECTORY = IMAGE_TLS_DIRECTORY64; +pub type PIMAGE_TLS_DIRECTORY = PIMAGE_TLS_DIRECTORY64; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_IMPORT_DESCRIPTOR { + pub __bindgen_anon_1: _IMAGE_IMPORT_DESCRIPTOR__bindgen_ty_1, + pub TimeDateStamp: DWORD, + pub ForwarderChain: DWORD, + pub Name: DWORD, + pub FirstThunk: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_IMPORT_DESCRIPTOR__bindgen_ty_1 { + pub Characteristics: DWORD, + pub OriginalFirstThunk: DWORD, + _bindgen_union_align: u32, +} +pub type IMAGE_IMPORT_DESCRIPTOR = _IMAGE_IMPORT_DESCRIPTOR; +pub type PIMAGE_IMPORT_DESCRIPTOR = *mut IMAGE_IMPORT_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_BOUND_IMPORT_DESCRIPTOR { + pub TimeDateStamp: DWORD, + pub OffsetModuleName: WORD, + pub NumberOfModuleForwarderRefs: WORD, +} +pub type IMAGE_BOUND_IMPORT_DESCRIPTOR = _IMAGE_BOUND_IMPORT_DESCRIPTOR; +pub type PIMAGE_BOUND_IMPORT_DESCRIPTOR = *mut _IMAGE_BOUND_IMPORT_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_BOUND_FORWARDER_REF { + pub TimeDateStamp: DWORD, + pub OffsetModuleName: WORD, + pub Reserved: WORD, +} +pub type IMAGE_BOUND_FORWARDER_REF = _IMAGE_BOUND_FORWARDER_REF; +pub type PIMAGE_BOUND_FORWARDER_REF = *mut _IMAGE_BOUND_FORWARDER_REF; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_DELAYLOAD_DESCRIPTOR { + pub Attributes: _IMAGE_DELAYLOAD_DESCRIPTOR__bindgen_ty_1, + pub DllNameRVA: DWORD, + pub ModuleHandleRVA: DWORD, + pub ImportAddressTableRVA: DWORD, + pub ImportNameTableRVA: DWORD, + pub BoundImportAddressTableRVA: DWORD, + pub UnloadInformationTableRVA: DWORD, + pub TimeDateStamp: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_DELAYLOAD_DESCRIPTOR__bindgen_ty_1 { + pub AllAttributes: DWORD, + pub __bindgen_anon_1: _IMAGE_DELAYLOAD_DESCRIPTOR__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_DELAYLOAD_DESCRIPTOR__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _IMAGE_DELAYLOAD_DESCRIPTOR__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn RvaBased(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_RvaBased(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn ReservedAttributes(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 31u8) as u32) } + } + #[inline] + pub fn set_ReservedAttributes(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 31u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + RvaBased: DWORD, + ReservedAttributes: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let RvaBased: u32 = unsafe { ::std::mem::transmute(RvaBased) }; + RvaBased as u64 + }); + __bindgen_bitfield_unit.set(1usize, 31u8, { + let ReservedAttributes: u32 = unsafe { ::std::mem::transmute(ReservedAttributes) }; + ReservedAttributes as u64 + }); + __bindgen_bitfield_unit + } +} +pub type IMAGE_DELAYLOAD_DESCRIPTOR = _IMAGE_DELAYLOAD_DESCRIPTOR; +pub type PIMAGE_DELAYLOAD_DESCRIPTOR = *mut _IMAGE_DELAYLOAD_DESCRIPTOR; +pub type PCIMAGE_DELAYLOAD_DESCRIPTOR = *const IMAGE_DELAYLOAD_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_RESOURCE_DIRECTORY { + pub Characteristics: DWORD, + pub TimeDateStamp: DWORD, + pub MajorVersion: WORD, + pub MinorVersion: WORD, + pub NumberOfNamedEntries: WORD, + pub NumberOfIdEntries: WORD, +} +pub type IMAGE_RESOURCE_DIRECTORY = _IMAGE_RESOURCE_DIRECTORY; +pub type PIMAGE_RESOURCE_DIRECTORY = *mut _IMAGE_RESOURCE_DIRECTORY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { + pub __bindgen_anon_1: _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_1, + pub __bindgen_anon_2: _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_1 { + pub __bindgen_anon_1: _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_1__bindgen_ty_1, + pub Name: DWORD, + pub Id: WORD, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn NameOffset(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) } + } + #[inline] + pub fn set_NameOffset(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 31u8, val as u64) + } + } + #[inline] + pub fn NameIsString(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } + } + #[inline] + pub fn set_NameIsString(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(31usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + NameOffset: DWORD, + NameIsString: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 31u8, { + let NameOffset: u32 = unsafe { ::std::mem::transmute(NameOffset) }; + NameOffset as u64 + }); + __bindgen_bitfield_unit.set(31usize, 1u8, { + let NameIsString: u32 = unsafe { ::std::mem::transmute(NameIsString) }; + NameIsString as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_2 { + pub OffsetToData: DWORD, + pub __bindgen_anon_1: _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_2__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_2__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _IMAGE_RESOURCE_DIRECTORY_ENTRY__bindgen_ty_2__bindgen_ty_1 { + #[inline] + pub fn OffsetToDirectory(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 31u8) as u32) } + } + #[inline] + pub fn set_OffsetToDirectory(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 31u8, val as u64) + } + } + #[inline] + pub fn DataIsDirectory(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } + } + #[inline] + pub fn set_DataIsDirectory(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(31usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + OffsetToDirectory: DWORD, + DataIsDirectory: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 31u8, { + let OffsetToDirectory: u32 = unsafe { ::std::mem::transmute(OffsetToDirectory) }; + OffsetToDirectory as u64 + }); + __bindgen_bitfield_unit.set(31usize, 1u8, { + let DataIsDirectory: u32 = unsafe { ::std::mem::transmute(DataIsDirectory) }; + DataIsDirectory as u64 + }); + __bindgen_bitfield_unit + } +} +pub type IMAGE_RESOURCE_DIRECTORY_ENTRY = _IMAGE_RESOURCE_DIRECTORY_ENTRY; +pub type PIMAGE_RESOURCE_DIRECTORY_ENTRY = *mut _IMAGE_RESOURCE_DIRECTORY_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_RESOURCE_DIRECTORY_STRING { + pub Length: WORD, + pub NameString: [CHAR; 1usize], +} +pub type IMAGE_RESOURCE_DIRECTORY_STRING = _IMAGE_RESOURCE_DIRECTORY_STRING; +pub type PIMAGE_RESOURCE_DIRECTORY_STRING = *mut _IMAGE_RESOURCE_DIRECTORY_STRING; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_RESOURCE_DIR_STRING_U { + pub Length: WORD, + pub NameString: [WCHAR; 1usize], +} +pub type IMAGE_RESOURCE_DIR_STRING_U = _IMAGE_RESOURCE_DIR_STRING_U; +pub type PIMAGE_RESOURCE_DIR_STRING_U = *mut _IMAGE_RESOURCE_DIR_STRING_U; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_RESOURCE_DATA_ENTRY { + pub OffsetToData: DWORD, + pub Size: DWORD, + pub CodePage: DWORD, + pub Reserved: DWORD, +} +pub type IMAGE_RESOURCE_DATA_ENTRY = _IMAGE_RESOURCE_DATA_ENTRY; +pub type PIMAGE_RESOURCE_DATA_ENTRY = *mut _IMAGE_RESOURCE_DATA_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct IMAGE_LOAD_CONFIG_DIRECTORY32 { + pub Size: DWORD, + pub TimeDateStamp: DWORD, + pub MajorVersion: WORD, + pub MinorVersion: WORD, + pub GlobalFlagsClear: DWORD, + pub GlobalFlagsSet: DWORD, + pub CriticalSectionDefaultTimeout: DWORD, + pub DeCommitFreeBlockThreshold: DWORD, + pub DeCommitTotalFreeThreshold: DWORD, + pub LockPrefixTable: DWORD, + pub MaximumAllocationSize: DWORD, + pub VirtualMemoryThreshold: DWORD, + pub ProcessHeapFlags: DWORD, + pub ProcessAffinityMask: DWORD, + pub CSDVersion: WORD, + pub Reserved1: WORD, + pub EditList: DWORD, + pub SecurityCookie: DWORD, + pub SEHandlerTable: DWORD, + pub SEHandlerCount: DWORD, +} +pub type PIMAGE_LOAD_CONFIG_DIRECTORY32 = *mut IMAGE_LOAD_CONFIG_DIRECTORY32; +#[repr(C, packed(4))] +#[derive(Debug, Copy, Clone)] +pub struct IMAGE_LOAD_CONFIG_DIRECTORY64 { + pub Size: DWORD, + pub TimeDateStamp: DWORD, + pub MajorVersion: WORD, + pub MinorVersion: WORD, + pub GlobalFlagsClear: DWORD, + pub GlobalFlagsSet: DWORD, + pub CriticalSectionDefaultTimeout: DWORD, + pub DeCommitFreeBlockThreshold: ULONGLONG, + pub DeCommitTotalFreeThreshold: ULONGLONG, + pub LockPrefixTable: ULONGLONG, + pub MaximumAllocationSize: ULONGLONG, + pub VirtualMemoryThreshold: ULONGLONG, + pub ProcessAffinityMask: ULONGLONG, + pub ProcessHeapFlags: DWORD, + pub CSDVersion: WORD, + pub Reserved1: WORD, + pub EditList: ULONGLONG, + pub SecurityCookie: ULONGLONG, + pub SEHandlerTable: ULONGLONG, + pub SEHandlerCount: ULONGLONG, +} +pub type PIMAGE_LOAD_CONFIG_DIRECTORY64 = *mut IMAGE_LOAD_CONFIG_DIRECTORY64; +pub type IMAGE_LOAD_CONFIG_DIRECTORY = IMAGE_LOAD_CONFIG_DIRECTORY64; +pub type PIMAGE_LOAD_CONFIG_DIRECTORY = PIMAGE_LOAD_CONFIG_DIRECTORY64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_CE_RUNTIME_FUNCTION_ENTRY { + pub FuncStart: DWORD, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _IMAGE_CE_RUNTIME_FUNCTION_ENTRY { + #[inline] + pub fn PrologLen(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_PrologLen(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn FuncLen(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 22u8) as u32) } + } + #[inline] + pub fn set_FuncLen(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 22u8, val as u64) + } + } + #[inline] + pub fn ThirtyTwoBit(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u32) } + } + #[inline] + pub fn set_ThirtyTwoBit(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(30usize, 1u8, val as u64) + } + } + #[inline] + pub fn ExceptionFlag(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u32) } + } + #[inline] + pub fn set_ExceptionFlag(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(31usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + PrologLen: DWORD, + FuncLen: DWORD, + ThirtyTwoBit: DWORD, + ExceptionFlag: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let PrologLen: u32 = unsafe { ::std::mem::transmute(PrologLen) }; + PrologLen as u64 + }); + __bindgen_bitfield_unit.set(8usize, 22u8, { + let FuncLen: u32 = unsafe { ::std::mem::transmute(FuncLen) }; + FuncLen as u64 + }); + __bindgen_bitfield_unit.set(30usize, 1u8, { + let ThirtyTwoBit: u32 = unsafe { ::std::mem::transmute(ThirtyTwoBit) }; + ThirtyTwoBit as u64 + }); + __bindgen_bitfield_unit.set(31usize, 1u8, { + let ExceptionFlag: u32 = unsafe { ::std::mem::transmute(ExceptionFlag) }; + ExceptionFlag as u64 + }); + __bindgen_bitfield_unit + } +} +pub type IMAGE_CE_RUNTIME_FUNCTION_ENTRY = _IMAGE_CE_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_CE_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_CE_RUNTIME_FUNCTION_ENTRY; +#[repr(C, packed(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY { + pub BeginAddress: ULONGLONG, + pub EndAddress: ULONGLONG, + pub ExceptionHandler: ULONGLONG, + pub HandlerData: ULONGLONG, + pub PrologEndAddress: ULONGLONG, +} +pub type IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = _IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY { + pub BeginAddress: DWORD, + pub EndAddress: DWORD, + pub ExceptionHandler: DWORD, + pub HandlerData: DWORD, + pub PrologEndAddress: DWORD, +} +pub type IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY { + pub BeginAddress: DWORD, + pub __bindgen_anon_1: _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1 { + pub UnwindData: DWORD, + pub __bindgen_anon_1: _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>, +} +impl _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn Flag(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) } + } + #[inline] + pub fn set_Flag(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 2u8, val as u64) + } + } + #[inline] + pub fn FunctionLength(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 11u8) as u32) } + } + #[inline] + pub fn set_FunctionLength(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 11u8, val as u64) + } + } + #[inline] + pub fn Ret(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 2u8) as u32) } + } + #[inline] + pub fn set_Ret(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 2u8, val as u64) + } + } + #[inline] + pub fn H(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) } + } + #[inline] + pub fn set_H(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reg(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 3u8) as u32) } + } + #[inline] + pub fn set_Reg(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 3u8, val as u64) + } + } + #[inline] + pub fn R(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u32) } + } + #[inline] + pub fn set_R(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub fn L(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) } + } + #[inline] + pub fn set_L(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub fn C(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) } + } + #[inline] + pub fn set_C(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub fn StackAdjust(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 10u8) as u32) } + } + #[inline] + pub fn set_StackAdjust(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 10u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + Flag: DWORD, + FunctionLength: DWORD, + Ret: DWORD, + H: DWORD, + Reg: DWORD, + R: DWORD, + L: DWORD, + C: DWORD, + StackAdjust: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 2u8, { + let Flag: u32 = unsafe { ::std::mem::transmute(Flag) }; + Flag as u64 + }); + __bindgen_bitfield_unit.set(2usize, 11u8, { + let FunctionLength: u32 = unsafe { ::std::mem::transmute(FunctionLength) }; + FunctionLength as u64 + }); + __bindgen_bitfield_unit.set(13usize, 2u8, { + let Ret: u32 = unsafe { ::std::mem::transmute(Ret) }; + Ret as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let H: u32 = unsafe { ::std::mem::transmute(H) }; + H as u64 + }); + __bindgen_bitfield_unit.set(16usize, 3u8, { + let Reg: u32 = unsafe { ::std::mem::transmute(Reg) }; + Reg as u64 + }); + __bindgen_bitfield_unit.set(19usize, 1u8, { + let R: u32 = unsafe { ::std::mem::transmute(R) }; + R as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let L: u32 = unsafe { ::std::mem::transmute(L) }; + L as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let C: u32 = unsafe { ::std::mem::transmute(C) }; + C as u64 + }); + __bindgen_bitfield_unit.set(22usize, 10u8, { + let StackAdjust: u32 = unsafe { ::std::mem::transmute(StackAdjust) }; + StackAdjust as u64 + }); + __bindgen_bitfield_unit + } +} +pub type IMAGE_ARM_RUNTIME_FUNCTION_ENTRY = _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_ARM_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY { + pub BeginAddress: DWORD, + pub __bindgen_anon_1: _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1 { + pub UnwindData: DWORD, + pub __bindgen_anon_1: _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>, +} +impl _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn Flag(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) } + } + #[inline] + pub fn set_Flag(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 2u8, val as u64) + } + } + #[inline] + pub fn FunctionLength(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 11u8) as u32) } + } + #[inline] + pub fn set_FunctionLength(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 11u8, val as u64) + } + } + #[inline] + pub fn RegF(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u32) } + } + #[inline] + pub fn set_RegF(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 3u8, val as u64) + } + } + #[inline] + pub fn RegI(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) } + } + #[inline] + pub fn set_RegI(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 4u8, val as u64) + } + } + #[inline] + pub fn H(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) } + } + #[inline] + pub fn set_H(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub fn CR(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 2u8) as u32) } + } + #[inline] + pub fn set_CR(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 2u8, val as u64) + } + } + #[inline] + pub fn FrameSize(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 9u8) as u32) } + } + #[inline] + pub fn set_FrameSize(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 9u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + Flag: DWORD, + FunctionLength: DWORD, + RegF: DWORD, + RegI: DWORD, + H: DWORD, + CR: DWORD, + FrameSize: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 2u8, { + let Flag: u32 = unsafe { ::std::mem::transmute(Flag) }; + Flag as u64 + }); + __bindgen_bitfield_unit.set(2usize, 11u8, { + let FunctionLength: u32 = unsafe { ::std::mem::transmute(FunctionLength) }; + FunctionLength as u64 + }); + __bindgen_bitfield_unit.set(13usize, 3u8, { + let RegF: u32 = unsafe { ::std::mem::transmute(RegF) }; + RegF as u64 + }); + __bindgen_bitfield_unit.set(16usize, 4u8, { + let RegI: u32 = unsafe { ::std::mem::transmute(RegI) }; + RegI as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let H: u32 = unsafe { ::std::mem::transmute(H) }; + H as u64 + }); + __bindgen_bitfield_unit.set(21usize, 2u8, { + let CR: u32 = unsafe { ::std::mem::transmute(CR) }; + CR as u64 + }); + __bindgen_bitfield_unit.set(23usize, 9u8, { + let FrameSize: u32 = unsafe { ::std::mem::transmute(FrameSize) }; + FrameSize as u64 + }); + __bindgen_bitfield_unit + } +} +pub type IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _IMAGE_RUNTIME_FUNCTION_ENTRY { + pub BeginAddress: DWORD, + pub EndAddress: DWORD, + pub __bindgen_anon_1: _IMAGE_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _IMAGE_RUNTIME_FUNCTION_ENTRY__bindgen_ty_1 { + pub UnwindInfoAddress: DWORD, + pub UnwindData: DWORD, + _bindgen_union_align: u32, +} +pub type _PIMAGE_RUNTIME_FUNCTION_ENTRY = *mut _IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type IMAGE_IA64_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_IA64_RUNTIME_FUNCTION_ENTRY = _PIMAGE_RUNTIME_FUNCTION_ENTRY; +pub type IMAGE_RUNTIME_FUNCTION_ENTRY = _IMAGE_RUNTIME_FUNCTION_ENTRY; +pub type PIMAGE_RUNTIME_FUNCTION_ENTRY = _PIMAGE_RUNTIME_FUNCTION_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_DEBUG_DIRECTORY { + pub Characteristics: DWORD, + pub TimeDateStamp: DWORD, + pub MajorVersion: WORD, + pub MinorVersion: WORD, + pub Type: DWORD, + pub SizeOfData: DWORD, + pub AddressOfRawData: DWORD, + pub PointerToRawData: DWORD, +} +pub type IMAGE_DEBUG_DIRECTORY = _IMAGE_DEBUG_DIRECTORY; +pub type PIMAGE_DEBUG_DIRECTORY = *mut _IMAGE_DEBUG_DIRECTORY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_COFF_SYMBOLS_HEADER { + pub NumberOfSymbols: DWORD, + pub LvaToFirstSymbol: DWORD, + pub NumberOfLinenumbers: DWORD, + pub LvaToFirstLinenumber: DWORD, + pub RvaToFirstByteOfCode: DWORD, + pub RvaToLastByteOfCode: DWORD, + pub RvaToFirstByteOfData: DWORD, + pub RvaToLastByteOfData: DWORD, +} +pub type IMAGE_COFF_SYMBOLS_HEADER = _IMAGE_COFF_SYMBOLS_HEADER; +pub type PIMAGE_COFF_SYMBOLS_HEADER = *mut _IMAGE_COFF_SYMBOLS_HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FPO_DATA { + pub ulOffStart: DWORD, + pub cbProcSize: DWORD, + pub cdwLocals: DWORD, + pub cdwParams: WORD, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>, +} +impl _FPO_DATA { + #[inline] + pub fn cbProlog(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u16) } + } + #[inline] + pub fn set_cbProlog(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn cbRegs(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 3u8) as u16) } + } + #[inline] + pub fn set_cbRegs(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 3u8, val as u64) + } + } + #[inline] + pub fn fHasSEH(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) } + } + #[inline] + pub fn set_fHasSEH(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub fn fUseBP(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) } + } + #[inline] + pub fn set_fUseBP(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub fn reserved(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) } + } + #[inline] + pub fn set_reserved(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub fn cbFrame(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 2u8) as u16) } + } + #[inline] + pub fn set_cbFrame(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 2u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + cbProlog: WORD, + cbRegs: WORD, + fHasSEH: WORD, + fUseBP: WORD, + reserved: WORD, + cbFrame: WORD, + ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let cbProlog: u16 = unsafe { ::std::mem::transmute(cbProlog) }; + cbProlog as u64 + }); + __bindgen_bitfield_unit.set(8usize, 3u8, { + let cbRegs: u16 = unsafe { ::std::mem::transmute(cbRegs) }; + cbRegs as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let fHasSEH: u16 = unsafe { ::std::mem::transmute(fHasSEH) }; + fHasSEH as u64 + }); + __bindgen_bitfield_unit.set(12usize, 1u8, { + let fUseBP: u16 = unsafe { ::std::mem::transmute(fUseBP) }; + fUseBP as u64 + }); + __bindgen_bitfield_unit.set(13usize, 1u8, { + let reserved: u16 = unsafe { ::std::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit.set(14usize, 2u8, { + let cbFrame: u16 = unsafe { ::std::mem::transmute(cbFrame) }; + cbFrame as u64 + }); + __bindgen_bitfield_unit + } +} +pub type FPO_DATA = _FPO_DATA; +pub type PFPO_DATA = *mut _FPO_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_DEBUG_MISC { + pub DataType: DWORD, + pub Length: DWORD, + pub Unicode: BOOLEAN, + pub Reserved: [BYTE; 3usize], + pub Data: [BYTE; 1usize], +} +pub type IMAGE_DEBUG_MISC = _IMAGE_DEBUG_MISC; +pub type PIMAGE_DEBUG_MISC = *mut _IMAGE_DEBUG_MISC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_FUNCTION_ENTRY { + pub StartingAddress: DWORD, + pub EndingAddress: DWORD, + pub EndOfPrologue: DWORD, +} +pub type IMAGE_FUNCTION_ENTRY = _IMAGE_FUNCTION_ENTRY; +pub type PIMAGE_FUNCTION_ENTRY = *mut _IMAGE_FUNCTION_ENTRY; +#[repr(C, packed(4))] +#[derive(Copy, Clone)] +pub struct _IMAGE_FUNCTION_ENTRY64 { + pub StartingAddress: ULONGLONG, + pub EndingAddress: ULONGLONG, + pub __bindgen_anon_1: _IMAGE_FUNCTION_ENTRY64__bindgen_ty_1, +} +#[repr(C, packed(4))] +#[derive(Copy, Clone)] +pub union _IMAGE_FUNCTION_ENTRY64__bindgen_ty_1 { + pub EndOfPrologue: ULONGLONG, + pub UnwindInfoAddress: ULONGLONG, + _bindgen_union_align: [u32; 2usize], +} +pub type IMAGE_FUNCTION_ENTRY64 = _IMAGE_FUNCTION_ENTRY64; +pub type PIMAGE_FUNCTION_ENTRY64 = *mut _IMAGE_FUNCTION_ENTRY64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IMAGE_SEPARATE_DEBUG_HEADER { + pub Signature: WORD, + pub Flags: WORD, + pub Machine: WORD, + pub Characteristics: WORD, + pub TimeDateStamp: DWORD, + pub CheckSum: DWORD, + pub ImageBase: DWORD, + pub SizeOfImage: DWORD, + pub NumberOfSections: DWORD, + pub ExportedNamesSize: DWORD, + pub DebugDirectorySize: DWORD, + pub SectionAlignment: DWORD, + pub Reserved: [DWORD; 2usize], +} +pub type IMAGE_SEPARATE_DEBUG_HEADER = _IMAGE_SEPARATE_DEBUG_HEADER; +pub type PIMAGE_SEPARATE_DEBUG_HEADER = *mut _IMAGE_SEPARATE_DEBUG_HEADER; +#[repr(C, packed(4))] +#[derive(Debug, Copy, Clone)] +pub struct _NON_PAGED_DEBUG_INFO { + pub Signature: WORD, + pub Flags: WORD, + pub Size: DWORD, + pub Machine: WORD, + pub Characteristics: WORD, + pub TimeDateStamp: DWORD, + pub CheckSum: DWORD, + pub SizeOfImage: DWORD, + pub ImageBase: ULONGLONG, +} +pub type NON_PAGED_DEBUG_INFO = _NON_PAGED_DEBUG_INFO; +pub type PNON_PAGED_DEBUG_INFO = *mut _NON_PAGED_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ImageArchitectureHeader { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>, + pub FirstEntryRVA: DWORD, +} +impl _ImageArchitectureHeader { + #[inline] + pub fn AmaskValue(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_AmaskValue(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn Adummy1(&self) -> ::std::os::raw::c_int { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u32) } + } + #[inline] + pub fn set_Adummy1(&mut self, val: ::std::os::raw::c_int) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 7u8, val as u64) + } + } + #[inline] + pub fn AmaskShift(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_AmaskShift(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn Adummy2(&self) -> ::std::os::raw::c_int { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + } + #[inline] + pub fn set_Adummy2(&mut self, val: ::std::os::raw::c_int) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + AmaskValue: ::std::os::raw::c_uint, + Adummy1: ::std::os::raw::c_int, + AmaskShift: ::std::os::raw::c_uint, + Adummy2: ::std::os::raw::c_int, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let AmaskValue: u32 = unsafe { ::std::mem::transmute(AmaskValue) }; + AmaskValue as u64 + }); + __bindgen_bitfield_unit.set(1usize, 7u8, { + let Adummy1: u32 = unsafe { ::std::mem::transmute(Adummy1) }; + Adummy1 as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let AmaskShift: u32 = unsafe { ::std::mem::transmute(AmaskShift) }; + AmaskShift as u64 + }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let Adummy2: u32 = unsafe { ::std::mem::transmute(Adummy2) }; + Adummy2 as u64 + }); + __bindgen_bitfield_unit + } +} +pub type IMAGE_ARCHITECTURE_HEADER = _ImageArchitectureHeader; +pub type PIMAGE_ARCHITECTURE_HEADER = *mut _ImageArchitectureHeader; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ImageArchitectureEntry { + pub FixupInstRVA: DWORD, + pub NewInst: DWORD, +} +pub type IMAGE_ARCHITECTURE_ENTRY = _ImageArchitectureEntry; +pub type PIMAGE_ARCHITECTURE_ENTRY = *mut _ImageArchitectureEntry; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct IMPORT_OBJECT_HEADER { + pub Sig1: WORD, + pub Sig2: WORD, + pub Version: WORD, + pub Machine: WORD, + pub TimeDateStamp: DWORD, + pub SizeOfData: DWORD, + pub __bindgen_anon_1: IMPORT_OBJECT_HEADER__bindgen_ty_1, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u16>, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union IMPORT_OBJECT_HEADER__bindgen_ty_1 { + pub Ordinal: WORD, + pub Hint: WORD, + _bindgen_union_align: u16, +} +impl IMPORT_OBJECT_HEADER { + #[inline] + pub fn Type(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u16) } + } + #[inline] + pub fn set_Type(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 2u8, val as u64) + } + } + #[inline] + pub fn NameType(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 3u8) as u16) } + } + #[inline] + pub fn set_NameType(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 3u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> WORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 11u8) as u16) } + } + #[inline] + pub fn set_Reserved(&mut self, val: WORD) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 11u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + Type: WORD, + NameType: WORD, + Reserved: WORD, + ) -> __BindgenBitfieldUnit<[u8; 2usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 2u8, { + let Type: u16 = unsafe { ::std::mem::transmute(Type) }; + Type as u64 + }); + __bindgen_bitfield_unit.set(2usize, 3u8, { + let NameType: u16 = unsafe { ::std::mem::transmute(NameType) }; + NameType as u64 + }); + __bindgen_bitfield_unit.set(5usize, 11u8, { + let Reserved: u16 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub const IMPORT_OBJECT_TYPE_IMPORT_OBJECT_CODE: IMPORT_OBJECT_TYPE = 0; +pub const IMPORT_OBJECT_TYPE_IMPORT_OBJECT_DATA: IMPORT_OBJECT_TYPE = 1; +pub const IMPORT_OBJECT_TYPE_IMPORT_OBJECT_CONST: IMPORT_OBJECT_TYPE = 2; +pub type IMPORT_OBJECT_TYPE = u32; +pub const IMPORT_OBJECT_NAME_TYPE_IMPORT_OBJECT_ORDINAL: IMPORT_OBJECT_NAME_TYPE = 0; +pub const IMPORT_OBJECT_NAME_TYPE_IMPORT_OBJECT_NAME: IMPORT_OBJECT_NAME_TYPE = 1; +pub const IMPORT_OBJECT_NAME_TYPE_IMPORT_OBJECT_NAME_NO_PREFIX: IMPORT_OBJECT_NAME_TYPE = 2; +pub const IMPORT_OBJECT_NAME_TYPE_IMPORT_OBJECT_NAME_UNDECORATE: IMPORT_OBJECT_NAME_TYPE = 3; +pub type IMPORT_OBJECT_NAME_TYPE = u32; +pub const ReplacesCorHdrNumericDefines_COMIMAGE_FLAGS_ILONLY: ReplacesCorHdrNumericDefines = 1; +pub const ReplacesCorHdrNumericDefines_COMIMAGE_FLAGS_32BITREQUIRED: ReplacesCorHdrNumericDefines = + 2; +pub const ReplacesCorHdrNumericDefines_COMIMAGE_FLAGS_IL_LIBRARY: ReplacesCorHdrNumericDefines = 4; +pub const ReplacesCorHdrNumericDefines_COMIMAGE_FLAGS_STRONGNAMESIGNED: + ReplacesCorHdrNumericDefines = 8; +pub const ReplacesCorHdrNumericDefines_COMIMAGE_FLAGS_TRACKDEBUGDATA: ReplacesCorHdrNumericDefines = + 65536; +pub const ReplacesCorHdrNumericDefines_COR_VERSION_MAJOR_V2: ReplacesCorHdrNumericDefines = 2; +pub const ReplacesCorHdrNumericDefines_COR_VERSION_MAJOR: ReplacesCorHdrNumericDefines = 2; +pub const ReplacesCorHdrNumericDefines_COR_VERSION_MINOR: ReplacesCorHdrNumericDefines = 0; +pub const ReplacesCorHdrNumericDefines_COR_DELETED_NAME_LENGTH: ReplacesCorHdrNumericDefines = 8; +pub const ReplacesCorHdrNumericDefines_COR_VTABLEGAP_NAME_LENGTH: ReplacesCorHdrNumericDefines = 8; +pub const ReplacesCorHdrNumericDefines_NATIVE_TYPE_MAX_CB: ReplacesCorHdrNumericDefines = 1; +pub const ReplacesCorHdrNumericDefines_COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE: + ReplacesCorHdrNumericDefines = 255; +pub const ReplacesCorHdrNumericDefines_IMAGE_COR_MIH_METHODRVA: ReplacesCorHdrNumericDefines = 1; +pub const ReplacesCorHdrNumericDefines_IMAGE_COR_MIH_EHRVA: ReplacesCorHdrNumericDefines = 2; +pub const ReplacesCorHdrNumericDefines_IMAGE_COR_MIH_BASICBLOCK: ReplacesCorHdrNumericDefines = 8; +pub const ReplacesCorHdrNumericDefines_COR_VTABLE_32BIT: ReplacesCorHdrNumericDefines = 1; +pub const ReplacesCorHdrNumericDefines_COR_VTABLE_64BIT: ReplacesCorHdrNumericDefines = 2; +pub const ReplacesCorHdrNumericDefines_COR_VTABLE_FROM_UNMANAGED: ReplacesCorHdrNumericDefines = 4; +pub const ReplacesCorHdrNumericDefines_COR_VTABLE_CALL_MOST_DERIVED: ReplacesCorHdrNumericDefines = + 16; +pub const ReplacesCorHdrNumericDefines_IMAGE_COR_EATJ_THUNK_SIZE: ReplacesCorHdrNumericDefines = 32; +pub const ReplacesCorHdrNumericDefines_MAX_CLASS_NAME: ReplacesCorHdrNumericDefines = 1024; +pub const ReplacesCorHdrNumericDefines_MAX_PACKAGE_NAME: ReplacesCorHdrNumericDefines = 1024; +pub type ReplacesCorHdrNumericDefines = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct IMAGE_COR20_HEADER { + pub cb: DWORD, + pub MajorRuntimeVersion: WORD, + pub MinorRuntimeVersion: WORD, + pub MetaData: IMAGE_DATA_DIRECTORY, + pub Flags: DWORD, + pub __bindgen_anon_1: IMAGE_COR20_HEADER__bindgen_ty_1, + pub Resources: IMAGE_DATA_DIRECTORY, + pub StrongNameSignature: IMAGE_DATA_DIRECTORY, + pub CodeManagerTable: IMAGE_DATA_DIRECTORY, + pub VTableFixups: IMAGE_DATA_DIRECTORY, + pub ExportAddressTableJumps: IMAGE_DATA_DIRECTORY, + pub ManagedNativeHeader: IMAGE_DATA_DIRECTORY, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union IMAGE_COR20_HEADER__bindgen_ty_1 { + pub EntryPointToken: DWORD, + pub EntryPointRVA: DWORD, + _bindgen_union_align: u32, +} +pub type PIMAGE_COR20_HEADER = *mut IMAGE_COR20_HEADER; +extern "C" { + pub fn RtlCaptureStackBackTrace( + FramesToSkip: DWORD, + FramesToCapture: DWORD, + BackTrace: *mut PVOID, + BackTraceHash: PDWORD, + ) -> WORD; +} +extern "C" { + pub fn RtlCaptureContext(ContextRecord: PCONTEXT); +} +extern "C" { + pub fn RtlCompareMemory( + Source1: *const ::std::os::raw::c_void, + Source2: *const ::std::os::raw::c_void, + Length: SIZE_T, + ) -> SIZE_T; +} +extern "C" { + pub fn RtlAddFunctionTable( + FunctionTable: PRUNTIME_FUNCTION, + EntryCount: DWORD, + BaseAddress: DWORD64, + ) -> BOOLEAN; +} +extern "C" { + pub fn RtlDeleteFunctionTable(FunctionTable: PRUNTIME_FUNCTION) -> BOOLEAN; +} +extern "C" { + pub fn RtlInstallFunctionTableCallback( + TableIdentifier: DWORD64, + BaseAddress: DWORD64, + Length: DWORD, + Callback: PGET_RUNTIME_FUNCTION_CALLBACK, + Context: PVOID, + OutOfProcessCallbackDll: PCWSTR, + ) -> BOOLEAN; +} +extern "C" { + pub fn RtlRestoreContext(ContextRecord: PCONTEXT, ExceptionRecord: *mut _EXCEPTION_RECORD); +} +extern "C" { + pub fn RtlVirtualUnwind( + HandlerType: DWORD, + ImageBase: DWORD64, + ControlPc: DWORD64, + FunctionEntry: PRUNTIME_FUNCTION, + ContextRecord: PCONTEXT, + HandlerData: *mut PVOID, + EstablisherFrame: PDWORD64, + ContextPointers: PKNONVOLATILE_CONTEXT_POINTERS, + ) -> PEXCEPTION_ROUTINE; +} +extern "C" { + pub fn RtlUnwind( + TargetFrame: PVOID, + TargetIp: PVOID, + ExceptionRecord: PEXCEPTION_RECORD, + ReturnValue: PVOID, + ); +} +extern "C" { + pub fn RtlPcToFileHeader(PcValue: PVOID, BaseOfImage: *mut PVOID) -> PVOID; +} +extern "C" { + pub fn RtlLookupFunctionEntry( + ControlPc: DWORD64, + ImageBase: PDWORD64, + HistoryTable: PUNWIND_HISTORY_TABLE, + ) -> PRUNTIME_FUNCTION; +} +extern "C" { + pub fn RtlUnwindEx( + TargetFrame: PVOID, + TargetIp: PVOID, + ExceptionRecord: PEXCEPTION_RECORD, + ReturnValue: PVOID, + ContextRecord: PCONTEXT, + HistoryTable: PUNWIND_HISTORY_TABLE, + ); +} +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct _SLIST_ENTRY { + pub Next: *mut _SLIST_ENTRY, + pub __bindgen_padding_0: u64, +} +pub type SLIST_ENTRY = _SLIST_ENTRY; +pub type PSLIST_ENTRY = *mut _SLIST_ENTRY; +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub union _SLIST_HEADER { + pub __bindgen_anon_1: _SLIST_HEADER__bindgen_ty_1, + pub Header8: _SLIST_HEADER__bindgen_ty_2, + pub HeaderX64: _SLIST_HEADER__bindgen_ty_3, + _bindgen_union_align: u128, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SLIST_HEADER__bindgen_ty_1 { + pub Alignment: ULONGLONG, + pub Region: ULONGLONG, +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct _SLIST_HEADER__bindgen_ty_2 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize], u64>, +} +impl _SLIST_HEADER__bindgen_ty_2 { + #[inline] + pub fn Depth(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 16u8) as u64) } + } + #[inline] + pub fn set_Depth(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 16u8, val as u64) + } + } + #[inline] + pub fn Sequence(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 9u8) as u64) } + } + #[inline] + pub fn set_Sequence(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 9u8, val as u64) + } + } + #[inline] + pub fn NextEntry(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 39u8) as u64) } + } + #[inline] + pub fn set_NextEntry(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(25usize, 39u8, val as u64) + } + } + #[inline] + pub fn HeaderType(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(64usize, 1u8) as u64) } + } + #[inline] + pub fn set_HeaderType(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(64usize, 1u8, val as u64) + } + } + #[inline] + pub fn Init(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(65usize, 1u8) as u64) } + } + #[inline] + pub fn set_Init(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(65usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(66usize, 59u8) as u64) } + } + #[inline] + pub fn set_Reserved(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(66usize, 59u8, val as u64) + } + } + #[inline] + pub fn Region(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(125usize, 3u8) as u64) } + } + #[inline] + pub fn set_Region(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(125usize, 3u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + Depth: ULONGLONG, + Sequence: ULONGLONG, + NextEntry: ULONGLONG, + HeaderType: ULONGLONG, + Init: ULONGLONG, + Reserved: ULONGLONG, + Region: ULONGLONG, + ) -> __BindgenBitfieldUnit<[u8; 16usize], u64> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize], u64> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 16u8, { + let Depth: u64 = unsafe { ::std::mem::transmute(Depth) }; + Depth as u64 + }); + __bindgen_bitfield_unit.set(16usize, 9u8, { + let Sequence: u64 = unsafe { ::std::mem::transmute(Sequence) }; + Sequence as u64 + }); + __bindgen_bitfield_unit.set(25usize, 39u8, { + let NextEntry: u64 = unsafe { ::std::mem::transmute(NextEntry) }; + NextEntry as u64 + }); + __bindgen_bitfield_unit.set(64usize, 1u8, { + let HeaderType: u64 = unsafe { ::std::mem::transmute(HeaderType) }; + HeaderType as u64 + }); + __bindgen_bitfield_unit.set(65usize, 1u8, { + let Init: u64 = unsafe { ::std::mem::transmute(Init) }; + Init as u64 + }); + __bindgen_bitfield_unit.set(66usize, 59u8, { + let Reserved: u64 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit.set(125usize, 3u8, { + let Region: u64 = unsafe { ::std::mem::transmute(Region) }; + Region as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct _SLIST_HEADER__bindgen_ty_3 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize], u64>, +} +impl _SLIST_HEADER__bindgen_ty_3 { + #[inline] + pub fn Depth(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 16u8) as u64) } + } + #[inline] + pub fn set_Depth(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 16u8, val as u64) + } + } + #[inline] + pub fn Sequence(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 48u8) as u64) } + } + #[inline] + pub fn set_Sequence(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 48u8, val as u64) + } + } + #[inline] + pub fn HeaderType(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(64usize, 1u8) as u64) } + } + #[inline] + pub fn set_HeaderType(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(64usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(65usize, 3u8) as u64) } + } + #[inline] + pub fn set_Reserved(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(65usize, 3u8, val as u64) + } + } + #[inline] + pub fn NextEntry(&self) -> ULONGLONG { + unsafe { ::std::mem::transmute(self._bitfield_1.get(68usize, 60u8) as u64) } + } + #[inline] + pub fn set_NextEntry(&mut self, val: ULONGLONG) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(68usize, 60u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + Depth: ULONGLONG, + Sequence: ULONGLONG, + HeaderType: ULONGLONG, + Reserved: ULONGLONG, + NextEntry: ULONGLONG, + ) -> __BindgenBitfieldUnit<[u8; 16usize], u64> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize], u64> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 16u8, { + let Depth: u64 = unsafe { ::std::mem::transmute(Depth) }; + Depth as u64 + }); + __bindgen_bitfield_unit.set(16usize, 48u8, { + let Sequence: u64 = unsafe { ::std::mem::transmute(Sequence) }; + Sequence as u64 + }); + __bindgen_bitfield_unit.set(64usize, 1u8, { + let HeaderType: u64 = unsafe { ::std::mem::transmute(HeaderType) }; + HeaderType as u64 + }); + __bindgen_bitfield_unit.set(65usize, 3u8, { + let Reserved: u64 = unsafe { ::std::mem::transmute(Reserved) }; + Reserved as u64 + }); + __bindgen_bitfield_unit.set(68usize, 60u8, { + let NextEntry: u64 = unsafe { ::std::mem::transmute(NextEntry) }; + NextEntry as u64 + }); + __bindgen_bitfield_unit + } +} +pub type SLIST_HEADER = _SLIST_HEADER; +pub type PSLIST_HEADER = *mut _SLIST_HEADER; +extern "C" { + pub fn RtlInitializeSListHead(ListHead: PSLIST_HEADER); +} +extern "C" { + pub fn RtlFirstEntrySList(ListHead: *const SLIST_HEADER) -> PSLIST_ENTRY; +} +extern "C" { + pub fn RtlInterlockedPopEntrySList(ListHead: PSLIST_HEADER) -> PSLIST_ENTRY; +} +extern "C" { + pub fn RtlInterlockedPushEntrySList( + ListHead: PSLIST_HEADER, + ListEntry: PSLIST_ENTRY, + ) -> PSLIST_ENTRY; +} +extern "C" { + pub fn RtlInterlockedPushListSListEx( + ListHead: PSLIST_HEADER, + List: PSLIST_ENTRY, + ListEnd: PSLIST_ENTRY, + Count: DWORD, + ) -> PSLIST_ENTRY; +} +extern "C" { + pub fn RtlInterlockedFlushSList(ListHead: PSLIST_HEADER) -> PSLIST_ENTRY; +} +extern "C" { + pub fn RtlQueryDepthSList(ListHead: PSLIST_HEADER) -> WORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_RUN_ONCE { + pub Ptr: PVOID, +} +pub type RTL_RUN_ONCE = _RTL_RUN_ONCE; +pub type PRTL_RUN_ONCE = *mut _RTL_RUN_ONCE; +pub type PRTL_RUN_ONCE_INIT_FN = ::std::option::Option< + unsafe extern "C" fn(arg1: PRTL_RUN_ONCE, arg2: PVOID, arg3: *mut PVOID) -> DWORD, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_BARRIER { + pub Reserved1: DWORD, + pub Reserved2: DWORD, + pub Reserved3: [ULONG_PTR; 2usize], + pub Reserved4: DWORD, + pub Reserved5: DWORD, +} +pub type RTL_BARRIER = _RTL_BARRIER; +pub type PRTL_BARRIER = *mut _RTL_BARRIER; +extern "C" { + pub fn RtlSecureZeroMemory(ptr: PVOID, cnt: SIZE_T) -> PVOID; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MESSAGE_RESOURCE_ENTRY { + pub Length: WORD, + pub Flags: WORD, + pub Text: [BYTE; 1usize], +} +pub type MESSAGE_RESOURCE_ENTRY = _MESSAGE_RESOURCE_ENTRY; +pub type PMESSAGE_RESOURCE_ENTRY = *mut _MESSAGE_RESOURCE_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MESSAGE_RESOURCE_BLOCK { + pub LowId: DWORD, + pub HighId: DWORD, + pub OffsetToEntries: DWORD, +} +pub type MESSAGE_RESOURCE_BLOCK = _MESSAGE_RESOURCE_BLOCK; +pub type PMESSAGE_RESOURCE_BLOCK = *mut _MESSAGE_RESOURCE_BLOCK; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MESSAGE_RESOURCE_DATA { + pub NumberOfBlocks: DWORD, + pub Blocks: [MESSAGE_RESOURCE_BLOCK; 1usize], +} +pub type MESSAGE_RESOURCE_DATA = _MESSAGE_RESOURCE_DATA; +pub type PMESSAGE_RESOURCE_DATA = *mut _MESSAGE_RESOURCE_DATA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _OSVERSIONINFOA { + pub dwOSVersionInfoSize: DWORD, + pub dwMajorVersion: DWORD, + pub dwMinorVersion: DWORD, + pub dwBuildNumber: DWORD, + pub dwPlatformId: DWORD, + pub szCSDVersion: [CHAR; 128usize], +} +pub type OSVERSIONINFOA = _OSVERSIONINFOA; +pub type POSVERSIONINFOA = *mut _OSVERSIONINFOA; +pub type LPOSVERSIONINFOA = *mut _OSVERSIONINFOA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _OSVERSIONINFOW { + pub dwOSVersionInfoSize: DWORD, + pub dwMajorVersion: DWORD, + pub dwMinorVersion: DWORD, + pub dwBuildNumber: DWORD, + pub dwPlatformId: DWORD, + pub szCSDVersion: [WCHAR; 128usize], +} +pub type OSVERSIONINFOW = _OSVERSIONINFOW; +pub type POSVERSIONINFOW = *mut _OSVERSIONINFOW; +pub type LPOSVERSIONINFOW = *mut _OSVERSIONINFOW; +pub type RTL_OSVERSIONINFOW = _OSVERSIONINFOW; +pub type PRTL_OSVERSIONINFOW = *mut _OSVERSIONINFOW; +pub type OSVERSIONINFO = OSVERSIONINFOA; +pub type POSVERSIONINFO = POSVERSIONINFOA; +pub type LPOSVERSIONINFO = LPOSVERSIONINFOA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _OSVERSIONINFOEXA { + pub dwOSVersionInfoSize: DWORD, + pub dwMajorVersion: DWORD, + pub dwMinorVersion: DWORD, + pub dwBuildNumber: DWORD, + pub dwPlatformId: DWORD, + pub szCSDVersion: [CHAR; 128usize], + pub wServicePackMajor: WORD, + pub wServicePackMinor: WORD, + pub wSuiteMask: WORD, + pub wProductType: BYTE, + pub wReserved: BYTE, +} +pub type OSVERSIONINFOEXA = _OSVERSIONINFOEXA; +pub type POSVERSIONINFOEXA = *mut _OSVERSIONINFOEXA; +pub type LPOSVERSIONINFOEXA = *mut _OSVERSIONINFOEXA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _OSVERSIONINFOEXW { + pub dwOSVersionInfoSize: DWORD, + pub dwMajorVersion: DWORD, + pub dwMinorVersion: DWORD, + pub dwBuildNumber: DWORD, + pub dwPlatformId: DWORD, + pub szCSDVersion: [WCHAR; 128usize], + pub wServicePackMajor: WORD, + pub wServicePackMinor: WORD, + pub wSuiteMask: WORD, + pub wProductType: BYTE, + pub wReserved: BYTE, +} +pub type OSVERSIONINFOEXW = _OSVERSIONINFOEXW; +pub type POSVERSIONINFOEXW = *mut _OSVERSIONINFOEXW; +pub type LPOSVERSIONINFOEXW = *mut _OSVERSIONINFOEXW; +pub type RTL_OSVERSIONINFOEXW = _OSVERSIONINFOEXW; +pub type PRTL_OSVERSIONINFOEXW = *mut _OSVERSIONINFOEXW; +pub type OSVERSIONINFOEX = OSVERSIONINFOEXA; +pub type POSVERSIONINFOEX = POSVERSIONINFOEXA; +pub type LPOSVERSIONINFOEX = LPOSVERSIONINFOEXA; +extern "C" { + pub fn VerSetConditionMask( + ConditionMask: ULONGLONG, + TypeMask: DWORD, + Condition: BYTE, + ) -> ULONGLONG; +} +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadInvalidInfoClass: _RTL_UMS_THREAD_INFO_CLASS = 0; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadUserContext: _RTL_UMS_THREAD_INFO_CLASS = 1; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadPriority: _RTL_UMS_THREAD_INFO_CLASS = 2; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadAffinity: _RTL_UMS_THREAD_INFO_CLASS = 3; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadTeb: _RTL_UMS_THREAD_INFO_CLASS = 4; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadIsSuspended: _RTL_UMS_THREAD_INFO_CLASS = 5; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadIsTerminated: _RTL_UMS_THREAD_INFO_CLASS = 6; +pub const _RTL_UMS_THREAD_INFO_CLASS_UmsThreadMaxInfoClass: _RTL_UMS_THREAD_INFO_CLASS = 7; +pub type _RTL_UMS_THREAD_INFO_CLASS = u32; +pub use self::_RTL_UMS_THREAD_INFO_CLASS as RTL_UMS_THREAD_INFO_CLASS; +pub type PRTL_UMS_THREAD_INFO_CLASS = *mut _RTL_UMS_THREAD_INFO_CLASS; +pub const _RTL_UMS_SCHEDULER_REASON_UmsSchedulerStartup: _RTL_UMS_SCHEDULER_REASON = 0; +pub const _RTL_UMS_SCHEDULER_REASON_UmsSchedulerThreadBlocked: _RTL_UMS_SCHEDULER_REASON = 1; +pub const _RTL_UMS_SCHEDULER_REASON_UmsSchedulerThreadYield: _RTL_UMS_SCHEDULER_REASON = 2; +pub type _RTL_UMS_SCHEDULER_REASON = u32; +pub use self::_RTL_UMS_SCHEDULER_REASON as RTL_UMS_SCHEDULER_REASON; +pub type PRTL_UMS_SCHEDULER_REASON = *mut _RTL_UMS_SCHEDULER_REASON; +pub type RTL_UMS_SCHEDULER_ENTRY_POINT = ::std::option::Option< + unsafe extern "C" fn( + Reason: RTL_UMS_SCHEDULER_REASON, + ActivationPayload: ULONG_PTR, + SchedulerParam: PVOID, + ), +>; +pub type PRTL_UMS_SCHEDULER_ENTRY_POINT = RTL_UMS_SCHEDULER_ENTRY_POINT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_CRITICAL_SECTION_DEBUG { + pub Type: WORD, + pub CreatorBackTraceIndex: WORD, + pub CriticalSection: *mut _RTL_CRITICAL_SECTION, + pub ProcessLocksList: LIST_ENTRY, + pub EntryCount: DWORD, + pub ContentionCount: DWORD, + pub Flags: DWORD, + pub CreatorBackTraceIndexHigh: WORD, + pub SpareWORD: WORD, +} +pub type RTL_CRITICAL_SECTION_DEBUG = _RTL_CRITICAL_SECTION_DEBUG; +pub type PRTL_CRITICAL_SECTION_DEBUG = *mut _RTL_CRITICAL_SECTION_DEBUG; +pub type RTL_RESOURCE_DEBUG = _RTL_CRITICAL_SECTION_DEBUG; +pub type PRTL_RESOURCE_DEBUG = *mut _RTL_CRITICAL_SECTION_DEBUG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_CRITICAL_SECTION { + pub DebugInfo: PRTL_CRITICAL_SECTION_DEBUG, + pub LockCount: LONG, + pub RecursionCount: LONG, + pub OwningThread: HANDLE, + pub LockSemaphore: HANDLE, + pub SpinCount: ULONG_PTR, +} +pub type RTL_CRITICAL_SECTION = _RTL_CRITICAL_SECTION; +pub type PRTL_CRITICAL_SECTION = *mut _RTL_CRITICAL_SECTION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_SRWLOCK { + pub Ptr: PVOID, +} +pub type RTL_SRWLOCK = _RTL_SRWLOCK; +pub type PRTL_SRWLOCK = *mut _RTL_SRWLOCK; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_CONDITION_VARIABLE { + pub Ptr: PVOID, +} +pub type RTL_CONDITION_VARIABLE = _RTL_CONDITION_VARIABLE; +pub type PRTL_CONDITION_VARIABLE = *mut _RTL_CONDITION_VARIABLE; +pub type PAPCFUNC = ::std::option::Option; +pub type PVECTORED_EXCEPTION_HANDLER = + ::std::option::Option LONG>; +pub const _HEAP_INFORMATION_CLASS_HeapCompatibilityInformation: _HEAP_INFORMATION_CLASS = 0; +pub const _HEAP_INFORMATION_CLASS_HeapEnableTerminationOnCorruption: _HEAP_INFORMATION_CLASS = 1; +pub type _HEAP_INFORMATION_CLASS = u32; +pub use self::_HEAP_INFORMATION_CLASS as HEAP_INFORMATION_CLASS; +pub type WORKERCALLBACKFUNC = ::std::option::Option; +pub type APC_CALLBACK_FUNCTION = + ::std::option::Option; +pub type WAITORTIMERCALLBACKFUNC = + ::std::option::Option; +pub type WAITORTIMERCALLBACK = WAITORTIMERCALLBACKFUNC; +pub type PFLS_CALLBACK_FUNCTION = ::std::option::Option; +pub type PSECURE_MEMORY_CACHE_CALLBACK = + ::std::option::Option BOOLEAN>; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_ActivationContextBasicInformation: + _ACTIVATION_CONTEXT_INFO_CLASS = 1; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_ActivationContextDetailedInformation: + _ACTIVATION_CONTEXT_INFO_CLASS = 2; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_AssemblyDetailedInformationInActivationContext: + _ACTIVATION_CONTEXT_INFO_CLASS = 3; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_FileInformationInAssemblyOfAssemblyInActivationContext: + _ACTIVATION_CONTEXT_INFO_CLASS = 4; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_RunlevelInformationInActivationContext: + _ACTIVATION_CONTEXT_INFO_CLASS = 5; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_CompatibilityInformationInActivationContext: + _ACTIVATION_CONTEXT_INFO_CLASS = 6; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_ActivationContextManifestResourceName: + _ACTIVATION_CONTEXT_INFO_CLASS = 7; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_MaxActivationContextInfoClass: + _ACTIVATION_CONTEXT_INFO_CLASS = 8; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_AssemblyDetailedInformationInActivationContxt: + _ACTIVATION_CONTEXT_INFO_CLASS = 3; +pub const _ACTIVATION_CONTEXT_INFO_CLASS_FileInformationInAssemblyOfAssemblyInActivationContxt: + _ACTIVATION_CONTEXT_INFO_CLASS = 4; +pub type _ACTIVATION_CONTEXT_INFO_CLASS = u32; +pub use self::_ACTIVATION_CONTEXT_INFO_CLASS as ACTIVATION_CONTEXT_INFO_CLASS; +pub const ACTCTX_REQUESTED_RUN_LEVEL_ACTCTX_RUN_LEVEL_UNSPECIFIED: ACTCTX_REQUESTED_RUN_LEVEL = 0; +pub const ACTCTX_REQUESTED_RUN_LEVEL_ACTCTX_RUN_LEVEL_AS_INVOKER: ACTCTX_REQUESTED_RUN_LEVEL = 1; +pub const ACTCTX_REQUESTED_RUN_LEVEL_ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE: + ACTCTX_REQUESTED_RUN_LEVEL = 2; +pub const ACTCTX_REQUESTED_RUN_LEVEL_ACTCTX_RUN_LEVEL_REQUIRE_ADMIN: ACTCTX_REQUESTED_RUN_LEVEL = 3; +pub const ACTCTX_REQUESTED_RUN_LEVEL_ACTCTX_RUN_LEVEL_NUMBERS: ACTCTX_REQUESTED_RUN_LEVEL = 4; +pub type ACTCTX_REQUESTED_RUN_LEVEL = u32; +pub const ACTCTX_COMPATIBILITY_ELEMENT_TYPE_ACTCTX_COMPATIBILITY_ELEMENT_TYPE_UNKNOWN: + ACTCTX_COMPATIBILITY_ELEMENT_TYPE = 0; +pub const ACTCTX_COMPATIBILITY_ELEMENT_TYPE_ACTCTX_COMPATIBILITY_ELEMENT_TYPE_OS: + ACTCTX_COMPATIBILITY_ELEMENT_TYPE = 1; +pub const ACTCTX_COMPATIBILITY_ELEMENT_TYPE_ACTCTX_COMPATIBILITY_ELEMENT_TYPE_MITIGATION: + ACTCTX_COMPATIBILITY_ELEMENT_TYPE = 2; +pub type ACTCTX_COMPATIBILITY_ELEMENT_TYPE = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACTIVATION_CONTEXT_QUERY_INDEX { + pub ulAssemblyIndex: DWORD, + pub ulFileIndexInAssembly: DWORD, +} +pub type ACTIVATION_CONTEXT_QUERY_INDEX = _ACTIVATION_CONTEXT_QUERY_INDEX; +pub type PACTIVATION_CONTEXT_QUERY_INDEX = *mut _ACTIVATION_CONTEXT_QUERY_INDEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ASSEMBLY_FILE_DETAILED_INFORMATION { + pub ulFlags: DWORD, + pub ulFilenameLength: DWORD, + pub ulPathLength: DWORD, + pub lpFileName: PCWSTR, + pub lpFilePath: PCWSTR, +} +pub type ASSEMBLY_FILE_DETAILED_INFORMATION = _ASSEMBLY_FILE_DETAILED_INFORMATION; +pub type PASSEMBLY_FILE_DETAILED_INFORMATION = *mut _ASSEMBLY_FILE_DETAILED_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION { + pub ulFlags: DWORD, + pub ulEncodedAssemblyIdentityLength: DWORD, + pub ulManifestPathType: DWORD, + pub ulManifestPathLength: DWORD, + pub liManifestLastWriteTime: LARGE_INTEGER, + pub ulPolicyPathType: DWORD, + pub ulPolicyPathLength: DWORD, + pub liPolicyLastWriteTime: LARGE_INTEGER, + pub ulMetadataSatelliteRosterIndex: DWORD, + pub ulManifestVersionMajor: DWORD, + pub ulManifestVersionMinor: DWORD, + pub ulPolicyVersionMajor: DWORD, + pub ulPolicyVersionMinor: DWORD, + pub ulAssemblyDirectoryNameLength: DWORD, + pub lpAssemblyEncodedAssemblyIdentity: PCWSTR, + pub lpAssemblyManifestPath: PCWSTR, + pub lpAssemblyPolicyPath: PCWSTR, + pub lpAssemblyDirectoryName: PCWSTR, + pub ulFileCount: DWORD, +} +pub type ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = + _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION; +pub type PACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = + *mut _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION { + pub ulFlags: DWORD, + pub RunLevel: ACTCTX_REQUESTED_RUN_LEVEL, + pub UiAccess: DWORD, +} +pub type ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = _ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION; +pub type PACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = *mut _ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _COMPATIBILITY_CONTEXT_ELEMENT { + pub Id: GUID, + pub Type: ACTCTX_COMPATIBILITY_ELEMENT_TYPE, +} +pub type COMPATIBILITY_CONTEXT_ELEMENT = _COMPATIBILITY_CONTEXT_ELEMENT; +pub type PCOMPATIBILITY_CONTEXT_ELEMENT = *mut _COMPATIBILITY_CONTEXT_ELEMENT; +#[repr(C)] +#[derive(Debug)] +pub struct _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION { + pub ElementCount: DWORD, + pub Elements: __IncompleteArrayField, +} +pub type ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = + _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION; +pub type PACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = + *mut _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SUPPORTED_OS_INFO { + pub OsCount: WORD, + pub MitigationExist: WORD, + pub OsList: [WORD; 4usize], +} +pub type SUPPORTED_OS_INFO = _SUPPORTED_OS_INFO; +pub type PSUPPORTED_OS_INFO = *mut _SUPPORTED_OS_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACTIVATION_CONTEXT_DETAILED_INFORMATION { + pub dwFlags: DWORD, + pub ulFormatVersion: DWORD, + pub ulAssemblyCount: DWORD, + pub ulRootManifestPathType: DWORD, + pub ulRootManifestPathChars: DWORD, + pub ulRootConfigurationPathType: DWORD, + pub ulRootConfigurationPathChars: DWORD, + pub ulAppDirPathType: DWORD, + pub ulAppDirPathChars: DWORD, + pub lpRootManifestPath: PCWSTR, + pub lpRootConfigurationPath: PCWSTR, + pub lpAppDirPath: PCWSTR, +} +pub type ACTIVATION_CONTEXT_DETAILED_INFORMATION = _ACTIVATION_CONTEXT_DETAILED_INFORMATION; +pub type PACTIVATION_CONTEXT_DETAILED_INFORMATION = *mut _ACTIVATION_CONTEXT_DETAILED_INFORMATION; +pub type PCACTIVATION_CONTEXT_QUERY_INDEX = *const _ACTIVATION_CONTEXT_QUERY_INDEX; +pub type PCASSEMBLY_FILE_DETAILED_INFORMATION = *const ASSEMBLY_FILE_DETAILED_INFORMATION; +pub type PCACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION = + *const _ACTIVATION_CONTEXT_ASSEMBLY_DETAILED_INFORMATION; +pub type PCACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION = + *const _ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION; +pub type PCCOMPATIBILITY_CONTEXT_ELEMENT = *const _COMPATIBILITY_CONTEXT_ELEMENT; +pub type PCACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION = + *const _ACTIVATION_CONTEXT_COMPATIBILITY_INFORMATION; +pub type PCACTIVATION_CONTEXT_DETAILED_INFORMATION = + *const _ACTIVATION_CONTEXT_DETAILED_INFORMATION; +pub type RTL_VERIFIER_DLL_LOAD_CALLBACK = ::std::option::Option< + unsafe extern "C" fn(DllName: PWSTR, DllBase: PVOID, DllSize: SIZE_T, Reserved: PVOID), +>; +pub type RTL_VERIFIER_DLL_UNLOAD_CALLBACK = ::std::option::Option< + unsafe extern "C" fn(DllName: PWSTR, DllBase: PVOID, DllSize: SIZE_T, Reserved: PVOID), +>; +pub type RTL_VERIFIER_NTDLLHEAPFREE_CALLBACK = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_VERIFIER_THUNK_DESCRIPTOR { + pub ThunkName: PCHAR, + pub ThunkOldAddress: PVOID, + pub ThunkNewAddress: PVOID, +} +pub type RTL_VERIFIER_THUNK_DESCRIPTOR = _RTL_VERIFIER_THUNK_DESCRIPTOR; +pub type PRTL_VERIFIER_THUNK_DESCRIPTOR = *mut _RTL_VERIFIER_THUNK_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_VERIFIER_DLL_DESCRIPTOR { + pub DllName: PWCHAR, + pub DllFlags: DWORD, + pub DllAddress: PVOID, + pub DllThunks: PRTL_VERIFIER_THUNK_DESCRIPTOR, +} +pub type RTL_VERIFIER_DLL_DESCRIPTOR = _RTL_VERIFIER_DLL_DESCRIPTOR; +pub type PRTL_VERIFIER_DLL_DESCRIPTOR = *mut _RTL_VERIFIER_DLL_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RTL_VERIFIER_PROVIDER_DESCRIPTOR { + pub Length: DWORD, + pub ProviderDlls: PRTL_VERIFIER_DLL_DESCRIPTOR, + pub ProviderDllLoadCallback: RTL_VERIFIER_DLL_LOAD_CALLBACK, + pub ProviderDllUnloadCallback: RTL_VERIFIER_DLL_UNLOAD_CALLBACK, + pub VerifierImage: PWSTR, + pub VerifierFlags: DWORD, + pub VerifierDebug: DWORD, + pub RtlpGetStackTraceAddress: PVOID, + pub RtlpDebugPageHeapCreate: PVOID, + pub RtlpDebugPageHeapDestroy: PVOID, + pub ProviderNtdllHeapFreeCallback: RTL_VERIFIER_NTDLLHEAPFREE_CALLBACK, +} +pub type RTL_VERIFIER_PROVIDER_DESCRIPTOR = _RTL_VERIFIER_PROVIDER_DESCRIPTOR; +pub type PRTL_VERIFIER_PROVIDER_DESCRIPTOR = *mut _RTL_VERIFIER_PROVIDER_DESCRIPTOR; +extern "C" { + pub fn RtlApplicationVerifierStop( + Code: ULONG_PTR, + Message: PSTR, + Param1: ULONG_PTR, + Description1: PSTR, + Param2: ULONG_PTR, + Description2: PSTR, + Param3: ULONG_PTR, + Description3: PSTR, + Param4: ULONG_PTR, + Description4: PSTR, + ); +} +extern "C" { + pub fn RtlSetHeapInformation( + HeapHandle: PVOID, + HeapInformationClass: HEAP_INFORMATION_CLASS, + HeapInformation: PVOID, + HeapInformationLength: SIZE_T, + ) -> DWORD; +} +extern "C" { + pub fn RtlQueryHeapInformation( + HeapHandle: PVOID, + HeapInformationClass: HEAP_INFORMATION_CLASS, + HeapInformation: PVOID, + HeapInformationLength: SIZE_T, + ReturnLength: PSIZE_T, + ) -> DWORD; +} +extern "C" { + pub fn RtlMultipleAllocateHeap( + HeapHandle: PVOID, + Flags: DWORD, + Size: SIZE_T, + Count: DWORD, + Array: *mut PVOID, + ) -> DWORD; +} +extern "C" { + pub fn RtlMultipleFreeHeap( + HeapHandle: PVOID, + Flags: DWORD, + Count: DWORD, + Array: *mut PVOID, + ) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _HARDWARE_COUNTER_DATA { + pub Type: HARDWARE_COUNTER_TYPE, + pub Reserved: DWORD, + pub Value: DWORD64, +} +pub type HARDWARE_COUNTER_DATA = _HARDWARE_COUNTER_DATA; +pub type PHARDWARE_COUNTER_DATA = *mut _HARDWARE_COUNTER_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PERFORMANCE_DATA { + pub Size: WORD, + pub Version: BYTE, + pub HwCountersCount: BYTE, + pub ContextSwitchCount: DWORD, + pub WaitReasonBitMap: DWORD64, + pub CycleTime: DWORD64, + pub RetryCount: DWORD, + pub Reserved: DWORD, + pub HwCounters: [HARDWARE_COUNTER_DATA; 16usize], +} +pub type PERFORMANCE_DATA = _PERFORMANCE_DATA; +pub type PPERFORMANCE_DATA = *mut _PERFORMANCE_DATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EVENTLOGRECORD { + pub Length: DWORD, + pub Reserved: DWORD, + pub RecordNumber: DWORD, + pub TimeGenerated: DWORD, + pub TimeWritten: DWORD, + pub EventID: DWORD, + pub EventType: WORD, + pub NumStrings: WORD, + pub EventCategory: WORD, + pub ReservedFlags: WORD, + pub ClosingRecordNumber: DWORD, + pub StringOffset: DWORD, + pub UserSidLength: DWORD, + pub UserSidOffset: DWORD, + pub DataLength: DWORD, + pub DataOffset: DWORD, +} +pub type EVENTLOGRECORD = _EVENTLOGRECORD; +pub type PEVENTLOGRECORD = *mut _EVENTLOGRECORD; +#[repr(C)] +pub struct _EVENTSFORLOGFILE { + pub ulSize: DWORD, + pub szLogicalLogFile: [WCHAR; 256usize], + pub ulNumRecords: DWORD, + pub pEventLogRecords: __IncompleteArrayField, +} +pub type EVENTSFORLOGFILE = _EVENTSFORLOGFILE; +pub type PEVENTSFORLOGFILE = *mut _EVENTSFORLOGFILE; +#[repr(C)] +#[derive(Debug)] +pub struct _PACKEDEVENTINFO { + pub ulSize: DWORD, + pub ulNumEventsForLogFile: DWORD, + pub ulOffsets: __IncompleteArrayField, +} +pub type PACKEDEVENTINFO = _PACKEDEVENTINFO; +pub type PPACKEDEVENTINFO = *mut _PACKEDEVENTINFO; +pub const _CM_SERVICE_NODE_TYPE_DriverType: _CM_SERVICE_NODE_TYPE = 1; +pub const _CM_SERVICE_NODE_TYPE_FileSystemType: _CM_SERVICE_NODE_TYPE = 2; +pub const _CM_SERVICE_NODE_TYPE_Win32ServiceOwnProcess: _CM_SERVICE_NODE_TYPE = 16; +pub const _CM_SERVICE_NODE_TYPE_Win32ServiceShareProcess: _CM_SERVICE_NODE_TYPE = 32; +pub const _CM_SERVICE_NODE_TYPE_AdapterType: _CM_SERVICE_NODE_TYPE = 4; +pub const _CM_SERVICE_NODE_TYPE_RecognizerType: _CM_SERVICE_NODE_TYPE = 8; +pub type _CM_SERVICE_NODE_TYPE = u32; +pub use self::_CM_SERVICE_NODE_TYPE as SERVICE_NODE_TYPE; +pub const _CM_SERVICE_LOAD_TYPE_BootLoad: _CM_SERVICE_LOAD_TYPE = 0; +pub const _CM_SERVICE_LOAD_TYPE_SystemLoad: _CM_SERVICE_LOAD_TYPE = 1; +pub const _CM_SERVICE_LOAD_TYPE_AutoLoad: _CM_SERVICE_LOAD_TYPE = 2; +pub const _CM_SERVICE_LOAD_TYPE_DemandLoad: _CM_SERVICE_LOAD_TYPE = 3; +pub const _CM_SERVICE_LOAD_TYPE_DisableLoad: _CM_SERVICE_LOAD_TYPE = 4; +pub type _CM_SERVICE_LOAD_TYPE = u32; +pub use self::_CM_SERVICE_LOAD_TYPE as SERVICE_LOAD_TYPE; +pub const _CM_ERROR_CONTROL_TYPE_IgnoreError: _CM_ERROR_CONTROL_TYPE = 0; +pub const _CM_ERROR_CONTROL_TYPE_NormalError: _CM_ERROR_CONTROL_TYPE = 1; +pub const _CM_ERROR_CONTROL_TYPE_SevereError: _CM_ERROR_CONTROL_TYPE = 2; +pub const _CM_ERROR_CONTROL_TYPE_CriticalError: _CM_ERROR_CONTROL_TYPE = 3; +pub type _CM_ERROR_CONTROL_TYPE = u32; +pub use self::_CM_ERROR_CONTROL_TYPE as SERVICE_ERROR_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_ERASE { + pub Type: DWORD, + pub Immediate: BOOLEAN, +} +pub type TAPE_ERASE = _TAPE_ERASE; +pub type PTAPE_ERASE = *mut _TAPE_ERASE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_PREPARE { + pub Operation: DWORD, + pub Immediate: BOOLEAN, +} +pub type TAPE_PREPARE = _TAPE_PREPARE; +pub type PTAPE_PREPARE = *mut _TAPE_PREPARE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_WRITE_MARKS { + pub Type: DWORD, + pub Count: DWORD, + pub Immediate: BOOLEAN, +} +pub type TAPE_WRITE_MARKS = _TAPE_WRITE_MARKS; +pub type PTAPE_WRITE_MARKS = *mut _TAPE_WRITE_MARKS; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TAPE_GET_POSITION { + pub Type: DWORD, + pub Partition: DWORD, + pub Offset: LARGE_INTEGER, +} +pub type TAPE_GET_POSITION = _TAPE_GET_POSITION; +pub type PTAPE_GET_POSITION = *mut _TAPE_GET_POSITION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TAPE_SET_POSITION { + pub Method: DWORD, + pub Partition: DWORD, + pub Offset: LARGE_INTEGER, + pub Immediate: BOOLEAN, +} +pub type TAPE_SET_POSITION = _TAPE_SET_POSITION; +pub type PTAPE_SET_POSITION = *mut _TAPE_SET_POSITION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_GET_DRIVE_PARAMETERS { + pub ECC: BOOLEAN, + pub Compression: BOOLEAN, + pub DataPadding: BOOLEAN, + pub ReportSetmarks: BOOLEAN, + pub DefaultBlockSize: DWORD, + pub MaximumBlockSize: DWORD, + pub MinimumBlockSize: DWORD, + pub MaximumPartitionCount: DWORD, + pub FeaturesLow: DWORD, + pub FeaturesHigh: DWORD, + pub EOTWarningZoneSize: DWORD, +} +pub type TAPE_GET_DRIVE_PARAMETERS = _TAPE_GET_DRIVE_PARAMETERS; +pub type PTAPE_GET_DRIVE_PARAMETERS = *mut _TAPE_GET_DRIVE_PARAMETERS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_SET_DRIVE_PARAMETERS { + pub ECC: BOOLEAN, + pub Compression: BOOLEAN, + pub DataPadding: BOOLEAN, + pub ReportSetmarks: BOOLEAN, + pub EOTWarningZoneSize: DWORD, +} +pub type TAPE_SET_DRIVE_PARAMETERS = _TAPE_SET_DRIVE_PARAMETERS; +pub type PTAPE_SET_DRIVE_PARAMETERS = *mut _TAPE_SET_DRIVE_PARAMETERS; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TAPE_GET_MEDIA_PARAMETERS { + pub Capacity: LARGE_INTEGER, + pub Remaining: LARGE_INTEGER, + pub BlockSize: DWORD, + pub PartitionCount: DWORD, + pub WriteProtected: BOOLEAN, +} +pub type TAPE_GET_MEDIA_PARAMETERS = _TAPE_GET_MEDIA_PARAMETERS; +pub type PTAPE_GET_MEDIA_PARAMETERS = *mut _TAPE_GET_MEDIA_PARAMETERS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_SET_MEDIA_PARAMETERS { + pub BlockSize: DWORD, +} +pub type TAPE_SET_MEDIA_PARAMETERS = _TAPE_SET_MEDIA_PARAMETERS; +pub type PTAPE_SET_MEDIA_PARAMETERS = *mut _TAPE_SET_MEDIA_PARAMETERS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_CREATE_PARTITION { + pub Method: DWORD, + pub Count: DWORD, + pub Size: DWORD, +} +pub type TAPE_CREATE_PARTITION = _TAPE_CREATE_PARTITION; +pub type PTAPE_CREATE_PARTITION = *mut _TAPE_CREATE_PARTITION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TAPE_WMI_OPERATIONS { + pub Method: DWORD, + pub DataBufferSize: DWORD, + pub DataBuffer: PVOID, +} +pub type TAPE_WMI_OPERATIONS = _TAPE_WMI_OPERATIONS; +pub type PTAPE_WMI_OPERATIONS = *mut _TAPE_WMI_OPERATIONS; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveProblemNone: _TAPE_DRIVE_PROBLEM_TYPE = 0; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveReadWriteWarning: _TAPE_DRIVE_PROBLEM_TYPE = 1; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveReadWriteError: _TAPE_DRIVE_PROBLEM_TYPE = 2; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveReadWarning: _TAPE_DRIVE_PROBLEM_TYPE = 3; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveWriteWarning: _TAPE_DRIVE_PROBLEM_TYPE = 4; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveReadError: _TAPE_DRIVE_PROBLEM_TYPE = 5; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveWriteError: _TAPE_DRIVE_PROBLEM_TYPE = 6; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveHardwareError: _TAPE_DRIVE_PROBLEM_TYPE = 7; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveUnsupportedMedia: _TAPE_DRIVE_PROBLEM_TYPE = 8; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveScsiConnectionError: _TAPE_DRIVE_PROBLEM_TYPE = 9; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveTimetoClean: _TAPE_DRIVE_PROBLEM_TYPE = 10; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveCleanDriveNow: _TAPE_DRIVE_PROBLEM_TYPE = 11; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveMediaLifeExpired: _TAPE_DRIVE_PROBLEM_TYPE = 12; +pub const _TAPE_DRIVE_PROBLEM_TYPE_TapeDriveSnappedTape: _TAPE_DRIVE_PROBLEM_TYPE = 13; +pub type _TAPE_DRIVE_PROBLEM_TYPE = u32; +pub use self::_TAPE_DRIVE_PROBLEM_TYPE as TAPE_DRIVE_PROBLEM_TYPE; +pub type TP_VERSION = DWORD; +pub type PTP_VERSION = *mut DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_CALLBACK_INSTANCE { + _unused: [u8; 0], +} +pub type TP_CALLBACK_INSTANCE = _TP_CALLBACK_INSTANCE; +pub type PTP_CALLBACK_INSTANCE = *mut _TP_CALLBACK_INSTANCE; +pub type PTP_SIMPLE_CALLBACK = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_POOL { + _unused: [u8; 0], +} +pub type TP_POOL = _TP_POOL; +pub type PTP_POOL = *mut _TP_POOL; +pub const _TP_CALLBACK_PRIORITY_TP_CALLBACK_PRIORITY_HIGH: _TP_CALLBACK_PRIORITY = 0; +pub const _TP_CALLBACK_PRIORITY_TP_CALLBACK_PRIORITY_NORMAL: _TP_CALLBACK_PRIORITY = 1; +pub const _TP_CALLBACK_PRIORITY_TP_CALLBACK_PRIORITY_LOW: _TP_CALLBACK_PRIORITY = 2; +pub const _TP_CALLBACK_PRIORITY_TP_CALLBACK_PRIORITY_INVALID: _TP_CALLBACK_PRIORITY = 3; +pub const _TP_CALLBACK_PRIORITY_TP_CALLBACK_PRIORITY_COUNT: _TP_CALLBACK_PRIORITY = 3; +pub type _TP_CALLBACK_PRIORITY = u32; +pub use self::_TP_CALLBACK_PRIORITY as TP_CALLBACK_PRIORITY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_POOL_STACK_INFORMATION { + pub StackReserve: SIZE_T, + pub StackCommit: SIZE_T, +} +pub type TP_POOL_STACK_INFORMATION = _TP_POOL_STACK_INFORMATION; +pub type PTP_POOL_STACK_INFORMATION = *mut _TP_POOL_STACK_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_CLEANUP_GROUP { + _unused: [u8; 0], +} +pub type TP_CLEANUP_GROUP = _TP_CLEANUP_GROUP; +pub type PTP_CLEANUP_GROUP = *mut _TP_CLEANUP_GROUP; +pub type PTP_CLEANUP_GROUP_CANCEL_CALLBACK = + ::std::option::Option; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TP_CALLBACK_ENVIRON_V1 { + pub Version: TP_VERSION, + pub Pool: PTP_POOL, + pub CleanupGroup: PTP_CLEANUP_GROUP, + pub CleanupGroupCancelCallback: PTP_CLEANUP_GROUP_CANCEL_CALLBACK, + pub RaceDll: PVOID, + pub ActivationContext: *mut _ACTIVATION_CONTEXT, + pub FinalizationCallback: PTP_SIMPLE_CALLBACK, + pub u: _TP_CALLBACK_ENVIRON_V1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _TP_CALLBACK_ENVIRON_V1__bindgen_ty_1 { + pub Flags: DWORD, + pub s: _TP_CALLBACK_ENVIRON_V1__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _TP_CALLBACK_ENVIRON_V1__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl _TP_CALLBACK_ENVIRON_V1__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn LongFunction(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_LongFunction(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn Persistent(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_Persistent(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn Private(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) } + } + #[inline] + pub fn set_Private(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 30u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + LongFunction: DWORD, + Persistent: DWORD, + Private: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let LongFunction: u32 = unsafe { ::std::mem::transmute(LongFunction) }; + LongFunction as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let Persistent: u32 = unsafe { ::std::mem::transmute(Persistent) }; + Persistent as u64 + }); + __bindgen_bitfield_unit.set(2usize, 30u8, { + let Private: u32 = unsafe { ::std::mem::transmute(Private) }; + Private as u64 + }); + __bindgen_bitfield_unit + } +} +pub type TP_CALLBACK_ENVIRON_V1 = _TP_CALLBACK_ENVIRON_V1; +pub type TP_CALLBACK_ENVIRON = TP_CALLBACK_ENVIRON_V1; +pub type PTP_CALLBACK_ENVIRON = *mut TP_CALLBACK_ENVIRON_V1; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_WORK { + _unused: [u8; 0], +} +pub type TP_WORK = _TP_WORK; +pub type PTP_WORK = *mut _TP_WORK; +pub type PTP_WORK_CALLBACK = ::std::option::Option< + unsafe extern "C" fn(Instance: PTP_CALLBACK_INSTANCE, Context: PVOID, Work: PTP_WORK), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_TIMER { + _unused: [u8; 0], +} +pub type TP_TIMER = _TP_TIMER; +pub type PTP_TIMER = *mut _TP_TIMER; +pub type PTP_TIMER_CALLBACK = ::std::option::Option< + unsafe extern "C" fn(Instance: PTP_CALLBACK_INSTANCE, Context: PVOID, Timer: PTP_TIMER), +>; +pub type TP_WAIT_RESULT = DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_WAIT { + _unused: [u8; 0], +} +pub type TP_WAIT = _TP_WAIT; +pub type PTP_WAIT = *mut _TP_WAIT; +pub type PTP_WAIT_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, + Wait: PTP_WAIT, + WaitResult: TP_WAIT_RESULT, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TP_IO { + _unused: [u8; 0], +} +pub type TP_IO = _TP_IO; +pub type PTP_IO = *mut _TP_IO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TEB { + _unused: [u8; 0], +} +extern "C" { + pub fn NtCurrentTeb() -> *mut _TEB; +} +extern "C" { + pub fn GetCurrentFiber() -> PVOID; +} +extern "C" { + pub fn GetFiberData() -> PVOID; +} +pub type CRM_PROTOCOL_ID = GUID; +pub type PCRM_PROTOCOL_ID = *mut GUID; +pub type NOTIFICATION_MASK = ULONG; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TRANSACTION_NOTIFICATION { + pub TransactionKey: PVOID, + pub TransactionNotification: ULONG, + pub TmVirtualClock: LARGE_INTEGER, + pub ArgumentLength: ULONG, +} +pub type TRANSACTION_NOTIFICATION = _TRANSACTION_NOTIFICATION; +pub type PTRANSACTION_NOTIFICATION = *mut _TRANSACTION_NOTIFICATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT { + pub EnlistmentId: GUID, + pub UOW: GUID, +} +pub type TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT = _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT = + *mut _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT { + pub TmIdentity: GUID, + pub Flags: ULONG, +} +pub type TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT = _TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT = + *mut _TRANSACTION_NOTIFICATION_TM_ONLINE_ARGUMENT; +pub type SAVEPOINT_ID = ULONG; +pub type PSAVEPOINT_ID = *mut ULONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT { + pub SavepointId: SAVEPOINT_ID, +} +pub type TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT = _TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT = + *mut _TRANSACTION_NOTIFICATION_SAVEPOINT_ARGUMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT { + pub PropagationCookie: ULONG, + pub UOW: GUID, + pub TmIdentity: GUID, + pub BufferLength: ULONG, +} +pub type TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT = _TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT = + *mut _TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT { + pub MarshalCookie: ULONG, + pub UOW: GUID, +} +pub type TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT = _TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT = + *mut _TRANSACTION_NOTIFICATION_MARSHAL_ARGUMENT; +pub type TRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT = TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +pub type PTRANSACTION_NOTIFICATION_PROMOTE_ARGUMENT = + *mut TRANSACTION_NOTIFICATION_PROPAGATE_ARGUMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _KCRM_MARSHAL_HEADER { + pub VersionMajor: ULONG, + pub VersionMinor: ULONG, + pub NumProtocols: ULONG, + pub Unused: ULONG, +} +pub type KCRM_MARSHAL_HEADER = _KCRM_MARSHAL_HEADER; +pub type PKCRM_MARSHAL_HEADER = *mut _KCRM_MARSHAL_HEADER; +pub type PRKCRM_MARSHAL_HEADER = *mut _KCRM_MARSHAL_HEADER; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _KCRM_TRANSACTION_BLOB { + pub UOW: GUID, + pub TmIdentity: GUID, + pub IsolationLevel: ULONG, + pub IsolationFlags: ULONG, + pub Timeout: ULONG, + pub Description: [WCHAR; 64usize], +} +pub type KCRM_TRANSACTION_BLOB = _KCRM_TRANSACTION_BLOB; +pub type PKCRM_TRANSACTION_BLOB = *mut _KCRM_TRANSACTION_BLOB; +pub type PRKCRM_TRANSACTION_BLOB = *mut _KCRM_TRANSACTION_BLOB; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _KCRM_PROTOCOL_BLOB { + pub ProtocolId: CRM_PROTOCOL_ID, + pub StaticInfoLength: ULONG, + pub TransactionIdInfoLength: ULONG, + pub Unused1: ULONG, + pub Unused2: ULONG, +} +pub type KCRM_PROTOCOL_BLOB = _KCRM_PROTOCOL_BLOB; +pub type PKCRM_PROTOCOL_BLOB = *mut _KCRM_PROTOCOL_BLOB; +pub type PRKCRM_PROTOCOL_BLOB = *mut _KCRM_PROTOCOL_BLOB; +pub const _TRANSACTION_OUTCOME_TransactionOutcomeUndetermined: _TRANSACTION_OUTCOME = 1; +pub const _TRANSACTION_OUTCOME_TransactionOutcomeCommitted: _TRANSACTION_OUTCOME = 2; +pub const _TRANSACTION_OUTCOME_TransactionOutcomeAborted: _TRANSACTION_OUTCOME = 3; +pub type _TRANSACTION_OUTCOME = u32; +pub use self::_TRANSACTION_OUTCOME as TRANSACTION_OUTCOME; +pub const _TRANSACTION_STATE_TransactionStateNormal: _TRANSACTION_STATE = 1; +pub const _TRANSACTION_STATE_TransactionStateIndoubt: _TRANSACTION_STATE = 2; +pub const _TRANSACTION_STATE_TransactionStateCommittedNotify: _TRANSACTION_STATE = 3; +pub type _TRANSACTION_STATE = u32; +pub use self::_TRANSACTION_STATE as TRANSACTION_STATE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_BASIC_INFORMATION { + pub TransactionId: GUID, + pub State: DWORD, + pub Outcome: DWORD, +} +pub type TRANSACTION_BASIC_INFORMATION = _TRANSACTION_BASIC_INFORMATION; +pub type PTRANSACTION_BASIC_INFORMATION = *mut _TRANSACTION_BASIC_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TRANSACTIONMANAGER_BASIC_INFORMATION { + pub TmIdentity: GUID, + pub VirtualClock: LARGE_INTEGER, +} +pub type TRANSACTIONMANAGER_BASIC_INFORMATION = _TRANSACTIONMANAGER_BASIC_INFORMATION; +pub type PTRANSACTIONMANAGER_BASIC_INFORMATION = *mut _TRANSACTIONMANAGER_BASIC_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTIONMANAGER_LOG_INFORMATION { + pub LogIdentity: GUID, +} +pub type TRANSACTIONMANAGER_LOG_INFORMATION = _TRANSACTIONMANAGER_LOG_INFORMATION; +pub type PTRANSACTIONMANAGER_LOG_INFORMATION = *mut _TRANSACTIONMANAGER_LOG_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTIONMANAGER_LOGPATH_INFORMATION { + pub LogPathLength: DWORD, + pub LogPath: [WCHAR; 1usize], +} +pub type TRANSACTIONMANAGER_LOGPATH_INFORMATION = _TRANSACTIONMANAGER_LOGPATH_INFORMATION; +pub type PTRANSACTIONMANAGER_LOGPATH_INFORMATION = *mut _TRANSACTIONMANAGER_LOGPATH_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTIONMANAGER_RECOVERY_INFORMATION { + pub LastRecoveredLsn: ULONGLONG, +} +pub type TRANSACTIONMANAGER_RECOVERY_INFORMATION = _TRANSACTIONMANAGER_RECOVERY_INFORMATION; +pub type PTRANSACTIONMANAGER_RECOVERY_INFORMATION = *mut _TRANSACTIONMANAGER_RECOVERY_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTIONMANAGER_OLDEST_INFORMATION { + pub OldestTransactionGuid: GUID, +} +pub type TRANSACTIONMANAGER_OLDEST_INFORMATION = _TRANSACTIONMANAGER_OLDEST_INFORMATION; +pub type PTRANSACTIONMANAGER_OLDEST_INFORMATION = *mut _TRANSACTIONMANAGER_OLDEST_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TRANSACTION_PROPERTIES_INFORMATION { + pub IsolationLevel: DWORD, + pub IsolationFlags: DWORD, + pub Timeout: LARGE_INTEGER, + pub Outcome: DWORD, + pub DescriptionLength: DWORD, + pub Description: [WCHAR; 1usize], +} +pub type TRANSACTION_PROPERTIES_INFORMATION = _TRANSACTION_PROPERTIES_INFORMATION; +pub type PTRANSACTION_PROPERTIES_INFORMATION = *mut _TRANSACTION_PROPERTIES_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_BIND_INFORMATION { + pub TmHandle: HANDLE, +} +pub type TRANSACTION_BIND_INFORMATION = _TRANSACTION_BIND_INFORMATION; +pub type PTRANSACTION_BIND_INFORMATION = *mut _TRANSACTION_BIND_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_ENLISTMENT_PAIR { + pub EnlistmentId: GUID, + pub ResourceManagerId: GUID, +} +pub type TRANSACTION_ENLISTMENT_PAIR = _TRANSACTION_ENLISTMENT_PAIR; +pub type PTRANSACTION_ENLISTMENT_PAIR = *mut _TRANSACTION_ENLISTMENT_PAIR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_ENLISTMENTS_INFORMATION { + pub NumberOfEnlistments: DWORD, + pub EnlistmentPair: [TRANSACTION_ENLISTMENT_PAIR; 1usize], +} +pub type TRANSACTION_ENLISTMENTS_INFORMATION = _TRANSACTION_ENLISTMENTS_INFORMATION; +pub type PTRANSACTION_ENLISTMENTS_INFORMATION = *mut _TRANSACTION_ENLISTMENTS_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION { + pub SuperiorEnlistmentPair: TRANSACTION_ENLISTMENT_PAIR, +} +pub type TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION = _TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION; +pub type PTRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION = + *mut _TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RESOURCEMANAGER_BASIC_INFORMATION { + pub ResourceManagerId: GUID, + pub DescriptionLength: DWORD, + pub Description: [WCHAR; 1usize], +} +pub type RESOURCEMANAGER_BASIC_INFORMATION = _RESOURCEMANAGER_BASIC_INFORMATION; +pub type PRESOURCEMANAGER_BASIC_INFORMATION = *mut _RESOURCEMANAGER_BASIC_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RESOURCEMANAGER_COMPLETION_INFORMATION { + pub IoCompletionPortHandle: HANDLE, + pub CompletionKey: ULONG_PTR, +} +pub type RESOURCEMANAGER_COMPLETION_INFORMATION = _RESOURCEMANAGER_COMPLETION_INFORMATION; +pub type PRESOURCEMANAGER_COMPLETION_INFORMATION = *mut _RESOURCEMANAGER_COMPLETION_INFORMATION; +pub const _TRANSACTION_INFORMATION_CLASS_TransactionBasicInformation: + _TRANSACTION_INFORMATION_CLASS = 0; +pub const _TRANSACTION_INFORMATION_CLASS_TransactionPropertiesInformation: + _TRANSACTION_INFORMATION_CLASS = 1; +pub const _TRANSACTION_INFORMATION_CLASS_TransactionEnlistmentInformation: + _TRANSACTION_INFORMATION_CLASS = 2; +pub const _TRANSACTION_INFORMATION_CLASS_TransactionSuperiorEnlistmentInformation: + _TRANSACTION_INFORMATION_CLASS = 3; +pub const _TRANSACTION_INFORMATION_CLASS_TransactionBindInformation: + _TRANSACTION_INFORMATION_CLASS = 4; +pub const _TRANSACTION_INFORMATION_CLASS_TransactionDTCPrivateInformation: + _TRANSACTION_INFORMATION_CLASS = 5; +pub type _TRANSACTION_INFORMATION_CLASS = u32; +pub use self::_TRANSACTION_INFORMATION_CLASS as TRANSACTION_INFORMATION_CLASS; +pub const _TRANSACTIONMANAGER_INFORMATION_CLASS_TransactionManagerBasicInformation: + _TRANSACTIONMANAGER_INFORMATION_CLASS = 0; +pub const _TRANSACTIONMANAGER_INFORMATION_CLASS_TransactionManagerLogInformation: + _TRANSACTIONMANAGER_INFORMATION_CLASS = 1; +pub const _TRANSACTIONMANAGER_INFORMATION_CLASS_TransactionManagerLogPathInformation: + _TRANSACTIONMANAGER_INFORMATION_CLASS = 2; +pub const _TRANSACTIONMANAGER_INFORMATION_CLASS_TransactionManagerOnlineProbeInformation: + _TRANSACTIONMANAGER_INFORMATION_CLASS = 3; +pub const _TRANSACTIONMANAGER_INFORMATION_CLASS_TransactionManagerRecoveryInformation: + _TRANSACTIONMANAGER_INFORMATION_CLASS = 4; +pub const _TRANSACTIONMANAGER_INFORMATION_CLASS_TransactionManagerOldestTransactionInformation: + _TRANSACTIONMANAGER_INFORMATION_CLASS = 5; +pub type _TRANSACTIONMANAGER_INFORMATION_CLASS = u32; +pub use self::_TRANSACTIONMANAGER_INFORMATION_CLASS as TRANSACTIONMANAGER_INFORMATION_CLASS; +pub const _RESOURCEMANAGER_INFORMATION_CLASS_ResourceManagerBasicInformation: + _RESOURCEMANAGER_INFORMATION_CLASS = 0; +pub const _RESOURCEMANAGER_INFORMATION_CLASS_ResourceManagerCompletionInformation: + _RESOURCEMANAGER_INFORMATION_CLASS = 1; +pub type _RESOURCEMANAGER_INFORMATION_CLASS = u32; +pub use self::_RESOURCEMANAGER_INFORMATION_CLASS as RESOURCEMANAGER_INFORMATION_CLASS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ENLISTMENT_BASIC_INFORMATION { + pub EnlistmentId: GUID, + pub TransactionId: GUID, + pub ResourceManagerId: GUID, +} +pub type ENLISTMENT_BASIC_INFORMATION = _ENLISTMENT_BASIC_INFORMATION; +pub type PENLISTMENT_BASIC_INFORMATION = *mut _ENLISTMENT_BASIC_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ENLISTMENT_CRM_INFORMATION { + pub CrmTransactionManagerId: GUID, + pub CrmResourceManagerId: GUID, + pub CrmEnlistmentId: GUID, +} +pub type ENLISTMENT_CRM_INFORMATION = _ENLISTMENT_CRM_INFORMATION; +pub type PENLISTMENT_CRM_INFORMATION = *mut _ENLISTMENT_CRM_INFORMATION; +pub const _ENLISTMENT_INFORMATION_CLASS_EnlistmentBasicInformation: _ENLISTMENT_INFORMATION_CLASS = + 0; +pub const _ENLISTMENT_INFORMATION_CLASS_EnlistmentRecoveryInformation: + _ENLISTMENT_INFORMATION_CLASS = 1; +pub const _ENLISTMENT_INFORMATION_CLASS_EnlistmentCrmInformation: _ENLISTMENT_INFORMATION_CLASS = 2; +pub type _ENLISTMENT_INFORMATION_CLASS = u32; +pub use self::_ENLISTMENT_INFORMATION_CLASS as ENLISTMENT_INFORMATION_CLASS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_LIST_ENTRY { + pub UOW: GUID, +} +pub type TRANSACTION_LIST_ENTRY = _TRANSACTION_LIST_ENTRY; +pub type PTRANSACTION_LIST_ENTRY = *mut _TRANSACTION_LIST_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRANSACTION_LIST_INFORMATION { + pub NumberOfTransactions: DWORD, + pub TransactionInformation: [TRANSACTION_LIST_ENTRY; 1usize], +} +pub type TRANSACTION_LIST_INFORMATION = _TRANSACTION_LIST_INFORMATION; +pub type PTRANSACTION_LIST_INFORMATION = *mut _TRANSACTION_LIST_INFORMATION; +pub const _KTMOBJECT_TYPE_KTMOBJECT_TRANSACTION: _KTMOBJECT_TYPE = 0; +pub const _KTMOBJECT_TYPE_KTMOBJECT_TRANSACTION_MANAGER: _KTMOBJECT_TYPE = 1; +pub const _KTMOBJECT_TYPE_KTMOBJECT_RESOURCE_MANAGER: _KTMOBJECT_TYPE = 2; +pub const _KTMOBJECT_TYPE_KTMOBJECT_ENLISTMENT: _KTMOBJECT_TYPE = 3; +pub const _KTMOBJECT_TYPE_KTMOBJECT_INVALID: _KTMOBJECT_TYPE = 4; +pub type _KTMOBJECT_TYPE = u32; +pub use self::_KTMOBJECT_TYPE as KTMOBJECT_TYPE; +pub type PKTMOBJECT_TYPE = *mut _KTMOBJECT_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _KTMOBJECT_CURSOR { + pub LastQuery: GUID, + pub ObjectIdCount: DWORD, + pub ObjectIds: [GUID; 1usize], +} +pub type KTMOBJECT_CURSOR = _KTMOBJECT_CURSOR; +pub type PKTMOBJECT_CURSOR = *mut _KTMOBJECT_CURSOR; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WOW64_FLOATING_SAVE_AREA { + pub ControlWord: DWORD, + pub StatusWord: DWORD, + pub TagWord: DWORD, + pub ErrorOffset: DWORD, + pub ErrorSelector: DWORD, + pub DataOffset: DWORD, + pub DataSelector: DWORD, + pub RegisterArea: [BYTE; 80usize], + pub Cr0NpxState: DWORD, +} +pub type WOW64_FLOATING_SAVE_AREA = _WOW64_FLOATING_SAVE_AREA; +pub type PWOW64_FLOATING_SAVE_AREA = *mut _WOW64_FLOATING_SAVE_AREA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WOW64_CONTEXT { + pub ContextFlags: DWORD, + pub Dr0: DWORD, + pub Dr1: DWORD, + pub Dr2: DWORD, + pub Dr3: DWORD, + pub Dr6: DWORD, + pub Dr7: DWORD, + pub FloatSave: WOW64_FLOATING_SAVE_AREA, + pub SegGs: DWORD, + pub SegFs: DWORD, + pub SegEs: DWORD, + pub SegDs: DWORD, + pub Edi: DWORD, + pub Esi: DWORD, + pub Ebx: DWORD, + pub Edx: DWORD, + pub Ecx: DWORD, + pub Eax: DWORD, + pub Ebp: DWORD, + pub Eip: DWORD, + pub SegCs: DWORD, + pub EFlags: DWORD, + pub Esp: DWORD, + pub SegSs: DWORD, + pub ExtendedRegisters: [BYTE; 512usize], +} +pub type WOW64_CONTEXT = _WOW64_CONTEXT; +pub type PWOW64_CONTEXT = *mut _WOW64_CONTEXT; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WOW64_LDT_ENTRY { + pub LimitLow: WORD, + pub BaseLow: WORD, + pub HighWord: _WOW64_LDT_ENTRY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _WOW64_LDT_ENTRY__bindgen_ty_1 { + pub Bytes: _WOW64_LDT_ENTRY__bindgen_ty_1__bindgen_ty_1, + pub Bits: _WOW64_LDT_ENTRY__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _WOW64_LDT_ENTRY__bindgen_ty_1__bindgen_ty_1 { + pub BaseMid: BYTE, + pub Flags1: BYTE, + pub Flags2: BYTE, + pub BaseHi: BYTE, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct _WOW64_LDT_ENTRY__bindgen_ty_1__bindgen_ty_2 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, +} +impl _WOW64_LDT_ENTRY__bindgen_ty_1__bindgen_ty_2 { + #[inline] + pub fn BaseMid(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_BaseMid(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn Type(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 5u8) as u32) } + } + #[inline] + pub fn set_Type(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 5u8, val as u64) + } + } + #[inline] + pub fn Dpl(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 2u8) as u32) } + } + #[inline] + pub fn set_Dpl(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 2u8, val as u64) + } + } + #[inline] + pub fn Pres(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) } + } + #[inline] + pub fn set_Pres(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub fn LimitHi(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u32) } + } + #[inline] + pub fn set_LimitHi(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 4u8, val as u64) + } + } + #[inline] + pub fn Sys(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u32) } + } + #[inline] + pub fn set_Sys(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(20usize, 1u8, val as u64) + } + } + #[inline] + pub fn Reserved_0(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u32) } + } + #[inline] + pub fn set_Reserved_0(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(21usize, 1u8, val as u64) + } + } + #[inline] + pub fn Default_Big(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u32) } + } + #[inline] + pub fn set_Default_Big(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(22usize, 1u8, val as u64) + } + } + #[inline] + pub fn Granularity(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u32) } + } + #[inline] + pub fn set_Granularity(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(23usize, 1u8, val as u64) + } + } + #[inline] + pub fn BaseHi(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_BaseHi(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + BaseMid: DWORD, + Type: DWORD, + Dpl: DWORD, + Pres: DWORD, + LimitHi: DWORD, + Sys: DWORD, + Reserved_0: DWORD, + Default_Big: DWORD, + Granularity: DWORD, + BaseHi: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let BaseMid: u32 = unsafe { ::std::mem::transmute(BaseMid) }; + BaseMid as u64 + }); + __bindgen_bitfield_unit.set(8usize, 5u8, { + let Type: u32 = unsafe { ::std::mem::transmute(Type) }; + Type as u64 + }); + __bindgen_bitfield_unit.set(13usize, 2u8, { + let Dpl: u32 = unsafe { ::std::mem::transmute(Dpl) }; + Dpl as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let Pres: u32 = unsafe { ::std::mem::transmute(Pres) }; + Pres as u64 + }); + __bindgen_bitfield_unit.set(16usize, 4u8, { + let LimitHi: u32 = unsafe { ::std::mem::transmute(LimitHi) }; + LimitHi as u64 + }); + __bindgen_bitfield_unit.set(20usize, 1u8, { + let Sys: u32 = unsafe { ::std::mem::transmute(Sys) }; + Sys as u64 + }); + __bindgen_bitfield_unit.set(21usize, 1u8, { + let Reserved_0: u32 = unsafe { ::std::mem::transmute(Reserved_0) }; + Reserved_0 as u64 + }); + __bindgen_bitfield_unit.set(22usize, 1u8, { + let Default_Big: u32 = unsafe { ::std::mem::transmute(Default_Big) }; + Default_Big as u64 + }); + __bindgen_bitfield_unit.set(23usize, 1u8, { + let Granularity: u32 = unsafe { ::std::mem::transmute(Granularity) }; + Granularity as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let BaseHi: u32 = unsafe { ::std::mem::transmute(BaseHi) }; + BaseHi as u64 + }); + __bindgen_bitfield_unit + } +} +pub type WOW64_LDT_ENTRY = _WOW64_LDT_ENTRY; +pub type PWOW64_LDT_ENTRY = *mut _WOW64_LDT_ENTRY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WOW64_DESCRIPTOR_TABLE_ENTRY { + pub Selector: DWORD, + pub Descriptor: WOW64_LDT_ENTRY, +} +pub type WOW64_DESCRIPTOR_TABLE_ENTRY = _WOW64_DESCRIPTOR_TABLE_ENTRY; +pub type PWOW64_DESCRIPTOR_TABLE_ENTRY = *mut _WOW64_DESCRIPTOR_TABLE_ENTRY; +pub type WPARAM = UINT_PTR; +pub type LPARAM = LONG_PTR; +pub type LRESULT = LONG_PTR; +pub type SPHANDLE = *mut HANDLE; +pub type LPHANDLE = *mut HANDLE; +pub type HGLOBAL = HANDLE; +pub type HLOCAL = HANDLE; +pub type GLOBALHANDLE = HANDLE; +pub type LOCALHANDLE = HANDLE; +pub type FARPROC = ::std::option::Option INT_PTR>; +pub type NEARPROC = ::std::option::Option INT_PTR>; +pub type PROC = ::std::option::Option INT_PTR>; +pub type ATOM = WORD; +pub type HFILE = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HINSTANCE__ { + pub unused: ::std::os::raw::c_int, +} +pub type HINSTANCE = *mut HINSTANCE__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HKEY__ { + pub unused: ::std::os::raw::c_int, +} +pub type HKEY = *mut HKEY__; +pub type PHKEY = *mut HKEY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HKL__ { + pub unused: ::std::os::raw::c_int, +} +pub type HKL = *mut HKL__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HLSURF__ { + pub unused: ::std::os::raw::c_int, +} +pub type HLSURF = *mut HLSURF__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HMETAFILE__ { + pub unused: ::std::os::raw::c_int, +} +pub type HMETAFILE = *mut HMETAFILE__; +pub type HMODULE = HINSTANCE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HRGN__ { + pub unused: ::std::os::raw::c_int, +} +pub type HRGN = *mut HRGN__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HRSRC__ { + pub unused: ::std::os::raw::c_int, +} +pub type HRSRC = *mut HRSRC__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HSPRITE__ { + pub unused: ::std::os::raw::c_int, +} +pub type HSPRITE = *mut HSPRITE__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HSTR__ { + pub unused: ::std::os::raw::c_int, +} +pub type HSTR = *mut HSTR__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HTASK__ { + pub unused: ::std::os::raw::c_int, +} +pub type HTASK = *mut HTASK__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HWINSTA__ { + pub unused: ::std::os::raw::c_int, +} +pub type HWINSTA = *mut HWINSTA__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FILETIME { + pub dwLowDateTime: DWORD, + pub dwHighDateTime: DWORD, +} +pub type FILETIME = _FILETIME; +pub type PFILETIME = *mut _FILETIME; +pub type LPFILETIME = *mut _FILETIME; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HWND__ { + pub unused: ::std::os::raw::c_int, +} +pub type HWND = *mut HWND__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HHOOK__ { + pub unused: ::std::os::raw::c_int, +} +pub type HHOOK = *mut HHOOK__; +pub type HGDIOBJ = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HACCEL__ { + pub unused: ::std::os::raw::c_int, +} +pub type HACCEL = *mut HACCEL__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HBITMAP__ { + pub unused: ::std::os::raw::c_int, +} +pub type HBITMAP = *mut HBITMAP__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HBRUSH__ { + pub unused: ::std::os::raw::c_int, +} +pub type HBRUSH = *mut HBRUSH__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HCOLORSPACE__ { + pub unused: ::std::os::raw::c_int, +} +pub type HCOLORSPACE = *mut HCOLORSPACE__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HDC__ { + pub unused: ::std::os::raw::c_int, +} +pub type HDC = *mut HDC__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HGLRC__ { + pub unused: ::std::os::raw::c_int, +} +pub type HGLRC = *mut HGLRC__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HDESK__ { + pub unused: ::std::os::raw::c_int, +} +pub type HDESK = *mut HDESK__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HENHMETAFILE__ { + pub unused: ::std::os::raw::c_int, +} +pub type HENHMETAFILE = *mut HENHMETAFILE__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HFONT__ { + pub unused: ::std::os::raw::c_int, +} +pub type HFONT = *mut HFONT__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HICON__ { + pub unused: ::std::os::raw::c_int, +} +pub type HICON = *mut HICON__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HMENU__ { + pub unused: ::std::os::raw::c_int, +} +pub type HMENU = *mut HMENU__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HPALETTE__ { + pub unused: ::std::os::raw::c_int, +} +pub type HPALETTE = *mut HPALETTE__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HPEN__ { + pub unused: ::std::os::raw::c_int, +} +pub type HPEN = *mut HPEN__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HMONITOR__ { + pub unused: ::std::os::raw::c_int, +} +pub type HMONITOR = *mut HMONITOR__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HWINEVENTHOOK__ { + pub unused: ::std::os::raw::c_int, +} +pub type HWINEVENTHOOK = *mut HWINEVENTHOOK__; +pub type HCURSOR = HICON; +pub type COLORREF = DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HUMPD__ { + pub unused: ::std::os::raw::c_int, +} +pub type HUMPD = *mut HUMPD__; +pub type LPCOLORREF = *mut DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRECT { + pub left: LONG, + pub top: LONG, + pub right: LONG, + pub bottom: LONG, +} +pub type RECT = tagRECT; +pub type PRECT = *mut tagRECT; +pub type NPRECT = *mut tagRECT; +pub type LPRECT = *mut tagRECT; +pub type LPCRECT = *const RECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RECTL { + pub left: LONG, + pub top: LONG, + pub right: LONG, + pub bottom: LONG, +} +pub type RECTL = _RECTL; +pub type PRECTL = *mut _RECTL; +pub type LPRECTL = *mut _RECTL; +pub type LPCRECTL = *const RECTL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPOINT { + pub x: LONG, + pub y: LONG, +} +pub type POINT = tagPOINT; +pub type PPOINT = *mut tagPOINT; +pub type NPPOINT = *mut tagPOINT; +pub type LPPOINT = *mut tagPOINT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POINTL { + pub x: LONG, + pub y: LONG, +} +pub type POINTL = _POINTL; +pub type PPOINTL = *mut _POINTL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSIZE { + pub cx: LONG, + pub cy: LONG, +} +pub type SIZE = tagSIZE; +pub type PSIZE = *mut tagSIZE; +pub type LPSIZE = *mut tagSIZE; +pub type SIZEL = SIZE; +pub type PSIZEL = *mut SIZE; +pub type LPSIZEL = *mut SIZE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPOINTS { + pub x: SHORT, + pub y: SHORT, +} +pub type POINTS = tagPOINTS; +pub type PPOINTS = *mut tagPOINTS; +pub type LPPOINTS = *mut tagPOINTS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SECURITY_ATTRIBUTES { + pub nLength: DWORD, + pub lpSecurityDescriptor: LPVOID, + pub bInheritHandle: WINBOOL, +} +pub type SECURITY_ATTRIBUTES = _SECURITY_ATTRIBUTES; +pub type PSECURITY_ATTRIBUTES = *mut _SECURITY_ATTRIBUTES; +pub type LPSECURITY_ATTRIBUTES = *mut _SECURITY_ATTRIBUTES; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _OVERLAPPED { + pub Internal: ULONG_PTR, + pub InternalHigh: ULONG_PTR, + pub __bindgen_anon_1: _OVERLAPPED__bindgen_ty_1, + pub hEvent: HANDLE, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _OVERLAPPED__bindgen_ty_1 { + pub __bindgen_anon_1: _OVERLAPPED__bindgen_ty_1__bindgen_ty_1, + pub Pointer: PVOID, + _bindgen_union_align: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OVERLAPPED__bindgen_ty_1__bindgen_ty_1 { + pub Offset: DWORD, + pub OffsetHigh: DWORD, +} +pub type OVERLAPPED = _OVERLAPPED; +pub type LPOVERLAPPED = *mut _OVERLAPPED; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OVERLAPPED_ENTRY { + pub lpCompletionKey: ULONG_PTR, + pub lpOverlapped: LPOVERLAPPED, + pub Internal: ULONG_PTR, + pub dwNumberOfBytesTransferred: DWORD, +} +pub type OVERLAPPED_ENTRY = _OVERLAPPED_ENTRY; +pub type LPOVERLAPPED_ENTRY = *mut _OVERLAPPED_ENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEMTIME { + pub wYear: WORD, + pub wMonth: WORD, + pub wDayOfWeek: WORD, + pub wDay: WORD, + pub wHour: WORD, + pub wMinute: WORD, + pub wSecond: WORD, + pub wMilliseconds: WORD, +} +pub type SYSTEMTIME = _SYSTEMTIME; +pub type PSYSTEMTIME = *mut _SYSTEMTIME; +pub type LPSYSTEMTIME = *mut _SYSTEMTIME; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WIN32_FIND_DATAA { + pub dwFileAttributes: DWORD, + pub ftCreationTime: FILETIME, + pub ftLastAccessTime: FILETIME, + pub ftLastWriteTime: FILETIME, + pub nFileSizeHigh: DWORD, + pub nFileSizeLow: DWORD, + pub dwReserved0: DWORD, + pub dwReserved1: DWORD, + pub cFileName: [CHAR; 260usize], + pub cAlternateFileName: [CHAR; 14usize], +} +pub type WIN32_FIND_DATAA = _WIN32_FIND_DATAA; +pub type PWIN32_FIND_DATAA = *mut _WIN32_FIND_DATAA; +pub type LPWIN32_FIND_DATAA = *mut _WIN32_FIND_DATAA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WIN32_FIND_DATAW { + pub dwFileAttributes: DWORD, + pub ftCreationTime: FILETIME, + pub ftLastAccessTime: FILETIME, + pub ftLastWriteTime: FILETIME, + pub nFileSizeHigh: DWORD, + pub nFileSizeLow: DWORD, + pub dwReserved0: DWORD, + pub dwReserved1: DWORD, + pub cFileName: [WCHAR; 260usize], + pub cAlternateFileName: [WCHAR; 14usize], +} +pub type WIN32_FIND_DATAW = _WIN32_FIND_DATAW; +pub type PWIN32_FIND_DATAW = *mut _WIN32_FIND_DATAW; +pub type LPWIN32_FIND_DATAW = *mut _WIN32_FIND_DATAW; +pub type WIN32_FIND_DATA = WIN32_FIND_DATAA; +pub type PWIN32_FIND_DATA = PWIN32_FIND_DATAA; +pub type LPWIN32_FIND_DATA = LPWIN32_FIND_DATAA; +pub const _FINDEX_INFO_LEVELS_FindExInfoStandard: _FINDEX_INFO_LEVELS = 0; +pub const _FINDEX_INFO_LEVELS_FindExInfoBasic: _FINDEX_INFO_LEVELS = 1; +pub const _FINDEX_INFO_LEVELS_FindExInfoMaxInfoLevel: _FINDEX_INFO_LEVELS = 2; +pub type _FINDEX_INFO_LEVELS = u32; +pub use self::_FINDEX_INFO_LEVELS as FINDEX_INFO_LEVELS; +pub const _FINDEX_SEARCH_OPS_FindExSearchNameMatch: _FINDEX_SEARCH_OPS = 0; +pub const _FINDEX_SEARCH_OPS_FindExSearchLimitToDirectories: _FINDEX_SEARCH_OPS = 1; +pub const _FINDEX_SEARCH_OPS_FindExSearchLimitToDevices: _FINDEX_SEARCH_OPS = 2; +pub const _FINDEX_SEARCH_OPS_FindExSearchMaxSearchOp: _FINDEX_SEARCH_OPS = 3; +pub type _FINDEX_SEARCH_OPS = u32; +pub use self::_FINDEX_SEARCH_OPS as FINDEX_SEARCH_OPS; +pub const _GET_FILEEX_INFO_LEVELS_GetFileExInfoStandard: _GET_FILEEX_INFO_LEVELS = 0; +pub const _GET_FILEEX_INFO_LEVELS_GetFileExMaxInfoLevel: _GET_FILEEX_INFO_LEVELS = 1; +pub type _GET_FILEEX_INFO_LEVELS = u32; +pub use self::_GET_FILEEX_INFO_LEVELS as GET_FILEEX_INFO_LEVELS; +pub type CRITICAL_SECTION = RTL_CRITICAL_SECTION; +pub type PCRITICAL_SECTION = PRTL_CRITICAL_SECTION; +pub type LPCRITICAL_SECTION = PRTL_CRITICAL_SECTION; +pub type CRITICAL_SECTION_DEBUG = RTL_CRITICAL_SECTION_DEBUG; +pub type PCRITICAL_SECTION_DEBUG = PRTL_CRITICAL_SECTION_DEBUG; +pub type LPCRITICAL_SECTION_DEBUG = PRTL_CRITICAL_SECTION_DEBUG; +pub type LPOVERLAPPED_COMPLETION_ROUTINE = ::std::option::Option< + unsafe extern "C" fn( + dwErrorCode: DWORD, + dwNumberOfBytesTransfered: DWORD, + lpOverlapped: LPOVERLAPPED, + ), +>; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _PROCESS_HEAP_ENTRY { + pub lpData: PVOID, + pub cbData: DWORD, + pub cbOverhead: BYTE, + pub iRegionIndex: BYTE, + pub wFlags: WORD, + pub __bindgen_anon_1: _PROCESS_HEAP_ENTRY__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _PROCESS_HEAP_ENTRY__bindgen_ty_1 { + pub Block: _PROCESS_HEAP_ENTRY__bindgen_ty_1__bindgen_ty_1, + pub Region: _PROCESS_HEAP_ENTRY__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: [u64; 3usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_HEAP_ENTRY__bindgen_ty_1__bindgen_ty_1 { + pub hMem: HANDLE, + pub dwReserved: [DWORD; 3usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_HEAP_ENTRY__bindgen_ty_1__bindgen_ty_2 { + pub dwCommittedSize: DWORD, + pub dwUnCommittedSize: DWORD, + pub lpFirstBlock: LPVOID, + pub lpLastBlock: LPVOID, +} +pub type PROCESS_HEAP_ENTRY = _PROCESS_HEAP_ENTRY; +pub type LPPROCESS_HEAP_ENTRY = *mut _PROCESS_HEAP_ENTRY; +pub type PPROCESS_HEAP_ENTRY = *mut _PROCESS_HEAP_ENTRY; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _REASON_CONTEXT { + pub Version: ULONG, + pub Flags: DWORD, + pub Reason: _REASON_CONTEXT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _REASON_CONTEXT__bindgen_ty_1 { + pub Detailed: _REASON_CONTEXT__bindgen_ty_1__bindgen_ty_1, + pub SimpleReasonString: LPWSTR, + _bindgen_union_align: [u64; 3usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REASON_CONTEXT__bindgen_ty_1__bindgen_ty_1 { + pub LocalizedReasonModule: HMODULE, + pub LocalizedReasonId: ULONG, + pub ReasonStringCount: ULONG, + pub ReasonStrings: *mut LPWSTR, +} +pub type REASON_CONTEXT = _REASON_CONTEXT; +pub type PREASON_CONTEXT = *mut _REASON_CONTEXT; +pub type PTHREAD_START_ROUTINE = + ::std::option::Option DWORD>; +pub type LPTHREAD_START_ROUTINE = PTHREAD_START_ROUTINE; +pub type PENCLAVE_ROUTINE = + ::std::option::Option LPVOID>; +pub type LPENCLAVE_ROUTINE = PENCLAVE_ROUTINE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXCEPTION_DEBUG_INFO { + pub ExceptionRecord: EXCEPTION_RECORD, + pub dwFirstChance: DWORD, +} +pub type EXCEPTION_DEBUG_INFO = _EXCEPTION_DEBUG_INFO; +pub type LPEXCEPTION_DEBUG_INFO = *mut _EXCEPTION_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CREATE_THREAD_DEBUG_INFO { + pub hThread: HANDLE, + pub lpThreadLocalBase: LPVOID, + pub lpStartAddress: LPTHREAD_START_ROUTINE, +} +pub type CREATE_THREAD_DEBUG_INFO = _CREATE_THREAD_DEBUG_INFO; +pub type LPCREATE_THREAD_DEBUG_INFO = *mut _CREATE_THREAD_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CREATE_PROCESS_DEBUG_INFO { + pub hFile: HANDLE, + pub hProcess: HANDLE, + pub hThread: HANDLE, + pub lpBaseOfImage: LPVOID, + pub dwDebugInfoFileOffset: DWORD, + pub nDebugInfoSize: DWORD, + pub lpThreadLocalBase: LPVOID, + pub lpStartAddress: LPTHREAD_START_ROUTINE, + pub lpImageName: LPVOID, + pub fUnicode: WORD, +} +pub type CREATE_PROCESS_DEBUG_INFO = _CREATE_PROCESS_DEBUG_INFO; +pub type LPCREATE_PROCESS_DEBUG_INFO = *mut _CREATE_PROCESS_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXIT_THREAD_DEBUG_INFO { + pub dwExitCode: DWORD, +} +pub type EXIT_THREAD_DEBUG_INFO = _EXIT_THREAD_DEBUG_INFO; +pub type LPEXIT_THREAD_DEBUG_INFO = *mut _EXIT_THREAD_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EXIT_PROCESS_DEBUG_INFO { + pub dwExitCode: DWORD, +} +pub type EXIT_PROCESS_DEBUG_INFO = _EXIT_PROCESS_DEBUG_INFO; +pub type LPEXIT_PROCESS_DEBUG_INFO = *mut _EXIT_PROCESS_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _LOAD_DLL_DEBUG_INFO { + pub hFile: HANDLE, + pub lpBaseOfDll: LPVOID, + pub dwDebugInfoFileOffset: DWORD, + pub nDebugInfoSize: DWORD, + pub lpImageName: LPVOID, + pub fUnicode: WORD, +} +pub type LOAD_DLL_DEBUG_INFO = _LOAD_DLL_DEBUG_INFO; +pub type LPLOAD_DLL_DEBUG_INFO = *mut _LOAD_DLL_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _UNLOAD_DLL_DEBUG_INFO { + pub lpBaseOfDll: LPVOID, +} +pub type UNLOAD_DLL_DEBUG_INFO = _UNLOAD_DLL_DEBUG_INFO; +pub type LPUNLOAD_DLL_DEBUG_INFO = *mut _UNLOAD_DLL_DEBUG_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OUTPUT_DEBUG_STRING_INFO { + pub lpDebugStringData: LPSTR, + pub fUnicode: WORD, + pub nDebugStringLength: WORD, +} +pub type OUTPUT_DEBUG_STRING_INFO = _OUTPUT_DEBUG_STRING_INFO; +pub type LPOUTPUT_DEBUG_STRING_INFO = *mut _OUTPUT_DEBUG_STRING_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RIP_INFO { + pub dwError: DWORD, + pub dwType: DWORD, +} +pub type RIP_INFO = _RIP_INFO; +pub type LPRIP_INFO = *mut _RIP_INFO; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _DEBUG_EVENT { + pub dwDebugEventCode: DWORD, + pub dwProcessId: DWORD, + pub dwThreadId: DWORD, + pub u: _DEBUG_EVENT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _DEBUG_EVENT__bindgen_ty_1 { + pub Exception: EXCEPTION_DEBUG_INFO, + pub CreateThread: CREATE_THREAD_DEBUG_INFO, + pub CreateProcessInfo: CREATE_PROCESS_DEBUG_INFO, + pub ExitThread: EXIT_THREAD_DEBUG_INFO, + pub ExitProcess: EXIT_PROCESS_DEBUG_INFO, + pub LoadDll: LOAD_DLL_DEBUG_INFO, + pub UnloadDll: UNLOAD_DLL_DEBUG_INFO, + pub DebugString: OUTPUT_DEBUG_STRING_INFO, + pub RipInfo: RIP_INFO, + _bindgen_union_align: [u64; 20usize], +} +pub type DEBUG_EVENT = _DEBUG_EVENT; +pub type LPDEBUG_EVENT = *mut _DEBUG_EVENT; +pub type LPCONTEXT = PCONTEXT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONTRACT_DESCRIPTION { + _unused: [u8; 0], +} +pub type CONTRACT_DESCRIPTION = _CONTRACT_DESCRIPTION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _BEM_REFERENCE { + _unused: [u8; 0], +} +pub type BEM_REFERENCE = _BEM_REFERENCE; +pub type BEM_FREE_INTERFACE_CALLBACK = + ::std::option::Option; +extern "C" { + pub fn BemCreateReference( + iid: *const GUID, + interfaceInstance: *mut ::std::os::raw::c_void, + freeCallback: BEM_FREE_INTERFACE_CALLBACK, + reference: *mut *mut BEM_REFERENCE, + ) -> HRESULT; +} +extern "C" { + pub fn BemCreateContractFrom( + dllPath: LPCWSTR, + extensionId: *const GUID, + contractDescription: *const CONTRACT_DESCRIPTION, + hostContract: *mut ::std::os::raw::c_void, + contract: *mut *mut ::std::os::raw::c_void, + ) -> HRESULT; +} +extern "C" { + pub fn BemCopyReference( + reference: *mut BEM_REFERENCE, + copiedReference: *mut *mut BEM_REFERENCE, + ) -> HRESULT; +} +extern "C" { + pub fn BemFreeReference(reference: *mut BEM_REFERENCE); +} +extern "C" { + pub fn BemFreeContract(contract: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn IsDebuggerPresent() -> WINBOOL; +} +extern "C" { + pub fn OutputDebugStringA(lpOutputString: LPCSTR); +} +extern "C" { + pub fn OutputDebugStringW(lpOutputString: LPCWSTR); +} +extern "C" { + pub fn DebugBreak(); +} +extern "C" { + pub fn ContinueDebugEvent( + dwProcessId: DWORD, + dwThreadId: DWORD, + dwContinueStatus: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WaitForDebugEvent(lpDebugEvent: LPDEBUG_EVENT, dwMilliseconds: DWORD) -> WINBOOL; +} +extern "C" { + pub fn DebugActiveProcess(dwProcessId: DWORD) -> WINBOOL; +} +extern "C" { + pub fn DebugActiveProcessStop(dwProcessId: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CheckRemoteDebuggerPresent(hProcess: HANDLE, pbDebuggerPresent: PBOOL) -> WINBOOL; +} +pub type PTOP_LEVEL_EXCEPTION_FILTER = + ::std::option::Option LONG>; +pub type LPTOP_LEVEL_EXCEPTION_FILTER = PTOP_LEVEL_EXCEPTION_FILTER; +extern "C" { + pub fn SetErrorMode(uMode: UINT) -> UINT; +} +extern "C" { + pub fn SetUnhandledExceptionFilter( + lpTopLevelExceptionFilter: LPTOP_LEVEL_EXCEPTION_FILTER, + ) -> LPTOP_LEVEL_EXCEPTION_FILTER; +} +extern "C" { + pub fn UnhandledExceptionFilter(ExceptionInfo: *mut _EXCEPTION_POINTERS) -> LONG; +} +extern "C" { + pub fn AddVectoredExceptionHandler(First: ULONG, Handler: PVECTORED_EXCEPTION_HANDLER) + -> PVOID; +} +extern "C" { + pub fn RemoveVectoredExceptionHandler(Handle: PVOID) -> ULONG; +} +extern "C" { + pub fn AddVectoredContinueHandler(First: ULONG, Handler: PVECTORED_EXCEPTION_HANDLER) -> PVOID; +} +extern "C" { + pub fn RemoveVectoredContinueHandler(Handle: PVOID) -> ULONG; +} +extern "C" { + pub fn RaiseException( + dwExceptionCode: DWORD, + dwExceptionFlags: DWORD, + nNumberOfArguments: DWORD, + lpArguments: *const ULONG_PTR, + ); +} +extern "C" { + pub fn GetLastError() -> DWORD; +} +extern "C" { + pub fn SetLastError(dwErrCode: DWORD); +} +extern "C" { + pub fn CreateFileW( + lpFileName: LPCWSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwCreationDisposition: DWORD, + dwFlagsAndAttributes: DWORD, + hTemplateFile: HANDLE, + ) -> HANDLE; +} +extern "C" { + pub fn GetFileAttributesW(lpFileName: LPCWSTR) -> DWORD; +} +extern "C" { + pub fn GetFileSize(hFile: HANDLE, lpFileSizeHigh: LPDWORD) -> DWORD; +} +extern "C" { + pub fn SetFilePointer( + hFile: HANDLE, + lDistanceToMove: LONG, + lpDistanceToMoveHigh: PLONG, + dwMoveMethod: DWORD, + ) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _BY_HANDLE_FILE_INFORMATION { + pub dwFileAttributes: DWORD, + pub ftCreationTime: FILETIME, + pub ftLastAccessTime: FILETIME, + pub ftLastWriteTime: FILETIME, + pub dwVolumeSerialNumber: DWORD, + pub nFileSizeHigh: DWORD, + pub nFileSizeLow: DWORD, + pub nNumberOfLinks: DWORD, + pub nFileIndexHigh: DWORD, + pub nFileIndexLow: DWORD, +} +pub type BY_HANDLE_FILE_INFORMATION = _BY_HANDLE_FILE_INFORMATION; +pub type PBY_HANDLE_FILE_INFORMATION = *mut _BY_HANDLE_FILE_INFORMATION; +pub type LPBY_HANDLE_FILE_INFORMATION = *mut _BY_HANDLE_FILE_INFORMATION; +extern "C" { + pub fn CreateFileA( + lpFileName: LPCSTR, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + dwCreationDisposition: DWORD, + dwFlagsAndAttributes: DWORD, + hTemplateFile: HANDLE, + ) -> HANDLE; +} +extern "C" { + pub fn DefineDosDeviceW( + dwFlags: DWORD, + lpDeviceName: LPCWSTR, + lpTargetPath: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn FindCloseChangeNotification(hChangeHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn FindFirstChangeNotificationA( + lpPathName: LPCSTR, + bWatchSubtree: WINBOOL, + dwNotifyFilter: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindFirstChangeNotificationW( + lpPathName: LPCWSTR, + bWatchSubtree: WINBOOL, + dwNotifyFilter: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindFirstVolumeW(lpszVolumeName: LPWSTR, cchBufferLength: DWORD) -> HANDLE; +} +extern "C" { + pub fn FindNextChangeNotification(hChangeHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn FindNextVolumeW( + hFindVolume: HANDLE, + lpszVolumeName: LPWSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FindVolumeClose(hFindVolume: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GetFileInformationByHandle( + hFile: HANDLE, + lpFileInformation: LPBY_HANDLE_FILE_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn CompareFileTime(lpFileTime1: *const FILETIME, lpFileTime2: *const FILETIME) -> LONG; +} +extern "C" { + pub fn DeleteVolumeMountPointW(lpszVolumeMountPoint: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn FileTimeToLocalFileTime( + lpFileTime: *const FILETIME, + lpLocalFileTime: LPFILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn FindFirstFileA(lpFileName: LPCSTR, lpFindFileData: LPWIN32_FIND_DATAA) -> HANDLE; +} +extern "C" { + pub fn FindFirstFileW(lpFileName: LPCWSTR, lpFindFileData: LPWIN32_FIND_DATAW) -> HANDLE; +} +extern "C" { + pub fn GetDiskFreeSpaceA( + lpRootPathName: LPCSTR, + lpSectorsPerCluster: LPDWORD, + lpBytesPerSector: LPDWORD, + lpNumberOfFreeClusters: LPDWORD, + lpTotalNumberOfClusters: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetDiskFreeSpaceW( + lpRootPathName: LPCWSTR, + lpSectorsPerCluster: LPDWORD, + lpBytesPerSector: LPDWORD, + lpNumberOfFreeClusters: LPDWORD, + lpTotalNumberOfClusters: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetDriveTypeA(lpRootPathName: LPCSTR) -> UINT; +} +extern "C" { + pub fn GetDriveTypeW(lpRootPathName: LPCWSTR) -> UINT; +} +extern "C" { + pub fn GetFileAttributesA(lpFileName: LPCSTR) -> DWORD; +} +extern "C" { + pub fn GetFileSizeEx(hFile: HANDLE, lpFileSize: PLARGE_INTEGER) -> WINBOOL; +} +extern "C" { + pub fn GetFileTime( + hFile: HANDLE, + lpCreationTime: LPFILETIME, + lpLastAccessTime: LPFILETIME, + lpLastWriteTime: LPFILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn GetFileType(hFile: HANDLE) -> DWORD; +} +extern "C" { + pub fn GetFullPathNameA( + lpFileName: LPCSTR, + nBufferLength: DWORD, + lpBuffer: LPSTR, + lpFilePart: *mut LPSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetFullPathNameW( + lpFileName: LPCWSTR, + nBufferLength: DWORD, + lpBuffer: LPWSTR, + lpFilePart: *mut LPWSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetLogicalDrives() -> DWORD; +} +extern "C" { + pub fn GetLogicalDriveStringsW(nBufferLength: DWORD, lpBuffer: LPWSTR) -> DWORD; +} +extern "C" { + pub fn GetLongPathNameA(lpszShortPath: LPCSTR, lpszLongPath: LPSTR, cchBuffer: DWORD) -> DWORD; +} +extern "C" { + pub fn GetLongPathNameW( + lpszShortPath: LPCWSTR, + lpszLongPath: LPWSTR, + cchBuffer: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetShortPathNameW( + lpszLongPath: LPCWSTR, + lpszShortPath: LPWSTR, + cchBuffer: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetTempFileNameA( + lpPathName: LPCSTR, + lpPrefixString: LPCSTR, + uUnique: UINT, + lpTempFileName: LPSTR, + ) -> UINT; +} +extern "C" { + pub fn GetTempFileNameW( + lpPathName: LPCWSTR, + lpPrefixString: LPCWSTR, + uUnique: UINT, + lpTempFileName: LPWSTR, + ) -> UINT; +} +extern "C" { + pub fn GetVolumeInformationW( + lpRootPathName: LPCWSTR, + lpVolumeNameBuffer: LPWSTR, + nVolumeNameSize: DWORD, + lpVolumeSerialNumber: LPDWORD, + lpMaximumComponentLength: LPDWORD, + lpFileSystemFlags: LPDWORD, + lpFileSystemNameBuffer: LPWSTR, + nFileSystemNameSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetVolumePathNameW( + lpszFileName: LPCWSTR, + lpszVolumePathName: LPWSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn LocalFileTimeToFileTime( + lpLocalFileTime: *const FILETIME, + lpFileTime: LPFILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn LockFile( + hFile: HANDLE, + dwFileOffsetLow: DWORD, + dwFileOffsetHigh: DWORD, + nNumberOfBytesToLockLow: DWORD, + nNumberOfBytesToLockHigh: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryDosDeviceW(lpDeviceName: LPCWSTR, lpTargetPath: LPWSTR, ucchMax: DWORD) -> DWORD; +} +extern "C" { + pub fn ReadFileEx( + hFile: HANDLE, + lpBuffer: LPVOID, + nNumberOfBytesToRead: DWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadFileScatter( + hFile: HANDLE, + aSegmentArray: *mut FILE_SEGMENT_ELEMENT, + nNumberOfBytesToRead: DWORD, + lpReserved: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn SetFileTime( + hFile: HANDLE, + lpCreationTime: *const FILETIME, + lpLastAccessTime: *const FILETIME, + lpLastWriteTime: *const FILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn SetFileValidData(hFile: HANDLE, ValidDataLength: LONGLONG) -> WINBOOL; +} +extern "C" { + pub fn UnlockFile( + hFile: HANDLE, + dwFileOffsetLow: DWORD, + dwFileOffsetHigh: DWORD, + nNumberOfBytesToUnlockLow: DWORD, + nNumberOfBytesToUnlockHigh: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteFileEx( + hFile: HANDLE, + lpBuffer: LPCVOID, + nNumberOfBytesToWrite: DWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteFileGather( + hFile: HANDLE, + aSegmentArray: *mut FILE_SEGMENT_ELEMENT, + nNumberOfBytesToWrite: DWORD, + lpReserved: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn GetVolumeNameForVolumeMountPointW( + lpszVolumeMountPoint: LPCWSTR, + lpszVolumeName: LPWSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetVolumePathNamesForVolumeNameW( + lpszVolumeName: LPCWSTR, + lpszVolumePathNames: LPWCH, + cchBufferLength: DWORD, + lpcchReturnLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTempPathA(nBufferLength: DWORD, lpBuffer: LPSTR) -> DWORD; +} +extern "C" { + pub fn GetTempPathW(nBufferLength: DWORD, lpBuffer: LPWSTR) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _WIN32_FILE_ATTRIBUTE_DATA { + pub dwFileAttributes: DWORD, + pub ftCreationTime: FILETIME, + pub ftLastAccessTime: FILETIME, + pub ftLastWriteTime: FILETIME, + pub nFileSizeHigh: DWORD, + pub nFileSizeLow: DWORD, +} +pub type WIN32_FILE_ATTRIBUTE_DATA = _WIN32_FILE_ATTRIBUTE_DATA; +pub type LPWIN32_FILE_ATTRIBUTE_DATA = *mut _WIN32_FILE_ATTRIBUTE_DATA; +extern "C" { + pub fn CreateDirectoryA( + lpPathName: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateDirectoryW( + lpPathName: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> WINBOOL; +} +extern "C" { + pub fn DeleteFileA(lpFileName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn DeleteFileW(lpFileName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn FindClose(hFindFile: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn FindFirstFileExA( + lpFileName: LPCSTR, + fInfoLevelId: FINDEX_INFO_LEVELS, + lpFindFileData: LPVOID, + fSearchOp: FINDEX_SEARCH_OPS, + lpSearchFilter: LPVOID, + dwAdditionalFlags: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindFirstFileExW( + lpFileName: LPCWSTR, + fInfoLevelId: FINDEX_INFO_LEVELS, + lpFindFileData: LPVOID, + fSearchOp: FINDEX_SEARCH_OPS, + lpSearchFilter: LPVOID, + dwAdditionalFlags: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindNextFileA(hFindFile: HANDLE, lpFindFileData: LPWIN32_FIND_DATAA) -> WINBOOL; +} +extern "C" { + pub fn FindNextFileW(hFindFile: HANDLE, lpFindFileData: LPWIN32_FIND_DATAW) -> WINBOOL; +} +extern "C" { + pub fn FlushFileBuffers(hFile: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GetDiskFreeSpaceExA( + lpDirectoryName: LPCSTR, + lpFreeBytesAvailableToCaller: PULARGE_INTEGER, + lpTotalNumberOfBytes: PULARGE_INTEGER, + lpTotalNumberOfFreeBytes: PULARGE_INTEGER, + ) -> WINBOOL; +} +extern "C" { + pub fn GetDiskFreeSpaceExW( + lpDirectoryName: LPCWSTR, + lpFreeBytesAvailableToCaller: PULARGE_INTEGER, + lpTotalNumberOfBytes: PULARGE_INTEGER, + lpTotalNumberOfFreeBytes: PULARGE_INTEGER, + ) -> WINBOOL; +} +extern "C" { + pub fn GetFileAttributesExA( + lpFileName: LPCSTR, + fInfoLevelId: GET_FILEEX_INFO_LEVELS, + lpFileInformation: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn GetFileAttributesExW( + lpFileName: LPCWSTR, + fInfoLevelId: GET_FILEEX_INFO_LEVELS, + lpFileInformation: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn LockFileEx( + hFile: HANDLE, + dwFlags: DWORD, + dwReserved: DWORD, + nNumberOfBytesToLockLow: DWORD, + nNumberOfBytesToLockHigh: DWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadFile( + hFile: HANDLE, + lpBuffer: LPVOID, + nNumberOfBytesToRead: DWORD, + lpNumberOfBytesRead: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn RemoveDirectoryA(lpPathName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn RemoveDirectoryW(lpPathName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn SetEndOfFile(hFile: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn SetFileAttributesA(lpFileName: LPCSTR, dwFileAttributes: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetFileAttributesW(lpFileName: LPCWSTR, dwFileAttributes: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetFilePointerEx( + hFile: HANDLE, + liDistanceToMove: LARGE_INTEGER, + lpNewFilePointer: PLARGE_INTEGER, + dwMoveMethod: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn UnlockFileEx( + hFile: HANDLE, + dwReserved: DWORD, + nNumberOfBytesToUnlockLow: DWORD, + nNumberOfBytesToUnlockHigh: DWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteFile( + hFile: HANDLE, + lpBuffer: LPCVOID, + nNumberOfBytesToWrite: DWORD, + lpNumberOfBytesWritten: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn CloseHandle(hObject: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn DuplicateHandle( + hSourceProcessHandle: HANDLE, + hSourceHandle: HANDLE, + hTargetProcessHandle: HANDLE, + lpTargetHandle: LPHANDLE, + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + dwOptions: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetHandleInformation(hObject: HANDLE, lpdwFlags: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn SetHandleInformation(hObject: HANDLE, dwMask: DWORD, dwFlags: DWORD) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _HEAP_SUMMARY { + pub cb: DWORD, + pub cbAllocated: SIZE_T, + pub cbCommitted: SIZE_T, + pub cbReserved: SIZE_T, + pub cbMaxReserve: SIZE_T, +} +pub type HEAP_SUMMARY = _HEAP_SUMMARY; +pub type PHEAP_SUMMARY = *mut _HEAP_SUMMARY; +pub type LPHEAP_SUMMARY = PHEAP_SUMMARY; +extern "C" { + pub fn HeapCreate(flOptions: DWORD, dwInitialSize: SIZE_T, dwMaximumSize: SIZE_T) -> HANDLE; +} +extern "C" { + pub fn HeapDestroy(hHeap: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn HeapValidate(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID) -> WINBOOL; +} +extern "C" { + pub fn HeapCompact(hHeap: HANDLE, dwFlags: DWORD) -> SIZE_T; +} +extern "C" { + pub fn HeapSummary(hHeap: HANDLE, dwFlags: DWORD, lpSummary: LPHEAP_SUMMARY) -> WINBOOL; +} +extern "C" { + pub fn GetProcessHeaps(NumberOfHeaps: DWORD, ProcessHeaps: PHANDLE) -> DWORD; +} +extern "C" { + pub fn HeapLock(hHeap: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn HeapUnlock(hHeap: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn HeapWalk(hHeap: HANDLE, lpEntry: LPPROCESS_HEAP_ENTRY) -> WINBOOL; +} +extern "C" { + pub fn HeapSetInformation( + HeapHandle: HANDLE, + HeapInformationClass: HEAP_INFORMATION_CLASS, + HeapInformation: PVOID, + HeapInformationLength: SIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn HeapQueryInformation( + HeapHandle: HANDLE, + HeapInformationClass: HEAP_INFORMATION_CLASS, + HeapInformation: PVOID, + HeapInformationLength: SIZE_T, + ReturnLength: PSIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID; +} +extern "C" { + pub fn HeapReAlloc(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID, dwBytes: SIZE_T) -> LPVOID; +} +extern "C" { + pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn HeapSize(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPCVOID) -> SIZE_T; +} +extern "C" { + pub fn GetProcessHeap() -> HANDLE; +} +extern "C" { + pub fn GetOverlappedResult( + hFile: HANDLE, + lpOverlapped: LPOVERLAPPED, + lpNumberOfBytesTransferred: LPDWORD, + bWait: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateIoCompletionPort( + FileHandle: HANDLE, + ExistingCompletionPort: HANDLE, + CompletionKey: ULONG_PTR, + NumberOfConcurrentThreads: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn GetQueuedCompletionStatus( + CompletionPort: HANDLE, + lpNumberOfBytesTransferred: LPDWORD, + lpCompletionKey: PULONG_PTR, + lpOverlapped: *mut LPOVERLAPPED, + dwMilliseconds: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn PostQueuedCompletionStatus( + CompletionPort: HANDLE, + dwNumberOfBytesTransferred: DWORD, + dwCompletionKey: ULONG_PTR, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn DeviceIoControl( + hDevice: HANDLE, + dwIoControlCode: DWORD, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesReturned: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn CancelIo(hFile: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GetOverlappedResultEx( + hFile: HANDLE, + lpOverlapped: LPOVERLAPPED, + lpNumberOfBytesTransferred: LPDWORD, + dwMilliseconds: DWORD, + bAlertable: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn InitializeSListHead(ListHead: PSLIST_HEADER); +} +extern "C" { + pub fn InterlockedPopEntrySList(ListHead: PSLIST_HEADER) -> PSLIST_ENTRY; +} +extern "C" { + pub fn InterlockedPushEntrySList( + ListHead: PSLIST_HEADER, + ListEntry: PSLIST_ENTRY, + ) -> PSLIST_ENTRY; +} +extern "C" { + pub fn InterlockedFlushSList(ListHead: PSLIST_HEADER) -> PSLIST_ENTRY; +} +extern "C" { + pub fn QueryDepthSList(ListHead: PSLIST_HEADER) -> USHORT; +} +extern "C" { + pub fn IsProcessInJob(ProcessHandle: HANDLE, JobHandle: HANDLE, Result: PBOOL) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagENUMUILANG { + pub NumOfEnumUILang: ULONG, + pub SizeOfEnumUIBuffer: ULONG, + pub pEnumUIBuffer: *mut LANGID, +} +pub type ENUMUILANG = tagENUMUILANG; +pub type PENUMUILANG = *mut tagENUMUILANG; +pub type ENUMRESLANGPROCA = ::std::option::Option< + unsafe extern "C" fn( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPCSTR, + wLanguage: WORD, + lParam: LONG_PTR, + ) -> WINBOOL, +>; +pub type ENUMRESLANGPROCW = ::std::option::Option< + unsafe extern "C" fn( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPCWSTR, + wLanguage: WORD, + lParam: LONG_PTR, + ) -> WINBOOL, +>; +pub type ENUMRESNAMEPROCA = ::std::option::Option< + unsafe extern "C" fn( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPSTR, + lParam: LONG_PTR, + ) -> WINBOOL, +>; +pub type ENUMRESNAMEPROCW = ::std::option::Option< + unsafe extern "C" fn( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPWSTR, + lParam: LONG_PTR, + ) -> WINBOOL, +>; +pub type ENUMRESTYPEPROCA = ::std::option::Option< + unsafe extern "C" fn(hModule: HMODULE, lpType: LPSTR, lParam: LONG_PTR) -> WINBOOL, +>; +pub type ENUMRESTYPEPROCW = ::std::option::Option< + unsafe extern "C" fn(hModule: HMODULE, lpType: LPWSTR, lParam: LONG_PTR) -> WINBOOL, +>; +pub type PGET_MODULE_HANDLE_EXA = ::std::option::Option< + unsafe extern "C" fn(dwFlags: DWORD, lpModuleName: LPCSTR, phModule: *mut HMODULE) -> WINBOOL, +>; +pub type PGET_MODULE_HANDLE_EXW = ::std::option::Option< + unsafe extern "C" fn(dwFlags: DWORD, lpModuleName: LPCWSTR, phModule: *mut HMODULE) -> WINBOOL, +>; +pub type DLL_DIRECTORY_COOKIE = PVOID; +pub type PDLL_DIRECTORY_COOKIE = *mut PVOID; +extern "C" { + pub fn EnumResourceNamesW( + hModule: HMODULE, + lpType: LPCWSTR, + lpEnumFunc: ENUMRESNAMEPROCW, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn FindResourceW(hModule: HMODULE, lpName: LPCWSTR, lpType: LPCWSTR) -> HRSRC; +} +extern "C" { + pub fn FindResourceExW( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPCWSTR, + wLanguage: WORD, + ) -> HRSRC; +} +extern "C" { + pub fn FreeLibraryAndExitThread(hLibModule: HMODULE, dwExitCode: DWORD); +} +extern "C" { + pub fn FreeResource(hResData: HGLOBAL) -> WINBOOL; +} +extern "C" { + pub fn GetModuleHandleA(lpModuleName: LPCSTR) -> HMODULE; +} +extern "C" { + pub fn GetModuleHandleW(lpModuleName: LPCWSTR) -> HMODULE; +} +extern "C" { + pub fn LoadLibraryA(lpLibFileName: LPCSTR) -> HMODULE; +} +extern "C" { + pub fn LoadLibraryW(lpLibFileName: LPCWSTR) -> HMODULE; +} +extern "C" { + pub fn LoadLibraryExA(lpLibFileName: LPCSTR, hFile: HANDLE, dwFlags: DWORD) -> HMODULE; +} +extern "C" { + pub fn LoadLibraryExW(lpLibFileName: LPCWSTR, hFile: HANDLE, dwFlags: DWORD) -> HMODULE; +} +extern "C" { + pub fn LoadResource(hModule: HMODULE, hResInfo: HRSRC) -> HGLOBAL; +} +extern "C" { + pub fn LoadStringA( + hInstance: HINSTANCE, + uID: UINT, + lpBuffer: LPSTR, + cchBufferMax: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn LoadStringW( + hInstance: HINSTANCE, + uID: UINT, + lpBuffer: LPWSTR, + cchBufferMax: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn LockResource(hResData: HGLOBAL) -> LPVOID; +} +extern "C" { + pub fn SizeofResource(hModule: HMODULE, hResInfo: HRSRC) -> DWORD; +} +extern "C" { + pub fn AddDllDirectory(NewDirectory: PCWSTR) -> DLL_DIRECTORY_COOKIE; +} +extern "C" { + pub fn RemoveDllDirectory(Cookie: DLL_DIRECTORY_COOKIE) -> WINBOOL; +} +extern "C" { + pub fn SetDefaultDllDirectories(DirectoryFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetModuleHandleExA( + dwFlags: DWORD, + lpModuleName: LPCSTR, + phModule: *mut HMODULE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetModuleHandleExW( + dwFlags: DWORD, + lpModuleName: LPCWSTR, + phModule: *mut HMODULE, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumResourceLanguagesA( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPCSTR, + lpEnumFunc: ENUMRESLANGPROCA, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumResourceLanguagesW( + hModule: HMODULE, + lpType: LPCWSTR, + lpName: LPCWSTR, + lpEnumFunc: ENUMRESLANGPROCW, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn DisableThreadLibraryCalls(hLibModule: HMODULE) -> WINBOOL; +} +extern "C" { + pub fn FreeLibrary(hLibModule: HMODULE) -> WINBOOL; +} +extern "C" { + pub fn GetProcAddress(hModule: HMODULE, lpProcName: LPCSTR) -> FARPROC; +} +extern "C" { + pub fn GetModuleFileNameA(hModule: HMODULE, lpFilename: LPSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn GetModuleFileNameW(hModule: HMODULE, lpFilename: LPWSTR, nSize: DWORD) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REDIRECTION_FUNCTION_DESCRIPTOR { + pub DllName: PCSTR, + pub FunctionName: PCSTR, + pub RedirectionTarget: PVOID, +} +pub type REDIRECTION_FUNCTION_DESCRIPTOR = _REDIRECTION_FUNCTION_DESCRIPTOR; +pub type PREDIRECTION_FUNCTION_DESCRIPTOR = *mut _REDIRECTION_FUNCTION_DESCRIPTOR; +pub type PCREDIRECTION_FUNCTION_DESCRIPTOR = *const REDIRECTION_FUNCTION_DESCRIPTOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REDIRECTION_DESCRIPTOR { + pub Version: ULONG, + pub FunctionCount: ULONG, + pub Redirections: PCREDIRECTION_FUNCTION_DESCRIPTOR, +} +pub type REDIRECTION_DESCRIPTOR = _REDIRECTION_DESCRIPTOR; +pub type PREDIRECTION_DESCRIPTOR = *mut _REDIRECTION_DESCRIPTOR; +pub type PCREDIRECTION_DESCRIPTOR = *const REDIRECTION_DESCRIPTOR; +pub const _MEMORY_RESOURCE_NOTIFICATION_TYPE_LowMemoryResourceNotification: + _MEMORY_RESOURCE_NOTIFICATION_TYPE = 0; +pub const _MEMORY_RESOURCE_NOTIFICATION_TYPE_HighMemoryResourceNotification: + _MEMORY_RESOURCE_NOTIFICATION_TYPE = 1; +pub type _MEMORY_RESOURCE_NOTIFICATION_TYPE = u32; +pub use self::_MEMORY_RESOURCE_NOTIFICATION_TYPE as MEMORY_RESOURCE_NOTIFICATION_TYPE; +extern "C" { + pub fn VirtualFree(lpAddress: LPVOID, dwSize: SIZE_T, dwFreeType: DWORD) -> WINBOOL; +} +extern "C" { + pub fn VirtualQuery( + lpAddress: LPCVOID, + lpBuffer: PMEMORY_BASIC_INFORMATION, + dwLength: SIZE_T, + ) -> SIZE_T; +} +extern "C" { + pub fn FlushViewOfFile(lpBaseAddress: LPCVOID, dwNumberOfBytesToFlush: SIZE_T) -> WINBOOL; +} +extern "C" { + pub fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> WINBOOL; +} +extern "C" { + pub fn CreateFileMappingFromApp( + hFile: HANDLE, + SecurityAttributes: PSECURITY_ATTRIBUTES, + PageProtection: ULONG, + MaximumSize: ULONG64, + Name: PCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn MapViewOfFileFromApp( + hFileMappingObject: HANDLE, + DesiredAccess: ULONG, + FileOffset: ULONG64, + NumberOfBytesToMap: SIZE_T, + ) -> PVOID; +} +extern "C" { + pub fn VirtualProtect( + lpAddress: LPVOID, + dwSize: SIZE_T, + flNewProtect: DWORD, + lpflOldProtect: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn VirtualAlloc( + lpAddress: LPVOID, + dwSize: SIZE_T, + flAllocationType: DWORD, + flProtect: DWORD, + ) -> LPVOID; +} +extern "C" { + pub fn VirtualAllocEx( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + flAllocationType: DWORD, + flProtect: DWORD, + ) -> LPVOID; +} +extern "C" { + pub fn VirtualFreeEx( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + dwFreeType: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn VirtualProtectEx( + hProcess: HANDLE, + lpAddress: LPVOID, + dwSize: SIZE_T, + flNewProtect: DWORD, + lpflOldProtect: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn VirtualQueryEx( + hProcess: HANDLE, + lpAddress: LPCVOID, + lpBuffer: PMEMORY_BASIC_INFORMATION, + dwLength: SIZE_T, + ) -> SIZE_T; +} +extern "C" { + pub fn ReadProcessMemory( + hProcess: HANDLE, + lpBaseAddress: LPCVOID, + lpBuffer: LPVOID, + nSize: SIZE_T, + lpNumberOfBytesRead: *mut SIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteProcessMemory( + hProcess: HANDLE, + lpBaseAddress: LPVOID, + lpBuffer: LPCVOID, + nSize: SIZE_T, + lpNumberOfBytesWritten: *mut SIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateFileMappingW( + hFile: HANDLE, + lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, + dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenFileMappingW( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn MapViewOfFile( + hFileMappingObject: HANDLE, + dwDesiredAccess: DWORD, + dwFileOffsetHigh: DWORD, + dwFileOffsetLow: DWORD, + dwNumberOfBytesToMap: SIZE_T, + ) -> LPVOID; +} +extern "C" { + pub fn MapViewOfFileEx( + hFileMappingObject: HANDLE, + dwDesiredAccess: DWORD, + dwFileOffsetHigh: DWORD, + dwFileOffsetLow: DWORD, + dwNumberOfBytesToMap: SIZE_T, + lpBaseAddress: LPVOID, + ) -> LPVOID; +} +extern "C" { + pub fn GetLargePageMinimum() -> SIZE_T; +} +extern "C" { + pub fn GetProcessWorkingSetSizeEx( + hProcess: HANDLE, + lpMinimumWorkingSetSize: PSIZE_T, + lpMaximumWorkingSetSize: PSIZE_T, + Flags: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetProcessWorkingSetSizeEx( + hProcess: HANDLE, + dwMinimumWorkingSetSize: SIZE_T, + dwMaximumWorkingSetSize: SIZE_T, + Flags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> WINBOOL; +} +extern "C" { + pub fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T) -> WINBOOL; +} +extern "C" { + pub fn GetWriteWatch( + dwFlags: DWORD, + lpBaseAddress: PVOID, + dwRegionSize: SIZE_T, + lpAddresses: *mut PVOID, + lpdwCount: *mut ULONG_PTR, + lpdwGranularity: LPDWORD, + ) -> UINT; +} +extern "C" { + pub fn ResetWriteWatch(lpBaseAddress: LPVOID, dwRegionSize: SIZE_T) -> UINT; +} +extern "C" { + pub fn CreateMemoryResourceNotification( + NotificationType: MEMORY_RESOURCE_NOTIFICATION_TYPE, + ) -> HANDLE; +} +extern "C" { + pub fn QueryMemoryResourceNotification( + ResourceNotificationHandle: HANDLE, + ResourceState: PBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSystemFileCacheSize( + lpMinimumFileCacheSize: PSIZE_T, + lpMaximumFileCacheSize: PSIZE_T, + lpFlags: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetSystemFileCacheSize( + MinimumFileCacheSize: SIZE_T, + MaximumFileCacheSize: SIZE_T, + Flags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ImpersonateNamedPipeClient(hNamedPipe: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn CreatePipe( + hReadPipe: PHANDLE, + hWritePipe: PHANDLE, + lpPipeAttributes: LPSECURITY_ATTRIBUTES, + nSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ConnectNamedPipe(hNamedPipe: HANDLE, lpOverlapped: LPOVERLAPPED) -> WINBOOL; +} +extern "C" { + pub fn DisconnectNamedPipe(hNamedPipe: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn SetNamedPipeHandleState( + hNamedPipe: HANDLE, + lpMode: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn PeekNamedPipe( + hNamedPipe: HANDLE, + lpBuffer: LPVOID, + nBufferSize: DWORD, + lpBytesRead: LPDWORD, + lpTotalBytesAvail: LPDWORD, + lpBytesLeftThisMessage: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn TransactNamedPipe( + hNamedPipe: HANDLE, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesRead: LPDWORD, + lpOverlapped: LPOVERLAPPED, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateNamedPipeW( + lpName: LPCWSTR, + dwOpenMode: DWORD, + dwPipeMode: DWORD, + nMaxInstances: DWORD, + nOutBufferSize: DWORD, + nInBufferSize: DWORD, + nDefaultTimeOut: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; +} +extern "C" { + pub fn WaitNamedPipeW(lpNamedPipeName: LPCWSTR, nTimeOut: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CreatePrivateNamespaceW( + lpPrivateNamespaceAttributes: LPSECURITY_ATTRIBUTES, + lpBoundaryDescriptor: LPVOID, + lpAliasPrefix: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenPrivateNamespaceW(lpBoundaryDescriptor: LPVOID, lpAliasPrefix: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn ClosePrivateNamespace(Handle: HANDLE, Flags: ULONG) -> BOOLEAN; +} +extern "C" { + pub fn CreateBoundaryDescriptorW(Name: LPCWSTR, Flags: ULONG) -> HANDLE; +} +extern "C" { + pub fn AddSIDToBoundaryDescriptor( + BoundaryDescriptor: *mut HANDLE, + RequiredSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn DeleteBoundaryDescriptor(BoundaryDescriptor: HANDLE); +} +extern "C" { + pub fn SetEnvironmentStringsW(NewEnvironment: LPWCH) -> WINBOOL; +} +extern "C" { + pub fn GetCommandLineA() -> LPSTR; +} +extern "C" { + pub fn GetCommandLineW() -> LPWSTR; +} +extern "C" { + pub fn SetCurrentDirectoryA(lpPathName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentDirectoryA(nBufferLength: DWORD, lpBuffer: LPSTR) -> DWORD; +} +extern "C" { + pub fn GetCurrentDirectoryW(nBufferLength: DWORD, lpBuffer: LPWSTR) -> DWORD; +} +extern "C" { + pub fn SearchPathW( + lpPath: LPCWSTR, + lpFileName: LPCWSTR, + lpExtension: LPCWSTR, + nBufferLength: DWORD, + lpBuffer: LPWSTR, + lpFilePart: *mut LPWSTR, + ) -> DWORD; +} +extern "C" { + pub fn SearchPathA( + lpPath: LPCSTR, + lpFileName: LPCSTR, + lpExtension: LPCSTR, + nBufferLength: DWORD, + lpBuffer: LPSTR, + lpFilePart: *mut LPSTR, + ) -> DWORD; +} +extern "C" { + pub fn NeedCurrentDirectoryForExePathA(ExeName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn NeedCurrentDirectoryForExePathW(ExeName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetEnvironmentStrings() -> LPCH; +} +extern "C" { + pub fn GetEnvironmentStringsW() -> LPWCH; +} +extern "C" { + pub fn GetStdHandle(nStdHandle: DWORD) -> HANDLE; +} +extern "C" { + pub fn ExpandEnvironmentStringsA(lpSrc: LPCSTR, lpDst: LPSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn ExpandEnvironmentStringsW(lpSrc: LPCWSTR, lpDst: LPWSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn FreeEnvironmentStringsA(penv: LPCH) -> WINBOOL; +} +extern "C" { + pub fn FreeEnvironmentStringsW(penv: LPWCH) -> WINBOOL; +} +extern "C" { + pub fn GetEnvironmentVariableA(lpName: LPCSTR, lpBuffer: LPSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn GetEnvironmentVariableW(lpName: LPCWSTR, lpBuffer: LPWSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn SetEnvironmentVariableA(lpName: LPCSTR, lpValue: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetEnvironmentVariableW(lpName: LPCWSTR, lpValue: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn SetStdHandle(nStdHandle: DWORD, hHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn TerminateProcess(hProcess: HANDLE, uExitCode: UINT) -> WINBOOL; +} +extern "C" { + pub fn OpenProcess( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + dwProcessId: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn QueueUserAPC(pfnAPC: PAPCFUNC, hThread: HANDLE, dwData: ULONG_PTR) -> DWORD; +} +extern "C" { + pub fn GetProcessTimes( + hProcess: HANDLE, + lpCreationTime: LPFILETIME, + lpExitTime: LPFILETIME, + lpKernelTime: LPFILETIME, + lpUserTime: LPFILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn ExitProcess(uExitCode: UINT); +} +extern "C" { + pub fn GetExitCodeProcess(hProcess: HANDLE, lpExitCode: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn SwitchToThread() -> WINBOOL; +} +extern "C" { + pub fn OpenThread(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, dwThreadId: DWORD) + -> HANDLE; +} +extern "C" { + pub fn SetThreadPriorityBoost(hThread: HANDLE, bDisablePriorityBoost: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetThreadPriorityBoost(hThread: HANDLE, pDisablePriorityBoost: PBOOL) -> WINBOOL; +} +extern "C" { + pub fn SetThreadToken(Thread: PHANDLE, Token: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn OpenProcessToken( + ProcessHandle: HANDLE, + DesiredAccess: DWORD, + TokenHandle: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn OpenThreadToken( + ThreadHandle: HANDLE, + DesiredAccess: DWORD, + OpenAsSelf: WINBOOL, + TokenHandle: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetPriorityClass(hProcess: HANDLE, dwPriorityClass: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetPriorityClass(hProcess: HANDLE) -> DWORD; +} +extern "C" { + pub fn GetProcessId(Process: HANDLE) -> DWORD; +} +extern "C" { + pub fn GetThreadId(Thread: HANDLE) -> DWORD; +} +extern "C" { + pub fn GetThreadContext(hThread: HANDLE, lpContext: LPCONTEXT) -> WINBOOL; +} +extern "C" { + pub fn FlushInstructionCache( + hProcess: HANDLE, + lpBaseAddress: LPCVOID, + dwSize: SIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn GetThreadTimes( + hThread: HANDLE, + lpCreationTime: LPFILETIME, + lpExitTime: LPFILETIME, + lpKernelTime: LPFILETIME, + lpUserTime: LPFILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentProcessorNumber() -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROCESS_INFORMATION { + pub hProcess: HANDLE, + pub hThread: HANDLE, + pub dwProcessId: DWORD, + pub dwThreadId: DWORD, +} +pub type PROCESS_INFORMATION = _PROCESS_INFORMATION; +pub type PPROCESS_INFORMATION = *mut _PROCESS_INFORMATION; +pub type LPPROCESS_INFORMATION = *mut _PROCESS_INFORMATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PROC_THREAD_ATTRIBUTE_LIST { + _unused: [u8; 0], +} +pub type PPROC_THREAD_ATTRIBUTE_LIST = *mut _PROC_THREAD_ATTRIBUTE_LIST; +pub type LPPROC_THREAD_ATTRIBUTE_LIST = *mut _PROC_THREAD_ATTRIBUTE_LIST; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _STARTUPINFOA { + pub cb: DWORD, + pub lpReserved: LPSTR, + pub lpDesktop: LPSTR, + pub lpTitle: LPSTR, + pub dwX: DWORD, + pub dwY: DWORD, + pub dwXSize: DWORD, + pub dwYSize: DWORD, + pub dwXCountChars: DWORD, + pub dwYCountChars: DWORD, + pub dwFillAttribute: DWORD, + pub dwFlags: DWORD, + pub wShowWindow: WORD, + pub cbReserved2: WORD, + pub lpReserved2: LPBYTE, + pub hStdInput: HANDLE, + pub hStdOutput: HANDLE, + pub hStdError: HANDLE, +} +pub type STARTUPINFOA = _STARTUPINFOA; +pub type LPSTARTUPINFOA = *mut _STARTUPINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _STARTUPINFOW { + pub cb: DWORD, + pub lpReserved: LPWSTR, + pub lpDesktop: LPWSTR, + pub lpTitle: LPWSTR, + pub dwX: DWORD, + pub dwY: DWORD, + pub dwXSize: DWORD, + pub dwYSize: DWORD, + pub dwXCountChars: DWORD, + pub dwYCountChars: DWORD, + pub dwFillAttribute: DWORD, + pub dwFlags: DWORD, + pub wShowWindow: WORD, + pub cbReserved2: WORD, + pub lpReserved2: LPBYTE, + pub hStdInput: HANDLE, + pub hStdOutput: HANDLE, + pub hStdError: HANDLE, +} +pub type STARTUPINFOW = _STARTUPINFOW; +pub type LPSTARTUPINFOW = *mut _STARTUPINFOW; +pub type STARTUPINFO = STARTUPINFOA; +pub type LPSTARTUPINFO = LPSTARTUPINFOA; +extern "C" { + pub fn CreateRemoteThread( + hProcess: HANDLE, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + dwStackSize: SIZE_T, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpParameter: LPVOID, + dwCreationFlags: DWORD, + lpThreadId: LPDWORD, + ) -> HANDLE; +} +extern "C" { + pub fn TerminateThread(hThread: HANDLE, dwExitCode: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetProcessShutdownParameters(dwLevel: DWORD, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetProcessVersion(ProcessId: DWORD) -> DWORD; +} +extern "C" { + pub fn GetStartupInfoW(lpStartupInfo: LPSTARTUPINFOW); +} +extern "C" { + pub fn SetThreadStackGuarantee(StackSizeInBytes: PULONG) -> WINBOOL; +} +extern "C" { + pub fn ProcessIdToSessionId(dwProcessId: DWORD, pSessionId: *mut DWORD) -> WINBOOL; +} +extern "C" { + pub fn CreateRemoteThreadEx( + hProcess: HANDLE, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + dwStackSize: SIZE_T, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpParameter: LPVOID, + dwCreationFlags: DWORD, + lpAttributeList: LPPROC_THREAD_ATTRIBUTE_LIST, + lpThreadId: LPDWORD, + ) -> HANDLE; +} +extern "C" { + pub fn SetThreadContext(hThread: HANDLE, lpContext: *const CONTEXT) -> WINBOOL; +} +extern "C" { + pub fn GetProcessHandleCount(hProcess: HANDLE, pdwHandleCount: PDWORD) -> WINBOOL; +} +extern "C" { + pub fn CreateProcessA( + lpApplicationName: LPCSTR, + lpCommandLine: LPSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: WINBOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCSTR, + lpStartupInfo: LPSTARTUPINFOA, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateProcessW( + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: WINBOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateProcessAsUserW( + hToken: HANDLE, + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: WINBOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentProcess() -> HANDLE; +} +extern "C" { + pub fn GetCurrentProcessId() -> DWORD; +} +extern "C" { + pub fn GetCurrentThread() -> HANDLE; +} +extern "C" { + pub fn GetCurrentThreadId() -> DWORD; +} +extern "C" { + pub fn IsProcessorFeaturePresent(ProcessorFeature: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CreateThread( + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + dwStackSize: SIZE_T, + lpStartAddress: LPTHREAD_START_ROUTINE, + lpParameter: LPVOID, + dwCreationFlags: DWORD, + lpThreadId: LPDWORD, + ) -> HANDLE; +} +extern "C" { + pub fn SetThreadPriority(hThread: HANDLE, nPriority: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn GetThreadPriority(hThread: HANDLE) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ExitThread(dwExitCode: DWORD); +} +extern "C" { + pub fn GetExitCodeThread(hThread: HANDLE, lpExitCode: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn SuspendThread(hThread: HANDLE) -> DWORD; +} +extern "C" { + pub fn ResumeThread(hThread: HANDLE) -> DWORD; +} +extern "C" { + pub fn TlsAlloc() -> DWORD; +} +extern "C" { + pub fn TlsGetValue(dwTlsIndex: DWORD) -> LPVOID; +} +extern "C" { + pub fn TlsSetValue(dwTlsIndex: DWORD, lpTlsValue: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn TlsFree(dwTlsIndex: DWORD) -> WINBOOL; +} +extern "C" { + pub fn QueryPerformanceCounter(lpPerformanceCount: *mut LARGE_INTEGER) -> WINBOOL; +} +extern "C" { + pub fn QueryPerformanceFrequency(lpFrequency: *mut LARGE_INTEGER) -> WINBOOL; +} +extern "C" { + pub fn AccessCheck( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ClientToken: HANDLE, + DesiredAccess: DWORD, + GenericMapping: PGENERIC_MAPPING, + PrivilegeSet: PPRIVILEGE_SET, + PrivilegeSetLength: LPDWORD, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckAndAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPWSTR, + ObjectName: LPWSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + DesiredAccess: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByType( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + PrivilegeSet: PPRIVILEGE_SET, + PrivilegeSetLength: LPDWORD, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeResultList( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + PrivilegeSet: PPRIVILEGE_SET, + PrivilegeSetLength: LPDWORD, + GrantedAccessList: LPDWORD, + AccessStatusList: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeAndAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPCWSTR, + ObjectName: LPCWSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeResultListAndAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPCWSTR, + ObjectName: LPCWSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccessList: LPDWORD, + AccessStatusList: LPDWORD, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeResultListAndAuditAlarmByHandleW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ClientToken: HANDLE, + ObjectTypeName: LPCWSTR, + ObjectName: LPCWSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccessList: LPDWORD, + AccessStatusList: LPDWORD, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAccessAllowedAce( + pAcl: PACL, + dwAceRevision: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAccessAllowedAceEx( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAccessAllowedObjectAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + ObjectTypeGuid: *mut GUID, + InheritedObjectTypeGuid: *mut GUID, + pSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAccessDeniedAce( + pAcl: PACL, + dwAceRevision: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAccessDeniedAceEx( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + pSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAccessDeniedObjectAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + ObjectTypeGuid: *mut GUID, + InheritedObjectTypeGuid: *mut GUID, + pSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAce( + pAcl: PACL, + dwAceRevision: DWORD, + dwStartingAceIndex: DWORD, + pAceList: LPVOID, + nAceListLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAuditAccessAce( + pAcl: PACL, + dwAceRevision: DWORD, + dwAccessMask: DWORD, + pSid: PSID, + bAuditSuccess: WINBOOL, + bAuditFailure: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAuditAccessAceEx( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + dwAccessMask: DWORD, + pSid: PSID, + bAuditSuccess: WINBOOL, + bAuditFailure: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AddAuditAccessObjectAce( + pAcl: PACL, + dwAceRevision: DWORD, + AceFlags: DWORD, + AccessMask: DWORD, + ObjectTypeGuid: *mut GUID, + InheritedObjectTypeGuid: *mut GUID, + pSid: PSID, + bAuditSuccess: WINBOOL, + bAuditFailure: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AdjustTokenGroups( + TokenHandle: HANDLE, + ResetToDefault: WINBOOL, + NewState: PTOKEN_GROUPS, + BufferLength: DWORD, + PreviousState: PTOKEN_GROUPS, + ReturnLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn AdjustTokenPrivileges( + TokenHandle: HANDLE, + DisableAllPrivileges: WINBOOL, + NewState: PTOKEN_PRIVILEGES, + BufferLength: DWORD, + PreviousState: PTOKEN_PRIVILEGES, + ReturnLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn AllocateAndInitializeSid( + pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, + nSubAuthorityCount: BYTE, + nSubAuthority0: DWORD, + nSubAuthority1: DWORD, + nSubAuthority2: DWORD, + nSubAuthority3: DWORD, + nSubAuthority4: DWORD, + nSubAuthority5: DWORD, + nSubAuthority6: DWORD, + nSubAuthority7: DWORD, + pSid: *mut PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn AllocateLocallyUniqueId(Luid: PLUID) -> WINBOOL; +} +extern "C" { + pub fn AreAllAccessesGranted(GrantedAccess: DWORD, DesiredAccess: DWORD) -> WINBOOL; +} +extern "C" { + pub fn AreAnyAccessesGranted(GrantedAccess: DWORD, DesiredAccess: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CheckTokenMembership(TokenHandle: HANDLE, SidToCheck: PSID, IsMember: PBOOL) -> WINBOOL; +} +extern "C" { + pub fn ConvertToAutoInheritPrivateObjectSecurity( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CurrentSecurityDescriptor: PSECURITY_DESCRIPTOR, + NewSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + ObjectType: *mut GUID, + IsDirectoryObject: BOOLEAN, + GenericMapping: PGENERIC_MAPPING, + ) -> WINBOOL; +} +extern "C" { + pub fn CopySid( + nDestinationSidLength: DWORD, + pDestinationSid: PSID, + pSourceSid: PSID, + ) -> WINBOOL; +} +extern "C" { + pub fn CreatePrivateObjectSecurity( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewDescriptor: *mut PSECURITY_DESCRIPTOR, + IsDirectoryObject: WINBOOL, + Token: HANDLE, + GenericMapping: PGENERIC_MAPPING, + ) -> WINBOOL; +} +extern "C" { + pub fn CreatePrivateObjectSecurityEx( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewDescriptor: *mut PSECURITY_DESCRIPTOR, + ObjectType: *mut GUID, + IsContainerObject: WINBOOL, + AutoInheritFlags: ULONG, + Token: HANDLE, + GenericMapping: PGENERIC_MAPPING, + ) -> WINBOOL; +} +extern "C" { + pub fn CreatePrivateObjectSecurityWithMultipleInheritance( + ParentDescriptor: PSECURITY_DESCRIPTOR, + CreatorDescriptor: PSECURITY_DESCRIPTOR, + NewDescriptor: *mut PSECURITY_DESCRIPTOR, + ObjectTypes: *mut *mut GUID, + GuidCount: ULONG, + IsContainerObject: WINBOOL, + AutoInheritFlags: ULONG, + Token: HANDLE, + GenericMapping: PGENERIC_MAPPING, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateRestrictedToken( + ExistingTokenHandle: HANDLE, + Flags: DWORD, + DisableSidCount: DWORD, + SidsToDisable: PSID_AND_ATTRIBUTES, + DeletePrivilegeCount: DWORD, + PrivilegesToDelete: PLUID_AND_ATTRIBUTES, + RestrictedSidCount: DWORD, + SidsToRestrict: PSID_AND_ATTRIBUTES, + NewTokenHandle: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateWellKnownSid( + WellKnownSidType: WELL_KNOWN_SID_TYPE, + DomainSid: PSID, + pSid: PSID, + cbSid: *mut DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EqualDomainSid(pSid1: PSID, pSid2: PSID, pfEqual: *mut WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn DeleteAce(pAcl: PACL, dwAceIndex: DWORD) -> WINBOOL; +} +extern "C" { + pub fn DestroyPrivateObjectSecurity(ObjectDescriptor: *mut PSECURITY_DESCRIPTOR) -> WINBOOL; +} +extern "C" { + pub fn DuplicateToken( + ExistingTokenHandle: HANDLE, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + DuplicateTokenHandle: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn DuplicateTokenEx( + hExistingToken: HANDLE, + dwDesiredAccess: DWORD, + lpTokenAttributes: LPSECURITY_ATTRIBUTES, + ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL, + TokenType: TOKEN_TYPE, + phNewToken: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn EqualPrefixSid(pSid1: PSID, pSid2: PSID) -> WINBOOL; +} +extern "C" { + pub fn EqualSid(pSid1: PSID, pSid2: PSID) -> WINBOOL; +} +extern "C" { + pub fn FindFirstFreeAce(pAcl: PACL, pAce: *mut LPVOID) -> WINBOOL; +} +extern "C" { + pub fn FreeSid(pSid: PSID) -> PVOID; +} +extern "C" { + pub fn GetAce(pAcl: PACL, dwAceIndex: DWORD, pAce: *mut LPVOID) -> WINBOOL; +} +extern "C" { + pub fn GetAclInformation( + pAcl: PACL, + pAclInformation: LPVOID, + nAclInformationLength: DWORD, + dwAclInformationClass: ACL_INFORMATION_CLASS, + ) -> WINBOOL; +} +extern "C" { + pub fn GetFileSecurityW( + lpFileName: LPCWSTR, + RequestedInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetKernelObjectSecurity( + Handle: HANDLE, + RequestedInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetLengthSid(pSid: PSID) -> DWORD; +} +extern "C" { + pub fn GetPrivateObjectSecurity( + ObjectDescriptor: PSECURITY_DESCRIPTOR, + SecurityInformation: SECURITY_INFORMATION, + ResultantDescriptor: PSECURITY_DESCRIPTOR, + DescriptorLength: DWORD, + ReturnLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSecurityDescriptorControl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pControl: PSECURITY_DESCRIPTOR_CONTROL, + lpdwRevision: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSecurityDescriptorDacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpbDaclPresent: LPBOOL, + pDacl: *mut PACL, + lpbDaclDefaulted: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSecurityDescriptorGroup( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pGroup: *mut PSID, + lpbGroupDefaulted: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSecurityDescriptorLength(pSecurityDescriptor: PSECURITY_DESCRIPTOR) -> DWORD; +} +extern "C" { + pub fn GetSecurityDescriptorOwner( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pOwner: *mut PSID, + lpbOwnerDefaulted: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSecurityDescriptorRMControl( + SecurityDescriptor: PSECURITY_DESCRIPTOR, + RMControl: PUCHAR, + ) -> DWORD; +} +extern "C" { + pub fn GetSecurityDescriptorSacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpbSaclPresent: LPBOOL, + pSacl: *mut PACL, + lpbSaclDefaulted: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSidIdentifierAuthority(pSid: PSID) -> PSID_IDENTIFIER_AUTHORITY; +} +extern "C" { + pub fn GetSidLengthRequired(nSubAuthorityCount: UCHAR) -> DWORD; +} +extern "C" { + pub fn GetSidSubAuthority(pSid: PSID, nSubAuthority: DWORD) -> PDWORD; +} +extern "C" { + pub fn GetSidSubAuthorityCount(pSid: PSID) -> PUCHAR; +} +extern "C" { + pub fn GetTokenInformation( + TokenHandle: HANDLE, + TokenInformationClass: TOKEN_INFORMATION_CLASS, + TokenInformation: LPVOID, + TokenInformationLength: DWORD, + ReturnLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetWindowsAccountDomainSid( + pSid: PSID, + pDomainSid: PSID, + cbDomainSid: *mut DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ImpersonateAnonymousToken(ThreadHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ImpersonateLoggedOnUser(hToken: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ImpersonateSelf(ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL) -> WINBOOL; +} +extern "C" { + pub fn InitializeAcl(pAcl: PACL, nAclLength: DWORD, dwAclRevision: DWORD) -> WINBOOL; +} +extern "C" { + pub fn InitializeSecurityDescriptor( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + dwRevision: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn InitializeSid( + Sid: PSID, + pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY, + nSubAuthorityCount: BYTE, + ) -> WINBOOL; +} +extern "C" { + pub fn IsTokenRestricted(TokenHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn IsValidAcl(pAcl: PACL) -> WINBOOL; +} +extern "C" { + pub fn IsValidSecurityDescriptor(pSecurityDescriptor: PSECURITY_DESCRIPTOR) -> WINBOOL; +} +extern "C" { + pub fn IsValidSid(pSid: PSID) -> WINBOOL; +} +extern "C" { + pub fn IsWellKnownSid(pSid: PSID, WellKnownSidType: WELL_KNOWN_SID_TYPE) -> WINBOOL; +} +extern "C" { + pub fn MakeAbsoluteSD( + pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR, + pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpdwAbsoluteSecurityDescriptorSize: LPDWORD, + pDacl: PACL, + lpdwDaclSize: LPDWORD, + pSacl: PACL, + lpdwSaclSize: LPDWORD, + pOwner: PSID, + lpdwOwnerSize: LPDWORD, + pPrimaryGroup: PSID, + lpdwPrimaryGroupSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn MakeSelfRelativeSD( + pAbsoluteSecurityDescriptor: PSECURITY_DESCRIPTOR, + pSelfRelativeSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpdwBufferLength: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn MapGenericMask(AccessMask: PDWORD, GenericMapping: PGENERIC_MAPPING); +} +extern "C" { + pub fn ObjectCloseAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + GenerateOnClose: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectDeleteAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + GenerateOnClose: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectOpenAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ObjectTypeName: LPWSTR, + ObjectName: LPWSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ClientToken: HANDLE, + DesiredAccess: DWORD, + GrantedAccess: DWORD, + Privileges: PPRIVILEGE_SET, + ObjectCreation: WINBOOL, + AccessGranted: WINBOOL, + GenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectPrivilegeAuditAlarmW( + SubsystemName: LPCWSTR, + HandleId: LPVOID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + Privileges: PPRIVILEGE_SET, + AccessGranted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn PrivilegeCheck( + ClientToken: HANDLE, + RequiredPrivileges: PPRIVILEGE_SET, + pfResult: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn PrivilegedServiceAuditAlarmW( + SubsystemName: LPCWSTR, + ServiceName: LPCWSTR, + ClientToken: HANDLE, + Privileges: PPRIVILEGE_SET, + AccessGranted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn RevertToSelf() -> WINBOOL; +} +extern "C" { + pub fn SetAclInformation( + pAcl: PACL, + pAclInformation: LPVOID, + nAclInformationLength: DWORD, + dwAclInformationClass: ACL_INFORMATION_CLASS, + ) -> WINBOOL; +} +extern "C" { + pub fn SetFileSecurityW( + lpFileName: LPCWSTR, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetKernelObjectSecurity( + Handle: HANDLE, + SecurityInformation: SECURITY_INFORMATION, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetPrivateObjectSecurity( + SecurityInformation: SECURITY_INFORMATION, + ModificationDescriptor: PSECURITY_DESCRIPTOR, + ObjectsSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + GenericMapping: PGENERIC_MAPPING, + Token: HANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetPrivateObjectSecurityEx( + SecurityInformation: SECURITY_INFORMATION, + ModificationDescriptor: PSECURITY_DESCRIPTOR, + ObjectsSecurityDescriptor: *mut PSECURITY_DESCRIPTOR, + AutoInheritFlags: ULONG, + GenericMapping: PGENERIC_MAPPING, + Token: HANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetSecurityDescriptorControl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ControlBitsOfInterest: SECURITY_DESCRIPTOR_CONTROL, + ControlBitsToSet: SECURITY_DESCRIPTOR_CONTROL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetSecurityDescriptorDacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + bDaclPresent: WINBOOL, + pDacl: PACL, + bDaclDefaulted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetSecurityDescriptorGroup( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pGroup: PSID, + bGroupDefaulted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetSecurityDescriptorOwner( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + pOwner: PSID, + bOwnerDefaulted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetSecurityDescriptorRMControl( + SecurityDescriptor: PSECURITY_DESCRIPTOR, + RMControl: PUCHAR, + ) -> DWORD; +} +extern "C" { + pub fn SetSecurityDescriptorSacl( + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + bSaclPresent: WINBOOL, + pSacl: PACL, + bSaclDefaulted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetTokenInformation( + TokenHandle: HANDLE, + TokenInformationClass: TOKEN_INFORMATION_CLASS, + TokenInformation: LPVOID, + TokenInformationLength: DWORD, + ) -> WINBOOL; +} +pub type SRWLOCK = RTL_SRWLOCK; +pub type PSRWLOCK = *mut RTL_SRWLOCK; +pub type INIT_ONCE = RTL_RUN_ONCE; +pub type PINIT_ONCE = PRTL_RUN_ONCE; +pub type LPINIT_ONCE = PRTL_RUN_ONCE; +pub type PINIT_ONCE_FN = ::std::option::Option< + unsafe extern "C" fn(InitOnce: PINIT_ONCE, Parameter: PVOID, Context: *mut PVOID) -> WINBOOL, +>; +pub type CONDITION_VARIABLE = RTL_CONDITION_VARIABLE; +pub type PCONDITION_VARIABLE = *mut RTL_CONDITION_VARIABLE; +extern "C" { + pub fn EnterCriticalSection(lpCriticalSection: LPCRITICAL_SECTION); +} +extern "C" { + pub fn LeaveCriticalSection(lpCriticalSection: LPCRITICAL_SECTION); +} +extern "C" { + pub fn TryEnterCriticalSection(lpCriticalSection: LPCRITICAL_SECTION) -> WINBOOL; +} +extern "C" { + pub fn DeleteCriticalSection(lpCriticalSection: LPCRITICAL_SECTION); +} +extern "C" { + pub fn SetEvent(hEvent: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ResetEvent(hEvent: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ReleaseSemaphore( + hSemaphore: HANDLE, + lReleaseCount: LONG, + lpPreviousCount: LPLONG, + ) -> WINBOOL; +} +extern "C" { + pub fn ReleaseMutex(hMutex: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn WaitForSingleObjectEx( + hHandle: HANDLE, + dwMilliseconds: DWORD, + bAlertable: WINBOOL, + ) -> DWORD; +} +extern "C" { + pub fn WaitForMultipleObjectsEx( + nCount: DWORD, + lpHandles: *const HANDLE, + bWaitAll: WINBOOL, + dwMilliseconds: DWORD, + bAlertable: WINBOOL, + ) -> DWORD; +} +extern "C" { + pub fn OpenMutexW(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn OpenEventA(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn OpenEventW(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn OpenSemaphoreW( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn WaitOnAddress( + Address: *mut ::std::os::raw::c_void, + CompareAddress: PVOID, + AddressSize: SIZE_T, + dwMilliseconds: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WakeByAddressSingle(Address: PVOID); +} +extern "C" { + pub fn WakeByAddressAll(Address: PVOID); +} +pub type PTIMERAPCROUTINE = ::std::option::Option< + unsafe extern "C" fn( + lpArgToCompletionRoutine: LPVOID, + dwTimerLowValue: DWORD, + dwTimerHighValue: DWORD, + ), +>; +pub type SYNCHRONIZATION_BARRIER = RTL_BARRIER; +pub type PSYNCHRONIZATION_BARRIER = PRTL_BARRIER; +pub type LPSYNCHRONIZATION_BARRIER = PRTL_BARRIER; +extern "C" { + pub fn InitializeCriticalSection(lpCriticalSection: LPCRITICAL_SECTION); +} +extern "C" { + pub fn InitializeCriticalSectionAndSpinCount( + lpCriticalSection: LPCRITICAL_SECTION, + dwSpinCount: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetCriticalSectionSpinCount( + lpCriticalSection: LPCRITICAL_SECTION, + dwSpinCount: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: DWORD) -> DWORD; +} +extern "C" { + pub fn SleepEx(dwMilliseconds: DWORD, bAlertable: WINBOOL) -> DWORD; +} +extern "C" { + pub fn CreateMutexA( + lpMutexAttributes: LPSECURITY_ATTRIBUTES, + bInitialOwner: WINBOOL, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn CreateMutexW( + lpMutexAttributes: LPSECURITY_ATTRIBUTES, + bInitialOwner: WINBOOL, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn CreateEventA( + lpEventAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: WINBOOL, + bInitialState: WINBOOL, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn CreateEventW( + lpEventAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: WINBOOL, + bInitialState: WINBOOL, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn SetWaitableTimer( + hTimer: HANDLE, + lpDueTime: *const LARGE_INTEGER, + lPeriod: LONG, + pfnCompletionRoutine: PTIMERAPCROUTINE, + lpArgToCompletionRoutine: LPVOID, + fResume: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn CancelWaitableTimer(hTimer: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn OpenWaitableTimerW( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpTimerName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn EnterSynchronizationBarrier( + lpBarrier: LPSYNCHRONIZATION_BARRIER, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn InitializeSynchronizationBarrier( + lpBarrier: LPSYNCHRONIZATION_BARRIER, + lTotalThreads: LONG, + lSpinCount: LONG, + ) -> WINBOOL; +} +extern "C" { + pub fn DeleteSynchronizationBarrier(lpBarrier: LPSYNCHRONIZATION_BARRIER) -> WINBOOL; +} +extern "C" { + pub fn Sleep(dwMilliseconds: DWORD); +} +extern "C" { + pub fn SignalObjectAndWait( + hObjectToSignal: HANDLE, + hObjectToWaitOn: HANDLE, + dwMilliseconds: DWORD, + bAlertable: WINBOOL, + ) -> DWORD; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SYSTEM_INFO { + pub __bindgen_anon_1: _SYSTEM_INFO__bindgen_ty_1, + pub dwPageSize: DWORD, + pub lpMinimumApplicationAddress: LPVOID, + pub lpMaximumApplicationAddress: LPVOID, + pub dwActiveProcessorMask: DWORD_PTR, + pub dwNumberOfProcessors: DWORD, + pub dwProcessorType: DWORD, + pub dwAllocationGranularity: DWORD, + pub wProcessorLevel: WORD, + pub wProcessorRevision: WORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _SYSTEM_INFO__bindgen_ty_1 { + pub dwOemId: DWORD, + pub __bindgen_anon_1: _SYSTEM_INFO__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_INFO__bindgen_ty_1__bindgen_ty_1 { + pub wProcessorArchitecture: WORD, + pub wReserved: WORD, +} +pub type SYSTEM_INFO = _SYSTEM_INFO; +pub type LPSYSTEM_INFO = *mut _SYSTEM_INFO; +extern "C" { + pub fn GetSystemTime(lpSystemTime: LPSYSTEMTIME); +} +extern "C" { + pub fn GetSystemTimeAsFileTime(lpSystemTimeAsFileTime: LPFILETIME); +} +extern "C" { + pub fn GetLocalTime(lpSystemTime: LPSYSTEMTIME); +} +extern "C" { + pub fn GetNativeSystemInfo(lpSystemInfo: LPSYSTEM_INFO); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MEMORYSTATUSEX { + pub dwLength: DWORD, + pub dwMemoryLoad: DWORD, + pub ullTotalPhys: DWORDLONG, + pub ullAvailPhys: DWORDLONG, + pub ullTotalPageFile: DWORDLONG, + pub ullAvailPageFile: DWORDLONG, + pub ullTotalVirtual: DWORDLONG, + pub ullAvailVirtual: DWORDLONG, + pub ullAvailExtendedVirtual: DWORDLONG, +} +pub type MEMORYSTATUSEX = _MEMORYSTATUSEX; +pub type LPMEMORYSTATUSEX = *mut _MEMORYSTATUSEX; +extern "C" { + pub fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO); +} +extern "C" { + pub fn GlobalMemoryStatusEx(lpBuffer: LPMEMORYSTATUSEX) -> WINBOOL; +} +extern "C" { + pub fn GetTickCount() -> DWORD; +} +extern "C" { + pub fn GetSystemTimePreciseAsFileTime(lpSystemTimeAsFileTime: LPFILETIME); +} +extern "C" { + pub fn GetVersionExA(lpVersionInformation: LPOSVERSIONINFOA) -> WINBOOL; +} +extern "C" { + pub fn GetVersionExW(lpVersionInformation: LPOSVERSIONINFOW) -> WINBOOL; +} +pub const _COMPUTER_NAME_FORMAT_ComputerNameNetBIOS: _COMPUTER_NAME_FORMAT = 0; +pub const _COMPUTER_NAME_FORMAT_ComputerNameDnsHostname: _COMPUTER_NAME_FORMAT = 1; +pub const _COMPUTER_NAME_FORMAT_ComputerNameDnsDomain: _COMPUTER_NAME_FORMAT = 2; +pub const _COMPUTER_NAME_FORMAT_ComputerNameDnsFullyQualified: _COMPUTER_NAME_FORMAT = 3; +pub const _COMPUTER_NAME_FORMAT_ComputerNamePhysicalNetBIOS: _COMPUTER_NAME_FORMAT = 4; +pub const _COMPUTER_NAME_FORMAT_ComputerNamePhysicalDnsHostname: _COMPUTER_NAME_FORMAT = 5; +pub const _COMPUTER_NAME_FORMAT_ComputerNamePhysicalDnsDomain: _COMPUTER_NAME_FORMAT = 6; +pub const _COMPUTER_NAME_FORMAT_ComputerNamePhysicalDnsFullyQualified: _COMPUTER_NAME_FORMAT = 7; +pub const _COMPUTER_NAME_FORMAT_ComputerNameMax: _COMPUTER_NAME_FORMAT = 8; +pub type _COMPUTER_NAME_FORMAT = u32; +pub use self::_COMPUTER_NAME_FORMAT as COMPUTER_NAME_FORMAT; +extern "C" { + pub fn GetVersion() -> DWORD; +} +extern "C" { + pub fn SetLocalTime(lpSystemTime: *const SYSTEMTIME) -> WINBOOL; +} +extern "C" { + pub fn GetSystemTimeAdjustment( + lpTimeAdjustment: PDWORD, + lpTimeIncrement: PDWORD, + lpTimeAdjustmentDisabled: PBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSystemDirectoryA(lpBuffer: LPSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetSystemDirectoryW(lpBuffer: LPWSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetWindowsDirectoryA(lpBuffer: LPSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetWindowsDirectoryW(lpBuffer: LPWSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetSystemWindowsDirectoryA(lpBuffer: LPSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetSystemWindowsDirectoryW(lpBuffer: LPWSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetComputerNameExA( + NameType: COMPUTER_NAME_FORMAT, + lpBuffer: LPSTR, + nSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetComputerNameExW( + NameType: COMPUTER_NAME_FORMAT, + lpBuffer: LPWSTR, + nSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetComputerNameExW(NameType: COMPUTER_NAME_FORMAT, lpBuffer: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn SetSystemTime(lpSystemTime: *const SYSTEMTIME) -> WINBOOL; +} +extern "C" { + pub fn GetLogicalProcessorInformation( + Buffer: PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, + ReturnedLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumSystemFirmwareTables( + FirmwareTableProviderSignature: DWORD, + pFirmwareTableEnumBuffer: PVOID, + BufferSize: DWORD, + ) -> UINT; +} +extern "C" { + pub fn GetSystemFirmwareTable( + FirmwareTableProviderSignature: DWORD, + FirmwareTableID: DWORD, + pFirmwareTableBuffer: PVOID, + BufferSize: DWORD, + ) -> UINT; +} +extern "C" { + pub fn GetNumaHighestNodeNumber(HighestNodeNumber: PULONG) -> WINBOOL; +} +pub type PTP_WIN32_IO_CALLBACK = ::std::option::Option< + unsafe extern "C" fn( + Instance: PTP_CALLBACK_INSTANCE, + Context: PVOID, + Overlapped: PVOID, + IoResult: ULONG, + NumberOfBytesTransferred: ULONG_PTR, + Io: PTP_IO, + ), +>; +extern "C" { + pub fn CreateTimerQueueTimer( + phNewTimer: PHANDLE, + TimerQueue: HANDLE, + Callback: WAITORTIMERCALLBACK, + Parameter: PVOID, + DueTime: DWORD, + Period: DWORD, + Flags: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn DeleteTimerQueueTimer( + TimerQueue: HANDLE, + Timer: HANDLE, + CompletionEvent: HANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn QueueUserWorkItem( + Function: LPTHREAD_START_ROUTINE, + Context: PVOID, + Flags: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn UnregisterWaitEx(WaitHandle: HANDLE, CompletionEvent: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn CreateTimerQueue() -> HANDLE; +} +extern "C" { + pub fn ChangeTimerQueueTimer( + TimerQueue: HANDLE, + Timer: HANDLE, + DueTime: ULONG, + Period: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn DeleteTimerQueueEx(TimerQueue: HANDLE, CompletionEvent: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn EncodePointer(Ptr: PVOID) -> PVOID; +} +extern "C" { + pub fn DecodePointer(Ptr: PVOID) -> PVOID; +} +extern "C" { + pub fn EncodeSystemPointer(Ptr: PVOID) -> PVOID; +} +extern "C" { + pub fn DecodeSystemPointer(Ptr: PVOID) -> PVOID; +} +extern "C" { + pub fn Beep(dwFreq: DWORD, dwDuration: DWORD) -> WINBOOL; +} +extern "C" { + pub fn Wow64DisableWow64FsRedirection(OldValue: *mut PVOID) -> WINBOOL; +} +extern "C" { + pub fn Wow64RevertWow64FsRedirection(OlValue: PVOID) -> WINBOOL; +} +extern "C" { + pub fn IsWow64Process(hProcess: HANDLE, Wow64Process: PBOOL) -> WINBOOL; +} +pub type PFIBER_START_ROUTINE = + ::std::option::Option; +pub type LPFIBER_START_ROUTINE = PFIBER_START_ROUTINE; +pub type LPLDT_ENTRY = LPVOID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _COMMPROP { + pub wPacketLength: WORD, + pub wPacketVersion: WORD, + pub dwServiceMask: DWORD, + pub dwReserved1: DWORD, + pub dwMaxTxQueue: DWORD, + pub dwMaxRxQueue: DWORD, + pub dwMaxBaud: DWORD, + pub dwProvSubType: DWORD, + pub dwProvCapabilities: DWORD, + pub dwSettableParams: DWORD, + pub dwSettableBaud: DWORD, + pub wSettableData: WORD, + pub wSettableStopParity: WORD, + pub dwCurrentTxQueue: DWORD, + pub dwCurrentRxQueue: DWORD, + pub dwProvSpec1: DWORD, + pub dwProvSpec2: DWORD, + pub wcProvChar: [WCHAR; 1usize], +} +pub type COMMPROP = _COMMPROP; +pub type LPCOMMPROP = *mut _COMMPROP; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _COMSTAT { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, + pub cbInQue: DWORD, + pub cbOutQue: DWORD, +} +impl _COMSTAT { + #[inline] + pub fn fCtsHold(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_fCtsHold(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn fDsrHold(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_fDsrHold(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn fRlsdHold(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_fRlsdHold(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn fXoffHold(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_fXoffHold(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn fXoffSent(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_fXoffSent(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub fn fEof(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_fEof(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub fn fTxim(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_fTxim(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub fn fReserved(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 25u8) as u32) } + } + #[inline] + pub fn set_fReserved(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 25u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + fCtsHold: DWORD, + fDsrHold: DWORD, + fRlsdHold: DWORD, + fXoffHold: DWORD, + fXoffSent: DWORD, + fEof: DWORD, + fTxim: DWORD, + fReserved: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let fCtsHold: u32 = unsafe { ::std::mem::transmute(fCtsHold) }; + fCtsHold as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let fDsrHold: u32 = unsafe { ::std::mem::transmute(fDsrHold) }; + fDsrHold as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let fRlsdHold: u32 = unsafe { ::std::mem::transmute(fRlsdHold) }; + fRlsdHold as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let fXoffHold: u32 = unsafe { ::std::mem::transmute(fXoffHold) }; + fXoffHold as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let fXoffSent: u32 = unsafe { ::std::mem::transmute(fXoffSent) }; + fXoffSent as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let fEof: u32 = unsafe { ::std::mem::transmute(fEof) }; + fEof as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let fTxim: u32 = unsafe { ::std::mem::transmute(fTxim) }; + fTxim as u64 + }); + __bindgen_bitfield_unit.set(7usize, 25u8, { + let fReserved: u32 = unsafe { ::std::mem::transmute(fReserved) }; + fReserved as u64 + }); + __bindgen_bitfield_unit + } +} +pub type COMSTAT = _COMSTAT; +pub type LPCOMSTAT = *mut _COMSTAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DCB { + pub DCBlength: DWORD, + pub BaudRate: DWORD, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, + pub wReserved: WORD, + pub XonLim: WORD, + pub XoffLim: WORD, + pub ByteSize: BYTE, + pub Parity: BYTE, + pub StopBits: BYTE, + pub XonChar: ::std::os::raw::c_char, + pub XoffChar: ::std::os::raw::c_char, + pub ErrorChar: ::std::os::raw::c_char, + pub EofChar: ::std::os::raw::c_char, + pub EvtChar: ::std::os::raw::c_char, + pub wReserved1: WORD, +} +impl _DCB { + #[inline] + pub fn fBinary(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_fBinary(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn fParity(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_fParity(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn fOutxCtsFlow(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } + } + #[inline] + pub fn set_fOutxCtsFlow(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) + } + } + #[inline] + pub fn fOutxDsrFlow(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } + } + #[inline] + pub fn set_fOutxDsrFlow(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 1u8, val as u64) + } + } + #[inline] + pub fn fDtrControl(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u32) } + } + #[inline] + pub fn set_fDtrControl(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 2u8, val as u64) + } + } + #[inline] + pub fn fDsrSensitivity(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) } + } + #[inline] + pub fn set_fDsrSensitivity(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub fn fTXContinueOnXoff(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_fTXContinueOnXoff(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub fn fOutX(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) } + } + #[inline] + pub fn set_fOutX(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub fn fInX(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) } + } + #[inline] + pub fn set_fInX(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub fn fErrorChar(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) } + } + #[inline] + pub fn set_fErrorChar(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub fn fNull(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u32) } + } + #[inline] + pub fn set_fNull(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub fn fRtsControl(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 2u8) as u32) } + } + #[inline] + pub fn set_fRtsControl(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 2u8, val as u64) + } + } + #[inline] + pub fn fAbortOnError(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) } + } + #[inline] + pub fn set_fAbortOnError(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub fn fDummy2(&self) -> DWORD { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 17u8) as u32) } + } + #[inline] + pub fn set_fDummy2(&mut self, val: DWORD) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 17u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + fBinary: DWORD, + fParity: DWORD, + fOutxCtsFlow: DWORD, + fOutxDsrFlow: DWORD, + fDtrControl: DWORD, + fDsrSensitivity: DWORD, + fTXContinueOnXoff: DWORD, + fOutX: DWORD, + fInX: DWORD, + fErrorChar: DWORD, + fNull: DWORD, + fRtsControl: DWORD, + fAbortOnError: DWORD, + fDummy2: DWORD, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let fBinary: u32 = unsafe { ::std::mem::transmute(fBinary) }; + fBinary as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let fParity: u32 = unsafe { ::std::mem::transmute(fParity) }; + fParity as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let fOutxCtsFlow: u32 = unsafe { ::std::mem::transmute(fOutxCtsFlow) }; + fOutxCtsFlow as u64 + }); + __bindgen_bitfield_unit.set(3usize, 1u8, { + let fOutxDsrFlow: u32 = unsafe { ::std::mem::transmute(fOutxDsrFlow) }; + fOutxDsrFlow as u64 + }); + __bindgen_bitfield_unit.set(4usize, 2u8, { + let fDtrControl: u32 = unsafe { ::std::mem::transmute(fDtrControl) }; + fDtrControl as u64 + }); + __bindgen_bitfield_unit.set(6usize, 1u8, { + let fDsrSensitivity: u32 = unsafe { ::std::mem::transmute(fDsrSensitivity) }; + fDsrSensitivity as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let fTXContinueOnXoff: u32 = unsafe { ::std::mem::transmute(fTXContinueOnXoff) }; + fTXContinueOnXoff as u64 + }); + __bindgen_bitfield_unit.set(8usize, 1u8, { + let fOutX: u32 = unsafe { ::std::mem::transmute(fOutX) }; + fOutX as u64 + }); + __bindgen_bitfield_unit.set(9usize, 1u8, { + let fInX: u32 = unsafe { ::std::mem::transmute(fInX) }; + fInX as u64 + }); + __bindgen_bitfield_unit.set(10usize, 1u8, { + let fErrorChar: u32 = unsafe { ::std::mem::transmute(fErrorChar) }; + fErrorChar as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let fNull: u32 = unsafe { ::std::mem::transmute(fNull) }; + fNull as u64 + }); + __bindgen_bitfield_unit.set(12usize, 2u8, { + let fRtsControl: u32 = unsafe { ::std::mem::transmute(fRtsControl) }; + fRtsControl as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let fAbortOnError: u32 = unsafe { ::std::mem::transmute(fAbortOnError) }; + fAbortOnError as u64 + }); + __bindgen_bitfield_unit.set(15usize, 17u8, { + let fDummy2: u32 = unsafe { ::std::mem::transmute(fDummy2) }; + fDummy2 as u64 + }); + __bindgen_bitfield_unit + } +} +pub type DCB = _DCB; +pub type LPDCB = *mut _DCB; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _COMMTIMEOUTS { + pub ReadIntervalTimeout: DWORD, + pub ReadTotalTimeoutMultiplier: DWORD, + pub ReadTotalTimeoutConstant: DWORD, + pub WriteTotalTimeoutMultiplier: DWORD, + pub WriteTotalTimeoutConstant: DWORD, +} +pub type COMMTIMEOUTS = _COMMTIMEOUTS; +pub type LPCOMMTIMEOUTS = *mut _COMMTIMEOUTS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _COMMCONFIG { + pub dwSize: DWORD, + pub wVersion: WORD, + pub wReserved: WORD, + pub dcb: DCB, + pub dwProviderSubType: DWORD, + pub dwProviderOffset: DWORD, + pub dwProviderSize: DWORD, + pub wcProviderData: [WCHAR; 1usize], +} +pub type COMMCONFIG = _COMMCONFIG; +pub type LPCOMMCONFIG = *mut _COMMCONFIG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MEMORYSTATUS { + pub dwLength: DWORD, + pub dwMemoryLoad: DWORD, + pub dwTotalPhys: SIZE_T, + pub dwAvailPhys: SIZE_T, + pub dwTotalPageFile: SIZE_T, + pub dwAvailPageFile: SIZE_T, + pub dwTotalVirtual: SIZE_T, + pub dwAvailVirtual: SIZE_T, +} +pub type MEMORYSTATUS = _MEMORYSTATUS; +pub type LPMEMORYSTATUS = *mut _MEMORYSTATUS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _JIT_DEBUG_INFO { + pub dwSize: DWORD, + pub dwProcessorArchitecture: DWORD, + pub dwThreadID: DWORD, + pub dwReserved0: DWORD, + pub lpExceptionAddress: ULONG64, + pub lpExceptionRecord: ULONG64, + pub lpContextRecord: ULONG64, +} +pub type JIT_DEBUG_INFO = _JIT_DEBUG_INFO; +pub type LPJIT_DEBUG_INFO = *mut _JIT_DEBUG_INFO; +pub type JIT_DEBUG_INFO32 = JIT_DEBUG_INFO; +pub type LPJIT_DEBUG_INFO32 = *mut JIT_DEBUG_INFO; +pub type JIT_DEBUG_INFO64 = JIT_DEBUG_INFO; +pub type LPJIT_DEBUG_INFO64 = *mut JIT_DEBUG_INFO; +pub type LPEXCEPTION_RECORD = PEXCEPTION_RECORD; +pub type LPEXCEPTION_POINTERS = PEXCEPTION_POINTERS; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _OFSTRUCT { + pub cBytes: BYTE, + pub fFixedDisk: BYTE, + pub nErrCode: WORD, + pub Reserved1: WORD, + pub Reserved2: WORD, + pub szPathName: [CHAR; 128usize], +} +pub type OFSTRUCT = _OFSTRUCT; +pub type LPOFSTRUCT = *mut _OFSTRUCT; +pub type POFSTRUCT = *mut _OFSTRUCT; +extern "C" { + pub fn _InterlockedAnd8( + Destination: *mut ::std::os::raw::c_char, + Value: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn _InterlockedOr8( + Destination: *mut ::std::os::raw::c_char, + Value: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn _InterlockedXor8( + Destination: *mut ::std::os::raw::c_char, + Value: ::std::os::raw::c_char, + ) -> ::std::os::raw::c_char; +} +extern "C" { + pub fn _InterlockedAnd16(Destination: *mut SHORT, Value: SHORT) -> SHORT; +} +extern "C" { + pub fn _InterlockedOr16(Destination: *mut SHORT, Value: SHORT) -> SHORT; +} +extern "C" { + pub fn _InterlockedXor16(Destination: *mut SHORT, Value: SHORT) -> SHORT; +} +extern "C" { + pub fn LocalAlloc(uFlags: UINT, uBytes: SIZE_T) -> HLOCAL; +} +extern "C" { + pub fn LocalFree(hMem: HLOCAL) -> HLOCAL; +} +extern "C" { + pub fn WinMain( + hInstance: HINSTANCE, + hPrevInstance: HINSTANCE, + lpCmdLine: LPSTR, + nShowCmd: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wWinMain( + hInstance: HINSTANCE, + hPrevInstance: HINSTANCE, + lpCmdLine: LPWSTR, + nShowCmd: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GlobalAlloc(uFlags: UINT, dwBytes: SIZE_T) -> HGLOBAL; +} +extern "C" { + pub fn GlobalReAlloc(hMem: HGLOBAL, dwBytes: SIZE_T, uFlags: UINT) -> HGLOBAL; +} +extern "C" { + pub fn GlobalSize(hMem: HGLOBAL) -> SIZE_T; +} +extern "C" { + pub fn GlobalFlags(hMem: HGLOBAL) -> UINT; +} +extern "C" { + pub fn GlobalLock(hMem: HGLOBAL) -> LPVOID; +} +extern "C" { + pub fn GlobalHandle(pMem: LPCVOID) -> HGLOBAL; +} +extern "C" { + pub fn GlobalUnlock(hMem: HGLOBAL) -> WINBOOL; +} +extern "C" { + pub fn GlobalFree(hMem: HGLOBAL) -> HGLOBAL; +} +extern "C" { + pub fn GlobalCompact(dwMinFree: DWORD) -> SIZE_T; +} +extern "C" { + pub fn GlobalFix(hMem: HGLOBAL); +} +extern "C" { + pub fn GlobalUnfix(hMem: HGLOBAL); +} +extern "C" { + pub fn GlobalWire(hMem: HGLOBAL) -> LPVOID; +} +extern "C" { + pub fn GlobalUnWire(hMem: HGLOBAL) -> WINBOOL; +} +extern "C" { + pub fn GlobalMemoryStatus(lpBuffer: LPMEMORYSTATUS); +} +extern "C" { + pub fn LocalReAlloc(hMem: HLOCAL, uBytes: SIZE_T, uFlags: UINT) -> HLOCAL; +} +extern "C" { + pub fn LocalLock(hMem: HLOCAL) -> LPVOID; +} +extern "C" { + pub fn LocalHandle(pMem: LPCVOID) -> HLOCAL; +} +extern "C" { + pub fn LocalUnlock(hMem: HLOCAL) -> WINBOOL; +} +extern "C" { + pub fn LocalSize(hMem: HLOCAL) -> SIZE_T; +} +extern "C" { + pub fn LocalFlags(hMem: HLOCAL) -> UINT; +} +extern "C" { + pub fn LocalShrink(hMem: HLOCAL, cbNewSize: UINT) -> SIZE_T; +} +extern "C" { + pub fn LocalCompact(uMinFree: UINT) -> SIZE_T; +} +extern "C" { + pub fn GetBinaryTypeA(lpApplicationName: LPCSTR, lpBinaryType: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetBinaryTypeW(lpApplicationName: LPCWSTR, lpBinaryType: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetShortPathNameA(lpszLongPath: LPCSTR, lpszShortPath: LPSTR, cchBuffer: DWORD) + -> DWORD; +} +extern "C" { + pub fn GetProcessAffinityMask( + hProcess: HANDLE, + lpProcessAffinityMask: PDWORD_PTR, + lpSystemAffinityMask: PDWORD_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetProcessAffinityMask(hProcess: HANDLE, dwProcessAffinityMask: DWORD_PTR) -> WINBOOL; +} +extern "C" { + pub fn GetProcessIoCounters(hProcess: HANDLE, lpIoCounters: PIO_COUNTERS) -> WINBOOL; +} +extern "C" { + pub fn GetProcessWorkingSetSize( + hProcess: HANDLE, + lpMinimumWorkingSetSize: PSIZE_T, + lpMaximumWorkingSetSize: PSIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn SetProcessWorkingSetSize( + hProcess: HANDLE, + dwMinimumWorkingSetSize: SIZE_T, + dwMaximumWorkingSetSize: SIZE_T, + ) -> WINBOOL; +} +extern "C" { + pub fn FatalExit(ExitCode: ::std::os::raw::c_int); +} +extern "C" { + pub fn SetEnvironmentStringsA(NewEnvironment: LPCH) -> WINBOOL; +} +extern "C" { + pub fn RaiseFailFastException( + pExceptionRecord: PEXCEPTION_RECORD, + pContextRecord: PCONTEXT, + dwFlags: DWORD, + ); +} +extern "C" { + pub fn SetThreadIdealProcessor(hThread: HANDLE, dwIdealProcessor: DWORD) -> DWORD; +} +extern "C" { + pub fn CreateFiber( + dwStackSize: SIZE_T, + lpStartAddress: LPFIBER_START_ROUTINE, + lpParameter: LPVOID, + ) -> LPVOID; +} +extern "C" { + pub fn CreateFiberEx( + dwStackCommitSize: SIZE_T, + dwStackReserveSize: SIZE_T, + dwFlags: DWORD, + lpStartAddress: LPFIBER_START_ROUTINE, + lpParameter: LPVOID, + ) -> LPVOID; +} +extern "C" { + pub fn DeleteFiber(lpFiber: LPVOID); +} +extern "C" { + pub fn ConvertThreadToFiber(lpParameter: LPVOID) -> LPVOID; +} +extern "C" { + pub fn ConvertThreadToFiberEx(lpParameter: LPVOID, dwFlags: DWORD) -> LPVOID; +} +extern "C" { + pub fn ConvertFiberToThread() -> WINBOOL; +} +extern "C" { + pub fn SwitchToFiber(lpFiber: LPVOID); +} +extern "C" { + pub fn SetThreadAffinityMask(hThread: HANDLE, dwThreadAffinityMask: DWORD_PTR) -> DWORD_PTR; +} +pub const _THREAD_INFORMATION_CLASS_ThreadMemoryPriority: _THREAD_INFORMATION_CLASS = 0; +pub const _THREAD_INFORMATION_CLASS_ThreadAbsoluteCpuPriority: _THREAD_INFORMATION_CLASS = 1; +pub const _THREAD_INFORMATION_CLASS_ThreadInformationClassMax: _THREAD_INFORMATION_CLASS = 2; +pub type _THREAD_INFORMATION_CLASS = u32; +pub use self::_THREAD_INFORMATION_CLASS as THREAD_INFORMATION_CLASS; +pub const _PROCESS_INFORMATION_CLASS_ProcessMemoryPriority: _PROCESS_INFORMATION_CLASS = 0; +pub const _PROCESS_INFORMATION_CLASS_ProcessInformationClassMax: _PROCESS_INFORMATION_CLASS = 1; +pub type _PROCESS_INFORMATION_CLASS = u32; +pub use self::_PROCESS_INFORMATION_CLASS as PROCESS_INFORMATION_CLASS; +extern "C" { + pub fn SetProcessPriorityBoost(hProcess: HANDLE, bDisablePriorityBoost: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetProcessPriorityBoost(hProcess: HANDLE, pDisablePriorityBoost: PBOOL) -> WINBOOL; +} +extern "C" { + pub fn RequestWakeupLatency(latency: LATENCY_TIME) -> WINBOOL; +} +extern "C" { + pub fn IsSystemResumeAutomatic() -> WINBOOL; +} +extern "C" { + pub fn GetThreadIOPendingFlag(hThread: HANDLE, lpIOIsPending: PBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetThreadSelectorEntry( + hThread: HANDLE, + dwSelector: DWORD, + lpSelectorEntry: LPLDT_ENTRY, + ) -> WINBOOL; +} +extern "C" { + pub fn SetThreadExecutionState(esFlags: EXECUTION_STATE) -> EXECUTION_STATE; +} +extern "C" { + pub fn GetThreadErrorMode() -> DWORD; +} +extern "C" { + pub fn SetThreadErrorMode(dwNewMode: DWORD, lpOldMode: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn DebugSetProcessKillOnExit(KillOnExit: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn DebugBreakProcess(Process: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn WaitForMultipleObjects( + nCount: DWORD, + lpHandles: *const HANDLE, + bWaitAll: WINBOOL, + dwMilliseconds: DWORD, + ) -> DWORD; +} +pub const _DEP_SYSTEM_POLICY_TYPE_DEPPolicyAlwaysOff: _DEP_SYSTEM_POLICY_TYPE = 0; +pub const _DEP_SYSTEM_POLICY_TYPE_DEPPolicyAlwaysOn: _DEP_SYSTEM_POLICY_TYPE = 1; +pub const _DEP_SYSTEM_POLICY_TYPE_DEPPolicyOptIn: _DEP_SYSTEM_POLICY_TYPE = 2; +pub const _DEP_SYSTEM_POLICY_TYPE_DEPPolicyOptOut: _DEP_SYSTEM_POLICY_TYPE = 3; +pub const _DEP_SYSTEM_POLICY_TYPE_DEPTotalPolicyCount: _DEP_SYSTEM_POLICY_TYPE = 4; +pub type _DEP_SYSTEM_POLICY_TYPE = u32; +pub use self::_DEP_SYSTEM_POLICY_TYPE as DEP_SYSTEM_POLICY_TYPE; +extern "C" { + pub fn PulseEvent(hEvent: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GlobalDeleteAtom(nAtom: ATOM) -> ATOM; +} +extern "C" { + pub fn InitAtomTable(nSize: DWORD) -> WINBOOL; +} +extern "C" { + pub fn DeleteAtom(nAtom: ATOM) -> ATOM; +} +extern "C" { + pub fn SetHandleCount(uNumber: UINT) -> UINT; +} +extern "C" { + pub fn RequestDeviceWakeup(hDevice: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn CancelDeviceWakeupRequest(hDevice: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GetDevicePowerState(hDevice: HANDLE, pfOn: *mut WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn SetMessageWaitingIndicator(hMsgIndicator: HANDLE, ulMsgCount: ULONG) -> WINBOOL; +} +extern "C" { + pub fn SetFileShortNameA(hFile: HANDLE, lpShortName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetFileShortNameW(hFile: HANDLE, lpShortName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn LoadModule(lpModuleName: LPCSTR, lpParameterBlock: LPVOID) -> DWORD; +} +extern "C" { + pub fn WinExec(lpCmdLine: LPCSTR, uCmdShow: UINT) -> UINT; +} +extern "C" { + pub fn ClearCommBreak(hFile: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ClearCommError(hFile: HANDLE, lpErrors: LPDWORD, lpStat: LPCOMSTAT) -> WINBOOL; +} +extern "C" { + pub fn SetupComm(hFile: HANDLE, dwInQueue: DWORD, dwOutQueue: DWORD) -> WINBOOL; +} +extern "C" { + pub fn EscapeCommFunction(hFile: HANDLE, dwFunc: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetCommConfig(hCommDev: HANDLE, lpCC: LPCOMMCONFIG, lpdwSize: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetCommMask(hFile: HANDLE, lpEvtMask: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetCommProperties(hFile: HANDLE, lpCommProp: LPCOMMPROP) -> WINBOOL; +} +extern "C" { + pub fn GetCommModemStatus(hFile: HANDLE, lpModemStat: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetCommState(hFile: HANDLE, lpDCB: LPDCB) -> WINBOOL; +} +extern "C" { + pub fn GetCommTimeouts(hFile: HANDLE, lpCommTimeouts: LPCOMMTIMEOUTS) -> WINBOOL; +} +extern "C" { + pub fn PurgeComm(hFile: HANDLE, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetCommBreak(hFile: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn SetCommConfig(hCommDev: HANDLE, lpCC: LPCOMMCONFIG, dwSize: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetCommMask(hFile: HANDLE, dwEvtMask: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetCommState(hFile: HANDLE, lpDCB: LPDCB) -> WINBOOL; +} +extern "C" { + pub fn SetCommTimeouts(hFile: HANDLE, lpCommTimeouts: LPCOMMTIMEOUTS) -> WINBOOL; +} +extern "C" { + pub fn TransmitCommChar(hFile: HANDLE, cChar: ::std::os::raw::c_char) -> WINBOOL; +} +extern "C" { + pub fn WaitCommEvent(hFile: HANDLE, lpEvtMask: LPDWORD, lpOverlapped: LPOVERLAPPED) -> WINBOOL; +} +extern "C" { + pub fn SetTapePosition( + hDevice: HANDLE, + dwPositionMethod: DWORD, + dwPartition: DWORD, + dwOffsetLow: DWORD, + dwOffsetHigh: DWORD, + bImmediate: WINBOOL, + ) -> DWORD; +} +extern "C" { + pub fn GetTapePosition( + hDevice: HANDLE, + dwPositionType: DWORD, + lpdwPartition: LPDWORD, + lpdwOffsetLow: LPDWORD, + lpdwOffsetHigh: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn PrepareTape(hDevice: HANDLE, dwOperation: DWORD, bImmediate: WINBOOL) -> DWORD; +} +extern "C" { + pub fn EraseTape(hDevice: HANDLE, dwEraseType: DWORD, bImmediate: WINBOOL) -> DWORD; +} +extern "C" { + pub fn CreateTapePartition( + hDevice: HANDLE, + dwPartitionMethod: DWORD, + dwCount: DWORD, + dwSize: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WriteTapemark( + hDevice: HANDLE, + dwTapemarkType: DWORD, + dwTapemarkCount: DWORD, + bImmediate: WINBOOL, + ) -> DWORD; +} +extern "C" { + pub fn GetTapeStatus(hDevice: HANDLE) -> DWORD; +} +extern "C" { + pub fn GetTapeParameters( + hDevice: HANDLE, + dwOperation: DWORD, + lpdwSize: LPDWORD, + lpTapeInformation: LPVOID, + ) -> DWORD; +} +extern "C" { + pub fn SetTapeParameters( + hDevice: HANDLE, + dwOperation: DWORD, + lpTapeInformation: LPVOID, + ) -> DWORD; +} +extern "C" { + pub fn GetSystemDEPPolicy() -> DEP_SYSTEM_POLICY_TYPE; +} +extern "C" { + pub fn GetSystemRegistryQuota(pdwQuotaAllowed: PDWORD, pdwQuotaUsed: PDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetSystemTimes( + lpIdleTime: LPFILETIME, + lpKernelTime: LPFILETIME, + lpUserTime: LPFILETIME, + ) -> WINBOOL; +} +extern "C" { + pub fn FileTimeToDosDateTime( + lpFileTime: *const FILETIME, + lpFatDate: LPWORD, + lpFatTime: LPWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn DosDateTimeToFileTime(wFatDate: WORD, wFatTime: WORD, lpFileTime: LPFILETIME) + -> WINBOOL; +} +extern "C" { + pub fn SetSystemTimeAdjustment( + dwTimeAdjustment: DWORD, + bTimeAdjustmentDisabled: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn MulDiv( + nNumber: ::std::os::raw::c_int, + nNumerator: ::std::os::raw::c_int, + nDenominator: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn FormatMessageA( + dwFlags: DWORD, + lpSource: LPCVOID, + dwMessageId: DWORD, + dwLanguageId: DWORD, + lpBuffer: LPSTR, + nSize: DWORD, + Arguments: *mut va_list, + ) -> DWORD; +} +extern "C" { + pub fn FormatMessageW( + dwFlags: DWORD, + lpSource: LPCVOID, + dwMessageId: DWORD, + dwLanguageId: DWORD, + lpBuffer: LPWSTR, + nSize: DWORD, + Arguments: *mut va_list, + ) -> DWORD; +} +pub type PFE_EXPORT_FUNC = ::std::option::Option< + unsafe extern "C" fn(pbData: PBYTE, pvCallbackContext: PVOID, ulLength: ULONG) -> DWORD, +>; +pub type PFE_IMPORT_FUNC = ::std::option::Option< + unsafe extern "C" fn(pbData: PBYTE, pvCallbackContext: PVOID, ulLength: PULONG) -> DWORD, +>; +extern "C" { + pub fn GetNamedPipeInfo( + hNamedPipe: HANDLE, + lpFlags: LPDWORD, + lpOutBufferSize: LPDWORD, + lpInBufferSize: LPDWORD, + lpMaxInstances: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateMailslotA( + lpName: LPCSTR, + nMaxMessageSize: DWORD, + lReadTimeout: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; +} +extern "C" { + pub fn CreateMailslotW( + lpName: LPCWSTR, + nMaxMessageSize: DWORD, + lReadTimeout: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; +} +extern "C" { + pub fn GetMailslotInfo( + hMailslot: HANDLE, + lpMaxMessageSize: LPDWORD, + lpNextSize: LPDWORD, + lpMessageCount: LPDWORD, + lpReadTimeout: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetMailslotInfo(hMailslot: HANDLE, lReadTimeout: DWORD) -> WINBOOL; +} +extern "C" { + pub fn EncryptFileA(lpFileName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn EncryptFileW(lpFileName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn DecryptFileA(lpFileName: LPCSTR, dwReserved: DWORD) -> WINBOOL; +} +extern "C" { + pub fn DecryptFileW(lpFileName: LPCWSTR, dwReserved: DWORD) -> WINBOOL; +} +extern "C" { + pub fn FileEncryptionStatusA(lpFileName: LPCSTR, lpStatus: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn FileEncryptionStatusW(lpFileName: LPCWSTR, lpStatus: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn OpenEncryptedFileRawA( + lpFileName: LPCSTR, + ulFlags: ULONG, + pvContext: *mut PVOID, + ) -> DWORD; +} +extern "C" { + pub fn OpenEncryptedFileRawW( + lpFileName: LPCWSTR, + ulFlags: ULONG, + pvContext: *mut PVOID, + ) -> DWORD; +} +extern "C" { + pub fn ReadEncryptedFileRaw( + pfExportCallback: PFE_EXPORT_FUNC, + pvCallbackContext: PVOID, + pvContext: PVOID, + ) -> DWORD; +} +extern "C" { + pub fn WriteEncryptedFileRaw( + pfImportCallback: PFE_IMPORT_FUNC, + pvCallbackContext: PVOID, + pvContext: PVOID, + ) -> DWORD; +} +extern "C" { + pub fn CloseEncryptedFileRaw(pvContext: PVOID); +} +extern "C" { + pub fn lstrcmpA(lpString1: LPCSTR, lpString2: LPCSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lstrcmpW(lpString1: LPCWSTR, lpString2: LPCWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lstrcmpiA(lpString1: LPCSTR, lpString2: LPCSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lstrcmpiW(lpString1: LPCWSTR, lpString2: LPCWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lstrcpynA( + lpString1: LPSTR, + lpString2: LPCSTR, + iMaxLength: ::std::os::raw::c_int, + ) -> LPSTR; +} +extern "C" { + pub fn lstrcpynW( + lpString1: LPWSTR, + lpString2: LPCWSTR, + iMaxLength: ::std::os::raw::c_int, + ) -> LPWSTR; +} +extern "C" { + pub fn lstrcpyA(lpString1: LPSTR, lpString2: LPCSTR) -> LPSTR; +} +extern "C" { + pub fn lstrcpyW(lpString1: LPWSTR, lpString2: LPCWSTR) -> LPWSTR; +} +extern "C" { + pub fn lstrcatA(lpString1: LPSTR, lpString2: LPCSTR) -> LPSTR; +} +extern "C" { + pub fn lstrcatW(lpString1: LPWSTR, lpString2: LPCWSTR) -> LPWSTR; +} +extern "C" { + pub fn lstrlenA(lpString: LPCSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn lstrlenW(lpString: LPCWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn OpenFile(lpFileName: LPCSTR, lpReOpenBuff: LPOFSTRUCT, uStyle: UINT) -> HFILE; +} +extern "C" { + pub fn _lopen(lpPathName: LPCSTR, iReadWrite: ::std::os::raw::c_int) -> HFILE; +} +extern "C" { + pub fn _lcreat(lpPathName: LPCSTR, iAttribute: ::std::os::raw::c_int) -> HFILE; +} +extern "C" { + pub fn _lread(hFile: HFILE, lpBuffer: LPVOID, uBytes: UINT) -> UINT; +} +extern "C" { + pub fn _lwrite(hFile: HFILE, lpBuffer: LPCCH, uBytes: UINT) -> UINT; +} +extern "C" { + pub fn _hread( + hFile: HFILE, + lpBuffer: LPVOID, + lBytes: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _hwrite( + hFile: HFILE, + lpBuffer: LPCCH, + lBytes: ::std::os::raw::c_long, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn _lclose(hFile: HFILE) -> HFILE; +} +extern "C" { + pub fn _llseek(hFile: HFILE, lOffset: LONG, iOrigin: ::std::os::raw::c_int) -> LONG; +} +extern "C" { + pub fn IsTextUnicode( + lpv: *const ::std::os::raw::c_void, + iSize: ::std::os::raw::c_int, + lpiResult: LPINT, + ) -> WINBOOL; +} +extern "C" { + pub fn BackupRead( + hFile: HANDLE, + lpBuffer: LPBYTE, + nNumberOfBytesToRead: DWORD, + lpNumberOfBytesRead: LPDWORD, + bAbort: WINBOOL, + bProcessSecurity: WINBOOL, + lpContext: *mut LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn BackupSeek( + hFile: HANDLE, + dwLowBytesToSeek: DWORD, + dwHighBytesToSeek: DWORD, + lpdwLowByteSeeked: LPDWORD, + lpdwHighByteSeeked: LPDWORD, + lpContext: *mut LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn BackupWrite( + hFile: HANDLE, + lpBuffer: LPBYTE, + nNumberOfBytesToWrite: DWORD, + lpNumberOfBytesWritten: LPDWORD, + bAbort: WINBOOL, + bProcessSecurity: WINBOOL, + lpContext: *mut LPVOID, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WIN32_STREAM_ID { + pub dwStreamId: DWORD, + pub dwStreamAttributes: DWORD, + pub Size: LARGE_INTEGER, + pub dwStreamNameSize: DWORD, + pub cStreamName: [WCHAR; 1usize], +} +pub type WIN32_STREAM_ID = _WIN32_STREAM_ID; +pub type LPWIN32_STREAM_ID = *mut _WIN32_STREAM_ID; +extern "C" { + pub fn CreateSemaphoreW( + lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, + lMaximumCount: LONG, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenMutexA(dwDesiredAccess: DWORD, bInheritHandle: WINBOOL, lpName: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn CreateSemaphoreA( + lpSemaphoreAttributes: LPSECURITY_ATTRIBUTES, + lInitialCount: LONG, + lMaximumCount: LONG, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenSemaphoreA( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn CreateWaitableTimerA( + lpTimerAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: WINBOOL, + lpTimerName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn CreateWaitableTimerW( + lpTimerAttributes: LPSECURITY_ATTRIBUTES, + bManualReset: WINBOOL, + lpTimerName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenWaitableTimerA( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpTimerName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn CreateFileMappingA( + hFile: HANDLE, + lpFileMappingAttributes: LPSECURITY_ATTRIBUTES, + flProtect: DWORD, + dwMaximumSizeHigh: DWORD, + dwMaximumSizeLow: DWORD, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenFileMappingA( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn GetLogicalDriveStringsA(nBufferLength: DWORD, lpBuffer: LPSTR) -> DWORD; +} +extern "C" { + pub fn GetProcessShutdownParameters(lpdwLevel: LPDWORD, lpdwFlags: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn FatalAppExitA(uAction: UINT, lpMessageText: LPCSTR); +} +extern "C" { + pub fn FatalAppExitW(uAction: UINT, lpMessageText: LPCWSTR); +} +extern "C" { + pub fn GetStartupInfoA(lpStartupInfo: LPSTARTUPINFOA); +} +extern "C" { + pub fn GetFirmwareEnvironmentVariableA( + lpName: LPCSTR, + lpGuid: LPCSTR, + pBuffer: PVOID, + nSize: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetFirmwareEnvironmentVariableW( + lpName: LPCWSTR, + lpGuid: LPCWSTR, + pBuffer: PVOID, + nSize: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn SetFirmwareEnvironmentVariableA( + lpName: LPCSTR, + lpGuid: LPCSTR, + pValue: PVOID, + nSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetFirmwareEnvironmentVariableW( + lpName: LPCWSTR, + lpGuid: LPCWSTR, + pValue: PVOID, + nSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FindResourceA(hModule: HMODULE, lpName: LPCSTR, lpType: LPCSTR) -> HRSRC; +} +extern "C" { + pub fn FindResourceExA( + hModule: HMODULE, + lpType: LPCSTR, + lpName: LPCSTR, + wLanguage: WORD, + ) -> HRSRC; +} +extern "C" { + pub fn EnumResourceTypesA( + hModule: HMODULE, + lpEnumFunc: ENUMRESTYPEPROCA, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumResourceTypesW( + hModule: HMODULE, + lpEnumFunc: ENUMRESTYPEPROCW, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumResourceNamesA( + hModule: HMODULE, + lpType: LPCSTR, + lpEnumFunc: ENUMRESNAMEPROCA, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn BeginUpdateResourceA(pFileName: LPCSTR, bDeleteExistingResources: WINBOOL) -> HANDLE; +} +extern "C" { + pub fn BeginUpdateResourceW(pFileName: LPCWSTR, bDeleteExistingResources: WINBOOL) -> HANDLE; +} +extern "C" { + pub fn UpdateResourceA( + hUpdate: HANDLE, + lpType: LPCSTR, + lpName: LPCSTR, + wLanguage: WORD, + lpData: LPVOID, + cb: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn UpdateResourceW( + hUpdate: HANDLE, + lpType: LPCWSTR, + lpName: LPCWSTR, + wLanguage: WORD, + lpData: LPVOID, + cb: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EndUpdateResourceA(hUpdate: HANDLE, fDiscard: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn EndUpdateResourceW(hUpdate: HANDLE, fDiscard: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GlobalAddAtomA(lpString: LPCSTR) -> ATOM; +} +extern "C" { + pub fn GlobalAddAtomW(lpString: LPCWSTR) -> ATOM; +} +extern "C" { + pub fn GlobalAddAtomExA(lpString: LPCSTR, Flags: DWORD) -> ATOM; +} +extern "C" { + pub fn GlobalAddAtomExW(lpString: LPCWSTR, Flags: DWORD) -> ATOM; +} +extern "C" { + pub fn GlobalFindAtomA(lpString: LPCSTR) -> ATOM; +} +extern "C" { + pub fn GlobalFindAtomW(lpString: LPCWSTR) -> ATOM; +} +extern "C" { + pub fn GlobalGetAtomNameA(nAtom: ATOM, lpBuffer: LPSTR, nSize: ::std::os::raw::c_int) -> UINT; +} +extern "C" { + pub fn GlobalGetAtomNameW(nAtom: ATOM, lpBuffer: LPWSTR, nSize: ::std::os::raw::c_int) -> UINT; +} +extern "C" { + pub fn AddAtomA(lpString: LPCSTR) -> ATOM; +} +extern "C" { + pub fn AddAtomW(lpString: LPCWSTR) -> ATOM; +} +extern "C" { + pub fn FindAtomA(lpString: LPCSTR) -> ATOM; +} +extern "C" { + pub fn FindAtomW(lpString: LPCWSTR) -> ATOM; +} +extern "C" { + pub fn GetAtomNameA(nAtom: ATOM, lpBuffer: LPSTR, nSize: ::std::os::raw::c_int) -> UINT; +} +extern "C" { + pub fn GetAtomNameW(nAtom: ATOM, lpBuffer: LPWSTR, nSize: ::std::os::raw::c_int) -> UINT; +} +extern "C" { + pub fn GetProfileIntA(lpAppName: LPCSTR, lpKeyName: LPCSTR, nDefault: INT) -> UINT; +} +extern "C" { + pub fn GetProfileIntW(lpAppName: LPCWSTR, lpKeyName: LPCWSTR, nDefault: INT) -> UINT; +} +extern "C" { + pub fn GetProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpDefault: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpDefault: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WriteProfileStringA(lpAppName: LPCSTR, lpKeyName: LPCSTR, lpString: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn WriteProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpString: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetProfileSectionA(lpAppName: LPCSTR, lpReturnedString: LPSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn GetProfileSectionW(lpAppName: LPCWSTR, lpReturnedString: LPWSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn WriteProfileSectionA(lpAppName: LPCSTR, lpString: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn WriteProfileSectionW(lpAppName: LPCWSTR, lpString: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetPrivateProfileIntA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + nDefault: INT, + lpFileName: LPCSTR, + ) -> UINT; +} +extern "C" { + pub fn GetPrivateProfileIntW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + nDefault: INT, + lpFileName: LPCWSTR, + ) -> UINT; +} +extern "C" { + pub fn GetPrivateProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpDefault: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + lpFileName: LPCSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetPrivateProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpDefault: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + lpFileName: LPCWSTR, + ) -> DWORD; +} +extern "C" { + pub fn WritePrivateProfileStringA( + lpAppName: LPCSTR, + lpKeyName: LPCSTR, + lpString: LPCSTR, + lpFileName: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn WritePrivateProfileStringW( + lpAppName: LPCWSTR, + lpKeyName: LPCWSTR, + lpString: LPCWSTR, + lpFileName: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetPrivateProfileSectionA( + lpAppName: LPCSTR, + lpReturnedString: LPSTR, + nSize: DWORD, + lpFileName: LPCSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetPrivateProfileSectionW( + lpAppName: LPCWSTR, + lpReturnedString: LPWSTR, + nSize: DWORD, + lpFileName: LPCWSTR, + ) -> DWORD; +} +extern "C" { + pub fn WritePrivateProfileSectionA( + lpAppName: LPCSTR, + lpString: LPCSTR, + lpFileName: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn WritePrivateProfileSectionW( + lpAppName: LPCWSTR, + lpString: LPCWSTR, + lpFileName: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetPrivateProfileSectionNamesA( + lpszReturnBuffer: LPSTR, + nSize: DWORD, + lpFileName: LPCSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetPrivateProfileSectionNamesW( + lpszReturnBuffer: LPWSTR, + nSize: DWORD, + lpFileName: LPCWSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetPrivateProfileStructA( + lpszSection: LPCSTR, + lpszKey: LPCSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetPrivateProfileStructW( + lpszSection: LPCWSTR, + lpszKey: LPCWSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn WritePrivateProfileStructA( + lpszSection: LPCSTR, + lpszKey: LPCSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn WritePrivateProfileStructW( + lpszSection: LPCWSTR, + lpszKey: LPCWSTR, + lpStruct: LPVOID, + uSizeStruct: UINT, + szFile: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetSystemWow64DirectoryA(lpBuffer: LPSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn GetSystemWow64DirectoryW(lpBuffer: LPWSTR, uSize: UINT) -> UINT; +} +extern "C" { + pub fn Wow64EnableWow64FsRedirection(Wow64FsEnableRedirection: BOOLEAN) -> BOOLEAN; +} +pub type PGET_SYSTEM_WOW64_DIRECTORY_A = + ::std::option::Option UINT>; +pub type PGET_SYSTEM_WOW64_DIRECTORY_W = + ::std::option::Option UINT>; +extern "C" { + pub fn SetDllDirectoryA(lpPathName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetDllDirectoryW(lpPathName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetDllDirectoryA(nBufferLength: DWORD, lpBuffer: LPSTR) -> DWORD; +} +extern "C" { + pub fn GetDllDirectoryW(nBufferLength: DWORD, lpBuffer: LPWSTR) -> DWORD; +} +extern "C" { + pub fn SetSearchPathMode(Flags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CreateDirectoryExA( + lpTemplateDirectory: LPCSTR, + lpNewDirectory: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateDirectoryExW( + lpTemplateDirectory: LPCWSTR, + lpNewDirectory: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> WINBOOL; +} +extern "C" { + pub fn DefineDosDeviceA(dwFlags: DWORD, lpDeviceName: LPCSTR, lpTargetPath: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn QueryDosDeviceA(lpDeviceName: LPCSTR, lpTargetPath: LPSTR, ucchMax: DWORD) -> DWORD; +} +extern "C" { + pub fn ReOpenFile( + hOriginalFile: HANDLE, + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + dwFlagsAndAttributes: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn GetCompressedFileSizeA(lpFileName: LPCSTR, lpFileSizeHigh: LPDWORD) -> DWORD; +} +extern "C" { + pub fn GetCompressedFileSizeW(lpFileName: LPCWSTR, lpFileSizeHigh: LPDWORD) -> DWORD; +} +pub type LPPROGRESS_ROUTINE = ::std::option::Option< + unsafe extern "C" fn( + TotalFileSize: LARGE_INTEGER, + TotalBytesTransferred: LARGE_INTEGER, + StreamSize: LARGE_INTEGER, + StreamBytesTransferred: LARGE_INTEGER, + dwStreamNumber: DWORD, + dwCallbackReason: DWORD, + hSourceFile: HANDLE, + hDestinationFile: HANDLE, + lpData: LPVOID, + ) -> DWORD, +>; +extern "C" { + pub fn CopyFileExA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + pbCancel: LPBOOL, + dwCopyFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CopyFileExW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + pbCancel: LPBOOL, + dwCopyFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CheckNameLegalDOS8Dot3A( + lpName: LPCSTR, + lpOemName: LPSTR, + OemNameSize: DWORD, + pbNameContainsSpaces: PBOOL, + pbNameLegal: PBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn CheckNameLegalDOS8Dot3W( + lpName: LPCWSTR, + lpOemName: LPSTR, + OemNameSize: DWORD, + pbNameContainsSpaces: PBOOL, + pbNameLegal: PBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn CopyFileA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + bFailIfExists: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn CopyFileW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + bFailIfExists: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn MoveFileA(lpExistingFileName: LPCSTR, lpNewFileName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn MoveFileW(lpExistingFileName: LPCWSTR, lpNewFileName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn MoveFileExA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn MoveFileExW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn MoveFileWithProgressA( + lpExistingFileName: LPCSTR, + lpNewFileName: LPCSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn MoveFileWithProgressW( + lpExistingFileName: LPCWSTR, + lpNewFileName: LPCWSTR, + lpProgressRoutine: LPPROGRESS_ROUTINE, + lpData: LPVOID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetNamedPipeClientComputerNameA( + Pipe: HANDLE, + ClientComputerName: LPSTR, + ClientComputerNameLength: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn GetNamedPipeHandleStateA( + hNamedPipe: HANDLE, + lpState: LPDWORD, + lpCurInstances: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD, + lpUserName: LPSTR, + nMaxUserNameSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WaitNamedPipeA(lpNamedPipeName: LPCSTR, nTimeOut: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CallNamedPipeA( + lpNamedPipeName: LPCSTR, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesRead: LPDWORD, + nTimeOut: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CallNamedPipeW( + lpNamedPipeName: LPCWSTR, + lpInBuffer: LPVOID, + nInBufferSize: DWORD, + lpOutBuffer: LPVOID, + nOutBufferSize: DWORD, + lpBytesRead: LPDWORD, + nTimeOut: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateNamedPipeA( + lpName: LPCSTR, + dwOpenMode: DWORD, + dwPipeMode: DWORD, + nMaxInstances: DWORD, + nOutBufferSize: DWORD, + nInBufferSize: DWORD, + nDefaultTimeOut: DWORD, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> HANDLE; +} +extern "C" { + pub fn ReplaceFileA( + lpReplacedFileName: LPCSTR, + lpReplacementFileName: LPCSTR, + lpBackupFileName: LPCSTR, + dwReplaceFlags: DWORD, + lpExclude: LPVOID, + lpReserved: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn ReplaceFileW( + lpReplacedFileName: LPCWSTR, + lpReplacementFileName: LPCWSTR, + lpBackupFileName: LPCWSTR, + dwReplaceFlags: DWORD, + lpExclude: LPVOID, + lpReserved: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateHardLinkA( + lpFileName: LPCSTR, + lpExistingFileName: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateHardLinkW( + lpFileName: LPCWSTR, + lpExistingFileName: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> WINBOOL; +} +pub const _STREAM_INFO_LEVELS_FindStreamInfoStandard: _STREAM_INFO_LEVELS = 0; +pub const _STREAM_INFO_LEVELS_FindStreamInfoMaxInfoLevel: _STREAM_INFO_LEVELS = 1; +pub type _STREAM_INFO_LEVELS = u32; +pub use self::_STREAM_INFO_LEVELS as STREAM_INFO_LEVELS; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _WIN32_FIND_STREAM_DATA { + pub StreamSize: LARGE_INTEGER, + pub cStreamName: [WCHAR; 296usize], +} +pub type WIN32_FIND_STREAM_DATA = _WIN32_FIND_STREAM_DATA; +pub type PWIN32_FIND_STREAM_DATA = *mut _WIN32_FIND_STREAM_DATA; +extern "C" { + pub fn FindFirstStreamW( + lpFileName: LPCWSTR, + InfoLevel: STREAM_INFO_LEVELS, + lpFindStreamData: LPVOID, + dwFlags: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindNextStreamW(hFindStream: HANDLE, lpFindStreamData: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn GetNamedPipeHandleStateW( + hNamedPipe: HANDLE, + lpState: LPDWORD, + lpCurInstances: LPDWORD, + lpMaxCollectionCount: LPDWORD, + lpCollectDataTimeout: LPDWORD, + lpUserName: LPWSTR, + nMaxUserNameSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetVolumeLabelA(lpRootPathName: LPCSTR, lpVolumeName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetVolumeLabelW(lpRootPathName: LPCWSTR, lpVolumeName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn SetFileApisToOEM(); +} +extern "C" { + pub fn SetFileApisToANSI(); +} +extern "C" { + pub fn AreFileApisANSI() -> WINBOOL; +} +extern "C" { + pub fn GetVolumeInformationA( + lpRootPathName: LPCSTR, + lpVolumeNameBuffer: LPSTR, + nVolumeNameSize: DWORD, + lpVolumeSerialNumber: LPDWORD, + lpMaximumComponentLength: LPDWORD, + lpFileSystemFlags: LPDWORD, + lpFileSystemNameBuffer: LPSTR, + nFileSystemNameSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ClearEventLogA(hEventLog: HANDLE, lpBackupFileName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn ClearEventLogW(hEventLog: HANDLE, lpBackupFileName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn BackupEventLogA(hEventLog: HANDLE, lpBackupFileName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn BackupEventLogW(hEventLog: HANDLE, lpBackupFileName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn CloseEventLog(hEventLog: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn DeregisterEventSource(hEventLog: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn NotifyChangeEventLog(hEventLog: HANDLE, hEvent: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GetNumberOfEventLogRecords(hEventLog: HANDLE, NumberOfRecords: PDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetOldestEventLogRecord(hEventLog: HANDLE, OldestRecord: PDWORD) -> WINBOOL; +} +extern "C" { + pub fn OpenEventLogA(lpUNCServerName: LPCSTR, lpSourceName: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn OpenEventLogW(lpUNCServerName: LPCWSTR, lpSourceName: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn RegisterEventSourceA(lpUNCServerName: LPCSTR, lpSourceName: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn RegisterEventSourceW(lpUNCServerName: LPCWSTR, lpSourceName: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn OpenBackupEventLogA(lpUNCServerName: LPCSTR, lpFileName: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn OpenBackupEventLogW(lpUNCServerName: LPCWSTR, lpFileName: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn ReadEventLogA( + hEventLog: HANDLE, + dwReadFlags: DWORD, + dwRecordOffset: DWORD, + lpBuffer: LPVOID, + nNumberOfBytesToRead: DWORD, + pnBytesRead: *mut DWORD, + pnMinNumberOfBytesNeeded: *mut DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadEventLogW( + hEventLog: HANDLE, + dwReadFlags: DWORD, + dwRecordOffset: DWORD, + lpBuffer: LPVOID, + nNumberOfBytesToRead: DWORD, + pnBytesRead: *mut DWORD, + pnMinNumberOfBytesNeeded: *mut DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReportEventA( + hEventLog: HANDLE, + wType: WORD, + wCategory: WORD, + dwEventID: DWORD, + lpUserSid: PSID, + wNumStrings: WORD, + dwDataSize: DWORD, + lpStrings: *mut LPCSTR, + lpRawData: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn ReportEventW( + hEventLog: HANDLE, + wType: WORD, + wCategory: WORD, + dwEventID: DWORD, + lpUserSid: PSID, + wNumStrings: WORD, + dwDataSize: DWORD, + lpStrings: *mut LPCWSTR, + lpRawData: LPVOID, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _EVENTLOG_FULL_INFORMATION { + pub dwFull: DWORD, +} +pub type EVENTLOG_FULL_INFORMATION = _EVENTLOG_FULL_INFORMATION; +pub type LPEVENTLOG_FULL_INFORMATION = *mut _EVENTLOG_FULL_INFORMATION; +extern "C" { + pub fn GetEventLogInformation( + hEventLog: HANDLE, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadDirectoryChangesW( + hDirectory: HANDLE, + lpBuffer: LPVOID, + nBufferLength: DWORD, + bWatchSubtree: WINBOOL, + dwNotifyFilter: DWORD, + lpBytesReturned: LPDWORD, + lpOverlapped: LPOVERLAPPED, + lpCompletionRoutine: LPOVERLAPPED_COMPLETION_ROUTINE, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckAndAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + ObjectTypeName: LPSTR, + ObjectName: LPSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + DesiredAccess: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeAndAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + ObjectTypeName: LPCSTR, + ObjectName: LPCSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccess: LPDWORD, + AccessStatus: LPBOOL, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeResultListAndAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + ObjectTypeName: LPCSTR, + ObjectName: LPCSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccess: LPDWORD, + AccessStatusList: LPDWORD, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AccessCheckByTypeResultListAndAuditAlarmByHandleA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + ClientToken: HANDLE, + ObjectTypeName: LPCSTR, + ObjectName: LPCSTR, + SecurityDescriptor: PSECURITY_DESCRIPTOR, + PrincipalSelfSid: PSID, + DesiredAccess: DWORD, + AuditType: AUDIT_EVENT_TYPE, + Flags: DWORD, + ObjectTypeList: POBJECT_TYPE_LIST, + ObjectTypeListLength: DWORD, + GenericMapping: PGENERIC_MAPPING, + ObjectCreation: WINBOOL, + GrantedAccess: LPDWORD, + AccessStatusList: LPDWORD, + pfGenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectOpenAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + ObjectTypeName: LPSTR, + ObjectName: LPSTR, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ClientToken: HANDLE, + DesiredAccess: DWORD, + GrantedAccess: DWORD, + Privileges: PPRIVILEGE_SET, + ObjectCreation: WINBOOL, + AccessGranted: WINBOOL, + GenerateOnClose: LPBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectPrivilegeAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + ClientToken: HANDLE, + DesiredAccess: DWORD, + Privileges: PPRIVILEGE_SET, + AccessGranted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectCloseAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + GenerateOnClose: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn ObjectDeleteAuditAlarmA( + SubsystemName: LPCSTR, + HandleId: LPVOID, + GenerateOnClose: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn PrivilegedServiceAuditAlarmA( + SubsystemName: LPCSTR, + ServiceName: LPCSTR, + ClientToken: HANDLE, + Privileges: PPRIVILEGE_SET, + AccessGranted: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetFileSecurityA( + lpFileName: LPCSTR, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetFileSecurityA( + lpFileName: LPCSTR, + RequestedInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn IsBadReadPtr(lp: *const ::std::os::raw::c_void, ucb: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn IsBadWritePtr(lp: LPVOID, ucb: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn IsBadHugeReadPtr(lp: *const ::std::os::raw::c_void, ucb: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn IsBadHugeWritePtr(lp: LPVOID, ucb: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn IsBadCodePtr(lpfn: FARPROC) -> WINBOOL; +} +extern "C" { + pub fn IsBadStringPtrA(lpsz: LPCSTR, ucchMax: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn IsBadStringPtrW(lpsz: LPCWSTR, ucchMax: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn LookupAccountSidA( + lpSystemName: LPCSTR, + Sid: PSID, + Name: LPSTR, + cchName: LPDWORD, + ReferencedDomainName: LPSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupAccountSidW( + lpSystemName: LPCWSTR, + Sid: PSID, + Name: LPWSTR, + cchName: LPDWORD, + ReferencedDomainName: LPWSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupAccountNameA( + lpSystemName: LPCSTR, + lpAccountName: LPCSTR, + Sid: PSID, + cbSid: LPDWORD, + ReferencedDomainName: LPSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupAccountNameW( + lpSystemName: LPCWSTR, + lpAccountName: LPCWSTR, + Sid: PSID, + cbSid: LPDWORD, + ReferencedDomainName: LPWSTR, + cchReferencedDomainName: LPDWORD, + peUse: PSID_NAME_USE, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupPrivilegeValueA(lpSystemName: LPCSTR, lpName: LPCSTR, lpLuid: PLUID) -> WINBOOL; +} +extern "C" { + pub fn LookupPrivilegeValueW(lpSystemName: LPCWSTR, lpName: LPCWSTR, lpLuid: PLUID) -> WINBOOL; +} +extern "C" { + pub fn LookupPrivilegeNameA( + lpSystemName: LPCSTR, + lpLuid: PLUID, + lpName: LPSTR, + cchName: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupPrivilegeNameW( + lpSystemName: LPCWSTR, + lpLuid: PLUID, + lpName: LPWSTR, + cchName: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupPrivilegeDisplayNameA( + lpSystemName: LPCSTR, + lpName: LPCSTR, + lpDisplayName: LPSTR, + cchDisplayName: LPDWORD, + lpLanguageId: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn LookupPrivilegeDisplayNameW( + lpSystemName: LPCWSTR, + lpName: LPCWSTR, + lpDisplayName: LPWSTR, + cchDisplayName: LPDWORD, + lpLanguageId: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn BuildCommDCBA(lpDef: LPCSTR, lpDCB: LPDCB) -> WINBOOL; +} +extern "C" { + pub fn BuildCommDCBW(lpDef: LPCWSTR, lpDCB: LPDCB) -> WINBOOL; +} +extern "C" { + pub fn BuildCommDCBAndTimeoutsA( + lpDef: LPCSTR, + lpDCB: LPDCB, + lpCommTimeouts: LPCOMMTIMEOUTS, + ) -> WINBOOL; +} +extern "C" { + pub fn BuildCommDCBAndTimeoutsW( + lpDef: LPCWSTR, + lpDCB: LPDCB, + lpCommTimeouts: LPCOMMTIMEOUTS, + ) -> WINBOOL; +} +extern "C" { + pub fn CommConfigDialogA(lpszName: LPCSTR, hWnd: HWND, lpCC: LPCOMMCONFIG) -> WINBOOL; +} +extern "C" { + pub fn CommConfigDialogW(lpszName: LPCWSTR, hWnd: HWND, lpCC: LPCOMMCONFIG) -> WINBOOL; +} +extern "C" { + pub fn GetDefaultCommConfigA( + lpszName: LPCSTR, + lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetDefaultCommConfigW( + lpszName: LPCWSTR, + lpCC: LPCOMMCONFIG, + lpdwSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetDefaultCommConfigA(lpszName: LPCSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetDefaultCommConfigW(lpszName: LPCWSTR, lpCC: LPCOMMCONFIG, dwSize: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetComputerNameA(lpBuffer: LPSTR, nSize: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetComputerNameW(lpBuffer: LPWSTR, nSize: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn SetComputerNameA(lpComputerName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetComputerNameW(lpComputerName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn SetComputerNameExA(NameType: COMPUTER_NAME_FORMAT, lpBuffer: LPCTSTR) -> WINBOOL; +} +extern "C" { + pub fn DnsHostnameToComputerNameA( + Hostname: LPCSTR, + ComputerName: LPSTR, + nSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn DnsHostnameToComputerNameW( + Hostname: LPCWSTR, + ComputerName: LPWSTR, + nSize: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetUserNameA(lpBuffer: LPSTR, pcbBuffer: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetUserNameW(lpBuffer: LPWSTR, pcbBuffer: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn LogonUserA( + lpszUsername: LPCSTR, + lpszDomain: LPCSTR, + lpszPassword: LPCSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn LogonUserW( + lpszUsername: LPCWSTR, + lpszDomain: LPCWSTR, + lpszPassword: LPCWSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ) -> WINBOOL; +} +extern "C" { + pub fn LogonUserExA( + lpszUsername: LPCSTR, + lpszDomain: LPCSTR, + lpszPassword: LPCSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ppLogonSid: *mut PSID, + ppProfileBuffer: *mut PVOID, + pdwProfileLength: LPDWORD, + pQuotaLimits: PQUOTA_LIMITS, + ) -> WINBOOL; +} +extern "C" { + pub fn LogonUserExW( + lpszUsername: LPCWSTR, + lpszDomain: LPCWSTR, + lpszPassword: LPCWSTR, + dwLogonType: DWORD, + dwLogonProvider: DWORD, + phToken: PHANDLE, + ppLogonSid: *mut PSID, + ppProfileBuffer: *mut PVOID, + pdwProfileLength: LPDWORD, + pQuotaLimits: PQUOTA_LIMITS, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateProcessAsUserA( + hToken: HANDLE, + lpApplicationName: LPCSTR, + lpCommandLine: LPSTR, + lpProcessAttributes: LPSECURITY_ATTRIBUTES, + lpThreadAttributes: LPSECURITY_ATTRIBUTES, + bInheritHandles: WINBOOL, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCSTR, + lpStartupInfo: LPSTARTUPINFOA, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateProcessWithLogonW( + lpUsername: LPCWSTR, + lpDomain: LPCWSTR, + lpPassword: LPCWSTR, + dwLogonFlags: DWORD, + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateProcessWithTokenW( + hToken: HANDLE, + dwLogonFlags: DWORD, + lpApplicationName: LPCWSTR, + lpCommandLine: LPWSTR, + dwCreationFlags: DWORD, + lpEnvironment: LPVOID, + lpCurrentDirectory: LPCWSTR, + lpStartupInfo: LPSTARTUPINFOW, + lpProcessInformation: LPPROCESS_INFORMATION, + ) -> WINBOOL; +} +extern "C" { + pub fn IsTokenUntrusted(TokenHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn RegisterWaitForSingleObject( + phNewWaitObject: PHANDLE, + hObject: HANDLE, + Callback: WAITORTIMERCALLBACK, + Context: PVOID, + dwMilliseconds: ULONG, + dwFlags: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn UnregisterWait(WaitHandle: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn BindIoCompletionCallback( + FileHandle: HANDLE, + Function: LPOVERLAPPED_COMPLETION_ROUTINE, + Flags: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn SetTimerQueueTimer( + TimerQueue: HANDLE, + Callback: WAITORTIMERCALLBACK, + Parameter: PVOID, + DueTime: DWORD, + Period: DWORD, + PreferIo: WINBOOL, + ) -> HANDLE; +} +extern "C" { + pub fn CancelTimerQueueTimer(TimerQueue: HANDLE, Timer: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn DeleteTimerQueue(TimerQueue: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn CreatePrivateNamespaceA( + lpPrivateNamespaceAttributes: LPSECURITY_ATTRIBUTES, + lpBoundaryDescriptor: LPVOID, + lpAliasPrefix: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenPrivateNamespaceA(lpBoundaryDescriptor: LPVOID, lpAliasPrefix: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn CreateBoundaryDescriptorA(Name: LPCSTR, Flags: ULONG) -> HANDLE; +} +extern "C" { + pub fn AddIntegrityLabelToBoundaryDescriptor( + BoundaryDescriptor: *mut HANDLE, + IntegrityLabel: PSID, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagHW_PROFILE_INFOA { + pub dwDockInfo: DWORD, + pub szHwProfileGuid: [CHAR; 39usize], + pub szHwProfileName: [CHAR; 80usize], +} +pub type HW_PROFILE_INFOA = tagHW_PROFILE_INFOA; +pub type LPHW_PROFILE_INFOA = *mut tagHW_PROFILE_INFOA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagHW_PROFILE_INFOW { + pub dwDockInfo: DWORD, + pub szHwProfileGuid: [WCHAR; 39usize], + pub szHwProfileName: [WCHAR; 80usize], +} +pub type HW_PROFILE_INFOW = tagHW_PROFILE_INFOW; +pub type LPHW_PROFILE_INFOW = *mut tagHW_PROFILE_INFOW; +pub type HW_PROFILE_INFO = HW_PROFILE_INFOA; +pub type LPHW_PROFILE_INFO = LPHW_PROFILE_INFOA; +extern "C" { + pub fn GetCurrentHwProfileA(lpHwProfileInfo: LPHW_PROFILE_INFOA) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentHwProfileW(lpHwProfileInfo: LPHW_PROFILE_INFOW) -> WINBOOL; +} +extern "C" { + pub fn VerifyVersionInfoA( + lpVersionInformation: LPOSVERSIONINFOEXA, + dwTypeMask: DWORD, + dwlConditionMask: DWORDLONG, + ) -> WINBOOL; +} +extern "C" { + pub fn VerifyVersionInfoW( + lpVersionInformation: LPOSVERSIONINFOEXW, + dwTypeMask: DWORD, + dwlConditionMask: DWORDLONG, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TIME_ZONE_INFORMATION { + pub Bias: LONG, + pub StandardName: [WCHAR; 32usize], + pub StandardDate: SYSTEMTIME, + pub StandardBias: LONG, + pub DaylightName: [WCHAR; 32usize], + pub DaylightDate: SYSTEMTIME, + pub DaylightBias: LONG, +} +pub type TIME_ZONE_INFORMATION = _TIME_ZONE_INFORMATION; +pub type PTIME_ZONE_INFORMATION = *mut _TIME_ZONE_INFORMATION; +pub type LPTIME_ZONE_INFORMATION = *mut _TIME_ZONE_INFORMATION; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _TIME_DYNAMIC_ZONE_INFORMATION { + pub Bias: LONG, + pub StandardName: [WCHAR; 32usize], + pub StandardDate: SYSTEMTIME, + pub StandardBias: LONG, + pub DaylightName: [WCHAR; 32usize], + pub DaylightDate: SYSTEMTIME, + pub DaylightBias: LONG, + pub TimeZoneKeyName: [WCHAR; 128usize], + pub DynamicDaylightTimeDisabled: BOOLEAN, +} +pub type DYNAMIC_TIME_ZONE_INFORMATION = _TIME_DYNAMIC_ZONE_INFORMATION; +pub type PDYNAMIC_TIME_ZONE_INFORMATION = *mut _TIME_DYNAMIC_ZONE_INFORMATION; +extern "C" { + pub fn SystemTimeToTzSpecificLocalTime( + lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, + lpUniversalTime: *const SYSTEMTIME, + lpLocalTime: LPSYSTEMTIME, + ) -> WINBOOL; +} +extern "C" { + pub fn TzSpecificLocalTimeToSystemTime( + lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, + lpLocalTime: *const SYSTEMTIME, + lpUniversalTime: LPSYSTEMTIME, + ) -> WINBOOL; +} +extern "C" { + pub fn FileTimeToSystemTime(lpFileTime: *const FILETIME, lpSystemTime: LPSYSTEMTIME) + -> WINBOOL; +} +extern "C" { + pub fn SystemTimeToFileTime(lpSystemTime: *const SYSTEMTIME, lpFileTime: LPFILETIME) + -> WINBOOL; +} +extern "C" { + pub fn GetTimeZoneInformation(lpTimeZoneInformation: LPTIME_ZONE_INFORMATION) -> DWORD; +} +extern "C" { + pub fn SetTimeZoneInformation(lpTimeZoneInformation: *const TIME_ZONE_INFORMATION) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SYSTEM_POWER_STATUS { + pub ACLineStatus: BYTE, + pub BatteryFlag: BYTE, + pub BatteryLifePercent: BYTE, + pub Reserved1: BYTE, + pub BatteryLifeTime: DWORD, + pub BatteryFullLifeTime: DWORD, +} +pub type SYSTEM_POWER_STATUS = _SYSTEM_POWER_STATUS; +pub type LPSYSTEM_POWER_STATUS = *mut _SYSTEM_POWER_STATUS; +extern "C" { + pub fn GetSystemPowerStatus(lpSystemPowerStatus: LPSYSTEM_POWER_STATUS) -> WINBOOL; +} +extern "C" { + pub fn SetSystemPowerState(fSuspend: WINBOOL, fForce: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn AllocateUserPhysicalPages( + hProcess: HANDLE, + NumberOfPages: PULONG_PTR, + PageArray: PULONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn FreeUserPhysicalPages( + hProcess: HANDLE, + NumberOfPages: PULONG_PTR, + PageArray: PULONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn MapUserPhysicalPages( + VirtualAddress: PVOID, + NumberOfPages: ULONG_PTR, + PageArray: PULONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn MapUserPhysicalPagesScatter( + VirtualAddresses: *mut PVOID, + NumberOfPages: ULONG_PTR, + PageArray: PULONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateJobObjectA(lpJobAttributes: LPSECURITY_ATTRIBUTES, lpName: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn CreateJobObjectW(lpJobAttributes: LPSECURITY_ATTRIBUTES, lpName: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn OpenJobObjectA( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpName: LPCSTR, + ) -> HANDLE; +} +extern "C" { + pub fn OpenJobObjectW( + dwDesiredAccess: DWORD, + bInheritHandle: WINBOOL, + lpName: LPCWSTR, + ) -> HANDLE; +} +extern "C" { + pub fn AssignProcessToJobObject(hJob: HANDLE, hProcess: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn TerminateJobObject(hJob: HANDLE, uExitCode: UINT) -> WINBOOL; +} +extern "C" { + pub fn QueryInformationJobObject( + hJob: HANDLE, + JobObjectInformationClass: JOBOBJECTINFOCLASS, + lpJobObjectInformation: LPVOID, + cbJobObjectInformationLength: DWORD, + lpReturnLength: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetInformationJobObject( + hJob: HANDLE, + JobObjectInformationClass: JOBOBJECTINFOCLASS, + lpJobObjectInformation: LPVOID, + cbJobObjectInformationLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateJobSet(NumJob: ULONG, UserJobSet: PJOB_SET_ARRAY, Flags: ULONG) -> WINBOOL; +} +extern "C" { + pub fn FindFirstVolumeA(lpszVolumeName: LPSTR, cchBufferLength: DWORD) -> HANDLE; +} +extern "C" { + pub fn FindNextVolumeA( + hFindVolume: HANDLE, + lpszVolumeName: LPSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FindFirstVolumeMountPointA( + lpszRootPathName: LPCSTR, + lpszVolumeMountPoint: LPSTR, + cchBufferLength: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindFirstVolumeMountPointW( + lpszRootPathName: LPCWSTR, + lpszVolumeMountPoint: LPWSTR, + cchBufferLength: DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn FindNextVolumeMountPointA( + hFindVolumeMountPoint: HANDLE, + lpszVolumeMountPoint: LPSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FindNextVolumeMountPointW( + hFindVolumeMountPoint: HANDLE, + lpszVolumeMountPoint: LPWSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FindVolumeMountPointClose(hFindVolumeMountPoint: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn SetVolumeMountPointA(lpszVolumeMountPoint: LPCSTR, lpszVolumeName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetVolumeMountPointW(lpszVolumeMountPoint: LPCWSTR, lpszVolumeName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn DeleteVolumeMountPointA(lpszVolumeMountPoint: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn GetVolumeNameForVolumeMountPointA( + lpszVolumeMountPoint: LPCSTR, + lpszVolumeName: LPSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetVolumePathNameA( + lpszFileName: LPCSTR, + lpszVolumePathName: LPSTR, + cchBufferLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetVolumePathNamesForVolumeNameA( + lpszVolumeName: LPCSTR, + lpszVolumePathNames: LPCH, + cchBufferLength: DWORD, + lpcchReturnLength: PDWORD, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACTCTXA { + pub cbSize: ULONG, + pub dwFlags: DWORD, + pub lpSource: LPCSTR, + pub wProcessorArchitecture: USHORT, + pub wLangId: LANGID, + pub lpAssemblyDirectory: LPCSTR, + pub lpResourceName: LPCSTR, + pub lpApplicationName: LPCSTR, + pub hModule: HMODULE, +} +pub type ACTCTXA = tagACTCTXA; +pub type PACTCTXA = *mut tagACTCTXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACTCTXW { + pub cbSize: ULONG, + pub dwFlags: DWORD, + pub lpSource: LPCWSTR, + pub wProcessorArchitecture: USHORT, + pub wLangId: LANGID, + pub lpAssemblyDirectory: LPCWSTR, + pub lpResourceName: LPCWSTR, + pub lpApplicationName: LPCWSTR, + pub hModule: HMODULE, +} +pub type ACTCTXW = tagACTCTXW; +pub type PACTCTXW = *mut tagACTCTXW; +pub type ACTCTX = ACTCTXA; +pub type PACTCTX = PACTCTXA; +pub type PCACTCTXA = *const ACTCTXA; +pub type PCACTCTXW = *const ACTCTXW; +pub type PCACTCTX = PCACTCTXA; +extern "C" { + pub fn CreateActCtxA(pActCtx: PCACTCTXA) -> HANDLE; +} +extern "C" { + pub fn CreateActCtxW(pActCtx: PCACTCTXW) -> HANDLE; +} +extern "C" { + pub fn AddRefActCtx(hActCtx: HANDLE); +} +extern "C" { + pub fn ReleaseActCtx(hActCtx: HANDLE); +} +extern "C" { + pub fn ZombifyActCtx(hActCtx: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ActivateActCtx(hActCtx: HANDLE, lpCookie: *mut ULONG_PTR) -> WINBOOL; +} +extern "C" { + pub fn DeactivateActCtx(dwFlags: DWORD, ulCookie: ULONG_PTR) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentActCtx(lphActCtx: *mut HANDLE) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACTCTX_SECTION_KEYED_DATA_2600 { + pub cbSize: ULONG, + pub ulDataFormatVersion: ULONG, + pub lpData: PVOID, + pub ulLength: ULONG, + pub lpSectionGlobalData: PVOID, + pub ulSectionGlobalDataLength: ULONG, + pub lpSectionBase: PVOID, + pub ulSectionTotalLength: ULONG, + pub hActCtx: HANDLE, + pub ulAssemblyRosterIndex: ULONG, +} +pub type ACTCTX_SECTION_KEYED_DATA_2600 = tagACTCTX_SECTION_KEYED_DATA_2600; +pub type PACTCTX_SECTION_KEYED_DATA_2600 = *mut tagACTCTX_SECTION_KEYED_DATA_2600; +pub type PCACTCTX_SECTION_KEYED_DATA_2600 = *const ACTCTX_SECTION_KEYED_DATA_2600; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA { + pub lpInformation: PVOID, + pub lpSectionBase: PVOID, + pub ulSectionLength: ULONG, + pub lpSectionGlobalDataBase: PVOID, + pub ulSectionGlobalDataLength: ULONG, +} +pub type ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = + tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA; +pub type PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = + *mut tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA; +pub type PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA = + *const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACTCTX_SECTION_KEYED_DATA { + pub cbSize: ULONG, + pub ulDataFormatVersion: ULONG, + pub lpData: PVOID, + pub ulLength: ULONG, + pub lpSectionGlobalData: PVOID, + pub ulSectionGlobalDataLength: ULONG, + pub lpSectionBase: PVOID, + pub ulSectionTotalLength: ULONG, + pub hActCtx: HANDLE, + pub ulAssemblyRosterIndex: ULONG, + pub ulFlags: ULONG, + pub AssemblyMetadata: ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA, +} +pub type ACTCTX_SECTION_KEYED_DATA = tagACTCTX_SECTION_KEYED_DATA; +pub type PACTCTX_SECTION_KEYED_DATA = *mut tagACTCTX_SECTION_KEYED_DATA; +pub type PCACTCTX_SECTION_KEYED_DATA = *const ACTCTX_SECTION_KEYED_DATA; +extern "C" { + pub fn FindActCtxSectionStringA( + dwFlags: DWORD, + lpExtensionGuid: *const GUID, + ulSectionId: ULONG, + lpStringToFind: LPCSTR, + ReturnedData: PACTCTX_SECTION_KEYED_DATA, + ) -> WINBOOL; +} +extern "C" { + pub fn FindActCtxSectionStringW( + dwFlags: DWORD, + lpExtensionGuid: *const GUID, + ulSectionId: ULONG, + lpStringToFind: LPCWSTR, + ReturnedData: PACTCTX_SECTION_KEYED_DATA, + ) -> WINBOOL; +} +extern "C" { + pub fn FindActCtxSectionGuid( + dwFlags: DWORD, + lpExtensionGuid: *const GUID, + ulSectionId: ULONG, + lpGuidToFind: *const GUID, + ReturnedData: PACTCTX_SECTION_KEYED_DATA, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACTIVATION_CONTEXT_BASIC_INFORMATION { + pub hActCtx: HANDLE, + pub dwFlags: DWORD, +} +pub type ACTIVATION_CONTEXT_BASIC_INFORMATION = _ACTIVATION_CONTEXT_BASIC_INFORMATION; +pub type PACTIVATION_CONTEXT_BASIC_INFORMATION = *mut _ACTIVATION_CONTEXT_BASIC_INFORMATION; +pub type PCACTIVATION_CONTEXT_BASIC_INFORMATION = *const _ACTIVATION_CONTEXT_BASIC_INFORMATION; +extern "C" { + pub fn QueryActCtxW( + dwFlags: DWORD, + hActCtx: HANDLE, + pvSubInstance: PVOID, + ulInfoClass: ULONG, + pvBuffer: PVOID, + cbBuffer: SIZE_T, + pcbWrittenOrRequired: *mut SIZE_T, + ) -> WINBOOL; +} +pub type PQUERYACTCTXW_FUNC = ::std::option::Option< + unsafe extern "C" fn( + dwFlags: DWORD, + hActCtx: HANDLE, + pvSubInstance: PVOID, + ulInfoClass: ULONG, + pvBuffer: PVOID, + cbBuffer: SIZE_T, + pcbWrittenOrRequired: *mut SIZE_T, + ) -> WINBOOL, +>; +extern "C" { + pub fn WTSGetActiveConsoleSessionId() -> DWORD; +} +extern "C" { + pub fn GetNumaProcessorNode(Processor: UCHAR, NodeNumber: PUCHAR) -> WINBOOL; +} +extern "C" { + pub fn GetNumaNodeProcessorMask(Node: UCHAR, ProcessorMask: PULONGLONG) -> WINBOOL; +} +extern "C" { + pub fn GetNumaAvailableMemoryNode(Node: UCHAR, AvailableBytes: PULONGLONG) -> WINBOOL; +} +pub type APPLICATION_RECOVERY_CALLBACK = + ::std::option::Option DWORD>; +extern "C" { + pub fn CopyContext(Destination: PCONTEXT, ContextFlags: DWORD, Source: PCONTEXT) -> WINBOOL; +} +extern "C" { + pub fn InitializeContext( + Buffer: PVOID, + ContextFlags: DWORD, + Context: *mut PCONTEXT, + ContextLength: PDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetEnabledXStateFeatures() -> DWORD64; +} +extern "C" { + pub fn GetXStateFeaturesMask(Context: PCONTEXT, FeatureMask: PDWORD64) -> WINBOOL; +} +extern "C" { + pub fn LocateXStateFeature(Context: PCONTEXT, FeatureId: DWORD, Length: PDWORD) -> PVOID; +} +extern "C" { + pub fn SetXStateFeaturesMask(Context: PCONTEXT, FeatureMask: DWORD64) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DRAWPATRECT { + pub ptPosition: POINT, + pub ptSize: POINT, + pub wStyle: WORD, + pub wPattern: WORD, +} +pub type DRAWPATRECT = _DRAWPATRECT; +pub type PDRAWPATRECT = *mut _DRAWPATRECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PSINJECTDATA { + pub DataBytes: DWORD, + pub InjectionPoint: WORD, + pub PageNumber: WORD, +} +pub type PSINJECTDATA = _PSINJECTDATA; +pub type PPSINJECTDATA = *mut _PSINJECTDATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PSFEATURE_OUTPUT { + pub bPageIndependent: WINBOOL, + pub bSetPageDevice: WINBOOL, +} +pub type PSFEATURE_OUTPUT = _PSFEATURE_OUTPUT; +pub type PPSFEATURE_OUTPUT = *mut _PSFEATURE_OUTPUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _PSFEATURE_CUSTPAPER { + pub lOrientation: LONG, + pub lWidth: LONG, + pub lHeight: LONG, + pub lWidthOffset: LONG, + pub lHeightOffset: LONG, +} +pub type PSFEATURE_CUSTPAPER = _PSFEATURE_CUSTPAPER; +pub type PPSFEATURE_CUSTPAPER = *mut _PSFEATURE_CUSTPAPER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagXFORM { + pub eM11: FLOAT, + pub eM12: FLOAT, + pub eM21: FLOAT, + pub eM22: FLOAT, + pub eDx: FLOAT, + pub eDy: FLOAT, +} +pub type XFORM = tagXFORM; +pub type PXFORM = *mut tagXFORM; +pub type LPXFORM = *mut tagXFORM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagBITMAP { + pub bmType: LONG, + pub bmWidth: LONG, + pub bmHeight: LONG, + pub bmWidthBytes: LONG, + pub bmPlanes: WORD, + pub bmBitsPixel: WORD, + pub bmBits: LPVOID, +} +pub type BITMAP = tagBITMAP; +pub type PBITMAP = *mut tagBITMAP; +pub type NPBITMAP = *mut tagBITMAP; +pub type LPBITMAP = *mut tagBITMAP; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRGBTRIPLE { + pub rgbtBlue: BYTE, + pub rgbtGreen: BYTE, + pub rgbtRed: BYTE, +} +pub type RGBTRIPLE = tagRGBTRIPLE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRGBQUAD { + pub rgbBlue: BYTE, + pub rgbGreen: BYTE, + pub rgbRed: BYTE, + pub rgbReserved: BYTE, +} +pub type RGBQUAD = tagRGBQUAD; +pub type LPRGBQUAD = *mut RGBQUAD; +pub type LCSCSTYPE = LONG; +pub type LCSGAMUTMATCH = LONG; +pub type FXPT16DOT16 = ::std::os::raw::c_long; +pub type LPFXPT16DOT16 = *mut ::std::os::raw::c_long; +pub type FXPT2DOT30 = ::std::os::raw::c_long; +pub type LPFXPT2DOT30 = *mut ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCIEXYZ { + pub ciexyzX: FXPT2DOT30, + pub ciexyzY: FXPT2DOT30, + pub ciexyzZ: FXPT2DOT30, +} +pub type CIEXYZ = tagCIEXYZ; +pub type LPCIEXYZ = *mut CIEXYZ; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagICEXYZTRIPLE { + pub ciexyzRed: CIEXYZ, + pub ciexyzGreen: CIEXYZ, + pub ciexyzBlue: CIEXYZ, +} +pub type CIEXYZTRIPLE = tagICEXYZTRIPLE; +pub type LPCIEXYZTRIPLE = *mut CIEXYZTRIPLE; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagLOGCOLORSPACEA { + pub lcsSignature: DWORD, + pub lcsVersion: DWORD, + pub lcsSize: DWORD, + pub lcsCSType: LCSCSTYPE, + pub lcsIntent: LCSGAMUTMATCH, + pub lcsEndpoints: CIEXYZTRIPLE, + pub lcsGammaRed: DWORD, + pub lcsGammaGreen: DWORD, + pub lcsGammaBlue: DWORD, + pub lcsFilename: [CHAR; 260usize], +} +pub type LOGCOLORSPACEA = tagLOGCOLORSPACEA; +pub type LPLOGCOLORSPACEA = *mut tagLOGCOLORSPACEA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagLOGCOLORSPACEW { + pub lcsSignature: DWORD, + pub lcsVersion: DWORD, + pub lcsSize: DWORD, + pub lcsCSType: LCSCSTYPE, + pub lcsIntent: LCSGAMUTMATCH, + pub lcsEndpoints: CIEXYZTRIPLE, + pub lcsGammaRed: DWORD, + pub lcsGammaGreen: DWORD, + pub lcsGammaBlue: DWORD, + pub lcsFilename: [WCHAR; 260usize], +} +pub type LOGCOLORSPACEW = tagLOGCOLORSPACEW; +pub type LPLOGCOLORSPACEW = *mut tagLOGCOLORSPACEW; +pub type LOGCOLORSPACE = LOGCOLORSPACEA; +pub type LPLOGCOLORSPACE = LPLOGCOLORSPACEA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagBITMAPCOREHEADER { + pub bcSize: DWORD, + pub bcWidth: WORD, + pub bcHeight: WORD, + pub bcPlanes: WORD, + pub bcBitCount: WORD, +} +pub type BITMAPCOREHEADER = tagBITMAPCOREHEADER; +pub type LPBITMAPCOREHEADER = *mut tagBITMAPCOREHEADER; +pub type PBITMAPCOREHEADER = *mut tagBITMAPCOREHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagBITMAPINFOHEADER { + pub biSize: DWORD, + pub biWidth: LONG, + pub biHeight: LONG, + pub biPlanes: WORD, + pub biBitCount: WORD, + pub biCompression: DWORD, + pub biSizeImage: DWORD, + pub biXPelsPerMeter: LONG, + pub biYPelsPerMeter: LONG, + pub biClrUsed: DWORD, + pub biClrImportant: DWORD, +} +pub type BITMAPINFOHEADER = tagBITMAPINFOHEADER; +pub type LPBITMAPINFOHEADER = *mut tagBITMAPINFOHEADER; +pub type PBITMAPINFOHEADER = *mut tagBITMAPINFOHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct BITMAPV4HEADER { + pub bV4Size: DWORD, + pub bV4Width: LONG, + pub bV4Height: LONG, + pub bV4Planes: WORD, + pub bV4BitCount: WORD, + pub bV4V4Compression: DWORD, + pub bV4SizeImage: DWORD, + pub bV4XPelsPerMeter: LONG, + pub bV4YPelsPerMeter: LONG, + pub bV4ClrUsed: DWORD, + pub bV4ClrImportant: DWORD, + pub bV4RedMask: DWORD, + pub bV4GreenMask: DWORD, + pub bV4BlueMask: DWORD, + pub bV4AlphaMask: DWORD, + pub bV4CSType: DWORD, + pub bV4Endpoints: CIEXYZTRIPLE, + pub bV4GammaRed: DWORD, + pub bV4GammaGreen: DWORD, + pub bV4GammaBlue: DWORD, +} +pub type LPBITMAPV4HEADER = *mut BITMAPV4HEADER; +pub type PBITMAPV4HEADER = *mut BITMAPV4HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct BITMAPV5HEADER { + pub bV5Size: DWORD, + pub bV5Width: LONG, + pub bV5Height: LONG, + pub bV5Planes: WORD, + pub bV5BitCount: WORD, + pub bV5Compression: DWORD, + pub bV5SizeImage: DWORD, + pub bV5XPelsPerMeter: LONG, + pub bV5YPelsPerMeter: LONG, + pub bV5ClrUsed: DWORD, + pub bV5ClrImportant: DWORD, + pub bV5RedMask: DWORD, + pub bV5GreenMask: DWORD, + pub bV5BlueMask: DWORD, + pub bV5AlphaMask: DWORD, + pub bV5CSType: DWORD, + pub bV5Endpoints: CIEXYZTRIPLE, + pub bV5GammaRed: DWORD, + pub bV5GammaGreen: DWORD, + pub bV5GammaBlue: DWORD, + pub bV5Intent: DWORD, + pub bV5ProfileData: DWORD, + pub bV5ProfileSize: DWORD, + pub bV5Reserved: DWORD, +} +pub type LPBITMAPV5HEADER = *mut BITMAPV5HEADER; +pub type PBITMAPV5HEADER = *mut BITMAPV5HEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagBITMAPINFO { + pub bmiHeader: BITMAPINFOHEADER, + pub bmiColors: [RGBQUAD; 1usize], +} +pub type BITMAPINFO = tagBITMAPINFO; +pub type LPBITMAPINFO = *mut tagBITMAPINFO; +pub type PBITMAPINFO = *mut tagBITMAPINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagBITMAPCOREINFO { + pub bmciHeader: BITMAPCOREHEADER, + pub bmciColors: [RGBTRIPLE; 1usize], +} +pub type BITMAPCOREINFO = tagBITMAPCOREINFO; +pub type LPBITMAPCOREINFO = *mut tagBITMAPCOREINFO; +pub type PBITMAPCOREINFO = *mut tagBITMAPCOREINFO; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct tagBITMAPFILEHEADER { + pub bfType: WORD, + pub bfSize: DWORD, + pub bfReserved1: WORD, + pub bfReserved2: WORD, + pub bfOffBits: DWORD, +} +pub type BITMAPFILEHEADER = tagBITMAPFILEHEADER; +pub type LPBITMAPFILEHEADER = *mut tagBITMAPFILEHEADER; +pub type PBITMAPFILEHEADER = *mut tagBITMAPFILEHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagFONTSIGNATURE { + pub fsUsb: [DWORD; 4usize], + pub fsCsb: [DWORD; 2usize], +} +pub type FONTSIGNATURE = tagFONTSIGNATURE; +pub type PFONTSIGNATURE = *mut tagFONTSIGNATURE; +pub type LPFONTSIGNATURE = *mut tagFONTSIGNATURE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCHARSETINFO { + pub ciCharset: UINT, + pub ciACP: UINT, + pub fs: FONTSIGNATURE, +} +pub type CHARSETINFO = tagCHARSETINFO; +pub type PCHARSETINFO = *mut tagCHARSETINFO; +pub type NPCHARSETINFO = *mut tagCHARSETINFO; +pub type LPCHARSETINFO = *mut tagCHARSETINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOCALESIGNATURE { + pub lsUsb: [DWORD; 4usize], + pub lsCsbDefault: [DWORD; 2usize], + pub lsCsbSupported: [DWORD; 2usize], +} +pub type LOCALESIGNATURE = tagLOCALESIGNATURE; +pub type PLOCALESIGNATURE = *mut tagLOCALESIGNATURE; +pub type LPLOCALESIGNATURE = *mut tagLOCALESIGNATURE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHANDLETABLE { + pub objectHandle: [HGDIOBJ; 1usize], +} +pub type HANDLETABLE = tagHANDLETABLE; +pub type PHANDLETABLE = *mut tagHANDLETABLE; +pub type LPHANDLETABLE = *mut tagHANDLETABLE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMETARECORD { + pub rdSize: DWORD, + pub rdFunction: WORD, + pub rdParm: [WORD; 1usize], +} +pub type METARECORD = tagMETARECORD; +pub type PMETARECORD = *mut tagMETARECORD; +pub type LPMETARECORD = *mut tagMETARECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMETAFILEPICT { + pub mm: LONG, + pub xExt: LONG, + pub yExt: LONG, + pub hMF: HMETAFILE, +} +pub type METAFILEPICT = tagMETAFILEPICT; +pub type LPMETAFILEPICT = *mut tagMETAFILEPICT; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct tagMETAHEADER { + pub mtType: WORD, + pub mtHeaderSize: WORD, + pub mtVersion: WORD, + pub mtSize: DWORD, + pub mtNoObjects: WORD, + pub mtMaxRecord: DWORD, + pub mtNoParameters: WORD, +} +pub type METAHEADER = tagMETAHEADER; +pub type PMETAHEADER = *mut tagMETAHEADER; +pub type LPMETAHEADER = *mut tagMETAHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagENHMETARECORD { + pub iType: DWORD, + pub nSize: DWORD, + pub dParm: [DWORD; 1usize], +} +pub type ENHMETARECORD = tagENHMETARECORD; +pub type PENHMETARECORD = *mut tagENHMETARECORD; +pub type LPENHMETARECORD = *mut tagENHMETARECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagENHMETAHEADER { + pub iType: DWORD, + pub nSize: DWORD, + pub rclBounds: RECTL, + pub rclFrame: RECTL, + pub dSignature: DWORD, + pub nVersion: DWORD, + pub nBytes: DWORD, + pub nRecords: DWORD, + pub nHandles: WORD, + pub sReserved: WORD, + pub nDescription: DWORD, + pub offDescription: DWORD, + pub nPalEntries: DWORD, + pub szlDevice: SIZEL, + pub szlMillimeters: SIZEL, + pub cbPixelFormat: DWORD, + pub offPixelFormat: DWORD, + pub bOpenGL: DWORD, + pub szlMicrometers: SIZEL, +} +pub type ENHMETAHEADER = tagENHMETAHEADER; +pub type PENHMETAHEADER = *mut tagENHMETAHEADER; +pub type LPENHMETAHEADER = *mut tagENHMETAHEADER; +pub type BCHAR = BYTE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTEXTMETRICA { + pub tmHeight: LONG, + pub tmAscent: LONG, + pub tmDescent: LONG, + pub tmInternalLeading: LONG, + pub tmExternalLeading: LONG, + pub tmAveCharWidth: LONG, + pub tmMaxCharWidth: LONG, + pub tmWeight: LONG, + pub tmOverhang: LONG, + pub tmDigitizedAspectX: LONG, + pub tmDigitizedAspectY: LONG, + pub tmFirstChar: BYTE, + pub tmLastChar: BYTE, + pub tmDefaultChar: BYTE, + pub tmBreakChar: BYTE, + pub tmItalic: BYTE, + pub tmUnderlined: BYTE, + pub tmStruckOut: BYTE, + pub tmPitchAndFamily: BYTE, + pub tmCharSet: BYTE, +} +pub type TEXTMETRICA = tagTEXTMETRICA; +pub type PTEXTMETRICA = *mut tagTEXTMETRICA; +pub type NPTEXTMETRICA = *mut tagTEXTMETRICA; +pub type LPTEXTMETRICA = *mut tagTEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTEXTMETRICW { + pub tmHeight: LONG, + pub tmAscent: LONG, + pub tmDescent: LONG, + pub tmInternalLeading: LONG, + pub tmExternalLeading: LONG, + pub tmAveCharWidth: LONG, + pub tmMaxCharWidth: LONG, + pub tmWeight: LONG, + pub tmOverhang: LONG, + pub tmDigitizedAspectX: LONG, + pub tmDigitizedAspectY: LONG, + pub tmFirstChar: WCHAR, + pub tmLastChar: WCHAR, + pub tmDefaultChar: WCHAR, + pub tmBreakChar: WCHAR, + pub tmItalic: BYTE, + pub tmUnderlined: BYTE, + pub tmStruckOut: BYTE, + pub tmPitchAndFamily: BYTE, + pub tmCharSet: BYTE, +} +pub type TEXTMETRICW = tagTEXTMETRICW; +pub type PTEXTMETRICW = *mut tagTEXTMETRICW; +pub type NPTEXTMETRICW = *mut tagTEXTMETRICW; +pub type LPTEXTMETRICW = *mut tagTEXTMETRICW; +pub type TEXTMETRIC = TEXTMETRICA; +pub type PTEXTMETRIC = PTEXTMETRICA; +pub type NPTEXTMETRIC = NPTEXTMETRICA; +pub type LPTEXTMETRIC = LPTEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNEWTEXTMETRICA { + pub tmHeight: LONG, + pub tmAscent: LONG, + pub tmDescent: LONG, + pub tmInternalLeading: LONG, + pub tmExternalLeading: LONG, + pub tmAveCharWidth: LONG, + pub tmMaxCharWidth: LONG, + pub tmWeight: LONG, + pub tmOverhang: LONG, + pub tmDigitizedAspectX: LONG, + pub tmDigitizedAspectY: LONG, + pub tmFirstChar: BYTE, + pub tmLastChar: BYTE, + pub tmDefaultChar: BYTE, + pub tmBreakChar: BYTE, + pub tmItalic: BYTE, + pub tmUnderlined: BYTE, + pub tmStruckOut: BYTE, + pub tmPitchAndFamily: BYTE, + pub tmCharSet: BYTE, + pub ntmFlags: DWORD, + pub ntmSizeEM: UINT, + pub ntmCellHeight: UINT, + pub ntmAvgWidth: UINT, +} +pub type NEWTEXTMETRICA = tagNEWTEXTMETRICA; +pub type PNEWTEXTMETRICA = *mut tagNEWTEXTMETRICA; +pub type NPNEWTEXTMETRICA = *mut tagNEWTEXTMETRICA; +pub type LPNEWTEXTMETRICA = *mut tagNEWTEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNEWTEXTMETRICW { + pub tmHeight: LONG, + pub tmAscent: LONG, + pub tmDescent: LONG, + pub tmInternalLeading: LONG, + pub tmExternalLeading: LONG, + pub tmAveCharWidth: LONG, + pub tmMaxCharWidth: LONG, + pub tmWeight: LONG, + pub tmOverhang: LONG, + pub tmDigitizedAspectX: LONG, + pub tmDigitizedAspectY: LONG, + pub tmFirstChar: WCHAR, + pub tmLastChar: WCHAR, + pub tmDefaultChar: WCHAR, + pub tmBreakChar: WCHAR, + pub tmItalic: BYTE, + pub tmUnderlined: BYTE, + pub tmStruckOut: BYTE, + pub tmPitchAndFamily: BYTE, + pub tmCharSet: BYTE, + pub ntmFlags: DWORD, + pub ntmSizeEM: UINT, + pub ntmCellHeight: UINT, + pub ntmAvgWidth: UINT, +} +pub type NEWTEXTMETRICW = tagNEWTEXTMETRICW; +pub type PNEWTEXTMETRICW = *mut tagNEWTEXTMETRICW; +pub type NPNEWTEXTMETRICW = *mut tagNEWTEXTMETRICW; +pub type LPNEWTEXTMETRICW = *mut tagNEWTEXTMETRICW; +pub type NEWTEXTMETRIC = NEWTEXTMETRICA; +pub type PNEWTEXTMETRIC = PNEWTEXTMETRICA; +pub type NPNEWTEXTMETRIC = NPNEWTEXTMETRICA; +pub type LPNEWTEXTMETRIC = LPNEWTEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNEWTEXTMETRICEXA { + pub ntmTm: NEWTEXTMETRICA, + pub ntmFontSig: FONTSIGNATURE, +} +pub type NEWTEXTMETRICEXA = tagNEWTEXTMETRICEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNEWTEXTMETRICEXW { + pub ntmTm: NEWTEXTMETRICW, + pub ntmFontSig: FONTSIGNATURE, +} +pub type NEWTEXTMETRICEXW = tagNEWTEXTMETRICEXW; +pub type NEWTEXTMETRICEX = NEWTEXTMETRICEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPELARRAY { + pub paXCount: LONG, + pub paYCount: LONG, + pub paXExt: LONG, + pub paYExt: LONG, + pub paRGBs: BYTE, +} +pub type PELARRAY = tagPELARRAY; +pub type PPELARRAY = *mut tagPELARRAY; +pub type NPPELARRAY = *mut tagPELARRAY; +pub type LPPELARRAY = *mut tagPELARRAY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOGBRUSH { + pub lbStyle: UINT, + pub lbColor: COLORREF, + pub lbHatch: ULONG_PTR, +} +pub type LOGBRUSH = tagLOGBRUSH; +pub type PLOGBRUSH = *mut tagLOGBRUSH; +pub type NPLOGBRUSH = *mut tagLOGBRUSH; +pub type LPLOGBRUSH = *mut tagLOGBRUSH; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOGBRUSH32 { + pub lbStyle: UINT, + pub lbColor: COLORREF, + pub lbHatch: ULONG, +} +pub type LOGBRUSH32 = tagLOGBRUSH32; +pub type PLOGBRUSH32 = *mut tagLOGBRUSH32; +pub type NPLOGBRUSH32 = *mut tagLOGBRUSH32; +pub type LPLOGBRUSH32 = *mut tagLOGBRUSH32; +pub type PATTERN = LOGBRUSH; +pub type PPATTERN = *mut PATTERN; +pub type NPPATTERN = *mut PATTERN; +pub type LPPATTERN = *mut PATTERN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOGPEN { + pub lopnStyle: UINT, + pub lopnWidth: POINT, + pub lopnColor: COLORREF, +} +pub type LOGPEN = tagLOGPEN; +pub type PLOGPEN = *mut tagLOGPEN; +pub type NPLOGPEN = *mut tagLOGPEN; +pub type LPLOGPEN = *mut tagLOGPEN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEXTLOGPEN { + pub elpPenStyle: DWORD, + pub elpWidth: DWORD, + pub elpBrushStyle: UINT, + pub elpColor: COLORREF, + pub elpHatch: ULONG_PTR, + pub elpNumEntries: DWORD, + pub elpStyleEntry: [DWORD; 1usize], +} +pub type EXTLOGPEN = tagEXTLOGPEN; +pub type PEXTLOGPEN = *mut tagEXTLOGPEN; +pub type NPEXTLOGPEN = *mut tagEXTLOGPEN; +pub type LPEXTLOGPEN = *mut tagEXTLOGPEN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEXTLOGPEN32 { + pub elpPenStyle: DWORD, + pub elpWidth: DWORD, + pub elpBrushStyle: UINT, + pub elpColor: COLORREF, + pub elpHatch: ULONG, + pub elpNumEntries: DWORD, + pub elpStyleEntry: [DWORD; 1usize], +} +pub type EXTLOGPEN32 = tagEXTLOGPEN32; +pub type PEXTLOGPEN32 = *mut tagEXTLOGPEN32; +pub type NPEXTLOGPEN32 = *mut tagEXTLOGPEN32; +pub type LPEXTLOGPEN32 = *mut tagEXTLOGPEN32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPALETTEENTRY { + pub peRed: BYTE, + pub peGreen: BYTE, + pub peBlue: BYTE, + pub peFlags: BYTE, +} +pub type PALETTEENTRY = tagPALETTEENTRY; +pub type PPALETTEENTRY = *mut tagPALETTEENTRY; +pub type LPPALETTEENTRY = *mut tagPALETTEENTRY; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOGPALETTE { + pub palVersion: WORD, + pub palNumEntries: WORD, + pub palPalEntry: [PALETTEENTRY; 1usize], +} +pub type LOGPALETTE = tagLOGPALETTE; +pub type PLOGPALETTE = *mut tagLOGPALETTE; +pub type NPLOGPALETTE = *mut tagLOGPALETTE; +pub type LPLOGPALETTE = *mut tagLOGPALETTE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOGFONTA { + pub lfHeight: LONG, + pub lfWidth: LONG, + pub lfEscapement: LONG, + pub lfOrientation: LONG, + pub lfWeight: LONG, + pub lfItalic: BYTE, + pub lfUnderline: BYTE, + pub lfStrikeOut: BYTE, + pub lfCharSet: BYTE, + pub lfOutPrecision: BYTE, + pub lfClipPrecision: BYTE, + pub lfQuality: BYTE, + pub lfPitchAndFamily: BYTE, + pub lfFaceName: [CHAR; 32usize], +} +pub type LOGFONTA = tagLOGFONTA; +pub type PLOGFONTA = *mut tagLOGFONTA; +pub type NPLOGFONTA = *mut tagLOGFONTA; +pub type LPLOGFONTA = *mut tagLOGFONTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLOGFONTW { + pub lfHeight: LONG, + pub lfWidth: LONG, + pub lfEscapement: LONG, + pub lfOrientation: LONG, + pub lfWeight: LONG, + pub lfItalic: BYTE, + pub lfUnderline: BYTE, + pub lfStrikeOut: BYTE, + pub lfCharSet: BYTE, + pub lfOutPrecision: BYTE, + pub lfClipPrecision: BYTE, + pub lfQuality: BYTE, + pub lfPitchAndFamily: BYTE, + pub lfFaceName: [WCHAR; 32usize], +} +pub type LOGFONTW = tagLOGFONTW; +pub type PLOGFONTW = *mut tagLOGFONTW; +pub type NPLOGFONTW = *mut tagLOGFONTW; +pub type LPLOGFONTW = *mut tagLOGFONTW; +pub type LOGFONT = LOGFONTA; +pub type PLOGFONT = PLOGFONTA; +pub type NPLOGFONT = NPLOGFONTA; +pub type LPLOGFONT = LPLOGFONTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagENUMLOGFONTA { + pub elfLogFont: LOGFONTA, + pub elfFullName: [BYTE; 64usize], + pub elfStyle: [BYTE; 32usize], +} +pub type ENUMLOGFONTA = tagENUMLOGFONTA; +pub type LPENUMLOGFONTA = *mut tagENUMLOGFONTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagENUMLOGFONTW { + pub elfLogFont: LOGFONTW, + pub elfFullName: [WCHAR; 64usize], + pub elfStyle: [WCHAR; 32usize], +} +pub type ENUMLOGFONTW = tagENUMLOGFONTW; +pub type LPENUMLOGFONTW = *mut tagENUMLOGFONTW; +pub type ENUMLOGFONT = ENUMLOGFONTA; +pub type LPENUMLOGFONT = LPENUMLOGFONTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagENUMLOGFONTEXA { + pub elfLogFont: LOGFONTA, + pub elfFullName: [BYTE; 64usize], + pub elfStyle: [BYTE; 32usize], + pub elfScript: [BYTE; 32usize], +} +pub type ENUMLOGFONTEXA = tagENUMLOGFONTEXA; +pub type LPENUMLOGFONTEXA = *mut tagENUMLOGFONTEXA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagENUMLOGFONTEXW { + pub elfLogFont: LOGFONTW, + pub elfFullName: [WCHAR; 64usize], + pub elfStyle: [WCHAR; 32usize], + pub elfScript: [WCHAR; 32usize], +} +pub type ENUMLOGFONTEXW = tagENUMLOGFONTEXW; +pub type LPENUMLOGFONTEXW = *mut tagENUMLOGFONTEXW; +pub type ENUMLOGFONTEX = ENUMLOGFONTEXA; +pub type LPENUMLOGFONTEX = LPENUMLOGFONTEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPANOSE { + pub bFamilyType: BYTE, + pub bSerifStyle: BYTE, + pub bWeight: BYTE, + pub bProportion: BYTE, + pub bContrast: BYTE, + pub bStrokeVariation: BYTE, + pub bArmStyle: BYTE, + pub bLetterform: BYTE, + pub bMidline: BYTE, + pub bXHeight: BYTE, +} +pub type PANOSE = tagPANOSE; +pub type LPPANOSE = *mut tagPANOSE; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagEXTLOGFONTA { + pub elfLogFont: LOGFONTA, + pub elfFullName: [BYTE; 64usize], + pub elfStyle: [BYTE; 32usize], + pub elfVersion: DWORD, + pub elfStyleSize: DWORD, + pub elfMatch: DWORD, + pub elfReserved: DWORD, + pub elfVendorId: [BYTE; 4usize], + pub elfCulture: DWORD, + pub elfPanose: PANOSE, +} +pub type EXTLOGFONTA = tagEXTLOGFONTA; +pub type PEXTLOGFONTA = *mut tagEXTLOGFONTA; +pub type NPEXTLOGFONTA = *mut tagEXTLOGFONTA; +pub type LPEXTLOGFONTA = *mut tagEXTLOGFONTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagEXTLOGFONTW { + pub elfLogFont: LOGFONTW, + pub elfFullName: [WCHAR; 64usize], + pub elfStyle: [WCHAR; 32usize], + pub elfVersion: DWORD, + pub elfStyleSize: DWORD, + pub elfMatch: DWORD, + pub elfReserved: DWORD, + pub elfVendorId: [BYTE; 4usize], + pub elfCulture: DWORD, + pub elfPanose: PANOSE, +} +pub type EXTLOGFONTW = tagEXTLOGFONTW; +pub type PEXTLOGFONTW = *mut tagEXTLOGFONTW; +pub type NPEXTLOGFONTW = *mut tagEXTLOGFONTW; +pub type LPEXTLOGFONTW = *mut tagEXTLOGFONTW; +pub type EXTLOGFONT = EXTLOGFONTA; +pub type PEXTLOGFONT = PEXTLOGFONTA; +pub type NPEXTLOGFONT = NPEXTLOGFONTA; +pub type LPEXTLOGFONT = LPEXTLOGFONTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _devicemodeA { + pub dmDeviceName: [BYTE; 32usize], + pub dmSpecVersion: WORD, + pub dmDriverVersion: WORD, + pub dmSize: WORD, + pub dmDriverExtra: WORD, + pub dmFields: DWORD, + pub __bindgen_anon_1: _devicemodeA__bindgen_ty_1, + pub dmColor: ::std::os::raw::c_short, + pub dmDuplex: ::std::os::raw::c_short, + pub dmYResolution: ::std::os::raw::c_short, + pub dmTTOption: ::std::os::raw::c_short, + pub dmCollate: ::std::os::raw::c_short, + pub dmFormName: [BYTE; 32usize], + pub dmLogPixels: WORD, + pub dmBitsPerPel: DWORD, + pub dmPelsWidth: DWORD, + pub dmPelsHeight: DWORD, + pub __bindgen_anon_2: _devicemodeA__bindgen_ty_2, + pub dmDisplayFrequency: DWORD, + pub dmICMMethod: DWORD, + pub dmICMIntent: DWORD, + pub dmMediaType: DWORD, + pub dmDitherType: DWORD, + pub dmReserved1: DWORD, + pub dmReserved2: DWORD, + pub dmPanningWidth: DWORD, + pub dmPanningHeight: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _devicemodeA__bindgen_ty_1 { + pub __bindgen_anon_1: _devicemodeA__bindgen_ty_1__bindgen_ty_1, + pub __bindgen_anon_2: _devicemodeA__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: [u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _devicemodeA__bindgen_ty_1__bindgen_ty_1 { + pub dmOrientation: ::std::os::raw::c_short, + pub dmPaperSize: ::std::os::raw::c_short, + pub dmPaperLength: ::std::os::raw::c_short, + pub dmPaperWidth: ::std::os::raw::c_short, + pub dmScale: ::std::os::raw::c_short, + pub dmCopies: ::std::os::raw::c_short, + pub dmDefaultSource: ::std::os::raw::c_short, + pub dmPrintQuality: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _devicemodeA__bindgen_ty_1__bindgen_ty_2 { + pub dmPosition: POINTL, + pub dmDisplayOrientation: DWORD, + pub dmDisplayFixedOutput: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _devicemodeA__bindgen_ty_2 { + pub dmDisplayFlags: DWORD, + pub dmNup: DWORD, + _bindgen_union_align: u32, +} +pub type DEVMODEA = _devicemodeA; +pub type PDEVMODEA = *mut _devicemodeA; +pub type NPDEVMODEA = *mut _devicemodeA; +pub type LPDEVMODEA = *mut _devicemodeA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _devicemodeW { + pub dmDeviceName: [WCHAR; 32usize], + pub dmSpecVersion: WORD, + pub dmDriverVersion: WORD, + pub dmSize: WORD, + pub dmDriverExtra: WORD, + pub dmFields: DWORD, + pub __bindgen_anon_1: _devicemodeW__bindgen_ty_1, + pub dmColor: ::std::os::raw::c_short, + pub dmDuplex: ::std::os::raw::c_short, + pub dmYResolution: ::std::os::raw::c_short, + pub dmTTOption: ::std::os::raw::c_short, + pub dmCollate: ::std::os::raw::c_short, + pub dmFormName: [WCHAR; 32usize], + pub dmLogPixels: WORD, + pub dmBitsPerPel: DWORD, + pub dmPelsWidth: DWORD, + pub dmPelsHeight: DWORD, + pub __bindgen_anon_2: _devicemodeW__bindgen_ty_2, + pub dmDisplayFrequency: DWORD, + pub dmICMMethod: DWORD, + pub dmICMIntent: DWORD, + pub dmMediaType: DWORD, + pub dmDitherType: DWORD, + pub dmReserved1: DWORD, + pub dmReserved2: DWORD, + pub dmPanningWidth: DWORD, + pub dmPanningHeight: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _devicemodeW__bindgen_ty_1 { + pub __bindgen_anon_1: _devicemodeW__bindgen_ty_1__bindgen_ty_1, + pub __bindgen_anon_2: _devicemodeW__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: [u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _devicemodeW__bindgen_ty_1__bindgen_ty_1 { + pub dmOrientation: ::std::os::raw::c_short, + pub dmPaperSize: ::std::os::raw::c_short, + pub dmPaperLength: ::std::os::raw::c_short, + pub dmPaperWidth: ::std::os::raw::c_short, + pub dmScale: ::std::os::raw::c_short, + pub dmCopies: ::std::os::raw::c_short, + pub dmDefaultSource: ::std::os::raw::c_short, + pub dmPrintQuality: ::std::os::raw::c_short, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _devicemodeW__bindgen_ty_1__bindgen_ty_2 { + pub dmPosition: POINTL, + pub dmDisplayOrientation: DWORD, + pub dmDisplayFixedOutput: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _devicemodeW__bindgen_ty_2 { + pub dmDisplayFlags: DWORD, + pub dmNup: DWORD, + _bindgen_union_align: u32, +} +pub type DEVMODEW = _devicemodeW; +pub type PDEVMODEW = *mut _devicemodeW; +pub type NPDEVMODEW = *mut _devicemodeW; +pub type LPDEVMODEW = *mut _devicemodeW; +pub type DEVMODE = DEVMODEA; +pub type PDEVMODE = PDEVMODEA; +pub type NPDEVMODE = NPDEVMODEA; +pub type LPDEVMODE = LPDEVMODEA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _DISPLAY_DEVICEA { + pub cb: DWORD, + pub DeviceName: [CHAR; 32usize], + pub DeviceString: [CHAR; 128usize], + pub StateFlags: DWORD, + pub DeviceID: [CHAR; 128usize], + pub DeviceKey: [CHAR; 128usize], +} +pub type DISPLAY_DEVICEA = _DISPLAY_DEVICEA; +pub type PDISPLAY_DEVICEA = *mut _DISPLAY_DEVICEA; +pub type LPDISPLAY_DEVICEA = *mut _DISPLAY_DEVICEA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _DISPLAY_DEVICEW { + pub cb: DWORD, + pub DeviceName: [WCHAR; 32usize], + pub DeviceString: [WCHAR; 128usize], + pub StateFlags: DWORD, + pub DeviceID: [WCHAR; 128usize], + pub DeviceKey: [WCHAR; 128usize], +} +pub type DISPLAY_DEVICEW = _DISPLAY_DEVICEW; +pub type PDISPLAY_DEVICEW = *mut _DISPLAY_DEVICEW; +pub type LPDISPLAY_DEVICEW = *mut _DISPLAY_DEVICEW; +pub type DISPLAY_DEVICE = DISPLAY_DEVICEA; +pub type PDISPLAY_DEVICE = PDISPLAY_DEVICEA; +pub type LPDISPLAY_DEVICE = LPDISPLAY_DEVICEA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RGNDATAHEADER { + pub dwSize: DWORD, + pub iType: DWORD, + pub nCount: DWORD, + pub nRgnSize: DWORD, + pub rcBound: RECT, +} +pub type RGNDATAHEADER = _RGNDATAHEADER; +pub type PRGNDATAHEADER = *mut _RGNDATAHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RGNDATA { + pub rdh: RGNDATAHEADER, + pub Buffer: [::std::os::raw::c_char; 1usize], +} +pub type RGNDATA = _RGNDATA; +pub type PRGNDATA = *mut _RGNDATA; +pub type NPRGNDATA = *mut _RGNDATA; +pub type LPRGNDATA = *mut _RGNDATA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ABC { + pub abcA: ::std::os::raw::c_int, + pub abcB: UINT, + pub abcC: ::std::os::raw::c_int, +} +pub type ABC = _ABC; +pub type PABC = *mut _ABC; +pub type NPABC = *mut _ABC; +pub type LPABC = *mut _ABC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ABCFLOAT { + pub abcfA: FLOAT, + pub abcfB: FLOAT, + pub abcfC: FLOAT, +} +pub type ABCFLOAT = _ABCFLOAT; +pub type PABCFLOAT = *mut _ABCFLOAT; +pub type NPABCFLOAT = *mut _ABCFLOAT; +pub type LPABCFLOAT = *mut _ABCFLOAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OUTLINETEXTMETRICA { + pub otmSize: UINT, + pub otmTextMetrics: TEXTMETRICA, + pub otmFiller: BYTE, + pub otmPanoseNumber: PANOSE, + pub otmfsSelection: UINT, + pub otmfsType: UINT, + pub otmsCharSlopeRise: ::std::os::raw::c_int, + pub otmsCharSlopeRun: ::std::os::raw::c_int, + pub otmItalicAngle: ::std::os::raw::c_int, + pub otmEMSquare: UINT, + pub otmAscent: ::std::os::raw::c_int, + pub otmDescent: ::std::os::raw::c_int, + pub otmLineGap: UINT, + pub otmsCapEmHeight: UINT, + pub otmsXHeight: UINT, + pub otmrcFontBox: RECT, + pub otmMacAscent: ::std::os::raw::c_int, + pub otmMacDescent: ::std::os::raw::c_int, + pub otmMacLineGap: UINT, + pub otmusMinimumPPEM: UINT, + pub otmptSubscriptSize: POINT, + pub otmptSubscriptOffset: POINT, + pub otmptSuperscriptSize: POINT, + pub otmptSuperscriptOffset: POINT, + pub otmsStrikeoutSize: UINT, + pub otmsStrikeoutPosition: ::std::os::raw::c_int, + pub otmsUnderscoreSize: ::std::os::raw::c_int, + pub otmsUnderscorePosition: ::std::os::raw::c_int, + pub otmpFamilyName: PSTR, + pub otmpFaceName: PSTR, + pub otmpStyleName: PSTR, + pub otmpFullName: PSTR, +} +pub type OUTLINETEXTMETRICA = _OUTLINETEXTMETRICA; +pub type POUTLINETEXTMETRICA = *mut _OUTLINETEXTMETRICA; +pub type NPOUTLINETEXTMETRICA = *mut _OUTLINETEXTMETRICA; +pub type LPOUTLINETEXTMETRICA = *mut _OUTLINETEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _OUTLINETEXTMETRICW { + pub otmSize: UINT, + pub otmTextMetrics: TEXTMETRICW, + pub otmFiller: BYTE, + pub otmPanoseNumber: PANOSE, + pub otmfsSelection: UINT, + pub otmfsType: UINT, + pub otmsCharSlopeRise: ::std::os::raw::c_int, + pub otmsCharSlopeRun: ::std::os::raw::c_int, + pub otmItalicAngle: ::std::os::raw::c_int, + pub otmEMSquare: UINT, + pub otmAscent: ::std::os::raw::c_int, + pub otmDescent: ::std::os::raw::c_int, + pub otmLineGap: UINT, + pub otmsCapEmHeight: UINT, + pub otmsXHeight: UINT, + pub otmrcFontBox: RECT, + pub otmMacAscent: ::std::os::raw::c_int, + pub otmMacDescent: ::std::os::raw::c_int, + pub otmMacLineGap: UINT, + pub otmusMinimumPPEM: UINT, + pub otmptSubscriptSize: POINT, + pub otmptSubscriptOffset: POINT, + pub otmptSuperscriptSize: POINT, + pub otmptSuperscriptOffset: POINT, + pub otmsStrikeoutSize: UINT, + pub otmsStrikeoutPosition: ::std::os::raw::c_int, + pub otmsUnderscoreSize: ::std::os::raw::c_int, + pub otmsUnderscorePosition: ::std::os::raw::c_int, + pub otmpFamilyName: PSTR, + pub otmpFaceName: PSTR, + pub otmpStyleName: PSTR, + pub otmpFullName: PSTR, +} +pub type OUTLINETEXTMETRICW = _OUTLINETEXTMETRICW; +pub type POUTLINETEXTMETRICW = *mut _OUTLINETEXTMETRICW; +pub type NPOUTLINETEXTMETRICW = *mut _OUTLINETEXTMETRICW; +pub type LPOUTLINETEXTMETRICW = *mut _OUTLINETEXTMETRICW; +pub type OUTLINETEXTMETRIC = OUTLINETEXTMETRICA; +pub type POUTLINETEXTMETRIC = POUTLINETEXTMETRICA; +pub type NPOUTLINETEXTMETRIC = NPOUTLINETEXTMETRICA; +pub type LPOUTLINETEXTMETRIC = LPOUTLINETEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPOLYTEXTA { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub n: UINT, + pub lpstr: LPCSTR, + pub uiFlags: UINT, + pub rcl: RECT, + pub pdx: *mut ::std::os::raw::c_int, +} +pub type POLYTEXTA = tagPOLYTEXTA; +pub type PPOLYTEXTA = *mut tagPOLYTEXTA; +pub type NPPOLYTEXTA = *mut tagPOLYTEXTA; +pub type LPPOLYTEXTA = *mut tagPOLYTEXTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPOLYTEXTW { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub n: UINT, + pub lpstr: LPCWSTR, + pub uiFlags: UINT, + pub rcl: RECT, + pub pdx: *mut ::std::os::raw::c_int, +} +pub type POLYTEXTW = tagPOLYTEXTW; +pub type PPOLYTEXTW = *mut tagPOLYTEXTW; +pub type NPPOLYTEXTW = *mut tagPOLYTEXTW; +pub type LPPOLYTEXTW = *mut tagPOLYTEXTW; +pub type POLYTEXT = POLYTEXTA; +pub type PPOLYTEXT = PPOLYTEXTA; +pub type NPPOLYTEXT = NPPOLYTEXTA; +pub type LPPOLYTEXT = LPPOLYTEXTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FIXED { + pub fract: WORD, + pub value: ::std::os::raw::c_short, +} +pub type FIXED = _FIXED; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MAT2 { + pub eM11: FIXED, + pub eM12: FIXED, + pub eM21: FIXED, + pub eM22: FIXED, +} +pub type MAT2 = _MAT2; +pub type LPMAT2 = *mut _MAT2; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GLYPHMETRICS { + pub gmBlackBoxX: UINT, + pub gmBlackBoxY: UINT, + pub gmptGlyphOrigin: POINT, + pub gmCellIncX: ::std::os::raw::c_short, + pub gmCellIncY: ::std::os::raw::c_short, +} +pub type GLYPHMETRICS = _GLYPHMETRICS; +pub type LPGLYPHMETRICS = *mut _GLYPHMETRICS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPOINTFX { + pub x: FIXED, + pub y: FIXED, +} +pub type POINTFX = tagPOINTFX; +pub type LPPOINTFX = *mut tagPOINTFX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTTPOLYCURVE { + pub wType: WORD, + pub cpfx: WORD, + pub apfx: [POINTFX; 1usize], +} +pub type TTPOLYCURVE = tagTTPOLYCURVE; +pub type LPTTPOLYCURVE = *mut tagTTPOLYCURVE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTTPOLYGONHEADER { + pub cb: DWORD, + pub dwType: DWORD, + pub pfxStart: POINTFX, +} +pub type TTPOLYGONHEADER = tagTTPOLYGONHEADER; +pub type LPTTPOLYGONHEADER = *mut tagTTPOLYGONHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagGCP_RESULTSA { + pub lStructSize: DWORD, + pub lpOutString: LPSTR, + pub lpOrder: *mut UINT, + pub lpDx: *mut ::std::os::raw::c_int, + pub lpCaretPos: *mut ::std::os::raw::c_int, + pub lpClass: LPSTR, + pub lpGlyphs: LPWSTR, + pub nGlyphs: UINT, + pub nMaxFit: ::std::os::raw::c_int, +} +pub type GCP_RESULTSA = tagGCP_RESULTSA; +pub type LPGCP_RESULTSA = *mut tagGCP_RESULTSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagGCP_RESULTSW { + pub lStructSize: DWORD, + pub lpOutString: LPWSTR, + pub lpOrder: *mut UINT, + pub lpDx: *mut ::std::os::raw::c_int, + pub lpCaretPos: *mut ::std::os::raw::c_int, + pub lpClass: LPSTR, + pub lpGlyphs: LPWSTR, + pub nGlyphs: UINT, + pub nMaxFit: ::std::os::raw::c_int, +} +pub type GCP_RESULTSW = tagGCP_RESULTSW; +pub type LPGCP_RESULTSW = *mut tagGCP_RESULTSW; +pub type GCP_RESULTS = GCP_RESULTSA; +pub type LPGCP_RESULTS = LPGCP_RESULTSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RASTERIZER_STATUS { + pub nSize: ::std::os::raw::c_short, + pub wFlags: ::std::os::raw::c_short, + pub nLanguageID: ::std::os::raw::c_short, +} +pub type RASTERIZER_STATUS = _RASTERIZER_STATUS; +pub type LPRASTERIZER_STATUS = *mut _RASTERIZER_STATUS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPIXELFORMATDESCRIPTOR { + pub nSize: WORD, + pub nVersion: WORD, + pub dwFlags: DWORD, + pub iPixelType: BYTE, + pub cColorBits: BYTE, + pub cRedBits: BYTE, + pub cRedShift: BYTE, + pub cGreenBits: BYTE, + pub cGreenShift: BYTE, + pub cBlueBits: BYTE, + pub cBlueShift: BYTE, + pub cAlphaBits: BYTE, + pub cAlphaShift: BYTE, + pub cAccumBits: BYTE, + pub cAccumRedBits: BYTE, + pub cAccumGreenBits: BYTE, + pub cAccumBlueBits: BYTE, + pub cAccumAlphaBits: BYTE, + pub cDepthBits: BYTE, + pub cStencilBits: BYTE, + pub cAuxBuffers: BYTE, + pub iLayerType: BYTE, + pub bReserved: BYTE, + pub dwLayerMask: DWORD, + pub dwVisibleMask: DWORD, + pub dwDamageMask: DWORD, +} +pub type PIXELFORMATDESCRIPTOR = tagPIXELFORMATDESCRIPTOR; +pub type PPIXELFORMATDESCRIPTOR = *mut tagPIXELFORMATDESCRIPTOR; +pub type LPPIXELFORMATDESCRIPTOR = *mut tagPIXELFORMATDESCRIPTOR; +pub type OLDFONTENUMPROCA = ::std::option::Option< + unsafe extern "C" fn( + arg1: *const LOGFONTA, + arg2: *const TEXTMETRICA, + arg3: DWORD, + arg4: LPARAM, + ) -> ::std::os::raw::c_int, +>; +pub type OLDFONTENUMPROCW = ::std::option::Option< + unsafe extern "C" fn( + arg1: *const LOGFONTW, + arg2: *const TEXTMETRICW, + arg3: DWORD, + arg4: LPARAM, + ) -> ::std::os::raw::c_int, +>; +pub type FONTENUMPROCA = OLDFONTENUMPROCA; +pub type FONTENUMPROCW = OLDFONTENUMPROCW; +pub type FONTENUMPROC = FONTENUMPROCA; +pub type GOBJENUMPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: LPVOID, arg2: LPARAM) -> ::std::os::raw::c_int, +>; +pub type LINEDDAPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, arg3: LPARAM), +>; +extern "C" { + pub fn AddFontResourceA(arg1: LPCSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn AddFontResourceW(arg1: LPCWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn AnimatePalette( + hPal: HPALETTE, + iStartIndex: UINT, + cEntries: UINT, + ppe: *const PALETTEENTRY, + ) -> WINBOOL; +} +extern "C" { + pub fn Arc( + hdc: HDC, + x1: ::std::os::raw::c_int, + y1: ::std::os::raw::c_int, + x2: ::std::os::raw::c_int, + y2: ::std::os::raw::c_int, + x3: ::std::os::raw::c_int, + y3: ::std::os::raw::c_int, + x4: ::std::os::raw::c_int, + y4: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn BitBlt( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + hdcSrc: HDC, + x1: ::std::os::raw::c_int, + y1: ::std::os::raw::c_int, + rop: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CancelDC(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn Chord( + hdc: HDC, + x1: ::std::os::raw::c_int, + y1: ::std::os::raw::c_int, + x2: ::std::os::raw::c_int, + y2: ::std::os::raw::c_int, + x3: ::std::os::raw::c_int, + y3: ::std::os::raw::c_int, + x4: ::std::os::raw::c_int, + y4: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn ChoosePixelFormat(hdc: HDC, ppfd: *const PIXELFORMATDESCRIPTOR) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CloseMetaFile(hdc: HDC) -> HMETAFILE; +} +extern "C" { + pub fn CombineRgn( + hrgnDst: HRGN, + hrgnSrc1: HRGN, + hrgnSrc2: HRGN, + iMode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CopyMetaFileA(arg1: HMETAFILE, arg2: LPCSTR) -> HMETAFILE; +} +extern "C" { + pub fn CopyMetaFileW(arg1: HMETAFILE, arg2: LPCWSTR) -> HMETAFILE; +} +extern "C" { + pub fn CreateBitmap( + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + nPlanes: UINT, + nBitCount: UINT, + lpBits: *const ::std::os::raw::c_void, + ) -> HBITMAP; +} +extern "C" { + pub fn CreateBitmapIndirect(pbm: *const BITMAP) -> HBITMAP; +} +extern "C" { + pub fn CreateBrushIndirect(plbrush: *const LOGBRUSH) -> HBRUSH; +} +extern "C" { + pub fn CreateCompatibleBitmap( + hdc: HDC, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + ) -> HBITMAP; +} +extern "C" { + pub fn CreateDiscardableBitmap( + hdc: HDC, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + ) -> HBITMAP; +} +extern "C" { + pub fn CreateCompatibleDC(hdc: HDC) -> HDC; +} +extern "C" { + pub fn CreateDCA( + pwszDriver: LPCSTR, + pwszDevice: LPCSTR, + pszPort: LPCSTR, + pdm: *const DEVMODEA, + ) -> HDC; +} +extern "C" { + pub fn CreateDCW( + pwszDriver: LPCWSTR, + pwszDevice: LPCWSTR, + pszPort: LPCWSTR, + pdm: *const DEVMODEW, + ) -> HDC; +} +extern "C" { + pub fn CreateDIBitmap( + hdc: HDC, + pbmih: *const BITMAPINFOHEADER, + flInit: DWORD, + pjBits: *const ::std::os::raw::c_void, + pbmi: *const BITMAPINFO, + iUsage: UINT, + ) -> HBITMAP; +} +extern "C" { + pub fn CreateDIBPatternBrush(h: HGLOBAL, iUsage: UINT) -> HBRUSH; +} +extern "C" { + pub fn CreateDIBPatternBrushPt( + lpPackedDIB: *const ::std::os::raw::c_void, + iUsage: UINT, + ) -> HBRUSH; +} +extern "C" { + pub fn CreateEllipticRgn( + x1: ::std::os::raw::c_int, + y1: ::std::os::raw::c_int, + x2: ::std::os::raw::c_int, + y2: ::std::os::raw::c_int, + ) -> HRGN; +} +extern "C" { + pub fn CreateEllipticRgnIndirect(lprect: *const RECT) -> HRGN; +} +extern "C" { + pub fn CreateFontIndirectA(lplf: *const LOGFONTA) -> HFONT; +} +extern "C" { + pub fn CreateFontIndirectW(lplf: *const LOGFONTW) -> HFONT; +} +extern "C" { + pub fn CreateFontA( + cHeight: ::std::os::raw::c_int, + cWidth: ::std::os::raw::c_int, + cEscapement: ::std::os::raw::c_int, + cOrientation: ::std::os::raw::c_int, + cWeight: ::std::os::raw::c_int, + bItalic: DWORD, + bUnderline: DWORD, + bStrikeOut: DWORD, + iCharSet: DWORD, + iOutPrecision: DWORD, + iClipPrecision: DWORD, + iQuality: DWORD, + iPitchAndFamily: DWORD, + pszFaceName: LPCSTR, + ) -> HFONT; +} +extern "C" { + pub fn CreateFontW( + cHeight: ::std::os::raw::c_int, + cWidth: ::std::os::raw::c_int, + cEscapement: ::std::os::raw::c_int, + cOrientation: ::std::os::raw::c_int, + cWeight: ::std::os::raw::c_int, + bItalic: DWORD, + bUnderline: DWORD, + bStrikeOut: DWORD, + iCharSet: DWORD, + iOutPrecision: DWORD, + iClipPrecision: DWORD, + iQuality: DWORD, + iPitchAndFamily: DWORD, + pszFaceName: LPCWSTR, + ) -> HFONT; +} +extern "C" { + pub fn CreateHatchBrush(iHatch: ::std::os::raw::c_int, color: COLORREF) -> HBRUSH; +} +extern "C" { + pub fn CreateICA( + pszDriver: LPCSTR, + pszDevice: LPCSTR, + pszPort: LPCSTR, + pdm: *const DEVMODEA, + ) -> HDC; +} +extern "C" { + pub fn CreateICW( + pszDriver: LPCWSTR, + pszDevice: LPCWSTR, + pszPort: LPCWSTR, + pdm: *const DEVMODEW, + ) -> HDC; +} +extern "C" { + pub fn CreateMetaFileA(pszFile: LPCSTR) -> HDC; +} +extern "C" { + pub fn CreateMetaFileW(pszFile: LPCWSTR) -> HDC; +} +extern "C" { + pub fn CreatePalette(plpal: *const LOGPALETTE) -> HPALETTE; +} +extern "C" { + pub fn CreatePen( + iStyle: ::std::os::raw::c_int, + cWidth: ::std::os::raw::c_int, + color: COLORREF, + ) -> HPEN; +} +extern "C" { + pub fn CreatePenIndirect(plpen: *const LOGPEN) -> HPEN; +} +extern "C" { + pub fn CreatePolyPolygonRgn( + pptl: *const POINT, + pc: *const INT, + cPoly: ::std::os::raw::c_int, + iMode: ::std::os::raw::c_int, + ) -> HRGN; +} +extern "C" { + pub fn CreatePatternBrush(hbm: HBITMAP) -> HBRUSH; +} +extern "C" { + pub fn CreateRectRgn( + x1: ::std::os::raw::c_int, + y1: ::std::os::raw::c_int, + x2: ::std::os::raw::c_int, + y2: ::std::os::raw::c_int, + ) -> HRGN; +} +extern "C" { + pub fn CreateRectRgnIndirect(lprect: *const RECT) -> HRGN; +} +extern "C" { + pub fn CreateRoundRectRgn( + x1: ::std::os::raw::c_int, + y1: ::std::os::raw::c_int, + x2: ::std::os::raw::c_int, + y2: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> HRGN; +} +extern "C" { + pub fn CreateScalableFontResourceA( + fdwHidden: DWORD, + lpszFont: LPCSTR, + lpszFile: LPCSTR, + lpszPath: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateScalableFontResourceW( + fdwHidden: DWORD, + lpszFont: LPCWSTR, + lpszFile: LPCWSTR, + lpszPath: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateSolidBrush(color: COLORREF) -> HBRUSH; +} +extern "C" { + pub fn DeleteDC(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn DeleteMetaFile(hmf: HMETAFILE) -> WINBOOL; +} +extern "C" { + pub fn DeleteObject(ho: HGDIOBJ) -> WINBOOL; +} +extern "C" { + pub fn DescribePixelFormat( + hdc: HDC, + iPixelFormat: ::std::os::raw::c_int, + nBytes: UINT, + ppfd: LPPIXELFORMATDESCRIPTOR, + ) -> ::std::os::raw::c_int; +} +pub type LPFNDEVMODE = ::std::option::Option< + unsafe extern "C" fn( + arg1: HWND, + arg2: HMODULE, + arg3: LPDEVMODE, + arg4: LPSTR, + arg5: LPSTR, + arg6: LPDEVMODE, + arg7: LPSTR, + arg8: UINT, + ) -> UINT, +>; +pub type LPFNDEVCAPS = ::std::option::Option< + unsafe extern "C" fn( + arg1: LPSTR, + arg2: LPSTR, + arg3: UINT, + arg4: LPSTR, + arg5: LPDEVMODE, + ) -> DWORD, +>; +extern "C" { + pub fn DeviceCapabilitiesA( + pDevice: LPCSTR, + pPort: LPCSTR, + fwCapability: WORD, + pOutput: LPSTR, + pDevMode: *const DEVMODEA, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DeviceCapabilitiesW( + pDevice: LPCWSTR, + pPort: LPCWSTR, + fwCapability: WORD, + pOutput: LPWSTR, + pDevMode: *const DEVMODEW, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DrawEscape( + hdc: HDC, + iEscape: ::std::os::raw::c_int, + cjIn: ::std::os::raw::c_int, + lpIn: LPCSTR, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn Ellipse( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumFontFamiliesExA( + hdc: HDC, + lpLogfont: LPLOGFONTA, + lpProc: FONTENUMPROCA, + lParam: LPARAM, + dwFlags: DWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumFontFamiliesExW( + hdc: HDC, + lpLogfont: LPLOGFONTW, + lpProc: FONTENUMPROCW, + lParam: LPARAM, + dwFlags: DWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumFontFamiliesA( + hdc: HDC, + lpLogfont: LPCSTR, + lpProc: FONTENUMPROCA, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumFontFamiliesW( + hdc: HDC, + lpLogfont: LPCWSTR, + lpProc: FONTENUMPROCW, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumFontsA( + hdc: HDC, + lpLogfont: LPCSTR, + lpProc: FONTENUMPROCA, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumFontsW( + hdc: HDC, + lpLogfont: LPCWSTR, + lpProc: FONTENUMPROCW, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumObjects( + hdc: HDC, + nType: ::std::os::raw::c_int, + lpFunc: GOBJENUMPROC, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EqualRgn(hrgn1: HRGN, hrgn2: HRGN) -> WINBOOL; +} +extern "C" { + pub fn Escape( + hdc: HDC, + iEscape: ::std::os::raw::c_int, + cjIn: ::std::os::raw::c_int, + pvIn: LPCSTR, + pvOut: LPVOID, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ExtEscape( + hdc: HDC, + iEscape: ::std::os::raw::c_int, + cjInput: ::std::os::raw::c_int, + lpInData: LPCSTR, + cjOutput: ::std::os::raw::c_int, + lpOutData: LPSTR, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ExcludeClipRect( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ExtCreateRegion(lpx: *const XFORM, nCount: DWORD, lpData: *const RGNDATA) -> HRGN; +} +extern "C" { + pub fn ExtFloodFill( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + color: COLORREF, + type_: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn FillRgn(hdc: HDC, hrgn: HRGN, hbr: HBRUSH) -> WINBOOL; +} +extern "C" { + pub fn FloodFill( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + color: COLORREF, + ) -> WINBOOL; +} +extern "C" { + pub fn FrameRgn( + hdc: HDC, + hrgn: HRGN, + hbr: HBRUSH, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn GetROP2(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetAspectRatioFilterEx(hdc: HDC, lpsize: LPSIZE) -> WINBOOL; +} +extern "C" { + pub fn GetBkColor(hdc: HDC) -> COLORREF; +} +extern "C" { + pub fn GetDCBrushColor(hdc: HDC) -> COLORREF; +} +extern "C" { + pub fn GetDCPenColor(hdc: HDC) -> COLORREF; +} +extern "C" { + pub fn GetBkMode(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetBitmapBits(hbit: HBITMAP, cb: LONG, lpvBits: LPVOID) -> LONG; +} +extern "C" { + pub fn GetBitmapDimensionEx(hbit: HBITMAP, lpsize: LPSIZE) -> WINBOOL; +} +extern "C" { + pub fn GetBoundsRect(hdc: HDC, lprect: LPRECT, flags: UINT) -> UINT; +} +extern "C" { + pub fn GetBrushOrgEx(hdc: HDC, lppt: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidthA(hdc: HDC, iFirst: UINT, iLast: UINT, lpBuffer: LPINT) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidthW(hdc: HDC, iFirst: UINT, iLast: UINT, lpBuffer: LPINT) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidth32A(hdc: HDC, iFirst: UINT, iLast: UINT, lpBuffer: LPINT) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidth32W(hdc: HDC, iFirst: UINT, iLast: UINT, lpBuffer: LPINT) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidthFloatA(hdc: HDC, iFirst: UINT, iLast: UINT, lpBuffer: PFLOAT) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidthFloatW(hdc: HDC, iFirst: UINT, iLast: UINT, lpBuffer: PFLOAT) -> WINBOOL; +} +extern "C" { + pub fn GetCharABCWidthsA(hdc: HDC, wFirst: UINT, wLast: UINT, lpABC: LPABC) -> WINBOOL; +} +extern "C" { + pub fn GetCharABCWidthsW(hdc: HDC, wFirst: UINT, wLast: UINT, lpABC: LPABC) -> WINBOOL; +} +extern "C" { + pub fn GetCharABCWidthsFloatA( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpABC: LPABCFLOAT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCharABCWidthsFloatW( + hdc: HDC, + iFirst: UINT, + iLast: UINT, + lpABC: LPABCFLOAT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetClipBox(hdc: HDC, lprect: LPRECT) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetClipRgn(hdc: HDC, hrgn: HRGN) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetMetaRgn(hdc: HDC, hrgn: HRGN) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetCurrentObject(hdc: HDC, type_: UINT) -> HGDIOBJ; +} +extern "C" { + pub fn GetCurrentPositionEx(hdc: HDC, lppt: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn GetDeviceCaps(hdc: HDC, index: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetDIBits( + hdc: HDC, + hbm: HBITMAP, + start: UINT, + cLines: UINT, + lpvBits: LPVOID, + lpbmi: LPBITMAPINFO, + usage: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetFontData( + hdc: HDC, + dwTable: DWORD, + dwOffset: DWORD, + pvBuffer: PVOID, + cjBuffer: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetGlyphOutlineA( + hdc: HDC, + uChar: UINT, + fuFormat: UINT, + lpgm: LPGLYPHMETRICS, + cjBuffer: DWORD, + pvBuffer: LPVOID, + lpmat2: *const MAT2, + ) -> DWORD; +} +extern "C" { + pub fn GetGlyphOutlineW( + hdc: HDC, + uChar: UINT, + fuFormat: UINT, + lpgm: LPGLYPHMETRICS, + cjBuffer: DWORD, + pvBuffer: LPVOID, + lpmat2: *const MAT2, + ) -> DWORD; +} +extern "C" { + pub fn GetGraphicsMode(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetMapMode(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetMetaFileBitsEx(hMF: HMETAFILE, cbBuffer: UINT, lpData: LPVOID) -> UINT; +} +extern "C" { + pub fn GetMetaFileA(lpName: LPCSTR) -> HMETAFILE; +} +extern "C" { + pub fn GetMetaFileW(lpName: LPCWSTR) -> HMETAFILE; +} +extern "C" { + pub fn GetNearestColor(hdc: HDC, color: COLORREF) -> COLORREF; +} +extern "C" { + pub fn GetNearestPaletteIndex(h: HPALETTE, color: COLORREF) -> UINT; +} +extern "C" { + pub fn GetObjectType(h: HGDIOBJ) -> DWORD; +} +extern "C" { + pub fn GetOutlineTextMetricsA(hdc: HDC, cjCopy: UINT, potm: LPOUTLINETEXTMETRICA) -> UINT; +} +extern "C" { + pub fn GetOutlineTextMetricsW(hdc: HDC, cjCopy: UINT, potm: LPOUTLINETEXTMETRICW) -> UINT; +} +extern "C" { + pub fn GetPaletteEntries( + hpal: HPALETTE, + iStart: UINT, + cEntries: UINT, + pPalEntries: LPPALETTEENTRY, + ) -> UINT; +} +extern "C" { + pub fn GetPixel(hdc: HDC, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> COLORREF; +} +extern "C" { + pub fn GetPixelFormat(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetPolyFillMode(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetRasterizerCaps(lpraststat: LPRASTERIZER_STATUS, cjBytes: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetRandomRgn(hdc: HDC, hrgn: HRGN, i: INT) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetRegionData(hrgn: HRGN, nCount: DWORD, lpRgnData: LPRGNDATA) -> DWORD; +} +extern "C" { + pub fn GetRgnBox(hrgn: HRGN, lprc: LPRECT) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetStockObject(i: ::std::os::raw::c_int) -> HGDIOBJ; +} +extern "C" { + pub fn GetStretchBltMode(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetSystemPaletteEntries( + hdc: HDC, + iStart: UINT, + cEntries: UINT, + pPalEntries: LPPALETTEENTRY, + ) -> UINT; +} +extern "C" { + pub fn GetSystemPaletteUse(hdc: HDC) -> UINT; +} +extern "C" { + pub fn GetTextCharacterExtra(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetTextAlign(hdc: HDC) -> UINT; +} +extern "C" { + pub fn GetTextColor(hdc: HDC) -> COLORREF; +} +extern "C" { + pub fn GetTextExtentPointA( + hdc: HDC, + lpString: LPCSTR, + c: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextExtentPointW( + hdc: HDC, + lpString: LPCWSTR, + c: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextExtentPoint32A( + hdc: HDC, + lpString: LPCSTR, + c: ::std::os::raw::c_int, + psizl: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextExtentPoint32W( + hdc: HDC, + lpString: LPCWSTR, + c: ::std::os::raw::c_int, + psizl: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextExtentExPointA( + hdc: HDC, + lpszString: LPCSTR, + cchString: ::std::os::raw::c_int, + nMaxExtent: ::std::os::raw::c_int, + lpnFit: LPINT, + lpnDx: LPINT, + lpSize: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextExtentExPointW( + hdc: HDC, + lpszString: LPCWSTR, + cchString: ::std::os::raw::c_int, + nMaxExtent: ::std::os::raw::c_int, + lpnFit: LPINT, + lpnDx: LPINT, + lpSize: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextCharset(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetTextCharsetInfo( + hdc: HDC, + lpSig: LPFONTSIGNATURE, + dwFlags: DWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TranslateCharsetInfo(lpSrc: *mut DWORD, lpCs: LPCHARSETINFO, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetFontLanguageInfo(hdc: HDC) -> DWORD; +} +extern "C" { + pub fn GetCharacterPlacementA( + hdc: HDC, + lpString: LPCSTR, + nCount: ::std::os::raw::c_int, + nMexExtent: ::std::os::raw::c_int, + lpResults: LPGCP_RESULTSA, + dwFlags: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetCharacterPlacementW( + hdc: HDC, + lpString: LPCWSTR, + nCount: ::std::os::raw::c_int, + nMexExtent: ::std::os::raw::c_int, + lpResults: LPGCP_RESULTSW, + dwFlags: DWORD, + ) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWCRANGE { + pub wcLow: WCHAR, + pub cGlyphs: USHORT, +} +pub type WCRANGE = tagWCRANGE; +pub type PWCRANGE = *mut tagWCRANGE; +pub type LPWCRANGE = *mut tagWCRANGE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagGLYPHSET { + pub cbThis: DWORD, + pub flAccel: DWORD, + pub cGlyphsSupported: DWORD, + pub cRanges: DWORD, + pub ranges: [WCRANGE; 1usize], +} +pub type GLYPHSET = tagGLYPHSET; +pub type PGLYPHSET = *mut tagGLYPHSET; +pub type LPGLYPHSET = *mut tagGLYPHSET; +extern "C" { + pub fn GetFontUnicodeRanges(hdc: HDC, lpgs: LPGLYPHSET) -> DWORD; +} +extern "C" { + pub fn GetGlyphIndicesA( + hdc: HDC, + lpstr: LPCSTR, + c: ::std::os::raw::c_int, + pgi: LPWORD, + fl: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetGlyphIndicesW( + hdc: HDC, + lpstr: LPCWSTR, + c: ::std::os::raw::c_int, + pgi: LPWORD, + fl: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn GetTextExtentPointI( + hdc: HDC, + pgiIn: LPWORD, + cgi: ::std::os::raw::c_int, + psize: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextExtentExPointI( + hdc: HDC, + lpwszString: LPWORD, + cwchString: ::std::os::raw::c_int, + nMaxExtent: ::std::os::raw::c_int, + lpnFit: LPINT, + lpnDx: LPINT, + lpSize: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCharWidthI( + hdc: HDC, + giFirst: UINT, + cgi: UINT, + pgi: LPWORD, + piWidths: LPINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCharABCWidthsI( + hdc: HDC, + giFirst: UINT, + cgi: UINT, + pgi: LPWORD, + pabc: LPABC, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDESIGNVECTOR { + pub dvReserved: DWORD, + pub dvNumAxes: DWORD, + pub dvValues: [LONG; 16usize], +} +pub type DESIGNVECTOR = tagDESIGNVECTOR; +pub type PDESIGNVECTOR = *mut tagDESIGNVECTOR; +pub type LPDESIGNVECTOR = *mut tagDESIGNVECTOR; +extern "C" { + pub fn AddFontResourceExA(name: LPCSTR, fl: DWORD, res: PVOID) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn AddFontResourceExW(name: LPCWSTR, fl: DWORD, res: PVOID) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn RemoveFontResourceExA(name: LPCSTR, fl: DWORD, pdv: PVOID) -> WINBOOL; +} +extern "C" { + pub fn RemoveFontResourceExW(name: LPCWSTR, fl: DWORD, pdv: PVOID) -> WINBOOL; +} +extern "C" { + pub fn AddFontMemResourceEx( + pFileView: PVOID, + cjSize: DWORD, + pvResrved: PVOID, + pNumFonts: *mut DWORD, + ) -> HANDLE; +} +extern "C" { + pub fn RemoveFontMemResourceEx(h: HANDLE) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagAXISINFOA { + pub axMinValue: LONG, + pub axMaxValue: LONG, + pub axAxisName: [BYTE; 16usize], +} +pub type AXISINFOA = tagAXISINFOA; +pub type PAXISINFOA = *mut tagAXISINFOA; +pub type LPAXISINFOA = *mut tagAXISINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagAXISINFOW { + pub axMinValue: LONG, + pub axMaxValue: LONG, + pub axAxisName: [WCHAR; 16usize], +} +pub type AXISINFOW = tagAXISINFOW; +pub type PAXISINFOW = *mut tagAXISINFOW; +pub type LPAXISINFOW = *mut tagAXISINFOW; +pub type AXISINFO = AXISINFOA; +pub type PAXISINFO = PAXISINFOA; +pub type LPAXISINFO = LPAXISINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagAXESLISTA { + pub axlReserved: DWORD, + pub axlNumAxes: DWORD, + pub axlAxisInfo: [AXISINFOA; 16usize], +} +pub type AXESLISTA = tagAXESLISTA; +pub type PAXESLISTA = *mut tagAXESLISTA; +pub type LPAXESLISTA = *mut tagAXESLISTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagAXESLISTW { + pub axlReserved: DWORD, + pub axlNumAxes: DWORD, + pub axlAxisInfo: [AXISINFOW; 16usize], +} +pub type AXESLISTW = tagAXESLISTW; +pub type PAXESLISTW = *mut tagAXESLISTW; +pub type LPAXESLISTW = *mut tagAXESLISTW; +pub type AXESLIST = AXESLISTA; +pub type PAXESLIST = PAXESLISTA; +pub type LPAXESLIST = LPAXESLISTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagENUMLOGFONTEXDVA { + pub elfEnumLogfontEx: ENUMLOGFONTEXA, + pub elfDesignVector: DESIGNVECTOR, +} +pub type ENUMLOGFONTEXDVA = tagENUMLOGFONTEXDVA; +pub type PENUMLOGFONTEXDVA = *mut tagENUMLOGFONTEXDVA; +pub type LPENUMLOGFONTEXDVA = *mut tagENUMLOGFONTEXDVA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagENUMLOGFONTEXDVW { + pub elfEnumLogfontEx: ENUMLOGFONTEXW, + pub elfDesignVector: DESIGNVECTOR, +} +pub type ENUMLOGFONTEXDVW = tagENUMLOGFONTEXDVW; +pub type PENUMLOGFONTEXDVW = *mut tagENUMLOGFONTEXDVW; +pub type LPENUMLOGFONTEXDVW = *mut tagENUMLOGFONTEXDVW; +pub type ENUMLOGFONTEXDV = ENUMLOGFONTEXDVA; +pub type PENUMLOGFONTEXDV = PENUMLOGFONTEXDVA; +pub type LPENUMLOGFONTEXDV = LPENUMLOGFONTEXDVA; +extern "C" { + pub fn CreateFontIndirectExA(arg1: *const ENUMLOGFONTEXDVA) -> HFONT; +} +extern "C" { + pub fn CreateFontIndirectExW(arg1: *const ENUMLOGFONTEXDVW) -> HFONT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagENUMTEXTMETRICA { + pub etmNewTextMetricEx: NEWTEXTMETRICEXA, + pub etmAxesList: AXESLISTA, +} +pub type ENUMTEXTMETRICA = tagENUMTEXTMETRICA; +pub type PENUMTEXTMETRICA = *mut tagENUMTEXTMETRICA; +pub type LPENUMTEXTMETRICA = *mut tagENUMTEXTMETRICA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagENUMTEXTMETRICW { + pub etmNewTextMetricEx: NEWTEXTMETRICEXW, + pub etmAxesList: AXESLISTW, +} +pub type ENUMTEXTMETRICW = tagENUMTEXTMETRICW; +pub type PENUMTEXTMETRICW = *mut tagENUMTEXTMETRICW; +pub type LPENUMTEXTMETRICW = *mut tagENUMTEXTMETRICW; +pub type ENUMTEXTMETRIC = ENUMTEXTMETRICA; +pub type PENUMTEXTMETRIC = PENUMTEXTMETRICA; +pub type LPENUMTEXTMETRIC = LPENUMTEXTMETRICA; +extern "C" { + pub fn GetViewportExtEx(hdc: HDC, lpsize: LPSIZE) -> WINBOOL; +} +extern "C" { + pub fn GetViewportOrgEx(hdc: HDC, lppoint: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn GetWindowExtEx(hdc: HDC, lpsize: LPSIZE) -> WINBOOL; +} +extern "C" { + pub fn GetWindowOrgEx(hdc: HDC, lppoint: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn IntersectClipRect( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn InvertRgn(hdc: HDC, hrgn: HRGN) -> WINBOOL; +} +extern "C" { + pub fn LineDDA( + xStart: ::std::os::raw::c_int, + yStart: ::std::os::raw::c_int, + xEnd: ::std::os::raw::c_int, + yEnd: ::std::os::raw::c_int, + lpProc: LINEDDAPROC, + data: LPARAM, + ) -> WINBOOL; +} +extern "C" { + pub fn LineTo(hdc: HDC, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn MaskBlt( + hdcDest: HDC, + xDest: ::std::os::raw::c_int, + yDest: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + hdcSrc: HDC, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + hbmMask: HBITMAP, + xMask: ::std::os::raw::c_int, + yMask: ::std::os::raw::c_int, + rop: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn PlgBlt( + hdcDest: HDC, + lpPoint: *const POINT, + hdcSrc: HDC, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + hbmMask: HBITMAP, + xMask: ::std::os::raw::c_int, + yMask: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn OffsetClipRgn( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn OffsetRgn( + hrgn: HRGN, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn PatBlt( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + rop: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn Pie( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + xr1: ::std::os::raw::c_int, + yr1: ::std::os::raw::c_int, + xr2: ::std::os::raw::c_int, + yr2: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn PlayMetaFile(hdc: HDC, hmf: HMETAFILE) -> WINBOOL; +} +extern "C" { + pub fn PaintRgn(hdc: HDC, hrgn: HRGN) -> WINBOOL; +} +extern "C" { + pub fn PolyPolygon( + hdc: HDC, + apt: *const POINT, + asz: *const INT, + csz: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn PtInRegion(hrgn: HRGN, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn PtVisible(hdc: HDC, x: ::std::os::raw::c_int, y: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn RectInRegion(hrgn: HRGN, lprect: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn RectVisible(hdc: HDC, lprect: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn Rectangle( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn RestoreDC(hdc: HDC, nSavedDC: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn ResetDCA(hdc: HDC, lpdm: *const DEVMODEA) -> HDC; +} +extern "C" { + pub fn ResetDCW(hdc: HDC, lpdm: *const DEVMODEW) -> HDC; +} +extern "C" { + pub fn RealizePalette(hdc: HDC) -> UINT; +} +extern "C" { + pub fn RemoveFontResourceA(lpFileName: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn RemoveFontResourceW(lpFileName: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn RoundRect( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + width: ::std::os::raw::c_int, + height: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn ResizePalette(hpal: HPALETTE, n: UINT) -> WINBOOL; +} +extern "C" { + pub fn SaveDC(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SelectClipRgn(hdc: HDC, hrgn: HRGN) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ExtSelectClipRgn( + hdc: HDC, + hrgn: HRGN, + mode: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetMetaRgn(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SelectObject(hdc: HDC, h: HGDIOBJ) -> HGDIOBJ; +} +extern "C" { + pub fn SelectPalette(hdc: HDC, hPal: HPALETTE, bForceBkgd: WINBOOL) -> HPALETTE; +} +extern "C" { + pub fn SetBkColor(hdc: HDC, color: COLORREF) -> COLORREF; +} +extern "C" { + pub fn SetDCBrushColor(hdc: HDC, color: COLORREF) -> COLORREF; +} +extern "C" { + pub fn SetDCPenColor(hdc: HDC, color: COLORREF) -> COLORREF; +} +extern "C" { + pub fn SetBkMode(hdc: HDC, mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetBitmapBits(hbm: HBITMAP, cb: DWORD, pvBits: *const ::std::os::raw::c_void) -> LONG; +} +extern "C" { + pub fn SetBoundsRect(hdc: HDC, lprect: *const RECT, flags: UINT) -> UINT; +} +extern "C" { + pub fn SetDIBits( + hdc: HDC, + hbm: HBITMAP, + start: UINT, + cLines: UINT, + lpBits: *const ::std::os::raw::c_void, + lpbmi: *const BITMAPINFO, + ColorUse: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetDIBitsToDevice( + hdc: HDC, + xDest: ::std::os::raw::c_int, + yDest: ::std::os::raw::c_int, + w: DWORD, + h: DWORD, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + StartScan: UINT, + cLines: UINT, + lpvBits: *const ::std::os::raw::c_void, + lpbmi: *const BITMAPINFO, + ColorUse: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetMapperFlags(hdc: HDC, flags: DWORD) -> DWORD; +} +extern "C" { + pub fn SetGraphicsMode(hdc: HDC, iMode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetMapMode(hdc: HDC, iMode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetLayout(hdc: HDC, l: DWORD) -> DWORD; +} +extern "C" { + pub fn GetLayout(hdc: HDC) -> DWORD; +} +extern "C" { + pub fn SetMetaFileBitsEx(cbBuffer: UINT, lpData: *const BYTE) -> HMETAFILE; +} +extern "C" { + pub fn SetPaletteEntries( + hpal: HPALETTE, + iStart: UINT, + cEntries: UINT, + pPalEntries: *const PALETTEENTRY, + ) -> UINT; +} +extern "C" { + pub fn SetPixel( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + color: COLORREF, + ) -> COLORREF; +} +extern "C" { + pub fn SetPixelV( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + color: COLORREF, + ) -> WINBOOL; +} +extern "C" { + pub fn SetPixelFormat( + hdc: HDC, + format: ::std::os::raw::c_int, + ppfd: *const PIXELFORMATDESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetPolyFillMode(hdc: HDC, mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn StretchBlt( + hdcDest: HDC, + xDest: ::std::os::raw::c_int, + yDest: ::std::os::raw::c_int, + wDest: ::std::os::raw::c_int, + hDest: ::std::os::raw::c_int, + hdcSrc: HDC, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + rop: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetRectRgn( + hrgn: HRGN, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn StretchDIBits( + hdc: HDC, + xDest: ::std::os::raw::c_int, + yDest: ::std::os::raw::c_int, + DestWidth: ::std::os::raw::c_int, + DestHeight: ::std::os::raw::c_int, + xSrc: ::std::os::raw::c_int, + ySrc: ::std::os::raw::c_int, + SrcWidth: ::std::os::raw::c_int, + SrcHeight: ::std::os::raw::c_int, + lpBits: *const ::std::os::raw::c_void, + lpbmi: *const BITMAPINFO, + iUsage: UINT, + rop: DWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetROP2(hdc: HDC, rop2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetStretchBltMode(hdc: HDC, mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetSystemPaletteUse(hdc: HDC, use_: UINT) -> UINT; +} +extern "C" { + pub fn SetTextCharacterExtra(hdc: HDC, extra: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetTextColor(hdc: HDC, color: COLORREF) -> COLORREF; +} +extern "C" { + pub fn SetTextAlign(hdc: HDC, align: UINT) -> UINT; +} +extern "C" { + pub fn SetTextJustification( + hdc: HDC, + extra: ::std::os::raw::c_int, + count: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn UpdateColors(hdc: HDC) -> WINBOOL; +} +pub type COLOR16 = USHORT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _TRIVERTEX { + pub x: LONG, + pub y: LONG, + pub Red: COLOR16, + pub Green: COLOR16, + pub Blue: COLOR16, + pub Alpha: COLOR16, +} +pub type TRIVERTEX = _TRIVERTEX; +pub type PTRIVERTEX = *mut _TRIVERTEX; +pub type LPTRIVERTEX = *mut _TRIVERTEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GRADIENT_TRIANGLE { + pub Vertex1: ULONG, + pub Vertex2: ULONG, + pub Vertex3: ULONG, +} +pub type GRADIENT_TRIANGLE = _GRADIENT_TRIANGLE; +pub type PGRADIENT_TRIANGLE = *mut _GRADIENT_TRIANGLE; +pub type LPGRADIENT_TRIANGLE = *mut _GRADIENT_TRIANGLE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GRADIENT_RECT { + pub UpperLeft: ULONG, + pub LowerRight: ULONG, +} +pub type GRADIENT_RECT = _GRADIENT_RECT; +pub type PGRADIENT_RECT = *mut _GRADIENT_RECT; +pub type LPGRADIENT_RECT = *mut _GRADIENT_RECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _BLENDFUNCTION { + pub BlendOp: BYTE, + pub BlendFlags: BYTE, + pub SourceConstantAlpha: BYTE, + pub AlphaFormat: BYTE, +} +pub type BLENDFUNCTION = _BLENDFUNCTION; +pub type PBLENDFUNCTION = *mut _BLENDFUNCTION; +extern "C" { + pub fn AlphaBlend( + hdcDest: HDC, + xoriginDest: ::std::os::raw::c_int, + yoriginDest: ::std::os::raw::c_int, + wDest: ::std::os::raw::c_int, + hDest: ::std::os::raw::c_int, + hdcSrc: HDC, + xoriginSrc: ::std::os::raw::c_int, + yoriginSrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + ftn: BLENDFUNCTION, + ) -> WINBOOL; +} +extern "C" { + pub fn GdiAlphaBlend( + hdcDest: HDC, + xoriginDest: ::std::os::raw::c_int, + yoriginDest: ::std::os::raw::c_int, + wDest: ::std::os::raw::c_int, + hDest: ::std::os::raw::c_int, + hdcSrc: HDC, + xoriginSrc: ::std::os::raw::c_int, + yoriginSrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + ftn: BLENDFUNCTION, + ) -> WINBOOL; +} +extern "C" { + pub fn TransparentBlt( + hdcDest: HDC, + xoriginDest: ::std::os::raw::c_int, + yoriginDest: ::std::os::raw::c_int, + wDest: ::std::os::raw::c_int, + hDest: ::std::os::raw::c_int, + hdcSrc: HDC, + xoriginSrc: ::std::os::raw::c_int, + yoriginSrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + crTransparent: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GdiTransparentBlt( + hdcDest: HDC, + xoriginDest: ::std::os::raw::c_int, + yoriginDest: ::std::os::raw::c_int, + wDest: ::std::os::raw::c_int, + hDest: ::std::os::raw::c_int, + hdcSrc: HDC, + xoriginSrc: ::std::os::raw::c_int, + yoriginSrc: ::std::os::raw::c_int, + wSrc: ::std::os::raw::c_int, + hSrc: ::std::os::raw::c_int, + crTransparent: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GradientFill( + hdc: HDC, + pVertex: PTRIVERTEX, + nVertex: ULONG, + pMesh: PVOID, + nMesh: ULONG, + ulMode: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn GdiGradientFill( + hdc: HDC, + pVertex: PTRIVERTEX, + nVertex: ULONG, + pMesh: PVOID, + nMesh: ULONG, + ulMode: ULONG, + ) -> WINBOOL; +} +extern "C" { + pub fn PlayMetaFileRecord( + hdc: HDC, + lpHandleTable: LPHANDLETABLE, + lpMR: LPMETARECORD, + noObjs: UINT, + ) -> WINBOOL; +} +pub type MFENUMPROC = ::std::option::Option< + unsafe extern "C" fn( + hdc: HDC, + lpht: *mut HANDLETABLE, + lpMR: *mut METARECORD, + nObj: ::std::os::raw::c_int, + lParam: LPARAM, + ) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn EnumMetaFile(hdc: HDC, hmf: HMETAFILE, lpProc: MFENUMPROC, lParam: LPARAM) -> WINBOOL; +} +pub type ENHMFENUMPROC = ::std::option::Option< + unsafe extern "C" fn( + hdc: HDC, + lpht: *mut HANDLETABLE, + lpmr: *const ENHMETARECORD, + hHandles: ::std::os::raw::c_int, + data: LPARAM, + ) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn CloseEnhMetaFile(hdc: HDC) -> HENHMETAFILE; +} +extern "C" { + pub fn CopyEnhMetaFileA(hEnh: HENHMETAFILE, lpFileName: LPCSTR) -> HENHMETAFILE; +} +extern "C" { + pub fn CopyEnhMetaFileW(hEnh: HENHMETAFILE, lpFileName: LPCWSTR) -> HENHMETAFILE; +} +extern "C" { + pub fn CreateEnhMetaFileA( + hdc: HDC, + lpFilename: LPCSTR, + lprc: *const RECT, + lpDesc: LPCSTR, + ) -> HDC; +} +extern "C" { + pub fn CreateEnhMetaFileW( + hdc: HDC, + lpFilename: LPCWSTR, + lprc: *const RECT, + lpDesc: LPCWSTR, + ) -> HDC; +} +extern "C" { + pub fn DeleteEnhMetaFile(hmf: HENHMETAFILE) -> WINBOOL; +} +extern "C" { + pub fn EnumEnhMetaFile( + hdc: HDC, + hmf: HENHMETAFILE, + lpProc: ENHMFENUMPROC, + lpParam: LPVOID, + lpRect: *const RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetEnhMetaFileA(lpName: LPCSTR) -> HENHMETAFILE; +} +extern "C" { + pub fn GetEnhMetaFileW(lpName: LPCWSTR) -> HENHMETAFILE; +} +extern "C" { + pub fn GetEnhMetaFileBits(hEMF: HENHMETAFILE, nSize: UINT, lpData: LPBYTE) -> UINT; +} +extern "C" { + pub fn GetEnhMetaFileDescriptionA( + hemf: HENHMETAFILE, + cchBuffer: UINT, + lpDescription: LPSTR, + ) -> UINT; +} +extern "C" { + pub fn GetEnhMetaFileDescriptionW( + hemf: HENHMETAFILE, + cchBuffer: UINT, + lpDescription: LPWSTR, + ) -> UINT; +} +extern "C" { + pub fn GetEnhMetaFileHeader( + hemf: HENHMETAFILE, + nSize: UINT, + lpEnhMetaHeader: LPENHMETAHEADER, + ) -> UINT; +} +extern "C" { + pub fn GetEnhMetaFilePaletteEntries( + hemf: HENHMETAFILE, + nNumEntries: UINT, + lpPaletteEntries: LPPALETTEENTRY, + ) -> UINT; +} +extern "C" { + pub fn GetEnhMetaFilePixelFormat( + hemf: HENHMETAFILE, + cbBuffer: UINT, + ppfd: *mut PIXELFORMATDESCRIPTOR, + ) -> UINT; +} +extern "C" { + pub fn GetWinMetaFileBits( + hemf: HENHMETAFILE, + cbData16: UINT, + pData16: LPBYTE, + iMapMode: INT, + hdcRef: HDC, + ) -> UINT; +} +extern "C" { + pub fn PlayEnhMetaFile(hdc: HDC, hmf: HENHMETAFILE, lprect: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn PlayEnhMetaFileRecord( + hdc: HDC, + pht: LPHANDLETABLE, + pmr: *const ENHMETARECORD, + cht: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn SetEnhMetaFileBits(nSize: UINT, pb: *const BYTE) -> HENHMETAFILE; +} +extern "C" { + pub fn SetWinMetaFileBits( + nSize: UINT, + lpMeta16Data: *const BYTE, + hdcRef: HDC, + lpMFP: *const METAFILEPICT, + ) -> HENHMETAFILE; +} +extern "C" { + pub fn GdiComment(hdc: HDC, nSize: UINT, lpData: *const BYTE) -> WINBOOL; +} +extern "C" { + pub fn GetTextMetricsA(hdc: HDC, lptm: LPTEXTMETRICA) -> WINBOOL; +} +extern "C" { + pub fn GetTextMetricsW(hdc: HDC, lptm: LPTEXTMETRICW) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDIBSECTION { + pub dsBm: BITMAP, + pub dsBmih: BITMAPINFOHEADER, + pub dsBitfields: [DWORD; 3usize], + pub dshSection: HANDLE, + pub dsOffset: DWORD, +} +pub type DIBSECTION = tagDIBSECTION; +pub type LPDIBSECTION = *mut tagDIBSECTION; +pub type PDIBSECTION = *mut tagDIBSECTION; +extern "C" { + pub fn AngleArc( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + r: DWORD, + StartAngle: FLOAT, + SweepAngle: FLOAT, + ) -> WINBOOL; +} +extern "C" { + pub fn PolyPolyline(hdc: HDC, apt: *const POINT, asz: *const DWORD, csz: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetWorldTransform(hdc: HDC, lpxf: LPXFORM) -> WINBOOL; +} +extern "C" { + pub fn SetWorldTransform(hdc: HDC, lpxf: *const XFORM) -> WINBOOL; +} +extern "C" { + pub fn ModifyWorldTransform(hdc: HDC, lpxf: *const XFORM, mode: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CombineTransform(lpxfOut: LPXFORM, lpxf1: *const XFORM, lpxf2: *const XFORM) -> WINBOOL; +} +extern "C" { + pub fn CreateDIBSection( + hdc: HDC, + lpbmi: *const BITMAPINFO, + usage: UINT, + ppvBits: *mut *mut ::std::os::raw::c_void, + hSection: HANDLE, + offset: DWORD, + ) -> HBITMAP; +} +extern "C" { + pub fn GetDIBColorTable(hdc: HDC, iStart: UINT, cEntries: UINT, prgbq: *mut RGBQUAD) -> UINT; +} +extern "C" { + pub fn SetDIBColorTable(hdc: HDC, iStart: UINT, cEntries: UINT, prgbq: *const RGBQUAD) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOLORADJUSTMENT { + pub caSize: WORD, + pub caFlags: WORD, + pub caIlluminantIndex: WORD, + pub caRedGamma: WORD, + pub caGreenGamma: WORD, + pub caBlueGamma: WORD, + pub caReferenceBlack: WORD, + pub caReferenceWhite: WORD, + pub caContrast: SHORT, + pub caBrightness: SHORT, + pub caColorfulness: SHORT, + pub caRedGreenTint: SHORT, +} +pub type COLORADJUSTMENT = tagCOLORADJUSTMENT; +pub type PCOLORADJUSTMENT = *mut tagCOLORADJUSTMENT; +pub type LPCOLORADJUSTMENT = *mut tagCOLORADJUSTMENT; +extern "C" { + pub fn SetColorAdjustment(hdc: HDC, lpca: *const COLORADJUSTMENT) -> WINBOOL; +} +extern "C" { + pub fn GetColorAdjustment(hdc: HDC, lpca: LPCOLORADJUSTMENT) -> WINBOOL; +} +extern "C" { + pub fn CreateHalftonePalette(hdc: HDC) -> HPALETTE; +} +pub type ABORTPROC = + ::std::option::Option WINBOOL>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DOCINFOA { + pub cbSize: ::std::os::raw::c_int, + pub lpszDocName: LPCSTR, + pub lpszOutput: LPCSTR, + pub lpszDatatype: LPCSTR, + pub fwType: DWORD, +} +pub type DOCINFOA = _DOCINFOA; +pub type LPDOCINFOA = *mut _DOCINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DOCINFOW { + pub cbSize: ::std::os::raw::c_int, + pub lpszDocName: LPCWSTR, + pub lpszOutput: LPCWSTR, + pub lpszDatatype: LPCWSTR, + pub fwType: DWORD, +} +pub type DOCINFOW = _DOCINFOW; +pub type LPDOCINFOW = *mut _DOCINFOW; +pub type DOCINFO = DOCINFOA; +pub type LPDOCINFO = LPDOCINFOA; +extern "C" { + pub fn StartDocA(hdc: HDC, lpdi: *const DOCINFOA) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn StartDocW(hdc: HDC, lpdi: *const DOCINFOW) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EndDoc(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn StartPage(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EndPage(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn AbortDoc(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetAbortProc(hdc: HDC, lpProc: ABORTPROC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn AbortPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn ArcTo( + hdc: HDC, + left: ::std::os::raw::c_int, + top: ::std::os::raw::c_int, + right: ::std::os::raw::c_int, + bottom: ::std::os::raw::c_int, + xr1: ::std::os::raw::c_int, + yr1: ::std::os::raw::c_int, + xr2: ::std::os::raw::c_int, + yr2: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn BeginPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn CloseFigure(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn EndPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn FillPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn FlattenPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn GetPath( + hdc: HDC, + apt: LPPOINT, + aj: LPBYTE, + cpt: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn PathToRegion(hdc: HDC) -> HRGN; +} +extern "C" { + pub fn PolyDraw( + hdc: HDC, + apt: *const POINT, + aj: *const BYTE, + cpt: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn SelectClipPath(hdc: HDC, mode: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn SetArcDirection(hdc: HDC, dir: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetMiterLimit(hdc: HDC, limit: FLOAT, old: PFLOAT) -> WINBOOL; +} +extern "C" { + pub fn StrokeAndFillPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn StrokePath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn WidenPath(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn ExtCreatePen( + iPenStyle: DWORD, + cWidth: DWORD, + plbrush: *const LOGBRUSH, + cStyle: DWORD, + pstyle: *const DWORD, + ) -> HPEN; +} +extern "C" { + pub fn GetMiterLimit(hdc: HDC, plimit: PFLOAT) -> WINBOOL; +} +extern "C" { + pub fn GetArcDirection(hdc: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetObjectA(h: HANDLE, c: ::std::os::raw::c_int, pv: LPVOID) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetObjectW(h: HANDLE, c: ::std::os::raw::c_int, pv: LPVOID) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn MoveToEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lppt: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn TextOutA( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lpString: LPCSTR, + c: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn TextOutW( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lpString: LPCWSTR, + c: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn ExtTextOutA( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + options: UINT, + lprect: *const RECT, + lpString: LPCSTR, + c: UINT, + lpDx: *const INT, + ) -> WINBOOL; +} +extern "C" { + pub fn ExtTextOutW( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + options: UINT, + lprect: *const RECT, + lpString: LPCWSTR, + c: UINT, + lpDx: *const INT, + ) -> WINBOOL; +} +extern "C" { + pub fn PolyTextOutA( + hdc: HDC, + ppt: *const POLYTEXTA, + nstrings: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn PolyTextOutW( + hdc: HDC, + ppt: *const POLYTEXTW, + nstrings: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn CreatePolygonRgn( + pptl: *const POINT, + cPoint: ::std::os::raw::c_int, + iMode: ::std::os::raw::c_int, + ) -> HRGN; +} +extern "C" { + pub fn DPtoLP(hdc: HDC, lppt: LPPOINT, c: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn LPtoDP(hdc: HDC, lppt: LPPOINT, c: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn Polygon(hdc: HDC, apt: *const POINT, cpt: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn Polyline(hdc: HDC, apt: *const POINT, cpt: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn PolyBezier(hdc: HDC, apt: *const POINT, cpt: DWORD) -> WINBOOL; +} +extern "C" { + pub fn PolyBezierTo(hdc: HDC, apt: *const POINT, cpt: DWORD) -> WINBOOL; +} +extern "C" { + pub fn PolylineTo(hdc: HDC, apt: *const POINT, cpt: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetViewportExtEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetViewportOrgEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lppt: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn SetWindowExtEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetWindowOrgEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lppt: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn OffsetViewportOrgEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lppt: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn OffsetWindowOrgEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lppt: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn ScaleViewportExtEx( + hdc: HDC, + xn: ::std::os::raw::c_int, + dx: ::std::os::raw::c_int, + yn: ::std::os::raw::c_int, + yd: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn ScaleWindowExtEx( + hdc: HDC, + xn: ::std::os::raw::c_int, + xd: ::std::os::raw::c_int, + yn: ::std::os::raw::c_int, + yd: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetBitmapDimensionEx( + hbm: HBITMAP, + w: ::std::os::raw::c_int, + h: ::std::os::raw::c_int, + lpsz: LPSIZE, + ) -> WINBOOL; +} +extern "C" { + pub fn SetBrushOrgEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lppt: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetTextFaceA(hdc: HDC, c: ::std::os::raw::c_int, lpName: LPSTR) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetTextFaceW( + hdc: HDC, + c: ::std::os::raw::c_int, + lpName: LPWSTR, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagKERNINGPAIR { + pub wFirst: WORD, + pub wSecond: WORD, + pub iKernAmount: ::std::os::raw::c_int, +} +pub type KERNINGPAIR = tagKERNINGPAIR; +pub type LPKERNINGPAIR = *mut tagKERNINGPAIR; +extern "C" { + pub fn GetKerningPairsA(hdc: HDC, nPairs: DWORD, lpKernPair: LPKERNINGPAIR) -> DWORD; +} +extern "C" { + pub fn GetKerningPairsW(hdc: HDC, nPairs: DWORD, lpKernPair: LPKERNINGPAIR) -> DWORD; +} +extern "C" { + pub fn GetDCOrgEx(hdc: HDC, lppt: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn FixBrushOrgEx( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + ptl: LPPOINT, + ) -> WINBOOL; +} +extern "C" { + pub fn UnrealizeObject(h: HGDIOBJ) -> WINBOOL; +} +extern "C" { + pub fn GdiFlush() -> WINBOOL; +} +extern "C" { + pub fn GdiSetBatchLimit(dw: DWORD) -> DWORD; +} +extern "C" { + pub fn GdiGetBatchLimit() -> DWORD; +} +pub type ICMENUMPROCA = + ::std::option::Option ::std::os::raw::c_int>; +pub type ICMENUMPROCW = ::std::option::Option< + unsafe extern "C" fn(arg1: LPWSTR, arg2: LPARAM) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn SetICMMode(hdc: HDC, mode: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CheckColorsInGamut( + hdc: HDC, + lpRGBTriple: LPVOID, + dlpBuffer: LPVOID, + nCount: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetColorSpace(hdc: HDC) -> HCOLORSPACE; +} +extern "C" { + pub fn GetLogColorSpaceA( + hColorSpace: HCOLORSPACE, + lpBuffer: LPLOGCOLORSPACEA, + nSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetLogColorSpaceW( + hColorSpace: HCOLORSPACE, + lpBuffer: LPLOGCOLORSPACEW, + nSize: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateColorSpaceA(lplcs: LPLOGCOLORSPACEA) -> HCOLORSPACE; +} +extern "C" { + pub fn CreateColorSpaceW(lplcs: LPLOGCOLORSPACEW) -> HCOLORSPACE; +} +extern "C" { + pub fn SetColorSpace(hdc: HDC, hcs: HCOLORSPACE) -> HCOLORSPACE; +} +extern "C" { + pub fn DeleteColorSpace(hcs: HCOLORSPACE) -> WINBOOL; +} +extern "C" { + pub fn GetICMProfileA(hdc: HDC, pBufSize: LPDWORD, pszFilename: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn GetICMProfileW(hdc: HDC, pBufSize: LPDWORD, pszFilename: LPWSTR) -> WINBOOL; +} +extern "C" { + pub fn SetICMProfileA(hdc: HDC, lpFileName: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn SetICMProfileW(hdc: HDC, lpFileName: LPWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetDeviceGammaRamp(hdc: HDC, lpRamp: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn SetDeviceGammaRamp(hdc: HDC, lpRamp: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn ColorMatchToTarget(hdc: HDC, hdcTarget: HDC, action: DWORD) -> WINBOOL; +} +extern "C" { + pub fn EnumICMProfilesA( + hdc: HDC, + lpProc: ICMENUMPROCA, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumICMProfilesW( + hdc: HDC, + lpProc: ICMENUMPROCW, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn UpdateICMRegKeyA( + reserved: DWORD, + lpszCMID: LPSTR, + lpszFileName: LPSTR, + command: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn UpdateICMRegKeyW( + reserved: DWORD, + lpszCMID: LPWSTR, + lpszFileName: LPWSTR, + command: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn ColorCorrectPalette(hdc: HDC, hPal: HPALETTE, deFirst: DWORD, num: DWORD) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMR { + pub iType: DWORD, + pub nSize: DWORD, +} +pub type EMR = tagEMR; +pub type PEMR = *mut tagEMR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRTEXT { + pub ptlReference: POINTL, + pub nChars: DWORD, + pub offString: DWORD, + pub fOptions: DWORD, + pub rcl: RECTL, + pub offDx: DWORD, +} +pub type EMRTEXT = tagEMRTEXT; +pub type PEMRTEXT = *mut tagEMRTEXT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagABORTPATH { + pub emr: EMR, +} +pub type EMRABORTPATH = tagABORTPATH; +pub type PEMRABORTPATH = *mut tagABORTPATH; +pub type EMRBEGINPATH = tagABORTPATH; +pub type PEMRBEGINPATH = *mut tagABORTPATH; +pub type EMRENDPATH = tagABORTPATH; +pub type PEMRENDPATH = *mut tagABORTPATH; +pub type EMRCLOSEFIGURE = tagABORTPATH; +pub type PEMRCLOSEFIGURE = *mut tagABORTPATH; +pub type EMRFLATTENPATH = tagABORTPATH; +pub type PEMRFLATTENPATH = *mut tagABORTPATH; +pub type EMRWIDENPATH = tagABORTPATH; +pub type PEMRWIDENPATH = *mut tagABORTPATH; +pub type EMRSETMETARGN = tagABORTPATH; +pub type PEMRSETMETARGN = *mut tagABORTPATH; +pub type EMRSAVEDC = tagABORTPATH; +pub type PEMRSAVEDC = *mut tagABORTPATH; +pub type EMRREALIZEPALETTE = tagABORTPATH; +pub type PEMRREALIZEPALETTE = *mut tagABORTPATH; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSELECTCLIPPATH { + pub emr: EMR, + pub iMode: DWORD, +} +pub type EMRSELECTCLIPPATH = tagEMRSELECTCLIPPATH; +pub type PEMRSELECTCLIPPATH = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETBKMODE = tagEMRSELECTCLIPPATH; +pub type PEMRSETBKMODE = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETMAPMODE = tagEMRSELECTCLIPPATH; +pub type PEMRSETMAPMODE = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETLAYOUT = tagEMRSELECTCLIPPATH; +pub type PEMRSETLAYOUT = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETPOLYFILLMODE = tagEMRSELECTCLIPPATH; +pub type PEMRSETPOLYFILLMODE = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETROP2 = tagEMRSELECTCLIPPATH; +pub type PEMRSETROP2 = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETSTRETCHBLTMODE = tagEMRSELECTCLIPPATH; +pub type PEMRSETSTRETCHBLTMODE = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETICMMODE = tagEMRSELECTCLIPPATH; +pub type PEMRSETICMMODE = *mut tagEMRSELECTCLIPPATH; +pub type EMRSETTEXTALIGN = tagEMRSELECTCLIPPATH; +pub type PEMRSETTEXTALIGN = *mut tagEMRSELECTCLIPPATH; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETMITERLIMIT { + pub emr: EMR, + pub eMiterLimit: FLOAT, +} +pub type EMRSETMITERLIMIT = tagEMRSETMITERLIMIT; +pub type PEMRSETMITERLIMIT = *mut tagEMRSETMITERLIMIT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRRESTOREDC { + pub emr: EMR, + pub iRelative: LONG, +} +pub type EMRRESTOREDC = tagEMRRESTOREDC; +pub type PEMRRESTOREDC = *mut tagEMRRESTOREDC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETARCDIRECTION { + pub emr: EMR, + pub iArcDirection: DWORD, +} +pub type EMRSETARCDIRECTION = tagEMRSETARCDIRECTION; +pub type PEMRSETARCDIRECTION = *mut tagEMRSETARCDIRECTION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETMAPPERFLAGS { + pub emr: EMR, + pub dwFlags: DWORD, +} +pub type EMRSETMAPPERFLAGS = tagEMRSETMAPPERFLAGS; +pub type PEMRSETMAPPERFLAGS = *mut tagEMRSETMAPPERFLAGS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETTEXTCOLOR { + pub emr: EMR, + pub crColor: COLORREF, +} +pub type EMRSETBKCOLOR = tagEMRSETTEXTCOLOR; +pub type PEMRSETBKCOLOR = *mut tagEMRSETTEXTCOLOR; +pub type EMRSETTEXTCOLOR = tagEMRSETTEXTCOLOR; +pub type PEMRSETTEXTCOLOR = *mut tagEMRSETTEXTCOLOR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSELECTOBJECT { + pub emr: EMR, + pub ihObject: DWORD, +} +pub type EMRSELECTOBJECT = tagEMRSELECTOBJECT; +pub type PEMRSELECTOBJECT = *mut tagEMRSELECTOBJECT; +pub type EMRDELETEOBJECT = tagEMRSELECTOBJECT; +pub type PEMRDELETEOBJECT = *mut tagEMRSELECTOBJECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSELECTPALETTE { + pub emr: EMR, + pub ihPal: DWORD, +} +pub type EMRSELECTPALETTE = tagEMRSELECTPALETTE; +pub type PEMRSELECTPALETTE = *mut tagEMRSELECTPALETTE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRRESIZEPALETTE { + pub emr: EMR, + pub ihPal: DWORD, + pub cEntries: DWORD, +} +pub type EMRRESIZEPALETTE = tagEMRRESIZEPALETTE; +pub type PEMRRESIZEPALETTE = *mut tagEMRRESIZEPALETTE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETPALETTEENTRIES { + pub emr: EMR, + pub ihPal: DWORD, + pub iStart: DWORD, + pub cEntries: DWORD, + pub aPalEntries: [PALETTEENTRY; 1usize], +} +pub type EMRSETPALETTEENTRIES = tagEMRSETPALETTEENTRIES; +pub type PEMRSETPALETTEENTRIES = *mut tagEMRSETPALETTEENTRIES; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETCOLORADJUSTMENT { + pub emr: EMR, + pub ColorAdjustment: COLORADJUSTMENT, +} +pub type EMRSETCOLORADJUSTMENT = tagEMRSETCOLORADJUSTMENT; +pub type PEMRSETCOLORADJUSTMENT = *mut tagEMRSETCOLORADJUSTMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRGDICOMMENT { + pub emr: EMR, + pub cbData: DWORD, + pub Data: [BYTE; 1usize], +} +pub type EMRGDICOMMENT = tagEMRGDICOMMENT; +pub type PEMRGDICOMMENT = *mut tagEMRGDICOMMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREOF { + pub emr: EMR, + pub nPalEntries: DWORD, + pub offPalEntries: DWORD, + pub nSizeLast: DWORD, +} +pub type EMREOF = tagEMREOF; +pub type PEMREOF = *mut tagEMREOF; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRLINETO { + pub emr: EMR, + pub ptl: POINTL, +} +pub type EMRLINETO = tagEMRLINETO; +pub type PEMRLINETO = *mut tagEMRLINETO; +pub type EMRMOVETOEX = tagEMRLINETO; +pub type PEMRMOVETOEX = *mut tagEMRLINETO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMROFFSETCLIPRGN { + pub emr: EMR, + pub ptlOffset: POINTL, +} +pub type EMROFFSETCLIPRGN = tagEMROFFSETCLIPRGN; +pub type PEMROFFSETCLIPRGN = *mut tagEMROFFSETCLIPRGN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRFILLPATH { + pub emr: EMR, + pub rclBounds: RECTL, +} +pub type EMRFILLPATH = tagEMRFILLPATH; +pub type PEMRFILLPATH = *mut tagEMRFILLPATH; +pub type EMRSTROKEANDFILLPATH = tagEMRFILLPATH; +pub type PEMRSTROKEANDFILLPATH = *mut tagEMRFILLPATH; +pub type EMRSTROKEPATH = tagEMRFILLPATH; +pub type PEMRSTROKEPATH = *mut tagEMRFILLPATH; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREXCLUDECLIPRECT { + pub emr: EMR, + pub rclClip: RECTL, +} +pub type EMREXCLUDECLIPRECT = tagEMREXCLUDECLIPRECT; +pub type PEMREXCLUDECLIPRECT = *mut tagEMREXCLUDECLIPRECT; +pub type EMRINTERSECTCLIPRECT = tagEMREXCLUDECLIPRECT; +pub type PEMRINTERSECTCLIPRECT = *mut tagEMREXCLUDECLIPRECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETVIEWPORTORGEX { + pub emr: EMR, + pub ptlOrigin: POINTL, +} +pub type EMRSETVIEWPORTORGEX = tagEMRSETVIEWPORTORGEX; +pub type PEMRSETVIEWPORTORGEX = *mut tagEMRSETVIEWPORTORGEX; +pub type EMRSETWINDOWORGEX = tagEMRSETVIEWPORTORGEX; +pub type PEMRSETWINDOWORGEX = *mut tagEMRSETVIEWPORTORGEX; +pub type EMRSETBRUSHORGEX = tagEMRSETVIEWPORTORGEX; +pub type PEMRSETBRUSHORGEX = *mut tagEMRSETVIEWPORTORGEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETVIEWPORTEXTEX { + pub emr: EMR, + pub szlExtent: SIZEL, +} +pub type EMRSETVIEWPORTEXTEX = tagEMRSETVIEWPORTEXTEX; +pub type PEMRSETVIEWPORTEXTEX = *mut tagEMRSETVIEWPORTEXTEX; +pub type EMRSETWINDOWEXTEX = tagEMRSETVIEWPORTEXTEX; +pub type PEMRSETWINDOWEXTEX = *mut tagEMRSETVIEWPORTEXTEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSCALEVIEWPORTEXTEX { + pub emr: EMR, + pub xNum: LONG, + pub xDenom: LONG, + pub yNum: LONG, + pub yDenom: LONG, +} +pub type EMRSCALEVIEWPORTEXTEX = tagEMRSCALEVIEWPORTEXTEX; +pub type PEMRSCALEVIEWPORTEXTEX = *mut tagEMRSCALEVIEWPORTEXTEX; +pub type EMRSCALEWINDOWEXTEX = tagEMRSCALEVIEWPORTEXTEX; +pub type PEMRSCALEWINDOWEXTEX = *mut tagEMRSCALEVIEWPORTEXTEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETWORLDTRANSFORM { + pub emr: EMR, + pub xform: XFORM, +} +pub type EMRSETWORLDTRANSFORM = tagEMRSETWORLDTRANSFORM; +pub type PEMRSETWORLDTRANSFORM = *mut tagEMRSETWORLDTRANSFORM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRMODIFYWORLDTRANSFORM { + pub emr: EMR, + pub xform: XFORM, + pub iMode: DWORD, +} +pub type EMRMODIFYWORLDTRANSFORM = tagEMRMODIFYWORLDTRANSFORM; +pub type PEMRMODIFYWORLDTRANSFORM = *mut tagEMRMODIFYWORLDTRANSFORM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETPIXELV { + pub emr: EMR, + pub ptlPixel: POINTL, + pub crColor: COLORREF, +} +pub type EMRSETPIXELV = tagEMRSETPIXELV; +pub type PEMRSETPIXELV = *mut tagEMRSETPIXELV; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREXTFLOODFILL { + pub emr: EMR, + pub ptlStart: POINTL, + pub crColor: COLORREF, + pub iMode: DWORD, +} +pub type EMREXTFLOODFILL = tagEMREXTFLOODFILL; +pub type PEMREXTFLOODFILL = *mut tagEMREXTFLOODFILL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRELLIPSE { + pub emr: EMR, + pub rclBox: RECTL, +} +pub type EMRELLIPSE = tagEMRELLIPSE; +pub type PEMRELLIPSE = *mut tagEMRELLIPSE; +pub type EMRRECTANGLE = tagEMRELLIPSE; +pub type PEMRRECTANGLE = *mut tagEMRELLIPSE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRROUNDRECT { + pub emr: EMR, + pub rclBox: RECTL, + pub szlCorner: SIZEL, +} +pub type EMRROUNDRECT = tagEMRROUNDRECT; +pub type PEMRROUNDRECT = *mut tagEMRROUNDRECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRARC { + pub emr: EMR, + pub rclBox: RECTL, + pub ptlStart: POINTL, + pub ptlEnd: POINTL, +} +pub type EMRARC = tagEMRARC; +pub type PEMRARC = *mut tagEMRARC; +pub type EMRARCTO = tagEMRARC; +pub type PEMRARCTO = *mut tagEMRARC; +pub type EMRCHORD = tagEMRARC; +pub type PEMRCHORD = *mut tagEMRARC; +pub type EMRPIE = tagEMRARC; +pub type PEMRPIE = *mut tagEMRARC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRANGLEARC { + pub emr: EMR, + pub ptlCenter: POINTL, + pub nRadius: DWORD, + pub eStartAngle: FLOAT, + pub eSweepAngle: FLOAT, +} +pub type EMRANGLEARC = tagEMRANGLEARC; +pub type PEMRANGLEARC = *mut tagEMRANGLEARC; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYLINE { + pub emr: EMR, + pub rclBounds: RECTL, + pub cptl: DWORD, + pub aptl: [POINTL; 1usize], +} +pub type EMRPOLYLINE = tagEMRPOLYLINE; +pub type PEMRPOLYLINE = *mut tagEMRPOLYLINE; +pub type EMRPOLYBEZIER = tagEMRPOLYLINE; +pub type PEMRPOLYBEZIER = *mut tagEMRPOLYLINE; +pub type EMRPOLYGON = tagEMRPOLYLINE; +pub type PEMRPOLYGON = *mut tagEMRPOLYLINE; +pub type EMRPOLYBEZIERTO = tagEMRPOLYLINE; +pub type PEMRPOLYBEZIERTO = *mut tagEMRPOLYLINE; +pub type EMRPOLYLINETO = tagEMRPOLYLINE; +pub type PEMRPOLYLINETO = *mut tagEMRPOLYLINE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYLINE16 { + pub emr: EMR, + pub rclBounds: RECTL, + pub cpts: DWORD, + pub apts: [POINTS; 1usize], +} +pub type EMRPOLYLINE16 = tagEMRPOLYLINE16; +pub type PEMRPOLYLINE16 = *mut tagEMRPOLYLINE16; +pub type EMRPOLYBEZIER16 = tagEMRPOLYLINE16; +pub type PEMRPOLYBEZIER16 = *mut tagEMRPOLYLINE16; +pub type EMRPOLYGON16 = tagEMRPOLYLINE16; +pub type PEMRPOLYGON16 = *mut tagEMRPOLYLINE16; +pub type EMRPOLYBEZIERTO16 = tagEMRPOLYLINE16; +pub type PEMRPOLYBEZIERTO16 = *mut tagEMRPOLYLINE16; +pub type EMRPOLYLINETO16 = tagEMRPOLYLINE16; +pub type PEMRPOLYLINETO16 = *mut tagEMRPOLYLINE16; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYDRAW { + pub emr: EMR, + pub rclBounds: RECTL, + pub cptl: DWORD, + pub aptl: [POINTL; 1usize], + pub abTypes: [BYTE; 1usize], +} +pub type EMRPOLYDRAW = tagEMRPOLYDRAW; +pub type PEMRPOLYDRAW = *mut tagEMRPOLYDRAW; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYDRAW16 { + pub emr: EMR, + pub rclBounds: RECTL, + pub cpts: DWORD, + pub apts: [POINTS; 1usize], + pub abTypes: [BYTE; 1usize], +} +pub type EMRPOLYDRAW16 = tagEMRPOLYDRAW16; +pub type PEMRPOLYDRAW16 = *mut tagEMRPOLYDRAW16; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYPOLYLINE { + pub emr: EMR, + pub rclBounds: RECTL, + pub nPolys: DWORD, + pub cptl: DWORD, + pub aPolyCounts: [DWORD; 1usize], + pub aptl: [POINTL; 1usize], +} +pub type EMRPOLYPOLYLINE = tagEMRPOLYPOLYLINE; +pub type PEMRPOLYPOLYLINE = *mut tagEMRPOLYPOLYLINE; +pub type EMRPOLYPOLYGON = tagEMRPOLYPOLYLINE; +pub type PEMRPOLYPOLYGON = *mut tagEMRPOLYPOLYLINE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYPOLYLINE16 { + pub emr: EMR, + pub rclBounds: RECTL, + pub nPolys: DWORD, + pub cpts: DWORD, + pub aPolyCounts: [DWORD; 1usize], + pub apts: [POINTS; 1usize], +} +pub type EMRPOLYPOLYLINE16 = tagEMRPOLYPOLYLINE16; +pub type PEMRPOLYPOLYLINE16 = *mut tagEMRPOLYPOLYLINE16; +pub type EMRPOLYPOLYGON16 = tagEMRPOLYPOLYLINE16; +pub type PEMRPOLYPOLYGON16 = *mut tagEMRPOLYPOLYLINE16; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRINVERTRGN { + pub emr: EMR, + pub rclBounds: RECTL, + pub cbRgnData: DWORD, + pub RgnData: [BYTE; 1usize], +} +pub type EMRINVERTRGN = tagEMRINVERTRGN; +pub type PEMRINVERTRGN = *mut tagEMRINVERTRGN; +pub type EMRPAINTRGN = tagEMRINVERTRGN; +pub type PEMRPAINTRGN = *mut tagEMRINVERTRGN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRFILLRGN { + pub emr: EMR, + pub rclBounds: RECTL, + pub cbRgnData: DWORD, + pub ihBrush: DWORD, + pub RgnData: [BYTE; 1usize], +} +pub type EMRFILLRGN = tagEMRFILLRGN; +pub type PEMRFILLRGN = *mut tagEMRFILLRGN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRFRAMERGN { + pub emr: EMR, + pub rclBounds: RECTL, + pub cbRgnData: DWORD, + pub ihBrush: DWORD, + pub szlStroke: SIZEL, + pub RgnData: [BYTE; 1usize], +} +pub type EMRFRAMERGN = tagEMRFRAMERGN; +pub type PEMRFRAMERGN = *mut tagEMRFRAMERGN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREXTSELECTCLIPRGN { + pub emr: EMR, + pub cbRgnData: DWORD, + pub iMode: DWORD, + pub RgnData: [BYTE; 1usize], +} +pub type EMREXTSELECTCLIPRGN = tagEMREXTSELECTCLIPRGN; +pub type PEMREXTSELECTCLIPRGN = *mut tagEMREXTSELECTCLIPRGN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREXTTEXTOUTA { + pub emr: EMR, + pub rclBounds: RECTL, + pub iGraphicsMode: DWORD, + pub exScale: FLOAT, + pub eyScale: FLOAT, + pub emrtext: EMRTEXT, +} +pub type EMREXTTEXTOUTA = tagEMREXTTEXTOUTA; +pub type PEMREXTTEXTOUTA = *mut tagEMREXTTEXTOUTA; +pub type EMREXTTEXTOUTW = tagEMREXTTEXTOUTA; +pub type PEMREXTTEXTOUTW = *mut tagEMREXTTEXTOUTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPOLYTEXTOUTA { + pub emr: EMR, + pub rclBounds: RECTL, + pub iGraphicsMode: DWORD, + pub exScale: FLOAT, + pub eyScale: FLOAT, + pub cStrings: LONG, + pub aemrtext: [EMRTEXT; 1usize], +} +pub type EMRPOLYTEXTOUTA = tagEMRPOLYTEXTOUTA; +pub type PEMRPOLYTEXTOUTA = *mut tagEMRPOLYTEXTOUTA; +pub type EMRPOLYTEXTOUTW = tagEMRPOLYTEXTOUTA; +pub type PEMRPOLYTEXTOUTW = *mut tagEMRPOLYTEXTOUTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRBITBLT { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub cxDest: LONG, + pub cyDest: LONG, + pub dwRop: DWORD, + pub xSrc: LONG, + pub ySrc: LONG, + pub xformSrc: XFORM, + pub crBkColorSrc: COLORREF, + pub iUsageSrc: DWORD, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, +} +pub type EMRBITBLT = tagEMRBITBLT; +pub type PEMRBITBLT = *mut tagEMRBITBLT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSTRETCHBLT { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub cxDest: LONG, + pub cyDest: LONG, + pub dwRop: DWORD, + pub xSrc: LONG, + pub ySrc: LONG, + pub xformSrc: XFORM, + pub crBkColorSrc: COLORREF, + pub iUsageSrc: DWORD, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub cxSrc: LONG, + pub cySrc: LONG, +} +pub type EMRSTRETCHBLT = tagEMRSTRETCHBLT; +pub type PEMRSTRETCHBLT = *mut tagEMRSTRETCHBLT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRMASKBLT { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub cxDest: LONG, + pub cyDest: LONG, + pub dwRop: DWORD, + pub xSrc: LONG, + pub ySrc: LONG, + pub xformSrc: XFORM, + pub crBkColorSrc: COLORREF, + pub iUsageSrc: DWORD, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub xMask: LONG, + pub yMask: LONG, + pub iUsageMask: DWORD, + pub offBmiMask: DWORD, + pub cbBmiMask: DWORD, + pub offBitsMask: DWORD, + pub cbBitsMask: DWORD, +} +pub type EMRMASKBLT = tagEMRMASKBLT; +pub type PEMRMASKBLT = *mut tagEMRMASKBLT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPLGBLT { + pub emr: EMR, + pub rclBounds: RECTL, + pub aptlDest: [POINTL; 3usize], + pub xSrc: LONG, + pub ySrc: LONG, + pub cxSrc: LONG, + pub cySrc: LONG, + pub xformSrc: XFORM, + pub crBkColorSrc: COLORREF, + pub iUsageSrc: DWORD, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub xMask: LONG, + pub yMask: LONG, + pub iUsageMask: DWORD, + pub offBmiMask: DWORD, + pub cbBmiMask: DWORD, + pub offBitsMask: DWORD, + pub cbBitsMask: DWORD, +} +pub type EMRPLGBLT = tagEMRPLGBLT; +pub type PEMRPLGBLT = *mut tagEMRPLGBLT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETDIBITSTODEVICE { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub xSrc: LONG, + pub ySrc: LONG, + pub cxSrc: LONG, + pub cySrc: LONG, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub iUsageSrc: DWORD, + pub iStartScan: DWORD, + pub cScans: DWORD, +} +pub type EMRSETDIBITSTODEVICE = tagEMRSETDIBITSTODEVICE; +pub type PEMRSETDIBITSTODEVICE = *mut tagEMRSETDIBITSTODEVICE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSTRETCHDIBITS { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub xSrc: LONG, + pub ySrc: LONG, + pub cxSrc: LONG, + pub cySrc: LONG, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub iUsageSrc: DWORD, + pub dwRop: DWORD, + pub cxDest: LONG, + pub cyDest: LONG, +} +pub type EMRSTRETCHDIBITS = tagEMRSTRETCHDIBITS; +pub type PEMRSTRETCHDIBITS = *mut tagEMRSTRETCHDIBITS; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagEMREXTCREATEFONTINDIRECTW { + pub emr: EMR, + pub ihFont: DWORD, + pub elfw: EXTLOGFONTW, +} +pub type EMREXTCREATEFONTINDIRECTW = tagEMREXTCREATEFONTINDIRECTW; +pub type PEMREXTCREATEFONTINDIRECTW = *mut tagEMREXTCREATEFONTINDIRECTW; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRCREATEPALETTE { + pub emr: EMR, + pub ihPal: DWORD, + pub lgpl: LOGPALETTE, +} +pub type EMRCREATEPALETTE = tagEMRCREATEPALETTE; +pub type PEMRCREATEPALETTE = *mut tagEMRCREATEPALETTE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRCREATEPEN { + pub emr: EMR, + pub ihPen: DWORD, + pub lopn: LOGPEN, +} +pub type EMRCREATEPEN = tagEMRCREATEPEN; +pub type PEMRCREATEPEN = *mut tagEMRCREATEPEN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREXTCREATEPEN { + pub emr: EMR, + pub ihPen: DWORD, + pub offBmi: DWORD, + pub cbBmi: DWORD, + pub offBits: DWORD, + pub cbBits: DWORD, + pub elp: EXTLOGPEN, +} +pub type EMREXTCREATEPEN = tagEMREXTCREATEPEN; +pub type PEMREXTCREATEPEN = *mut tagEMREXTCREATEPEN; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRCREATEBRUSHINDIRECT { + pub emr: EMR, + pub ihBrush: DWORD, + pub lb: LOGBRUSH32, +} +pub type EMRCREATEBRUSHINDIRECT = tagEMRCREATEBRUSHINDIRECT; +pub type PEMRCREATEBRUSHINDIRECT = *mut tagEMRCREATEBRUSHINDIRECT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRCREATEMONOBRUSH { + pub emr: EMR, + pub ihBrush: DWORD, + pub iUsage: DWORD, + pub offBmi: DWORD, + pub cbBmi: DWORD, + pub offBits: DWORD, + pub cbBits: DWORD, +} +pub type EMRCREATEMONOBRUSH = tagEMRCREATEMONOBRUSH; +pub type PEMRCREATEMONOBRUSH = *mut tagEMRCREATEMONOBRUSH; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRCREATEDIBPATTERNBRUSHPT { + pub emr: EMR, + pub ihBrush: DWORD, + pub iUsage: DWORD, + pub offBmi: DWORD, + pub cbBmi: DWORD, + pub offBits: DWORD, + pub cbBits: DWORD, +} +pub type EMRCREATEDIBPATTERNBRUSHPT = tagEMRCREATEDIBPATTERNBRUSHPT; +pub type PEMRCREATEDIBPATTERNBRUSHPT = *mut tagEMRCREATEDIBPATTERNBRUSHPT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRFORMAT { + pub dSignature: DWORD, + pub nVersion: DWORD, + pub cbData: DWORD, + pub offData: DWORD, +} +pub type EMRFORMAT = tagEMRFORMAT; +pub type PEMRFORMAT = *mut tagEMRFORMAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRGLSRECORD { + pub emr: EMR, + pub cbData: DWORD, + pub Data: [BYTE; 1usize], +} +pub type EMRGLSRECORD = tagEMRGLSRECORD; +pub type PEMRGLSRECORD = *mut tagEMRGLSRECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRGLSBOUNDEDRECORD { + pub emr: EMR, + pub rclBounds: RECTL, + pub cbData: DWORD, + pub Data: [BYTE; 1usize], +} +pub type EMRGLSBOUNDEDRECORD = tagEMRGLSBOUNDEDRECORD; +pub type PEMRGLSBOUNDEDRECORD = *mut tagEMRGLSBOUNDEDRECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRPIXELFORMAT { + pub emr: EMR, + pub pfd: PIXELFORMATDESCRIPTOR, +} +pub type EMRPIXELFORMAT = tagEMRPIXELFORMAT; +pub type PEMRPIXELFORMAT = *mut tagEMRPIXELFORMAT; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagEMRCREATECOLORSPACE { + pub emr: EMR, + pub ihCS: DWORD, + pub lcs: LOGCOLORSPACEA, +} +pub type EMRCREATECOLORSPACE = tagEMRCREATECOLORSPACE; +pub type PEMRCREATECOLORSPACE = *mut tagEMRCREATECOLORSPACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETCOLORSPACE { + pub emr: EMR, + pub ihCS: DWORD, +} +pub type EMRSETCOLORSPACE = tagEMRSETCOLORSPACE; +pub type PEMRSETCOLORSPACE = *mut tagEMRSETCOLORSPACE; +pub type EMRSELECTCOLORSPACE = tagEMRSETCOLORSPACE; +pub type PEMRSELECTCOLORSPACE = *mut tagEMRSETCOLORSPACE; +pub type EMRDELETECOLORSPACE = tagEMRSETCOLORSPACE; +pub type PEMRDELETECOLORSPACE = *mut tagEMRSETCOLORSPACE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMREXTESCAPE { + pub emr: EMR, + pub iEscape: INT, + pub cbEscData: INT, + pub EscData: [BYTE; 1usize], +} +pub type EMREXTESCAPE = tagEMREXTESCAPE; +pub type PEMREXTESCAPE = *mut tagEMREXTESCAPE; +pub type EMRDRAWESCAPE = tagEMREXTESCAPE; +pub type PEMRDRAWESCAPE = *mut tagEMREXTESCAPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRNAMEDESCAPE { + pub emr: EMR, + pub iEscape: INT, + pub cbDriver: INT, + pub cbEscData: INT, + pub EscData: [BYTE; 1usize], +} +pub type EMRNAMEDESCAPE = tagEMRNAMEDESCAPE; +pub type PEMRNAMEDESCAPE = *mut tagEMRNAMEDESCAPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRSETICMPROFILE { + pub emr: EMR, + pub dwFlags: DWORD, + pub cbName: DWORD, + pub cbData: DWORD, + pub Data: [BYTE; 1usize], +} +pub type EMRSETICMPROFILE = tagEMRSETICMPROFILE; +pub type PEMRSETICMPROFILE = *mut tagEMRSETICMPROFILE; +pub type EMRSETICMPROFILEA = tagEMRSETICMPROFILE; +pub type PEMRSETICMPROFILEA = *mut tagEMRSETICMPROFILE; +pub type EMRSETICMPROFILEW = tagEMRSETICMPROFILE; +pub type PEMRSETICMPROFILEW = *mut tagEMRSETICMPROFILE; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagEMRCREATECOLORSPACEW { + pub emr: EMR, + pub ihCS: DWORD, + pub lcs: LOGCOLORSPACEW, + pub dwFlags: DWORD, + pub cbData: DWORD, + pub Data: [BYTE; 1usize], +} +pub type EMRCREATECOLORSPACEW = tagEMRCREATECOLORSPACEW; +pub type PEMRCREATECOLORSPACEW = *mut tagEMRCREATECOLORSPACEW; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOLORMATCHTOTARGET { + pub emr: EMR, + pub dwAction: DWORD, + pub dwFlags: DWORD, + pub cbName: DWORD, + pub cbData: DWORD, + pub Data: [BYTE; 1usize], +} +pub type EMRCOLORMATCHTOTARGET = tagCOLORMATCHTOTARGET; +pub type PEMRCOLORMATCHTOTARGET = *mut tagCOLORMATCHTOTARGET; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOLORCORRECTPALETTE { + pub emr: EMR, + pub ihPalette: DWORD, + pub nFirstEntry: DWORD, + pub nPalEntries: DWORD, + pub nReserved: DWORD, +} +pub type EMRCOLORCORRECTPALETTE = tagCOLORCORRECTPALETTE; +pub type PEMRCOLORCORRECTPALETTE = *mut tagCOLORCORRECTPALETTE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRALPHABLEND { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub cxDest: LONG, + pub cyDest: LONG, + pub dwRop: DWORD, + pub xSrc: LONG, + pub ySrc: LONG, + pub xformSrc: XFORM, + pub crBkColorSrc: COLORREF, + pub iUsageSrc: DWORD, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub cxSrc: LONG, + pub cySrc: LONG, +} +pub type EMRALPHABLEND = tagEMRALPHABLEND; +pub type PEMRALPHABLEND = *mut tagEMRALPHABLEND; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRGRADIENTFILL { + pub emr: EMR, + pub rclBounds: RECTL, + pub nVer: DWORD, + pub nTri: DWORD, + pub ulMode: ULONG, + pub Ver: [TRIVERTEX; 1usize], +} +pub type EMRGRADIENTFILL = tagEMRGRADIENTFILL; +pub type PEMRGRADIENTFILL = *mut tagEMRGRADIENTFILL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEMRTRANSPARENTBLT { + pub emr: EMR, + pub rclBounds: RECTL, + pub xDest: LONG, + pub yDest: LONG, + pub cxDest: LONG, + pub cyDest: LONG, + pub dwRop: DWORD, + pub xSrc: LONG, + pub ySrc: LONG, + pub xformSrc: XFORM, + pub crBkColorSrc: COLORREF, + pub iUsageSrc: DWORD, + pub offBmiSrc: DWORD, + pub cbBmiSrc: DWORD, + pub offBitsSrc: DWORD, + pub cbBitsSrc: DWORD, + pub cxSrc: LONG, + pub cySrc: LONG, +} +pub type EMRTRANSPARENTBLT = tagEMRTRANSPARENTBLT; +pub type PEMRTRANSPARENTBLT = *mut tagEMRTRANSPARENTBLT; +extern "C" { + pub fn wglCopyContext(arg1: HGLRC, arg2: HGLRC, arg3: UINT) -> WINBOOL; +} +extern "C" { + pub fn wglCreateContext(arg1: HDC) -> HGLRC; +} +extern "C" { + pub fn wglCreateLayerContext(arg1: HDC, arg2: ::std::os::raw::c_int) -> HGLRC; +} +extern "C" { + pub fn wglDeleteContext(arg1: HGLRC) -> WINBOOL; +} +extern "C" { + pub fn wglGetCurrentContext() -> HGLRC; +} +extern "C" { + pub fn wglGetCurrentDC() -> HDC; +} +extern "C" { + pub fn wglGetProcAddress(arg1: LPCSTR) -> PROC; +} +extern "C" { + pub fn wglMakeCurrent(arg1: HDC, arg2: HGLRC) -> WINBOOL; +} +extern "C" { + pub fn wglShareLists(arg1: HGLRC, arg2: HGLRC) -> WINBOOL; +} +extern "C" { + pub fn wglUseFontBitmapsA(arg1: HDC, arg2: DWORD, arg3: DWORD, arg4: DWORD) -> WINBOOL; +} +extern "C" { + pub fn wglUseFontBitmapsW(arg1: HDC, arg2: DWORD, arg3: DWORD, arg4: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SwapBuffers(arg1: HDC) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _POINTFLOAT { + pub x: FLOAT, + pub y: FLOAT, +} +pub type POINTFLOAT = _POINTFLOAT; +pub type PPOINTFLOAT = *mut _POINTFLOAT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GLYPHMETRICSFLOAT { + pub gmfBlackBoxX: FLOAT, + pub gmfBlackBoxY: FLOAT, + pub gmfptGlyphOrigin: POINTFLOAT, + pub gmfCellIncX: FLOAT, + pub gmfCellIncY: FLOAT, +} +pub type GLYPHMETRICSFLOAT = _GLYPHMETRICSFLOAT; +pub type PGLYPHMETRICSFLOAT = *mut _GLYPHMETRICSFLOAT; +pub type LPGLYPHMETRICSFLOAT = *mut _GLYPHMETRICSFLOAT; +extern "C" { + pub fn wglUseFontOutlinesA( + arg1: HDC, + arg2: DWORD, + arg3: DWORD, + arg4: DWORD, + arg5: FLOAT, + arg6: FLOAT, + arg7: ::std::os::raw::c_int, + arg8: LPGLYPHMETRICSFLOAT, + ) -> WINBOOL; +} +extern "C" { + pub fn wglUseFontOutlinesW( + arg1: HDC, + arg2: DWORD, + arg3: DWORD, + arg4: DWORD, + arg5: FLOAT, + arg6: FLOAT, + arg7: ::std::os::raw::c_int, + arg8: LPGLYPHMETRICSFLOAT, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLAYERPLANEDESCRIPTOR { + pub nSize: WORD, + pub nVersion: WORD, + pub dwFlags: DWORD, + pub iPixelType: BYTE, + pub cColorBits: BYTE, + pub cRedBits: BYTE, + pub cRedShift: BYTE, + pub cGreenBits: BYTE, + pub cGreenShift: BYTE, + pub cBlueBits: BYTE, + pub cBlueShift: BYTE, + pub cAlphaBits: BYTE, + pub cAlphaShift: BYTE, + pub cAccumBits: BYTE, + pub cAccumRedBits: BYTE, + pub cAccumGreenBits: BYTE, + pub cAccumBlueBits: BYTE, + pub cAccumAlphaBits: BYTE, + pub cDepthBits: BYTE, + pub cStencilBits: BYTE, + pub cAuxBuffers: BYTE, + pub iLayerPlane: BYTE, + pub bReserved: BYTE, + pub crTransparent: COLORREF, +} +pub type LAYERPLANEDESCRIPTOR = tagLAYERPLANEDESCRIPTOR; +pub type PLAYERPLANEDESCRIPTOR = *mut tagLAYERPLANEDESCRIPTOR; +pub type LPLAYERPLANEDESCRIPTOR = *mut tagLAYERPLANEDESCRIPTOR; +extern "C" { + pub fn wglDescribeLayerPlane( + arg1: HDC, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: UINT, + arg5: LPLAYERPLANEDESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn wglSetLayerPaletteEntries( + arg1: HDC, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *const COLORREF, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wglGetLayerPaletteEntries( + arg1: HDC, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: *mut COLORREF, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wglRealizeLayerPalette(arg1: HDC, arg2: ::std::os::raw::c_int, arg3: WINBOOL) + -> WINBOOL; +} +extern "C" { + pub fn wglSwapLayerBuffers(arg1: HDC, arg2: UINT) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _WGLSWAP { + pub hdc: HDC, + pub uiFlags: UINT, +} +pub type WGLSWAP = _WGLSWAP; +pub type PWGLSWAP = *mut _WGLSWAP; +pub type LPWGLSWAP = *mut _WGLSWAP; +extern "C" { + pub fn wglSwapMultipleBuffers(arg1: UINT, arg2: *const WGLSWAP) -> DWORD; +} +pub type HDWP = HANDLE; +pub type MENUTEMPLATEA = ::std::os::raw::c_void; +pub type MENUTEMPLATEW = ::std::os::raw::c_void; +pub type LPMENUTEMPLATEA = PVOID; +pub type LPMENUTEMPLATEW = PVOID; +pub type MENUTEMPLATE = MENUTEMPLATEA; +pub type LPMENUTEMPLATE = LPMENUTEMPLATEA; +pub type WNDPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HWND, arg2: UINT, arg3: WPARAM, arg4: LPARAM) -> LRESULT, +>; +pub type DLGPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HWND, arg2: UINT, arg3: WPARAM, arg4: LPARAM) -> INT_PTR, +>; +pub type TIMERPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HWND, arg2: UINT, arg3: UINT_PTR, arg4: DWORD), +>; +pub type GRAYSTRINGPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HDC, arg2: LPARAM, arg3: ::std::os::raw::c_int) -> WINBOOL, +>; +pub type WNDENUMPROC = + ::std::option::Option WINBOOL>; +pub type HOOKPROC = ::std::option::Option< + unsafe extern "C" fn(code: ::std::os::raw::c_int, wParam: WPARAM, lParam: LPARAM) -> LRESULT, +>; +pub type SENDASYNCPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HWND, arg2: UINT, arg3: ULONG_PTR, arg4: LRESULT), +>; +pub type PROPENUMPROCA = + ::std::option::Option WINBOOL>; +pub type PROPENUMPROCW = + ::std::option::Option WINBOOL>; +pub type PROPENUMPROCEXA = ::std::option::Option< + unsafe extern "C" fn(arg1: HWND, arg2: LPSTR, arg3: HANDLE, arg4: ULONG_PTR) -> WINBOOL, +>; +pub type PROPENUMPROCEXW = ::std::option::Option< + unsafe extern "C" fn(arg1: HWND, arg2: LPWSTR, arg3: HANDLE, arg4: ULONG_PTR) -> WINBOOL, +>; +pub type EDITWORDBREAKPROCA = ::std::option::Option< + unsafe extern "C" fn( + lpch: LPSTR, + ichCurrent: ::std::os::raw::c_int, + cch: ::std::os::raw::c_int, + code: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, +>; +pub type EDITWORDBREAKPROCW = ::std::option::Option< + unsafe extern "C" fn( + lpch: LPWSTR, + ichCurrent: ::std::os::raw::c_int, + cch: ::std::os::raw::c_int, + code: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, +>; +pub type DRAWSTATEPROC = ::std::option::Option< + unsafe extern "C" fn( + hdc: HDC, + lData: LPARAM, + wData: WPARAM, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + ) -> WINBOOL, +>; +pub type PROPENUMPROC = PROPENUMPROCA; +pub type PROPENUMPROCEX = PROPENUMPROCEXA; +pub type EDITWORDBREAKPROC = EDITWORDBREAKPROCA; +pub type NAMEENUMPROCA = + ::std::option::Option WINBOOL>; +pub type NAMEENUMPROCW = + ::std::option::Option WINBOOL>; +pub type WINSTAENUMPROCA = NAMEENUMPROCA; +pub type WINSTAENUMPROCW = NAMEENUMPROCW; +pub type DESKTOPENUMPROCA = NAMEENUMPROCA; +pub type DESKTOPENUMPROCW = NAMEENUMPROCW; +pub type WINSTAENUMPROC = WINSTAENUMPROCA; +pub type DESKTOPENUMPROC = DESKTOPENUMPROCA; +extern "C" { + pub fn wvsprintfA(arg1: LPSTR, arg2: LPCSTR, arglist: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wvsprintfW(arg1: LPWSTR, arg2: LPCWSTR, arglist: va_list) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wsprintfA(arg1: LPSTR, arg2: LPCSTR, ...) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wsprintfW(arg1: LPWSTR, arg2: LPCWSTR, ...) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCBT_CREATEWNDA { + pub lpcs: *mut tagCREATESTRUCTA, + pub hwndInsertAfter: HWND, +} +pub type CBT_CREATEWNDA = tagCBT_CREATEWNDA; +pub type LPCBT_CREATEWNDA = *mut tagCBT_CREATEWNDA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCBT_CREATEWNDW { + pub lpcs: *mut tagCREATESTRUCTW, + pub hwndInsertAfter: HWND, +} +pub type CBT_CREATEWNDW = tagCBT_CREATEWNDW; +pub type LPCBT_CREATEWNDW = *mut tagCBT_CREATEWNDW; +pub type CBT_CREATEWND = CBT_CREATEWNDA; +pub type LPCBT_CREATEWND = LPCBT_CREATEWNDA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCBTACTIVATESTRUCT { + pub fMouse: WINBOOL, + pub hWndActive: HWND, +} +pub type CBTACTIVATESTRUCT = tagCBTACTIVATESTRUCT; +pub type LPCBTACTIVATESTRUCT = *mut tagCBTACTIVATESTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWTSSESSION_NOTIFICATION { + pub cbSize: DWORD, + pub dwSessionId: DWORD, +} +pub type WTSSESSION_NOTIFICATION = tagWTSSESSION_NOTIFICATION; +pub type PWTSSESSION_NOTIFICATION = *mut tagWTSSESSION_NOTIFICATION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SHELLHOOKINFO { + pub hwnd: HWND, + pub rc: RECT, +} +pub type LPSHELLHOOKINFO = *mut SHELLHOOKINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagEVENTMSG { + pub message: UINT, + pub paramL: UINT, + pub paramH: UINT, + pub time: DWORD, + pub hwnd: HWND, +} +pub type EVENTMSG = tagEVENTMSG; +pub type PEVENTMSGMSG = *mut tagEVENTMSG; +pub type NPEVENTMSGMSG = *mut tagEVENTMSG; +pub type LPEVENTMSGMSG = *mut tagEVENTMSG; +pub type PEVENTMSG = *mut tagEVENTMSG; +pub type NPEVENTMSG = *mut tagEVENTMSG; +pub type LPEVENTMSG = *mut tagEVENTMSG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCWPSTRUCT { + pub lParam: LPARAM, + pub wParam: WPARAM, + pub message: UINT, + pub hwnd: HWND, +} +pub type CWPSTRUCT = tagCWPSTRUCT; +pub type PCWPSTRUCT = *mut tagCWPSTRUCT; +pub type NPCWPSTRUCT = *mut tagCWPSTRUCT; +pub type LPCWPSTRUCT = *mut tagCWPSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCWPRETSTRUCT { + pub lResult: LRESULT, + pub lParam: LPARAM, + pub wParam: WPARAM, + pub message: UINT, + pub hwnd: HWND, +} +pub type CWPRETSTRUCT = tagCWPRETSTRUCT; +pub type PCWPRETSTRUCT = *mut tagCWPRETSTRUCT; +pub type NPCWPRETSTRUCT = *mut tagCWPRETSTRUCT; +pub type LPCWPRETSTRUCT = *mut tagCWPRETSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagKBDLLHOOKSTRUCT { + pub vkCode: DWORD, + pub scanCode: DWORD, + pub flags: DWORD, + pub time: DWORD, + pub dwExtraInfo: ULONG_PTR, +} +pub type KBDLLHOOKSTRUCT = tagKBDLLHOOKSTRUCT; +pub type LPKBDLLHOOKSTRUCT = *mut tagKBDLLHOOKSTRUCT; +pub type PKBDLLHOOKSTRUCT = *mut tagKBDLLHOOKSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMSLLHOOKSTRUCT { + pub pt: POINT, + pub mouseData: DWORD, + pub flags: DWORD, + pub time: DWORD, + pub dwExtraInfo: ULONG_PTR, +} +pub type MSLLHOOKSTRUCT = tagMSLLHOOKSTRUCT; +pub type LPMSLLHOOKSTRUCT = *mut tagMSLLHOOKSTRUCT; +pub type PMSLLHOOKSTRUCT = *mut tagMSLLHOOKSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDEBUGHOOKINFO { + pub idThread: DWORD, + pub idThreadInstaller: DWORD, + pub lParam: LPARAM, + pub wParam: WPARAM, + pub code: ::std::os::raw::c_int, +} +pub type DEBUGHOOKINFO = tagDEBUGHOOKINFO; +pub type PDEBUGHOOKINFO = *mut tagDEBUGHOOKINFO; +pub type NPDEBUGHOOKINFO = *mut tagDEBUGHOOKINFO; +pub type LPDEBUGHOOKINFO = *mut tagDEBUGHOOKINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMOUSEHOOKSTRUCT { + pub pt: POINT, + pub hwnd: HWND, + pub wHitTestCode: UINT, + pub dwExtraInfo: ULONG_PTR, +} +pub type MOUSEHOOKSTRUCT = tagMOUSEHOOKSTRUCT; +pub type LPMOUSEHOOKSTRUCT = *mut tagMOUSEHOOKSTRUCT; +pub type PMOUSEHOOKSTRUCT = *mut tagMOUSEHOOKSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMOUSEHOOKSTRUCTEX { + pub __unnamed: MOUSEHOOKSTRUCT, + pub mouseData: DWORD, +} +pub type MOUSEHOOKSTRUCTEX = tagMOUSEHOOKSTRUCTEX; +pub type LPMOUSEHOOKSTRUCTEX = *mut tagMOUSEHOOKSTRUCTEX; +pub type PMOUSEHOOKSTRUCTEX = *mut tagMOUSEHOOKSTRUCTEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHARDWAREHOOKSTRUCT { + pub hwnd: HWND, + pub message: UINT, + pub wParam: WPARAM, + pub lParam: LPARAM, +} +pub type HARDWAREHOOKSTRUCT = tagHARDWAREHOOKSTRUCT; +pub type LPHARDWAREHOOKSTRUCT = *mut tagHARDWAREHOOKSTRUCT; +pub type PHARDWAREHOOKSTRUCT = *mut tagHARDWAREHOOKSTRUCT; +extern "C" { + pub fn LoadKeyboardLayoutA(pwszKLID: LPCSTR, Flags: UINT) -> HKL; +} +extern "C" { + pub fn LoadKeyboardLayoutW(pwszKLID: LPCWSTR, Flags: UINT) -> HKL; +} +extern "C" { + pub fn ActivateKeyboardLayout(hkl: HKL, Flags: UINT) -> HKL; +} +extern "C" { + pub fn ToUnicodeEx( + wVirtKey: UINT, + wScanCode: UINT, + lpKeyState: *const BYTE, + pwszBuff: LPWSTR, + cchBuff: ::std::os::raw::c_int, + wFlags: UINT, + dwhkl: HKL, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn UnloadKeyboardLayout(hkl: HKL) -> WINBOOL; +} +extern "C" { + pub fn GetKeyboardLayoutNameA(pwszKLID: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn GetKeyboardLayoutNameW(pwszKLID: LPWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetKeyboardLayoutList( + nBuff: ::std::os::raw::c_int, + lpList: *mut HKL, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetKeyboardLayout(idThread: DWORD) -> HKL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMOUSEMOVEPOINT { + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub time: DWORD, + pub dwExtraInfo: ULONG_PTR, +} +pub type MOUSEMOVEPOINT = tagMOUSEMOVEPOINT; +pub type PMOUSEMOVEPOINT = *mut tagMOUSEMOVEPOINT; +pub type LPMOUSEMOVEPOINT = *mut tagMOUSEMOVEPOINT; +extern "C" { + pub fn GetMouseMovePointsEx( + cbSize: UINT, + lppt: LPMOUSEMOVEPOINT, + lpptBuf: LPMOUSEMOVEPOINT, + nBufPoints: ::std::os::raw::c_int, + resolution: DWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CreateDesktopA( + lpszDesktop: LPCSTR, + lpszDevice: LPCSTR, + pDevmode: LPDEVMODEA, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HDESK; +} +extern "C" { + pub fn CreateDesktopW( + lpszDesktop: LPCWSTR, + lpszDevice: LPCWSTR, + pDevmode: LPDEVMODEW, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HDESK; +} +extern "C" { + pub fn CreateDesktopExA( + lpszDesktop: LPCSTR, + lpszDevice: LPCSTR, + pDevmode: *mut DEVMODEA, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ulHeapSize: ULONG, + pvoid: PVOID, + ) -> HDESK; +} +extern "C" { + pub fn CreateDesktopExW( + lpszDesktop: LPCWSTR, + lpszDevice: LPCWSTR, + pDevmode: *mut DEVMODEW, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ulHeapSize: ULONG, + pvoid: PVOID, + ) -> HDESK; +} +extern "C" { + pub fn OpenDesktopA( + lpszDesktop: LPCSTR, + dwFlags: DWORD, + fInherit: WINBOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HDESK; +} +extern "C" { + pub fn OpenDesktopW( + lpszDesktop: LPCWSTR, + dwFlags: DWORD, + fInherit: WINBOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HDESK; +} +extern "C" { + pub fn OpenInputDesktop( + dwFlags: DWORD, + fInherit: WINBOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HDESK; +} +extern "C" { + pub fn EnumDesktopsA(hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROCA, lParam: LPARAM) + -> WINBOOL; +} +extern "C" { + pub fn EnumDesktopsW(hwinsta: HWINSTA, lpEnumFunc: DESKTOPENUMPROCW, lParam: LPARAM) + -> WINBOOL; +} +extern "C" { + pub fn EnumDesktopWindows(hDesktop: HDESK, lpfn: WNDENUMPROC, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn SwitchDesktop(hDesktop: HDESK) -> WINBOOL; +} +extern "C" { + pub fn SetThreadDesktop(hDesktop: HDESK) -> WINBOOL; +} +extern "C" { + pub fn CloseDesktop(hDesktop: HDESK) -> WINBOOL; +} +extern "C" { + pub fn GetThreadDesktop(dwThreadId: DWORD) -> HDESK; +} +extern "C" { + pub fn CreateWindowStationA( + lpwinsta: LPCSTR, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HWINSTA; +} +extern "C" { + pub fn CreateWindowStationW( + lpwinsta: LPCWSTR, + dwFlags: DWORD, + dwDesiredAccess: ACCESS_MASK, + lpsa: LPSECURITY_ATTRIBUTES, + ) -> HWINSTA; +} +extern "C" { + pub fn OpenWindowStationA( + lpszWinSta: LPCSTR, + fInherit: WINBOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HWINSTA; +} +extern "C" { + pub fn OpenWindowStationW( + lpszWinSta: LPCWSTR, + fInherit: WINBOOL, + dwDesiredAccess: ACCESS_MASK, + ) -> HWINSTA; +} +extern "C" { + pub fn EnumWindowStationsA(lpEnumFunc: WINSTAENUMPROCA, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn EnumWindowStationsW(lpEnumFunc: WINSTAENUMPROCW, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn CloseWindowStation(hWinSta: HWINSTA) -> WINBOOL; +} +extern "C" { + pub fn SetProcessWindowStation(hWinSta: HWINSTA) -> WINBOOL; +} +extern "C" { + pub fn GetProcessWindowStation() -> HWINSTA; +} +extern "C" { + pub fn SetUserObjectSecurity( + hObj: HANDLE, + pSIRequested: PSECURITY_INFORMATION, + pSID: PSECURITY_DESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetUserObjectSecurity( + hObj: HANDLE, + pSIRequested: PSECURITY_INFORMATION, + pSID: PSECURITY_DESCRIPTOR, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagUSEROBJECTFLAGS { + pub fInherit: WINBOOL, + pub fReserved: WINBOOL, + pub dwFlags: DWORD, +} +pub type USEROBJECTFLAGS = tagUSEROBJECTFLAGS; +pub type PUSEROBJECTFLAGS = *mut tagUSEROBJECTFLAGS; +extern "C" { + pub fn GetUserObjectInformationA( + hObj: HANDLE, + nIndex: ::std::os::raw::c_int, + pvInfo: PVOID, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetUserObjectInformationW( + hObj: HANDLE, + nIndex: ::std::os::raw::c_int, + pvInfo: PVOID, + nLength: DWORD, + lpnLengthNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetUserObjectInformationA( + hObj: HANDLE, + nIndex: ::std::os::raw::c_int, + pvInfo: PVOID, + nLength: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SetUserObjectInformationW( + hObj: HANDLE, + nIndex: ::std::os::raw::c_int, + pvInfo: PVOID, + nLength: DWORD, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWNDCLASSEXA { + pub cbSize: UINT, + pub style: UINT, + pub lpfnWndProc: WNDPROC, + pub cbClsExtra: ::std::os::raw::c_int, + pub cbWndExtra: ::std::os::raw::c_int, + pub hInstance: HINSTANCE, + pub hIcon: HICON, + pub hCursor: HCURSOR, + pub hbrBackground: HBRUSH, + pub lpszMenuName: LPCSTR, + pub lpszClassName: LPCSTR, + pub hIconSm: HICON, +} +pub type WNDCLASSEXA = tagWNDCLASSEXA; +pub type PWNDCLASSEXA = *mut tagWNDCLASSEXA; +pub type NPWNDCLASSEXA = *mut tagWNDCLASSEXA; +pub type LPWNDCLASSEXA = *mut tagWNDCLASSEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWNDCLASSEXW { + pub cbSize: UINT, + pub style: UINT, + pub lpfnWndProc: WNDPROC, + pub cbClsExtra: ::std::os::raw::c_int, + pub cbWndExtra: ::std::os::raw::c_int, + pub hInstance: HINSTANCE, + pub hIcon: HICON, + pub hCursor: HCURSOR, + pub hbrBackground: HBRUSH, + pub lpszMenuName: LPCWSTR, + pub lpszClassName: LPCWSTR, + pub hIconSm: HICON, +} +pub type WNDCLASSEXW = tagWNDCLASSEXW; +pub type PWNDCLASSEXW = *mut tagWNDCLASSEXW; +pub type NPWNDCLASSEXW = *mut tagWNDCLASSEXW; +pub type LPWNDCLASSEXW = *mut tagWNDCLASSEXW; +pub type WNDCLASSEX = WNDCLASSEXA; +pub type PWNDCLASSEX = PWNDCLASSEXA; +pub type NPWNDCLASSEX = NPWNDCLASSEXA; +pub type LPWNDCLASSEX = LPWNDCLASSEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWNDCLASSA { + pub style: UINT, + pub lpfnWndProc: WNDPROC, + pub cbClsExtra: ::std::os::raw::c_int, + pub cbWndExtra: ::std::os::raw::c_int, + pub hInstance: HINSTANCE, + pub hIcon: HICON, + pub hCursor: HCURSOR, + pub hbrBackground: HBRUSH, + pub lpszMenuName: LPCSTR, + pub lpszClassName: LPCSTR, +} +pub type WNDCLASSA = tagWNDCLASSA; +pub type PWNDCLASSA = *mut tagWNDCLASSA; +pub type NPWNDCLASSA = *mut tagWNDCLASSA; +pub type LPWNDCLASSA = *mut tagWNDCLASSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWNDCLASSW { + pub style: UINT, + pub lpfnWndProc: WNDPROC, + pub cbClsExtra: ::std::os::raw::c_int, + pub cbWndExtra: ::std::os::raw::c_int, + pub hInstance: HINSTANCE, + pub hIcon: HICON, + pub hCursor: HCURSOR, + pub hbrBackground: HBRUSH, + pub lpszMenuName: LPCWSTR, + pub lpszClassName: LPCWSTR, +} +pub type WNDCLASSW = tagWNDCLASSW; +pub type PWNDCLASSW = *mut tagWNDCLASSW; +pub type NPWNDCLASSW = *mut tagWNDCLASSW; +pub type LPWNDCLASSW = *mut tagWNDCLASSW; +pub type WNDCLASS = WNDCLASSA; +pub type PWNDCLASS = PWNDCLASSA; +pub type NPWNDCLASS = NPWNDCLASSA; +pub type LPWNDCLASS = LPWNDCLASSA; +extern "C" { + pub fn IsHungAppWindow(hwnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn DisableProcessWindowsGhosting(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMSG { + pub hwnd: HWND, + pub message: UINT, + pub wParam: WPARAM, + pub lParam: LPARAM, + pub time: DWORD, + pub pt: POINT, +} +pub type MSG = tagMSG; +pub type PMSG = *mut tagMSG; +pub type NPMSG = *mut tagMSG; +pub type LPMSG = *mut tagMSG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMINMAXINFO { + pub ptReserved: POINT, + pub ptMaxSize: POINT, + pub ptMaxPosition: POINT, + pub ptMinTrackSize: POINT, + pub ptMaxTrackSize: POINT, +} +pub type MINMAXINFO = tagMINMAXINFO; +pub type PMINMAXINFO = *mut tagMINMAXINFO; +pub type LPMINMAXINFO = *mut tagMINMAXINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOPYDATASTRUCT { + pub dwData: ULONG_PTR, + pub cbData: DWORD, + pub lpData: PVOID, +} +pub type COPYDATASTRUCT = tagCOPYDATASTRUCT; +pub type PCOPYDATASTRUCT = *mut tagCOPYDATASTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMDINEXTMENU { + pub hmenuIn: HMENU, + pub hmenuNext: HMENU, + pub hwndNext: HWND, +} +pub type MDINEXTMENU = tagMDINEXTMENU; +pub type PMDINEXTMENU = *mut tagMDINEXTMENU; +pub type LPMDINEXTMENU = *mut tagMDINEXTMENU; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct POWERBROADCAST_SETTING { + pub PowerSetting: GUID, + pub DataLength: DWORD, + pub Data: [UCHAR; 1usize], +} +pub type PPOWERBROADCAST_SETTING = *mut POWERBROADCAST_SETTING; +extern "C" { + pub fn RegisterWindowMessageA(lpString: LPCSTR) -> UINT; +} +extern "C" { + pub fn RegisterWindowMessageW(lpString: LPCWSTR) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWINDOWPOS { + pub hwnd: HWND, + pub hwndInsertAfter: HWND, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub flags: UINT, +} +pub type WINDOWPOS = tagWINDOWPOS; +pub type LPWINDOWPOS = *mut tagWINDOWPOS; +pub type PWINDOWPOS = *mut tagWINDOWPOS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNCCALCSIZE_PARAMS { + pub rgrc: [RECT; 3usize], + pub lppos: PWINDOWPOS, +} +pub type NCCALCSIZE_PARAMS = tagNCCALCSIZE_PARAMS; +pub type LPNCCALCSIZE_PARAMS = *mut tagNCCALCSIZE_PARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTRACKMOUSEEVENT { + pub cbSize: DWORD, + pub dwFlags: DWORD, + pub hwndTrack: HWND, + pub dwHoverTime: DWORD, +} +pub type TRACKMOUSEEVENT = tagTRACKMOUSEEVENT; +pub type LPTRACKMOUSEEVENT = *mut tagTRACKMOUSEEVENT; +extern "C" { + pub fn TrackMouseEvent(lpEventTrack: LPTRACKMOUSEEVENT) -> WINBOOL; +} +extern "C" { + pub fn DrawEdge(hdc: HDC, qrc: LPRECT, edge: UINT, grfFlags: UINT) -> WINBOOL; +} +extern "C" { + pub fn DrawFrameControl(arg1: HDC, arg2: LPRECT, arg3: UINT, arg4: UINT) -> WINBOOL; +} +extern "C" { + pub fn DrawCaption(hwnd: HWND, hdc: HDC, lprect: *const RECT, flags: UINT) -> WINBOOL; +} +extern "C" { + pub fn DrawAnimatedRects( + hwnd: HWND, + idAni: ::std::os::raw::c_int, + lprcFrom: *const RECT, + lprcTo: *const RECT, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACCEL { + pub fVirt: BYTE, + pub key: WORD, + pub cmd: WORD, +} +pub type ACCEL = tagACCEL; +pub type LPACCEL = *mut tagACCEL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagPAINTSTRUCT { + pub hdc: HDC, + pub fErase: WINBOOL, + pub rcPaint: RECT, + pub fRestore: WINBOOL, + pub fIncUpdate: WINBOOL, + pub rgbReserved: [BYTE; 32usize], +} +pub type PAINTSTRUCT = tagPAINTSTRUCT; +pub type PPAINTSTRUCT = *mut tagPAINTSTRUCT; +pub type NPPAINTSTRUCT = *mut tagPAINTSTRUCT; +pub type LPPAINTSTRUCT = *mut tagPAINTSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCREATESTRUCTA { + pub lpCreateParams: LPVOID, + pub hInstance: HINSTANCE, + pub hMenu: HMENU, + pub hwndParent: HWND, + pub cy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub x: ::std::os::raw::c_int, + pub style: LONG, + pub lpszName: LPCSTR, + pub lpszClass: LPCSTR, + pub dwExStyle: DWORD, +} +pub type CREATESTRUCTA = tagCREATESTRUCTA; +pub type LPCREATESTRUCTA = *mut tagCREATESTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCREATESTRUCTW { + pub lpCreateParams: LPVOID, + pub hInstance: HINSTANCE, + pub hMenu: HMENU, + pub hwndParent: HWND, + pub cy: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub x: ::std::os::raw::c_int, + pub style: LONG, + pub lpszName: LPCWSTR, + pub lpszClass: LPCWSTR, + pub dwExStyle: DWORD, +} +pub type CREATESTRUCTW = tagCREATESTRUCTW; +pub type LPCREATESTRUCTW = *mut tagCREATESTRUCTW; +pub type CREATESTRUCT = CREATESTRUCTA; +pub type LPCREATESTRUCT = LPCREATESTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWINDOWPLACEMENT { + pub length: UINT, + pub flags: UINT, + pub showCmd: UINT, + pub ptMinPosition: POINT, + pub ptMaxPosition: POINT, + pub rcNormalPosition: RECT, +} +pub type WINDOWPLACEMENT = tagWINDOWPLACEMENT; +pub type PWINDOWPLACEMENT = *mut WINDOWPLACEMENT; +pub type LPWINDOWPLACEMENT = *mut WINDOWPLACEMENT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNMHDR { + pub hwndFrom: HWND, + pub idFrom: UINT_PTR, + pub code: UINT, +} +pub type NMHDR = tagNMHDR; +pub type LPNMHDR = *mut NMHDR; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSTYLESTRUCT { + pub styleOld: DWORD, + pub styleNew: DWORD, +} +pub type STYLESTRUCT = tagSTYLESTRUCT; +pub type LPSTYLESTRUCT = *mut tagSTYLESTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMEASUREITEMSTRUCT { + pub CtlType: UINT, + pub CtlID: UINT, + pub itemID: UINT, + pub itemWidth: UINT, + pub itemHeight: UINT, + pub itemData: ULONG_PTR, +} +pub type MEASUREITEMSTRUCT = tagMEASUREITEMSTRUCT; +pub type PMEASUREITEMSTRUCT = *mut tagMEASUREITEMSTRUCT; +pub type LPMEASUREITEMSTRUCT = *mut tagMEASUREITEMSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDRAWITEMSTRUCT { + pub CtlType: UINT, + pub CtlID: UINT, + pub itemID: UINT, + pub itemAction: UINT, + pub itemState: UINT, + pub hwndItem: HWND, + pub hDC: HDC, + pub rcItem: RECT, + pub itemData: ULONG_PTR, +} +pub type DRAWITEMSTRUCT = tagDRAWITEMSTRUCT; +pub type PDRAWITEMSTRUCT = *mut tagDRAWITEMSTRUCT; +pub type LPDRAWITEMSTRUCT = *mut tagDRAWITEMSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDELETEITEMSTRUCT { + pub CtlType: UINT, + pub CtlID: UINT, + pub itemID: UINT, + pub hwndItem: HWND, + pub itemData: ULONG_PTR, +} +pub type DELETEITEMSTRUCT = tagDELETEITEMSTRUCT; +pub type PDELETEITEMSTRUCT = *mut tagDELETEITEMSTRUCT; +pub type LPDELETEITEMSTRUCT = *mut tagDELETEITEMSTRUCT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOMPAREITEMSTRUCT { + pub CtlType: UINT, + pub CtlID: UINT, + pub hwndItem: HWND, + pub itemID1: UINT, + pub itemData1: ULONG_PTR, + pub itemID2: UINT, + pub itemData2: ULONG_PTR, + pub dwLocaleId: DWORD, +} +pub type COMPAREITEMSTRUCT = tagCOMPAREITEMSTRUCT; +pub type PCOMPAREITEMSTRUCT = *mut tagCOMPAREITEMSTRUCT; +pub type LPCOMPAREITEMSTRUCT = *mut tagCOMPAREITEMSTRUCT; +extern "C" { + pub fn GetMessageA( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetMessageW( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn TranslateMessage(lpMsg: *const MSG) -> WINBOOL; +} +extern "C" { + pub fn DispatchMessageA(lpMsg: *const MSG) -> LRESULT; +} +extern "C" { + pub fn DispatchMessageW(lpMsg: *const MSG) -> LRESULT; +} +extern "C" { + pub fn SetMessageQueue(cMessagesMax: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn PeekMessageA( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + wRemoveMsg: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn PeekMessageW( + lpMsg: LPMSG, + hWnd: HWND, + wMsgFilterMin: UINT, + wMsgFilterMax: UINT, + wRemoveMsg: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn RegisterHotKey( + hWnd: HWND, + id: ::std::os::raw::c_int, + fsModifiers: UINT, + vk: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn UnregisterHotKey(hWnd: HWND, id: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn ExitWindowsEx(uFlags: UINT, dwReason: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SwapMouseButton(fSwap: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetMessagePos() -> DWORD; +} +extern "C" { + pub fn GetMessageTime() -> LONG; +} +extern "C" { + pub fn GetMessageExtraInfo() -> LPARAM; +} +extern "C" { + pub fn IsWow64Message() -> WINBOOL; +} +extern "C" { + pub fn SetMessageExtraInfo(lParam: LPARAM) -> LPARAM; +} +extern "C" { + pub fn SendMessageA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn SendMessageW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn SendMessageTimeoutA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + fuFlags: UINT, + uTimeout: UINT, + lpdwResult: PDWORD_PTR, + ) -> LRESULT; +} +extern "C" { + pub fn SendMessageTimeoutW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + fuFlags: UINT, + uTimeout: UINT, + lpdwResult: PDWORD_PTR, + ) -> LRESULT; +} +extern "C" { + pub fn SendNotifyMessageA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn SendNotifyMessageW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn SendMessageCallbackA( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + lpResultCallBack: SENDASYNCPROC, + dwData: ULONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn SendMessageCallbackW( + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + lpResultCallBack: SENDASYNCPROC, + dwData: ULONG_PTR, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct BSMINFO { + pub cbSize: UINT, + pub hdesk: HDESK, + pub hwnd: HWND, + pub luid: LUID, +} +pub type PBSMINFO = *mut BSMINFO; +extern "C" { + pub fn BroadcastSystemMessageExA( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + pbsmInfo: PBSMINFO, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn BroadcastSystemMessageExW( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + pbsmInfo: PBSMINFO, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn BroadcastSystemMessageA( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn BroadcastSystemMessageW( + flags: DWORD, + lpInfo: LPDWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> ::std::os::raw::c_long; +} +pub type HDEVNOTIFY = PVOID; +pub type PHDEVNOTIFY = *mut HDEVNOTIFY; +pub type HPOWERNOTIFY = HANDLE; +pub type PHPOWERNOTIFY = *mut HPOWERNOTIFY; +extern "C" { + pub fn RegisterPowerSettingNotification( + hRecipient: HANDLE, + PowerSettingGuid: LPCGUID, + Flags: DWORD, + ) -> HPOWERNOTIFY; +} +extern "C" { + pub fn UnregisterPowerSettingNotification(Handle: HPOWERNOTIFY) -> WINBOOL; +} +extern "C" { + pub fn RegisterSuspendResumeNotification(hRecipient: HANDLE, Flags: DWORD) -> HPOWERNOTIFY; +} +extern "C" { + pub fn UnregisterSuspendResumeNotification(Handle: HPOWERNOTIFY) -> WINBOOL; +} +extern "C" { + pub fn PostMessageA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn PostMessageW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn PostThreadMessageA( + idThread: DWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> WINBOOL; +} +extern "C" { + pub fn PostThreadMessageW( + idThread: DWORD, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> WINBOOL; +} +extern "C" { + pub fn AttachThreadInput(idAttach: DWORD, idAttachTo: DWORD, fAttach: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn ReplyMessage(lResult: LRESULT) -> WINBOOL; +} +extern "C" { + pub fn WaitMessage() -> WINBOOL; +} +extern "C" { + pub fn WaitForInputIdle(hProcess: HANDLE, dwMilliseconds: DWORD) -> DWORD; +} +extern "C" { + pub fn DefWindowProcA(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn DefWindowProcW(hWnd: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn PostQuitMessage(nExitCode: ::std::os::raw::c_int); +} +extern "C" { + pub fn InSendMessage() -> WINBOOL; +} +extern "C" { + pub fn InSendMessageEx(lpReserved: LPVOID) -> DWORD; +} +extern "C" { + pub fn GetDoubleClickTime() -> UINT; +} +extern "C" { + pub fn SetDoubleClickTime(arg1: UINT) -> WINBOOL; +} +extern "C" { + pub fn RegisterClassA(lpWndClass: *const WNDCLASSA) -> ATOM; +} +extern "C" { + pub fn RegisterClassW(lpWndClass: *const WNDCLASSW) -> ATOM; +} +extern "C" { + pub fn UnregisterClassA(lpClassName: LPCSTR, hInstance: HINSTANCE) -> WINBOOL; +} +extern "C" { + pub fn UnregisterClassW(lpClassName: LPCWSTR, hInstance: HINSTANCE) -> WINBOOL; +} +extern "C" { + pub fn GetClassInfoA( + hInstance: HINSTANCE, + lpClassName: LPCSTR, + lpWndClass: LPWNDCLASSA, + ) -> WINBOOL; +} +extern "C" { + pub fn GetClassInfoW( + hInstance: HINSTANCE, + lpClassName: LPCWSTR, + lpWndClass: LPWNDCLASSW, + ) -> WINBOOL; +} +extern "C" { + pub fn RegisterClassExA(arg1: *const WNDCLASSEXA) -> ATOM; +} +extern "C" { + pub fn RegisterClassExW(arg1: *const WNDCLASSEXW) -> ATOM; +} +extern "C" { + pub fn GetClassInfoExA( + hInstance: HINSTANCE, + lpszClass: LPCSTR, + lpwcx: LPWNDCLASSEXA, + ) -> WINBOOL; +} +extern "C" { + pub fn GetClassInfoExW( + hInstance: HINSTANCE, + lpszClass: LPCWSTR, + lpwcx: LPWNDCLASSEXW, + ) -> WINBOOL; +} +extern "C" { + pub fn CallWindowProcA( + lpPrevWndFunc: WNDPROC, + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn CallWindowProcW( + lpPrevWndFunc: WNDPROC, + hWnd: HWND, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn RegisterDeviceNotificationA( + hRecipient: HANDLE, + NotificationFilter: LPVOID, + Flags: DWORD, + ) -> HDEVNOTIFY; +} +extern "C" { + pub fn RegisterDeviceNotificationW( + hRecipient: HANDLE, + NotificationFilter: LPVOID, + Flags: DWORD, + ) -> HDEVNOTIFY; +} +extern "C" { + pub fn UnregisterDeviceNotification(Handle: HDEVNOTIFY) -> WINBOOL; +} +pub type PREGISTERCLASSNAMEW = + ::std::option::Option BOOLEAN>; +extern "C" { + pub fn CreateWindowExA( + dwExStyle: DWORD, + lpClassName: LPCSTR, + lpWindowName: LPCSTR, + dwStyle: DWORD, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + hWndParent: HWND, + hMenu: HMENU, + hInstance: HINSTANCE, + lpParam: LPVOID, + ) -> HWND; +} +extern "C" { + pub fn CreateWindowExW( + dwExStyle: DWORD, + lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, + dwStyle: DWORD, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + hWndParent: HWND, + hMenu: HMENU, + hInstance: HINSTANCE, + lpParam: LPVOID, + ) -> HWND; +} +extern "C" { + pub fn IsWindow(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn IsMenu(hMenu: HMENU) -> WINBOOL; +} +extern "C" { + pub fn IsChild(hWndParent: HWND, hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn DestroyWindow(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn ShowWindow(hWnd: HWND, nCmdShow: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn AnimateWindow(hWnd: HWND, dwTime: DWORD, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn UpdateLayeredWindow( + hWnd: HWND, + hdcDst: HDC, + pptDst: *mut POINT, + psize: *mut SIZE, + hdcSrc: HDC, + pptSrc: *mut POINT, + crKey: COLORREF, + pblend: *mut BLENDFUNCTION, + dwFlags: DWORD, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagUPDATELAYEREDWINDOWINFO { + pub cbSize: DWORD, + pub hdcDst: HDC, + pub pptDst: *const POINT, + pub psize: *const SIZE, + pub hdcSrc: HDC, + pub pptSrc: *const POINT, + pub crKey: COLORREF, + pub pblend: *const BLENDFUNCTION, + pub dwFlags: DWORD, + pub prcDirty: *const RECT, +} +pub type UPDATELAYEREDWINDOWINFO = tagUPDATELAYEREDWINDOWINFO; +pub type PUPDATELAYEREDWINDOWINFO = *mut tagUPDATELAYEREDWINDOWINFO; +extern "C" { + pub fn UpdateLayeredWindowIndirect( + hWnd: HWND, + pULWInfo: *const UPDATELAYEREDWINDOWINFO, + ) -> WINBOOL; +} +extern "C" { + pub fn GetLayeredWindowAttributes( + hwnd: HWND, + pcrKey: *mut COLORREF, + pbAlpha: *mut BYTE, + pdwFlags: *mut DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn PrintWindow(hwnd: HWND, hdcBlt: HDC, nFlags: UINT) -> WINBOOL; +} +extern "C" { + pub fn SetLayeredWindowAttributes( + hwnd: HWND, + crKey: COLORREF, + bAlpha: BYTE, + dwFlags: DWORD, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FLASHWINFO { + pub cbSize: UINT, + pub hwnd: HWND, + pub dwFlags: DWORD, + pub uCount: UINT, + pub dwTimeout: DWORD, +} +pub type PFLASHWINFO = *mut FLASHWINFO; +extern "C" { + pub fn ShowWindowAsync(hWnd: HWND, nCmdShow: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn FlashWindow(hWnd: HWND, bInvert: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn FlashWindowEx(pfwi: PFLASHWINFO) -> WINBOOL; +} +extern "C" { + pub fn ShowOwnedPopups(hWnd: HWND, fShow: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn OpenIcon(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn CloseWindow(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn MoveWindow( + hWnd: HWND, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + bRepaint: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SetWindowPos( + hWnd: HWND, + hWndInsertAfter: HWND, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + uFlags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetWindowPlacement(hWnd: HWND, lpwndpl: *mut WINDOWPLACEMENT) -> WINBOOL; +} +extern "C" { + pub fn SetWindowPlacement(hWnd: HWND, lpwndpl: *const WINDOWPLACEMENT) -> WINBOOL; +} +extern "C" { + pub fn BeginDeferWindowPos(nNumWindows: ::std::os::raw::c_int) -> HDWP; +} +extern "C" { + pub fn DeferWindowPos( + hWinPosInfo: HDWP, + hWnd: HWND, + hWndInsertAfter: HWND, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + uFlags: UINT, + ) -> HDWP; +} +extern "C" { + pub fn EndDeferWindowPos(hWinPosInfo: HDWP) -> WINBOOL; +} +extern "C" { + pub fn IsWindowVisible(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn IsIconic(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn AnyPopup() -> WINBOOL; +} +extern "C" { + pub fn BringWindowToTop(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn IsZoomed(hWnd: HWND) -> WINBOOL; +} +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct DLGTEMPLATE { + pub style: DWORD, + pub dwExtendedStyle: DWORD, + pub cdit: WORD, + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, + pub cx: ::std::os::raw::c_short, + pub cy: ::std::os::raw::c_short, +} +pub type LPDLGTEMPLATEA = *mut DLGTEMPLATE; +pub type LPDLGTEMPLATEW = *mut DLGTEMPLATE; +pub type LPDLGTEMPLATE = LPDLGTEMPLATEA; +pub type LPCDLGTEMPLATEA = *const DLGTEMPLATE; +pub type LPCDLGTEMPLATEW = *const DLGTEMPLATE; +pub type LPCDLGTEMPLATE = LPCDLGTEMPLATEA; +#[repr(C, packed(2))] +#[derive(Debug, Copy, Clone)] +pub struct DLGITEMTEMPLATE { + pub style: DWORD, + pub dwExtendedStyle: DWORD, + pub x: ::std::os::raw::c_short, + pub y: ::std::os::raw::c_short, + pub cx: ::std::os::raw::c_short, + pub cy: ::std::os::raw::c_short, + pub id: WORD, +} +pub type PDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE; +pub type PDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE; +pub type PDLGITEMTEMPLATE = PDLGITEMTEMPLATEA; +pub type LPDLGITEMTEMPLATEA = *mut DLGITEMTEMPLATE; +pub type LPDLGITEMTEMPLATEW = *mut DLGITEMTEMPLATE; +pub type LPDLGITEMTEMPLATE = LPDLGITEMTEMPLATEA; +extern "C" { + pub fn CreateDialogParamA( + hInstance: HINSTANCE, + lpTemplateName: LPCSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; +} +extern "C" { + pub fn CreateDialogParamW( + hInstance: HINSTANCE, + lpTemplateName: LPCWSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; +} +extern "C" { + pub fn CreateDialogIndirectParamA( + hInstance: HINSTANCE, + lpTemplate: LPCDLGTEMPLATEA, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; +} +extern "C" { + pub fn CreateDialogIndirectParamW( + hInstance: HINSTANCE, + lpTemplate: LPCDLGTEMPLATEW, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> HWND; +} +extern "C" { + pub fn DialogBoxParamA( + hInstance: HINSTANCE, + lpTemplateName: LPCSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; +} +extern "C" { + pub fn DialogBoxParamW( + hInstance: HINSTANCE, + lpTemplateName: LPCWSTR, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; +} +extern "C" { + pub fn DialogBoxIndirectParamA( + hInstance: HINSTANCE, + hDialogTemplate: LPCDLGTEMPLATEA, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; +} +extern "C" { + pub fn DialogBoxIndirectParamW( + hInstance: HINSTANCE, + hDialogTemplate: LPCDLGTEMPLATEW, + hWndParent: HWND, + lpDialogFunc: DLGPROC, + dwInitParam: LPARAM, + ) -> INT_PTR; +} +extern "C" { + pub fn EndDialog(hDlg: HWND, nResult: INT_PTR) -> WINBOOL; +} +extern "C" { + pub fn GetDlgItem(hDlg: HWND, nIDDlgItem: ::std::os::raw::c_int) -> HWND; +} +extern "C" { + pub fn SetDlgItemInt( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + uValue: UINT, + bSigned: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetDlgItemInt( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + lpTranslated: *mut WINBOOL, + bSigned: WINBOOL, + ) -> UINT; +} +extern "C" { + pub fn SetDlgItemTextA( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + lpString: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetDlgItemTextW( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + lpString: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetDlgItemTextA( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + lpString: LPSTR, + cchMax: ::std::os::raw::c_int, + ) -> UINT; +} +extern "C" { + pub fn GetDlgItemTextW( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + lpString: LPWSTR, + cchMax: ::std::os::raw::c_int, + ) -> UINT; +} +extern "C" { + pub fn CheckDlgButton(hDlg: HWND, nIDButton: ::std::os::raw::c_int, uCheck: UINT) -> WINBOOL; +} +extern "C" { + pub fn CheckRadioButton( + hDlg: HWND, + nIDFirstButton: ::std::os::raw::c_int, + nIDLastButton: ::std::os::raw::c_int, + nIDCheckButton: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn IsDlgButtonChecked(hDlg: HWND, nIDButton: ::std::os::raw::c_int) -> UINT; +} +extern "C" { + pub fn SendDlgItemMessageA( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn SendDlgItemMessageW( + hDlg: HWND, + nIDDlgItem: ::std::os::raw::c_int, + Msg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn GetNextDlgGroupItem(hDlg: HWND, hCtl: HWND, bPrevious: WINBOOL) -> HWND; +} +extern "C" { + pub fn GetNextDlgTabItem(hDlg: HWND, hCtl: HWND, bPrevious: WINBOOL) -> HWND; +} +extern "C" { + pub fn GetDlgCtrlID(hWnd: HWND) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetDialogBaseUnits() -> ::std::os::raw::c_long; +} +extern "C" { + pub fn DefDlgProcA(hDlg: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn DefDlgProcW(hDlg: HWND, Msg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn CallMsgFilterA(lpMsg: LPMSG, nCode: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn CallMsgFilterW(lpMsg: LPMSG, nCode: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn OpenClipboard(hWndNewOwner: HWND) -> WINBOOL; +} +extern "C" { + pub fn CloseClipboard() -> WINBOOL; +} +extern "C" { + pub fn GetClipboardSequenceNumber() -> DWORD; +} +extern "C" { + pub fn GetClipboardOwner() -> HWND; +} +extern "C" { + pub fn SetClipboardViewer(hWndNewViewer: HWND) -> HWND; +} +extern "C" { + pub fn GetClipboardViewer() -> HWND; +} +extern "C" { + pub fn ChangeClipboardChain(hWndRemove: HWND, hWndNewNext: HWND) -> WINBOOL; +} +extern "C" { + pub fn SetClipboardData(uFormat: UINT, hMem: HANDLE) -> HANDLE; +} +extern "C" { + pub fn GetClipboardData(uFormat: UINT) -> HANDLE; +} +extern "C" { + pub fn RegisterClipboardFormatA(lpszFormat: LPCSTR) -> UINT; +} +extern "C" { + pub fn RegisterClipboardFormatW(lpszFormat: LPCWSTR) -> UINT; +} +extern "C" { + pub fn CountClipboardFormats() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumClipboardFormats(format: UINT) -> UINT; +} +extern "C" { + pub fn GetClipboardFormatNameA( + format: UINT, + lpszFormatName: LPSTR, + cchMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetClipboardFormatNameW( + format: UINT, + lpszFormatName: LPWSTR, + cchMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EmptyClipboard() -> WINBOOL; +} +extern "C" { + pub fn IsClipboardFormatAvailable(format: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetPriorityClipboardFormat( + paFormatPriorityList: *mut UINT, + cFormats: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetOpenClipboardWindow() -> HWND; +} +extern "C" { + pub fn CharToOemA(lpszSrc: LPCSTR, lpszDst: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn CharToOemW(lpszSrc: LPCWSTR, lpszDst: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn OemToCharA(lpszSrc: LPCSTR, lpszDst: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn OemToCharW(lpszSrc: LPCSTR, lpszDst: LPWSTR) -> WINBOOL; +} +extern "C" { + pub fn CharToOemBuffA(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CharToOemBuffW(lpszSrc: LPCWSTR, lpszDst: LPSTR, cchDstLength: DWORD) -> WINBOOL; +} +extern "C" { + pub fn OemToCharBuffA(lpszSrc: LPCSTR, lpszDst: LPSTR, cchDstLength: DWORD) -> WINBOOL; +} +extern "C" { + pub fn OemToCharBuffW(lpszSrc: LPCSTR, lpszDst: LPWSTR, cchDstLength: DWORD) -> WINBOOL; +} +extern "C" { + pub fn CharUpperA(lpsz: LPSTR) -> LPSTR; +} +extern "C" { + pub fn CharUpperW(lpsz: LPWSTR) -> LPWSTR; +} +extern "C" { + pub fn CharUpperBuffA(lpsz: LPSTR, cchLength: DWORD) -> DWORD; +} +extern "C" { + pub fn CharUpperBuffW(lpsz: LPWSTR, cchLength: DWORD) -> DWORD; +} +extern "C" { + pub fn CharLowerA(lpsz: LPSTR) -> LPSTR; +} +extern "C" { + pub fn CharLowerW(lpsz: LPWSTR) -> LPWSTR; +} +extern "C" { + pub fn CharLowerBuffA(lpsz: LPSTR, cchLength: DWORD) -> DWORD; +} +extern "C" { + pub fn CharLowerBuffW(lpsz: LPWSTR, cchLength: DWORD) -> DWORD; +} +extern "C" { + pub fn CharNextA(lpsz: LPCSTR) -> LPSTR; +} +extern "C" { + pub fn CharNextW(lpsz: LPCWSTR) -> LPWSTR; +} +extern "C" { + pub fn CharPrevA(lpszStart: LPCSTR, lpszCurrent: LPCSTR) -> LPSTR; +} +extern "C" { + pub fn CharPrevW(lpszStart: LPCWSTR, lpszCurrent: LPCWSTR) -> LPWSTR; +} +extern "C" { + pub fn CharNextExA(CodePage: WORD, lpCurrentChar: LPCSTR, dwFlags: DWORD) -> LPSTR; +} +extern "C" { + pub fn CharPrevExA( + CodePage: WORD, + lpStart: LPCSTR, + lpCurrentChar: LPCSTR, + dwFlags: DWORD, + ) -> LPSTR; +} +extern "C" { + pub fn IsCharAlphaA(ch: CHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharAlphaW(ch: WCHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharAlphaNumericA(ch: CHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharAlphaNumericW(ch: WCHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharUpperA(ch: CHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharUpperW(ch: WCHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharLowerA(ch: CHAR) -> WINBOOL; +} +extern "C" { + pub fn IsCharLowerW(ch: WCHAR) -> WINBOOL; +} +extern "C" { + pub fn SetFocus(hWnd: HWND) -> HWND; +} +extern "C" { + pub fn GetActiveWindow() -> HWND; +} +extern "C" { + pub fn GetFocus() -> HWND; +} +extern "C" { + pub fn GetKBCodePage() -> UINT; +} +extern "C" { + pub fn GetKeyState(nVirtKey: ::std::os::raw::c_int) -> SHORT; +} +extern "C" { + pub fn GetAsyncKeyState(vKey: ::std::os::raw::c_int) -> SHORT; +} +extern "C" { + pub fn GetKeyboardState(lpKeyState: PBYTE) -> WINBOOL; +} +extern "C" { + pub fn SetKeyboardState(lpKeyState: LPBYTE) -> WINBOOL; +} +extern "C" { + pub fn GetKeyNameTextA( + lParam: LONG, + lpString: LPSTR, + cchSize: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetKeyNameTextW( + lParam: LONG, + lpString: LPWSTR, + cchSize: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetKeyboardType(nTypeFlag: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ToAscii( + uVirtKey: UINT, + uScanCode: UINT, + lpKeyState: *const BYTE, + lpChar: LPWORD, + uFlags: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ToAsciiEx( + uVirtKey: UINT, + uScanCode: UINT, + lpKeyState: *const BYTE, + lpChar: LPWORD, + uFlags: UINT, + dwhkl: HKL, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ToUnicode( + wVirtKey: UINT, + wScanCode: UINT, + lpKeyState: *const BYTE, + pwszBuff: LPWSTR, + cchBuff: ::std::os::raw::c_int, + wFlags: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn OemKeyScan(wOemChar: WORD) -> DWORD; +} +extern "C" { + pub fn VkKeyScanA(ch: CHAR) -> SHORT; +} +extern "C" { + pub fn VkKeyScanW(ch: WCHAR) -> SHORT; +} +extern "C" { + pub fn VkKeyScanExA(ch: CHAR, dwhkl: HKL) -> SHORT; +} +extern "C" { + pub fn VkKeyScanExW(ch: WCHAR, dwhkl: HKL) -> SHORT; +} +extern "C" { + pub fn keybd_event(bVk: BYTE, bScan: BYTE, dwFlags: DWORD, dwExtraInfo: ULONG_PTR); +} +extern "C" { + pub fn mouse_event(dwFlags: DWORD, dx: DWORD, dy: DWORD, dwData: DWORD, dwExtraInfo: ULONG_PTR); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMOUSEINPUT { + pub dx: LONG, + pub dy: LONG, + pub mouseData: DWORD, + pub dwFlags: DWORD, + pub time: DWORD, + pub dwExtraInfo: ULONG_PTR, +} +pub type MOUSEINPUT = tagMOUSEINPUT; +pub type PMOUSEINPUT = *mut tagMOUSEINPUT; +pub type LPMOUSEINPUT = *mut tagMOUSEINPUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagKEYBDINPUT { + pub wVk: WORD, + pub wScan: WORD, + pub dwFlags: DWORD, + pub time: DWORD, + pub dwExtraInfo: ULONG_PTR, +} +pub type KEYBDINPUT = tagKEYBDINPUT; +pub type PKEYBDINPUT = *mut tagKEYBDINPUT; +pub type LPKEYBDINPUT = *mut tagKEYBDINPUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHARDWAREINPUT { + pub uMsg: DWORD, + pub wParamL: WORD, + pub wParamH: WORD, +} +pub type HARDWAREINPUT = tagHARDWAREINPUT; +pub type PHARDWAREINPUT = *mut tagHARDWAREINPUT; +pub type LPHARDWAREINPUT = *mut tagHARDWAREINPUT; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagINPUT { + pub type_: DWORD, + pub __bindgen_anon_1: tagINPUT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tagINPUT__bindgen_ty_1 { + pub mi: MOUSEINPUT, + pub ki: KEYBDINPUT, + pub hi: HARDWAREINPUT, + _bindgen_union_align: [u64; 4usize], +} +pub type INPUT = tagINPUT; +pub type PINPUT = *mut tagINPUT; +pub type LPINPUT = *mut tagINPUT; +extern "C" { + pub fn SendInput(cInputs: UINT, pInputs: LPINPUT, cbSize: ::std::os::raw::c_int) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagLASTINPUTINFO { + pub cbSize: UINT, + pub dwTime: DWORD, +} +pub type LASTINPUTINFO = tagLASTINPUTINFO; +pub type PLASTINPUTINFO = *mut tagLASTINPUTINFO; +extern "C" { + pub fn GetLastInputInfo(plii: PLASTINPUTINFO) -> WINBOOL; +} +extern "C" { + pub fn MapVirtualKeyA(uCode: UINT, uMapType: UINT) -> UINT; +} +extern "C" { + pub fn MapVirtualKeyW(uCode: UINT, uMapType: UINT) -> UINT; +} +extern "C" { + pub fn MapVirtualKeyExA(uCode: UINT, uMapType: UINT, dwhkl: HKL) -> UINT; +} +extern "C" { + pub fn MapVirtualKeyExW(uCode: UINT, uMapType: UINT, dwhkl: HKL) -> UINT; +} +extern "C" { + pub fn GetInputState() -> WINBOOL; +} +extern "C" { + pub fn GetQueueStatus(flags: UINT) -> DWORD; +} +extern "C" { + pub fn GetCapture() -> HWND; +} +extern "C" { + pub fn SetCapture(hWnd: HWND) -> HWND; +} +extern "C" { + pub fn ReleaseCapture() -> WINBOOL; +} +extern "C" { + pub fn MsgWaitForMultipleObjects( + nCount: DWORD, + pHandles: *const HANDLE, + fWaitAll: WINBOOL, + dwMilliseconds: DWORD, + dwWakeMask: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn MsgWaitForMultipleObjectsEx( + nCount: DWORD, + pHandles: *const HANDLE, + dwMilliseconds: DWORD, + dwWakeMask: DWORD, + dwFlags: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn SetTimer( + hWnd: HWND, + nIDEvent: UINT_PTR, + uElapse: UINT, + lpTimerFunc: TIMERPROC, + ) -> UINT_PTR; +} +extern "C" { + pub fn KillTimer(hWnd: HWND, uIDEvent: UINT_PTR) -> WINBOOL; +} +extern "C" { + pub fn IsWindowUnicode(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn EnableWindow(hWnd: HWND, bEnable: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn IsWindowEnabled(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn LoadAcceleratorsA(hInstance: HINSTANCE, lpTableName: LPCSTR) -> HACCEL; +} +extern "C" { + pub fn LoadAcceleratorsW(hInstance: HINSTANCE, lpTableName: LPCWSTR) -> HACCEL; +} +extern "C" { + pub fn CreateAcceleratorTableA(paccel: LPACCEL, cAccel: ::std::os::raw::c_int) -> HACCEL; +} +extern "C" { + pub fn CreateAcceleratorTableW(paccel: LPACCEL, cAccel: ::std::os::raw::c_int) -> HACCEL; +} +extern "C" { + pub fn DestroyAcceleratorTable(hAccel: HACCEL) -> WINBOOL; +} +extern "C" { + pub fn CopyAcceleratorTableA( + hAccelSrc: HACCEL, + lpAccelDst: LPACCEL, + cAccelEntries: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CopyAcceleratorTableW( + hAccelSrc: HACCEL, + lpAccelDst: LPACCEL, + cAccelEntries: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TranslateAcceleratorA( + hWnd: HWND, + hAccTable: HACCEL, + lpMsg: LPMSG, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn TranslateAcceleratorW( + hWnd: HWND, + hAccTable: HACCEL, + lpMsg: LPMSG, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetSystemMetrics(nIndex: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn LoadMenuA(hInstance: HINSTANCE, lpMenuName: LPCSTR) -> HMENU; +} +extern "C" { + pub fn LoadMenuW(hInstance: HINSTANCE, lpMenuName: LPCWSTR) -> HMENU; +} +extern "C" { + pub fn LoadMenuIndirectA(lpMenuTemplate: *const MENUTEMPLATEA) -> HMENU; +} +extern "C" { + pub fn LoadMenuIndirectW(lpMenuTemplate: *const MENUTEMPLATEW) -> HMENU; +} +extern "C" { + pub fn GetMenu(hWnd: HWND) -> HMENU; +} +extern "C" { + pub fn SetMenu(hWnd: HWND, hMenu: HMENU) -> WINBOOL; +} +extern "C" { + pub fn ChangeMenuA( + hMenu: HMENU, + cmd: UINT, + lpszNewItem: LPCSTR, + cmdInsert: UINT, + flags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn ChangeMenuW( + hMenu: HMENU, + cmd: UINT, + lpszNewItem: LPCWSTR, + cmdInsert: UINT, + flags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn HiliteMenuItem(hWnd: HWND, hMenu: HMENU, uIDHiliteItem: UINT, uHilite: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetMenuStringA( + hMenu: HMENU, + uIDItem: UINT, + lpString: LPSTR, + cchMax: ::std::os::raw::c_int, + flags: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetMenuStringW( + hMenu: HMENU, + uIDItem: UINT, + lpString: LPWSTR, + cchMax: ::std::os::raw::c_int, + flags: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetMenuState(hMenu: HMENU, uId: UINT, uFlags: UINT) -> UINT; +} +extern "C" { + pub fn DrawMenuBar(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn GetSystemMenu(hWnd: HWND, bRevert: WINBOOL) -> HMENU; +} +extern "C" { + pub fn CreateMenu() -> HMENU; +} +extern "C" { + pub fn CreatePopupMenu() -> HMENU; +} +extern "C" { + pub fn DestroyMenu(hMenu: HMENU) -> WINBOOL; +} +extern "C" { + pub fn CheckMenuItem(hMenu: HMENU, uIDCheckItem: UINT, uCheck: UINT) -> DWORD; +} +extern "C" { + pub fn EnableMenuItem(hMenu: HMENU, uIDEnableItem: UINT, uEnable: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetSubMenu(hMenu: HMENU, nPos: ::std::os::raw::c_int) -> HMENU; +} +extern "C" { + pub fn GetMenuItemID(hMenu: HMENU, nPos: ::std::os::raw::c_int) -> UINT; +} +extern "C" { + pub fn GetMenuItemCount(hMenu: HMENU) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn InsertMenuA( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn InsertMenuW( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn AppendMenuA( + hMenu: HMENU, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn AppendMenuW( + hMenu: HMENU, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ModifyMenuA( + hMnu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ModifyMenuW( + hMnu: HMENU, + uPosition: UINT, + uFlags: UINT, + uIDNewItem: UINT_PTR, + lpNewItem: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn RemoveMenu(hMenu: HMENU, uPosition: UINT, uFlags: UINT) -> WINBOOL; +} +extern "C" { + pub fn DeleteMenu(hMenu: HMENU, uPosition: UINT, uFlags: UINT) -> WINBOOL; +} +extern "C" { + pub fn SetMenuItemBitmaps( + hMenu: HMENU, + uPosition: UINT, + uFlags: UINT, + hBitmapUnchecked: HBITMAP, + hBitmapChecked: HBITMAP, + ) -> WINBOOL; +} +extern "C" { + pub fn GetMenuCheckMarkDimensions() -> LONG; +} +extern "C" { + pub fn TrackPopupMenu( + hMenu: HMENU, + uFlags: UINT, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + nReserved: ::std::os::raw::c_int, + hWnd: HWND, + prcRect: *const RECT, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTPMPARAMS { + pub cbSize: UINT, + pub rcExclude: RECT, +} +pub type TPMPARAMS = tagTPMPARAMS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMENUINFO { + pub cbSize: DWORD, + pub fMask: DWORD, + pub dwStyle: DWORD, + pub cyMax: UINT, + pub hbrBack: HBRUSH, + pub dwContextHelpID: DWORD, + pub dwMenuData: ULONG_PTR, +} +pub type MENUINFO = tagMENUINFO; +pub type LPMENUINFO = *mut tagMENUINFO; +pub type LPTPMPARAMS = *mut TPMPARAMS; +pub type LPCMENUINFO = *const MENUINFO; +extern "C" { + pub fn TrackPopupMenuEx( + arg1: HMENU, + arg2: UINT, + arg3: ::std::os::raw::c_int, + arg4: ::std::os::raw::c_int, + arg5: HWND, + arg6: LPTPMPARAMS, + ) -> WINBOOL; +} +extern "C" { + pub fn GetMenuInfo(arg1: HMENU, arg2: LPMENUINFO) -> WINBOOL; +} +extern "C" { + pub fn SetMenuInfo(arg1: HMENU, arg2: LPCMENUINFO) -> WINBOOL; +} +extern "C" { + pub fn EndMenu() -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMENUGETOBJECTINFO { + pub dwFlags: DWORD, + pub uPos: UINT, + pub hmenu: HMENU, + pub riid: PVOID, + pub pvObj: PVOID, +} +pub type MENUGETOBJECTINFO = tagMENUGETOBJECTINFO; +pub type PMENUGETOBJECTINFO = *mut tagMENUGETOBJECTINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMENUITEMINFOA { + pub cbSize: UINT, + pub fMask: UINT, + pub fType: UINT, + pub fState: UINT, + pub wID: UINT, + pub hSubMenu: HMENU, + pub hbmpChecked: HBITMAP, + pub hbmpUnchecked: HBITMAP, + pub dwItemData: ULONG_PTR, + pub dwTypeData: LPSTR, + pub cch: UINT, + pub hbmpItem: HBITMAP, +} +pub type MENUITEMINFOA = tagMENUITEMINFOA; +pub type LPMENUITEMINFOA = *mut tagMENUITEMINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMENUITEMINFOW { + pub cbSize: UINT, + pub fMask: UINT, + pub fType: UINT, + pub fState: UINT, + pub wID: UINT, + pub hSubMenu: HMENU, + pub hbmpChecked: HBITMAP, + pub hbmpUnchecked: HBITMAP, + pub dwItemData: ULONG_PTR, + pub dwTypeData: LPWSTR, + pub cch: UINT, + pub hbmpItem: HBITMAP, +} +pub type MENUITEMINFOW = tagMENUITEMINFOW; +pub type LPMENUITEMINFOW = *mut tagMENUITEMINFOW; +pub type MENUITEMINFO = MENUITEMINFOA; +pub type LPMENUITEMINFO = LPMENUITEMINFOA; +pub type LPCMENUITEMINFOA = *const MENUITEMINFOA; +pub type LPCMENUITEMINFOW = *const MENUITEMINFOW; +pub type LPCMENUITEMINFO = LPCMENUITEMINFOA; +extern "C" { + pub fn InsertMenuItemA( + hmenu: HMENU, + item: UINT, + fByPosition: WINBOOL, + lpmi: LPCMENUITEMINFOA, + ) -> WINBOOL; +} +extern "C" { + pub fn InsertMenuItemW( + hmenu: HMENU, + item: UINT, + fByPosition: WINBOOL, + lpmi: LPCMENUITEMINFOW, + ) -> WINBOOL; +} +extern "C" { + pub fn GetMenuItemInfoA( + hmenu: HMENU, + item: UINT, + fByPosition: WINBOOL, + lpmii: LPMENUITEMINFOA, + ) -> WINBOOL; +} +extern "C" { + pub fn GetMenuItemInfoW( + hmenu: HMENU, + item: UINT, + fByPosition: WINBOOL, + lpmii: LPMENUITEMINFOW, + ) -> WINBOOL; +} +extern "C" { + pub fn SetMenuItemInfoA( + hmenu: HMENU, + item: UINT, + fByPositon: WINBOOL, + lpmii: LPCMENUITEMINFOA, + ) -> WINBOOL; +} +extern "C" { + pub fn SetMenuItemInfoW( + hmenu: HMENU, + item: UINT, + fByPositon: WINBOOL, + lpmii: LPCMENUITEMINFOW, + ) -> WINBOOL; +} +extern "C" { + pub fn GetMenuDefaultItem(hMenu: HMENU, fByPos: UINT, gmdiFlags: UINT) -> UINT; +} +extern "C" { + pub fn SetMenuDefaultItem(hMenu: HMENU, uItem: UINT, fByPos: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetMenuItemRect(hWnd: HWND, hMenu: HMENU, uItem: UINT, lprcItem: LPRECT) -> WINBOOL; +} +extern "C" { + pub fn MenuItemFromPoint(hWnd: HWND, hMenu: HMENU, ptScreen: POINT) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDROPSTRUCT { + pub hwndSource: HWND, + pub hwndSink: HWND, + pub wFmt: DWORD, + pub dwData: ULONG_PTR, + pub ptDrop: POINT, + pub dwControlData: DWORD, +} +pub type DROPSTRUCT = tagDROPSTRUCT; +pub type PDROPSTRUCT = *mut tagDROPSTRUCT; +pub type LPDROPSTRUCT = *mut tagDROPSTRUCT; +extern "C" { + pub fn DragObject( + hwndParent: HWND, + hwndFrom: HWND, + fmt: UINT, + data: ULONG_PTR, + hcur: HCURSOR, + ) -> DWORD; +} +extern "C" { + pub fn DragDetect(hwnd: HWND, pt: POINT) -> WINBOOL; +} +extern "C" { + pub fn DrawIcon( + hDC: HDC, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + hIcon: HICON, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagDRAWTEXTPARAMS { + pub cbSize: UINT, + pub iTabLength: ::std::os::raw::c_int, + pub iLeftMargin: ::std::os::raw::c_int, + pub iRightMargin: ::std::os::raw::c_int, + pub uiLengthDrawn: UINT, +} +pub type DRAWTEXTPARAMS = tagDRAWTEXTPARAMS; +pub type LPDRAWTEXTPARAMS = *mut tagDRAWTEXTPARAMS; +extern "C" { + pub fn DrawTextA( + hdc: HDC, + lpchText: LPCSTR, + cchText: ::std::os::raw::c_int, + lprc: LPRECT, + format: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DrawTextW( + hdc: HDC, + lpchText: LPCWSTR, + cchText: ::std::os::raw::c_int, + lprc: LPRECT, + format: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DrawTextExA( + hdc: HDC, + lpchText: LPSTR, + cchText: ::std::os::raw::c_int, + lprc: LPRECT, + format: UINT, + lpdtp: LPDRAWTEXTPARAMS, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DrawTextExW( + hdc: HDC, + lpchText: LPWSTR, + cchText: ::std::os::raw::c_int, + lprc: LPRECT, + format: UINT, + lpdtp: LPDRAWTEXTPARAMS, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GrayStringA( + hDC: HDC, + hBrush: HBRUSH, + lpOutputFunc: GRAYSTRINGPROC, + lpData: LPARAM, + nCount: ::std::os::raw::c_int, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn GrayStringW( + hDC: HDC, + hBrush: HBRUSH, + lpOutputFunc: GRAYSTRINGPROC, + lpData: LPARAM, + nCount: ::std::os::raw::c_int, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn DrawStateA( + hdc: HDC, + hbrFore: HBRUSH, + qfnCallBack: DRAWSTATEPROC, + lData: LPARAM, + wData: WPARAM, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + uFlags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn DrawStateW( + hdc: HDC, + hbrFore: HBRUSH, + qfnCallBack: DRAWSTATEPROC, + lData: LPARAM, + wData: WPARAM, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + uFlags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn TabbedTextOutA( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lpString: LPCSTR, + chCount: ::std::os::raw::c_int, + nTabPositions: ::std::os::raw::c_int, + lpnTabStopPositions: *const INT, + nTabOrigin: ::std::os::raw::c_int, + ) -> LONG; +} +extern "C" { + pub fn TabbedTextOutW( + hdc: HDC, + x: ::std::os::raw::c_int, + y: ::std::os::raw::c_int, + lpString: LPCWSTR, + chCount: ::std::os::raw::c_int, + nTabPositions: ::std::os::raw::c_int, + lpnTabStopPositions: *const INT, + nTabOrigin: ::std::os::raw::c_int, + ) -> LONG; +} +extern "C" { + pub fn GetTabbedTextExtentA( + hdc: HDC, + lpString: LPCSTR, + chCount: ::std::os::raw::c_int, + nTabPositions: ::std::os::raw::c_int, + lpnTabStopPositions: *const INT, + ) -> DWORD; +} +extern "C" { + pub fn GetTabbedTextExtentW( + hdc: HDC, + lpString: LPCWSTR, + chCount: ::std::os::raw::c_int, + nTabPositions: ::std::os::raw::c_int, + lpnTabStopPositions: *const INT, + ) -> DWORD; +} +extern "C" { + pub fn UpdateWindow(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn SetActiveWindow(hWnd: HWND) -> HWND; +} +extern "C" { + pub fn GetForegroundWindow() -> HWND; +} +extern "C" { + pub fn PaintDesktop(hdc: HDC) -> WINBOOL; +} +extern "C" { + pub fn SwitchToThisWindow(hwnd: HWND, fUnknown: WINBOOL); +} +extern "C" { + pub fn SetForegroundWindow(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn AllowSetForegroundWindow(dwProcessId: DWORD) -> WINBOOL; +} +extern "C" { + pub fn LockSetForegroundWindow(uLockCode: UINT) -> WINBOOL; +} +extern "C" { + pub fn WindowFromDC(hDC: HDC) -> HWND; +} +extern "C" { + pub fn GetDC(hWnd: HWND) -> HDC; +} +extern "C" { + pub fn GetDCEx(hWnd: HWND, hrgnClip: HRGN, flags: DWORD) -> HDC; +} +extern "C" { + pub fn GetWindowDC(hWnd: HWND) -> HDC; +} +extern "C" { + pub fn ReleaseDC(hWnd: HWND, hDC: HDC) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn BeginPaint(hWnd: HWND, lpPaint: LPPAINTSTRUCT) -> HDC; +} +extern "C" { + pub fn EndPaint(hWnd: HWND, lpPaint: *const PAINTSTRUCT) -> WINBOOL; +} +extern "C" { + pub fn GetUpdateRect(hWnd: HWND, lpRect: LPRECT, bErase: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetUpdateRgn(hWnd: HWND, hRgn: HRGN, bErase: WINBOOL) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetWindowRgn(hWnd: HWND, hRgn: HRGN, bRedraw: WINBOOL) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetWindowRgn(hWnd: HWND, hRgn: HRGN) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetWindowRgnBox(hWnd: HWND, lprc: LPRECT) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ExcludeUpdateRgn(hDC: HDC, hWnd: HWND) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn InvalidateRect(hWnd: HWND, lpRect: *const RECT, bErase: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn ValidateRect(hWnd: HWND, lpRect: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn InvalidateRgn(hWnd: HWND, hRgn: HRGN, bErase: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn ValidateRgn(hWnd: HWND, hRgn: HRGN) -> WINBOOL; +} +extern "C" { + pub fn RedrawWindow( + hWnd: HWND, + lprcUpdate: *const RECT, + hrgnUpdate: HRGN, + flags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn LockWindowUpdate(hWndLock: HWND) -> WINBOOL; +} +extern "C" { + pub fn ScrollWindow( + hWnd: HWND, + XAmount: ::std::os::raw::c_int, + YAmount: ::std::os::raw::c_int, + lpRect: *const RECT, + lpClipRect: *const RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn ScrollDC( + hDC: HDC, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + lprcScroll: *const RECT, + lprcClip: *const RECT, + hrgnUpdate: HRGN, + lprcUpdate: LPRECT, + ) -> WINBOOL; +} +extern "C" { + pub fn ScrollWindowEx( + hWnd: HWND, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + prcScroll: *const RECT, + prcClip: *const RECT, + hrgnUpdate: HRGN, + prcUpdate: LPRECT, + flags: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetScrollPos( + hWnd: HWND, + nBar: ::std::os::raw::c_int, + nPos: ::std::os::raw::c_int, + bRedraw: WINBOOL, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetScrollPos(hWnd: HWND, nBar: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetScrollRange( + hWnd: HWND, + nBar: ::std::os::raw::c_int, + nMinPos: ::std::os::raw::c_int, + nMaxPos: ::std::os::raw::c_int, + bRedraw: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn GetScrollRange( + hWnd: HWND, + nBar: ::std::os::raw::c_int, + lpMinPos: LPINT, + lpMaxPos: LPINT, + ) -> WINBOOL; +} +extern "C" { + pub fn ShowScrollBar(hWnd: HWND, wBar: ::std::os::raw::c_int, bShow: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn EnableScrollBar(hWnd: HWND, wSBflags: UINT, wArrows: UINT) -> WINBOOL; +} +extern "C" { + pub fn SetPropA(hWnd: HWND, lpString: LPCSTR, hData: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn SetPropW(hWnd: HWND, lpString: LPCWSTR, hData: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn GetPropA(hWnd: HWND, lpString: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn GetPropW(hWnd: HWND, lpString: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn RemovePropA(hWnd: HWND, lpString: LPCSTR) -> HANDLE; +} +extern "C" { + pub fn RemovePropW(hWnd: HWND, lpString: LPCWSTR) -> HANDLE; +} +extern "C" { + pub fn EnumPropsExA( + hWnd: HWND, + lpEnumFunc: PROPENUMPROCEXA, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumPropsExW( + hWnd: HWND, + lpEnumFunc: PROPENUMPROCEXW, + lParam: LPARAM, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumPropsA(hWnd: HWND, lpEnumFunc: PROPENUMPROCA) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumPropsW(hWnd: HWND, lpEnumFunc: PROPENUMPROCW) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetWindowTextA(hWnd: HWND, lpString: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetWindowTextW(hWnd: HWND, lpString: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetWindowTextA( + hWnd: HWND, + lpString: LPSTR, + nMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetWindowTextW( + hWnd: HWND, + lpString: LPWSTR, + nMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetWindowTextLengthA(hWnd: HWND) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetWindowTextLengthW(hWnd: HWND) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetClientRect(hWnd: HWND, lpRect: LPRECT) -> WINBOOL; +} +extern "C" { + pub fn GetWindowRect(hWnd: HWND, lpRect: LPRECT) -> WINBOOL; +} +extern "C" { + pub fn AdjustWindowRect(lpRect: LPRECT, dwStyle: DWORD, bMenu: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn AdjustWindowRectEx( + lpRect: LPRECT, + dwStyle: DWORD, + bMenu: WINBOOL, + dwExStyle: DWORD, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHELPINFO { + pub cbSize: UINT, + pub iContextType: ::std::os::raw::c_int, + pub iCtrlId: ::std::os::raw::c_int, + pub hItemHandle: HANDLE, + pub dwContextId: DWORD_PTR, + pub MousePos: POINT, +} +pub type HELPINFO = tagHELPINFO; +pub type LPHELPINFO = *mut tagHELPINFO; +extern "C" { + pub fn SetWindowContextHelpId(arg1: HWND, arg2: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetWindowContextHelpId(arg1: HWND) -> DWORD; +} +extern "C" { + pub fn SetMenuContextHelpId(arg1: HMENU, arg2: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetMenuContextHelpId(arg1: HMENU) -> DWORD; +} +extern "C" { + pub fn MessageBoxA( + hWnd: HWND, + lpText: LPCSTR, + lpCaption: LPCSTR, + uType: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn MessageBoxW( + hWnd: HWND, + lpText: LPCWSTR, + lpCaption: LPCWSTR, + uType: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn MessageBoxExA( + hWnd: HWND, + lpText: LPCSTR, + lpCaption: LPCSTR, + uType: UINT, + wLanguageId: WORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn MessageBoxExW( + hWnd: HWND, + lpText: LPCWSTR, + lpCaption: LPCWSTR, + uType: UINT, + wLanguageId: WORD, + ) -> ::std::os::raw::c_int; +} +pub type MSGBOXCALLBACK = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMSGBOXPARAMSA { + pub cbSize: UINT, + pub hwndOwner: HWND, + pub hInstance: HINSTANCE, + pub lpszText: LPCSTR, + pub lpszCaption: LPCSTR, + pub dwStyle: DWORD, + pub lpszIcon: LPCSTR, + pub dwContextHelpId: DWORD_PTR, + pub lpfnMsgBoxCallback: MSGBOXCALLBACK, + pub dwLanguageId: DWORD, +} +pub type MSGBOXPARAMSA = tagMSGBOXPARAMSA; +pub type PMSGBOXPARAMSA = *mut tagMSGBOXPARAMSA; +pub type LPMSGBOXPARAMSA = *mut tagMSGBOXPARAMSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMSGBOXPARAMSW { + pub cbSize: UINT, + pub hwndOwner: HWND, + pub hInstance: HINSTANCE, + pub lpszText: LPCWSTR, + pub lpszCaption: LPCWSTR, + pub dwStyle: DWORD, + pub lpszIcon: LPCWSTR, + pub dwContextHelpId: DWORD_PTR, + pub lpfnMsgBoxCallback: MSGBOXCALLBACK, + pub dwLanguageId: DWORD, +} +pub type MSGBOXPARAMSW = tagMSGBOXPARAMSW; +pub type PMSGBOXPARAMSW = *mut tagMSGBOXPARAMSW; +pub type LPMSGBOXPARAMSW = *mut tagMSGBOXPARAMSW; +pub type MSGBOXPARAMS = MSGBOXPARAMSA; +pub type PMSGBOXPARAMS = PMSGBOXPARAMSA; +pub type LPMSGBOXPARAMS = LPMSGBOXPARAMSA; +extern "C" { + pub fn MessageBoxIndirectA(lpmbp: *const MSGBOXPARAMSA) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn MessageBoxIndirectW(lpmbp: *const MSGBOXPARAMSW) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn MessageBeep(uType: UINT) -> WINBOOL; +} +extern "C" { + pub fn ShowCursor(bShow: WINBOOL) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetCursorPos(X: ::std::os::raw::c_int, Y: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn SetCursor(hCursor: HCURSOR) -> HCURSOR; +} +extern "C" { + pub fn GetCursorPos(lpPoint: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn ClipCursor(lpRect: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn GetClipCursor(lpRect: LPRECT) -> WINBOOL; +} +extern "C" { + pub fn GetCursor() -> HCURSOR; +} +extern "C" { + pub fn CreateCaret( + hWnd: HWND, + hBitmap: HBITMAP, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCaretBlinkTime() -> UINT; +} +extern "C" { + pub fn SetCaretBlinkTime(uMSeconds: UINT) -> WINBOOL; +} +extern "C" { + pub fn DestroyCaret() -> WINBOOL; +} +extern "C" { + pub fn HideCaret(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn ShowCaret(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn SetCaretPos(X: ::std::os::raw::c_int, Y: ::std::os::raw::c_int) -> WINBOOL; +} +extern "C" { + pub fn GetCaretPos(lpPoint: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn ClientToScreen(hWnd: HWND, lpPoint: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn ScreenToClient(hWnd: HWND, lpPoint: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn MapWindowPoints( + hWndFrom: HWND, + hWndTo: HWND, + lpPoints: LPPOINT, + cPoints: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn WindowFromPoint(Point: POINT) -> HWND; +} +extern "C" { + pub fn ChildWindowFromPoint(hWndParent: HWND, Point: POINT) -> HWND; +} +extern "C" { + pub fn ChildWindowFromPointEx(hwnd: HWND, pt: POINT, flags: UINT) -> HWND; +} +extern "C" { + pub fn GetSysColor(nIndex: ::std::os::raw::c_int) -> DWORD; +} +extern "C" { + pub fn GetSysColorBrush(nIndex: ::std::os::raw::c_int) -> HBRUSH; +} +extern "C" { + pub fn SetSysColors( + cElements: ::std::os::raw::c_int, + lpaElements: *const INT, + lpaRgbValues: *const COLORREF, + ) -> WINBOOL; +} +extern "C" { + pub fn DrawFocusRect(hDC: HDC, lprc: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn FillRect(hDC: HDC, lprc: *const RECT, hbr: HBRUSH) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn FrameRect(hDC: HDC, lprc: *const RECT, hbr: HBRUSH) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn InvertRect(hDC: HDC, lprc: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn SetRect( + lprc: LPRECT, + xLeft: ::std::os::raw::c_int, + yTop: ::std::os::raw::c_int, + xRight: ::std::os::raw::c_int, + yBottom: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn SetRectEmpty(lprc: LPRECT) -> WINBOOL; +} +extern "C" { + pub fn CopyRect(lprcDst: LPRECT, lprcSrc: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn InflateRect( + lprc: LPRECT, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn IntersectRect(lprcDst: LPRECT, lprcSrc1: *const RECT, lprcSrc2: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn UnionRect(lprcDst: LPRECT, lprcSrc1: *const RECT, lprcSrc2: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn SubtractRect(lprcDst: LPRECT, lprcSrc1: *const RECT, lprcSrc2: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn OffsetRect( + lprc: LPRECT, + dx: ::std::os::raw::c_int, + dy: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn IsRectEmpty(lprc: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn EqualRect(lprc1: *const RECT, lprc2: *const RECT) -> WINBOOL; +} +extern "C" { + pub fn PtInRect(lprc: *const RECT, pt: POINT) -> WINBOOL; +} +extern "C" { + pub fn GetWindowWord(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> WORD; +} +extern "C" { + pub fn SetWindowWord(hWnd: HWND, nIndex: ::std::os::raw::c_int, wNewWord: WORD) -> WORD; +} +extern "C" { + pub fn GetWindowLongA(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> LONG; +} +extern "C" { + pub fn GetWindowLongW(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> LONG; +} +extern "C" { + pub fn SetWindowLongA(hWnd: HWND, nIndex: ::std::os::raw::c_int, dwNewLong: LONG) -> LONG; +} +extern "C" { + pub fn SetWindowLongW(hWnd: HWND, nIndex: ::std::os::raw::c_int, dwNewLong: LONG) -> LONG; +} +extern "C" { + pub fn GetWindowLongPtrA(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> LONG_PTR; +} +extern "C" { + pub fn GetWindowLongPtrW(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> LONG_PTR; +} +extern "C" { + pub fn SetWindowLongPtrA( + hWnd: HWND, + nIndex: ::std::os::raw::c_int, + dwNewLong: LONG_PTR, + ) -> LONG_PTR; +} +extern "C" { + pub fn SetWindowLongPtrW( + hWnd: HWND, + nIndex: ::std::os::raw::c_int, + dwNewLong: LONG_PTR, + ) -> LONG_PTR; +} +extern "C" { + pub fn GetClassWord(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> WORD; +} +extern "C" { + pub fn SetClassWord(hWnd: HWND, nIndex: ::std::os::raw::c_int, wNewWord: WORD) -> WORD; +} +extern "C" { + pub fn GetClassLongA(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> DWORD; +} +extern "C" { + pub fn GetClassLongW(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> DWORD; +} +extern "C" { + pub fn SetClassLongA(hWnd: HWND, nIndex: ::std::os::raw::c_int, dwNewLong: LONG) -> DWORD; +} +extern "C" { + pub fn SetClassLongW(hWnd: HWND, nIndex: ::std::os::raw::c_int, dwNewLong: LONG) -> DWORD; +} +extern "C" { + pub fn GetClassLongPtrA(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> ULONG_PTR; +} +extern "C" { + pub fn GetClassLongPtrW(hWnd: HWND, nIndex: ::std::os::raw::c_int) -> ULONG_PTR; +} +extern "C" { + pub fn SetClassLongPtrA( + hWnd: HWND, + nIndex: ::std::os::raw::c_int, + dwNewLong: LONG_PTR, + ) -> ULONG_PTR; +} +extern "C" { + pub fn SetClassLongPtrW( + hWnd: HWND, + nIndex: ::std::os::raw::c_int, + dwNewLong: LONG_PTR, + ) -> ULONG_PTR; +} +extern "C" { + pub fn GetProcessDefaultLayout(pdwDefaultLayout: *mut DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetProcessDefaultLayout(dwDefaultLayout: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetDesktopWindow() -> HWND; +} +extern "C" { + pub fn GetParent(hWnd: HWND) -> HWND; +} +extern "C" { + pub fn SetParent(hWndChild: HWND, hWndNewParent: HWND) -> HWND; +} +extern "C" { + pub fn EnumChildWindows(hWndParent: HWND, lpEnumFunc: WNDENUMPROC, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn FindWindowA(lpClassName: LPCSTR, lpWindowName: LPCSTR) -> HWND; +} +extern "C" { + pub fn FindWindowW(lpClassName: LPCWSTR, lpWindowName: LPCWSTR) -> HWND; +} +extern "C" { + pub fn FindWindowExA( + hWndParent: HWND, + hWndChildAfter: HWND, + lpszClass: LPCSTR, + lpszWindow: LPCSTR, + ) -> HWND; +} +extern "C" { + pub fn FindWindowExW( + hWndParent: HWND, + hWndChildAfter: HWND, + lpszClass: LPCWSTR, + lpszWindow: LPCWSTR, + ) -> HWND; +} +extern "C" { + pub fn GetShellWindow() -> HWND; +} +extern "C" { + pub fn RegisterShellHookWindow(hwnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn DeregisterShellHookWindow(hwnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn EnumWindows(lpEnumFunc: WNDENUMPROC, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn EnumThreadWindows(dwThreadId: DWORD, lpfn: WNDENUMPROC, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn GetClassNameA( + hWnd: HWND, + lpClassName: LPSTR, + nMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetClassNameW( + hWnd: HWND, + lpClassName: LPWSTR, + nMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetTopWindow(hWnd: HWND) -> HWND; +} +extern "C" { + pub fn GetWindowThreadProcessId(hWnd: HWND, lpdwProcessId: LPDWORD) -> DWORD; +} +extern "C" { + pub fn IsGUIThread(bConvert: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetLastActivePopup(hWnd: HWND) -> HWND; +} +extern "C" { + pub fn GetWindow(hWnd: HWND, uCmd: UINT) -> HWND; +} +extern "C" { + pub fn SetWindowsHookA(nFilterType: ::std::os::raw::c_int, pfnFilterProc: HOOKPROC) -> HHOOK; +} +extern "C" { + pub fn SetWindowsHookW(nFilterType: ::std::os::raw::c_int, pfnFilterProc: HOOKPROC) -> HHOOK; +} +extern "C" { + pub fn UnhookWindowsHook(nCode: ::std::os::raw::c_int, pfnFilterProc: HOOKPROC) -> WINBOOL; +} +extern "C" { + pub fn SetWindowsHookExA( + idHook: ::std::os::raw::c_int, + lpfn: HOOKPROC, + hmod: HINSTANCE, + dwThreadId: DWORD, + ) -> HHOOK; +} +extern "C" { + pub fn SetWindowsHookExW( + idHook: ::std::os::raw::c_int, + lpfn: HOOKPROC, + hmod: HINSTANCE, + dwThreadId: DWORD, + ) -> HHOOK; +} +extern "C" { + pub fn UnhookWindowsHookEx(hhk: HHOOK) -> WINBOOL; +} +extern "C" { + pub fn CallNextHookEx( + hhk: HHOOK, + nCode: ::std::os::raw::c_int, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn CheckMenuRadioItem( + hmenu: HMENU, + first: UINT, + last: UINT, + check: UINT, + flags: UINT, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MENUITEMTEMPLATEHEADER { + pub versionNumber: WORD, + pub offset: WORD, +} +pub type PMENUITEMTEMPLATEHEADER = *mut MENUITEMTEMPLATEHEADER; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MENUITEMTEMPLATE { + pub mtOption: WORD, + pub mtID: WORD, + pub mtString: [WCHAR; 1usize], +} +pub type PMENUITEMTEMPLATE = *mut MENUITEMTEMPLATE; +extern "C" { + pub fn LoadBitmapA(hInstance: HINSTANCE, lpBitmapName: LPCSTR) -> HBITMAP; +} +extern "C" { + pub fn LoadBitmapW(hInstance: HINSTANCE, lpBitmapName: LPCWSTR) -> HBITMAP; +} +extern "C" { + pub fn LoadCursorA(hInstance: HINSTANCE, lpCursorName: LPCSTR) -> HCURSOR; +} +extern "C" { + pub fn LoadCursorW(hInstance: HINSTANCE, lpCursorName: LPCWSTR) -> HCURSOR; +} +extern "C" { + pub fn LoadCursorFromFileA(lpFileName: LPCSTR) -> HCURSOR; +} +extern "C" { + pub fn LoadCursorFromFileW(lpFileName: LPCWSTR) -> HCURSOR; +} +extern "C" { + pub fn CreateCursor( + hInst: HINSTANCE, + xHotSpot: ::std::os::raw::c_int, + yHotSpot: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + pvANDPlane: *const ::std::os::raw::c_void, + pvXORPlane: *const ::std::os::raw::c_void, + ) -> HCURSOR; +} +extern "C" { + pub fn DestroyCursor(hCursor: HCURSOR) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ICONINFO { + pub fIcon: WINBOOL, + pub xHotspot: DWORD, + pub yHotspot: DWORD, + pub hbmMask: HBITMAP, + pub hbmColor: HBITMAP, +} +pub type ICONINFO = _ICONINFO; +pub type PICONINFO = *mut ICONINFO; +extern "C" { + pub fn SetSystemCursor(hcur: HCURSOR, id: DWORD) -> WINBOOL; +} +extern "C" { + pub fn LoadIconA(hInstance: HINSTANCE, lpIconName: LPCSTR) -> HICON; +} +extern "C" { + pub fn LoadIconW(hInstance: HINSTANCE, lpIconName: LPCWSTR) -> HICON; +} +extern "C" { + pub fn PrivateExtractIconsA( + szFileName: LPCSTR, + nIconIndex: ::std::os::raw::c_int, + cxIcon: ::std::os::raw::c_int, + cyIcon: ::std::os::raw::c_int, + phicon: *mut HICON, + piconid: *mut UINT, + nIcons: UINT, + flags: UINT, + ) -> UINT; +} +extern "C" { + pub fn PrivateExtractIconsW( + szFileName: LPCWSTR, + nIconIndex: ::std::os::raw::c_int, + cxIcon: ::std::os::raw::c_int, + cyIcon: ::std::os::raw::c_int, + phicon: *mut HICON, + piconid: *mut UINT, + nIcons: UINT, + flags: UINT, + ) -> UINT; +} +extern "C" { + pub fn CreateIcon( + hInstance: HINSTANCE, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + cPlanes: BYTE, + cBitsPixel: BYTE, + lpbANDbits: *const BYTE, + lpbXORbits: *const BYTE, + ) -> HICON; +} +extern "C" { + pub fn DestroyIcon(hIcon: HICON) -> WINBOOL; +} +extern "C" { + pub fn LookupIconIdFromDirectory(presbits: PBYTE, fIcon: WINBOOL) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn LookupIconIdFromDirectoryEx( + presbits: PBYTE, + fIcon: WINBOOL, + cxDesired: ::std::os::raw::c_int, + cyDesired: ::std::os::raw::c_int, + Flags: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CreateIconFromResource( + presbits: PBYTE, + dwResSize: DWORD, + fIcon: WINBOOL, + dwVer: DWORD, + ) -> HICON; +} +extern "C" { + pub fn CreateIconFromResourceEx( + presbits: PBYTE, + dwResSize: DWORD, + fIcon: WINBOOL, + dwVer: DWORD, + cxDesired: ::std::os::raw::c_int, + cyDesired: ::std::os::raw::c_int, + Flags: UINT, + ) -> HICON; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCURSORSHAPE { + pub xHotSpot: ::std::os::raw::c_int, + pub yHotSpot: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub cbWidth: ::std::os::raw::c_int, + pub Planes: BYTE, + pub BitsPixel: BYTE, +} +pub type CURSORSHAPE = tagCURSORSHAPE; +pub type LPCURSORSHAPE = *mut tagCURSORSHAPE; +extern "C" { + pub fn LoadImageA( + hInst: HINSTANCE, + name: LPCSTR, + type_: UINT, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + fuLoad: UINT, + ) -> HANDLE; +} +extern "C" { + pub fn LoadImageW( + hInst: HINSTANCE, + name: LPCWSTR, + type_: UINT, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + fuLoad: UINT, + ) -> HANDLE; +} +extern "C" { + pub fn CopyImage( + h: HANDLE, + type_: UINT, + cx: ::std::os::raw::c_int, + cy: ::std::os::raw::c_int, + flags: UINT, + ) -> HANDLE; +} +extern "C" { + pub fn DrawIconEx( + hdc: HDC, + xLeft: ::std::os::raw::c_int, + yTop: ::std::os::raw::c_int, + hIcon: HICON, + cxWidth: ::std::os::raw::c_int, + cyWidth: ::std::os::raw::c_int, + istepIfAniCur: UINT, + hbrFlickerFreeDraw: HBRUSH, + diFlags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateIconIndirect(piconinfo: PICONINFO) -> HICON; +} +extern "C" { + pub fn CopyIcon(hIcon: HICON) -> HICON; +} +extern "C" { + pub fn GetIconInfo(hIcon: HICON, piconinfo: PICONINFO) -> WINBOOL; +} +extern "C" { + pub fn IsDialogMessageA(hDlg: HWND, lpMsg: LPMSG) -> WINBOOL; +} +extern "C" { + pub fn IsDialogMessageW(hDlg: HWND, lpMsg: LPMSG) -> WINBOOL; +} +extern "C" { + pub fn MapDialogRect(hDlg: HWND, lpRect: LPRECT) -> WINBOOL; +} +extern "C" { + pub fn DlgDirListA( + hDlg: HWND, + lpPathSpec: LPSTR, + nIDListBox: ::std::os::raw::c_int, + nIDStaticPath: ::std::os::raw::c_int, + uFileType: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DlgDirListW( + hDlg: HWND, + lpPathSpec: LPWSTR, + nIDListBox: ::std::os::raw::c_int, + nIDStaticPath: ::std::os::raw::c_int, + uFileType: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DlgDirSelectExA( + hwndDlg: HWND, + lpString: LPSTR, + chCount: ::std::os::raw::c_int, + idListBox: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn DlgDirSelectExW( + hwndDlg: HWND, + lpString: LPWSTR, + chCount: ::std::os::raw::c_int, + idListBox: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn DlgDirListComboBoxA( + hDlg: HWND, + lpPathSpec: LPSTR, + nIDComboBox: ::std::os::raw::c_int, + nIDStaticPath: ::std::os::raw::c_int, + uFiletype: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DlgDirListComboBoxW( + hDlg: HWND, + lpPathSpec: LPWSTR, + nIDComboBox: ::std::os::raw::c_int, + nIDStaticPath: ::std::os::raw::c_int, + uFiletype: UINT, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn DlgDirSelectComboBoxExA( + hwndDlg: HWND, + lpString: LPSTR, + cchOut: ::std::os::raw::c_int, + idComboBox: ::std::os::raw::c_int, + ) -> WINBOOL; +} +extern "C" { + pub fn DlgDirSelectComboBoxExW( + hwndDlg: HWND, + lpString: LPWSTR, + cchOut: ::std::os::raw::c_int, + idComboBox: ::std::os::raw::c_int, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSCROLLINFO { + pub cbSize: UINT, + pub fMask: UINT, + pub nMin: ::std::os::raw::c_int, + pub nMax: ::std::os::raw::c_int, + pub nPage: UINT, + pub nPos: ::std::os::raw::c_int, + pub nTrackPos: ::std::os::raw::c_int, +} +pub type SCROLLINFO = tagSCROLLINFO; +pub type LPSCROLLINFO = *mut tagSCROLLINFO; +pub type LPCSCROLLINFO = *const SCROLLINFO; +extern "C" { + pub fn SetScrollInfo( + hwnd: HWND, + nBar: ::std::os::raw::c_int, + lpsi: LPCSCROLLINFO, + redraw: WINBOOL, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetScrollInfo(hwnd: HWND, nBar: ::std::os::raw::c_int, lpsi: LPSCROLLINFO) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMDICREATESTRUCTA { + pub szClass: LPCSTR, + pub szTitle: LPCSTR, + pub hOwner: HANDLE, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub style: DWORD, + pub lParam: LPARAM, +} +pub type MDICREATESTRUCTA = tagMDICREATESTRUCTA; +pub type LPMDICREATESTRUCTA = *mut tagMDICREATESTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMDICREATESTRUCTW { + pub szClass: LPCWSTR, + pub szTitle: LPCWSTR, + pub hOwner: HANDLE, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub cx: ::std::os::raw::c_int, + pub cy: ::std::os::raw::c_int, + pub style: DWORD, + pub lParam: LPARAM, +} +pub type MDICREATESTRUCTW = tagMDICREATESTRUCTW; +pub type LPMDICREATESTRUCTW = *mut tagMDICREATESTRUCTW; +pub type MDICREATESTRUCT = MDICREATESTRUCTA; +pub type LPMDICREATESTRUCT = LPMDICREATESTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCLIENTCREATESTRUCT { + pub hWindowMenu: HANDLE, + pub idFirstChild: UINT, +} +pub type CLIENTCREATESTRUCT = tagCLIENTCREATESTRUCT; +pub type LPCLIENTCREATESTRUCT = *mut tagCLIENTCREATESTRUCT; +extern "C" { + pub fn DefFrameProcA( + hWnd: HWND, + hWndMDIClient: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn DefFrameProcW( + hWnd: HWND, + hWndMDIClient: HWND, + uMsg: UINT, + wParam: WPARAM, + lParam: LPARAM, + ) -> LRESULT; +} +extern "C" { + pub fn DefMDIChildProcA(hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn DefMDIChildProcW(hWnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM) -> LRESULT; +} +extern "C" { + pub fn TranslateMDISysAccel(hWndClient: HWND, lpMsg: LPMSG) -> WINBOOL; +} +extern "C" { + pub fn ArrangeIconicWindows(hWnd: HWND) -> UINT; +} +extern "C" { + pub fn CreateMDIWindowA( + lpClassName: LPCSTR, + lpWindowName: LPCSTR, + dwStyle: DWORD, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + hWndParent: HWND, + hInstance: HINSTANCE, + lParam: LPARAM, + ) -> HWND; +} +extern "C" { + pub fn CreateMDIWindowW( + lpClassName: LPCWSTR, + lpWindowName: LPCWSTR, + dwStyle: DWORD, + X: ::std::os::raw::c_int, + Y: ::std::os::raw::c_int, + nWidth: ::std::os::raw::c_int, + nHeight: ::std::os::raw::c_int, + hWndParent: HWND, + hInstance: HINSTANCE, + lParam: LPARAM, + ) -> HWND; +} +extern "C" { + pub fn TileWindows( + hwndParent: HWND, + wHow: UINT, + lpRect: *const RECT, + cKids: UINT, + lpKids: *const HWND, + ) -> WORD; +} +extern "C" { + pub fn CascadeWindows( + hwndParent: HWND, + wHow: UINT, + lpRect: *const RECT, + cKids: UINT, + lpKids: *const HWND, + ) -> WORD; +} +pub type HELPPOLY = DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMULTIKEYHELPA { + pub mkSize: DWORD, + pub mkKeylist: CHAR, + pub szKeyphrase: [CHAR; 1usize], +} +pub type MULTIKEYHELPA = tagMULTIKEYHELPA; +pub type PMULTIKEYHELPA = *mut tagMULTIKEYHELPA; +pub type LPMULTIKEYHELPA = *mut tagMULTIKEYHELPA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMULTIKEYHELPW { + pub mkSize: DWORD, + pub mkKeylist: WCHAR, + pub szKeyphrase: [WCHAR; 1usize], +} +pub type MULTIKEYHELPW = tagMULTIKEYHELPW; +pub type PMULTIKEYHELPW = *mut tagMULTIKEYHELPW; +pub type LPMULTIKEYHELPW = *mut tagMULTIKEYHELPW; +pub type MULTIKEYHELP = MULTIKEYHELPA; +pub type PMULTIKEYHELP = PMULTIKEYHELPA; +pub type LPMULTIKEYHELP = LPMULTIKEYHELPA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHELPWININFOA { + pub wStructSize: ::std::os::raw::c_int, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub wMax: ::std::os::raw::c_int, + pub rgchMember: [CHAR; 2usize], +} +pub type HELPWININFOA = tagHELPWININFOA; +pub type PHELPWININFOA = *mut tagHELPWININFOA; +pub type LPHELPWININFOA = *mut tagHELPWININFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHELPWININFOW { + pub wStructSize: ::std::os::raw::c_int, + pub x: ::std::os::raw::c_int, + pub y: ::std::os::raw::c_int, + pub dx: ::std::os::raw::c_int, + pub dy: ::std::os::raw::c_int, + pub wMax: ::std::os::raw::c_int, + pub rgchMember: [WCHAR; 2usize], +} +pub type HELPWININFOW = tagHELPWININFOW; +pub type PHELPWININFOW = *mut tagHELPWININFOW; +pub type LPHELPWININFOW = *mut tagHELPWININFOW; +pub type HELPWININFO = HELPWININFOA; +pub type PHELPWININFO = PHELPWININFOA; +pub type LPHELPWININFO = LPHELPWININFOA; +extern "C" { + pub fn WinHelpA(hWndMain: HWND, lpszHelp: LPCSTR, uCommand: UINT, dwData: ULONG_PTR) + -> WINBOOL; +} +extern "C" { + pub fn WinHelpW( + hWndMain: HWND, + lpszHelp: LPCWSTR, + uCommand: UINT, + dwData: ULONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetGuiResources(hProcess: HANDLE, uiFlags: DWORD) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNONCLIENTMETRICSA { + pub cbSize: UINT, + pub iBorderWidth: ::std::os::raw::c_int, + pub iScrollWidth: ::std::os::raw::c_int, + pub iScrollHeight: ::std::os::raw::c_int, + pub iCaptionWidth: ::std::os::raw::c_int, + pub iCaptionHeight: ::std::os::raw::c_int, + pub lfCaptionFont: LOGFONTA, + pub iSmCaptionWidth: ::std::os::raw::c_int, + pub iSmCaptionHeight: ::std::os::raw::c_int, + pub lfSmCaptionFont: LOGFONTA, + pub iMenuWidth: ::std::os::raw::c_int, + pub iMenuHeight: ::std::os::raw::c_int, + pub lfMenuFont: LOGFONTA, + pub lfStatusFont: LOGFONTA, + pub lfMessageFont: LOGFONTA, +} +pub type NONCLIENTMETRICSA = tagNONCLIENTMETRICSA; +pub type PNONCLIENTMETRICSA = *mut tagNONCLIENTMETRICSA; +pub type LPNONCLIENTMETRICSA = *mut tagNONCLIENTMETRICSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagNONCLIENTMETRICSW { + pub cbSize: UINT, + pub iBorderWidth: ::std::os::raw::c_int, + pub iScrollWidth: ::std::os::raw::c_int, + pub iScrollHeight: ::std::os::raw::c_int, + pub iCaptionWidth: ::std::os::raw::c_int, + pub iCaptionHeight: ::std::os::raw::c_int, + pub lfCaptionFont: LOGFONTW, + pub iSmCaptionWidth: ::std::os::raw::c_int, + pub iSmCaptionHeight: ::std::os::raw::c_int, + pub lfSmCaptionFont: LOGFONTW, + pub iMenuWidth: ::std::os::raw::c_int, + pub iMenuHeight: ::std::os::raw::c_int, + pub lfMenuFont: LOGFONTW, + pub lfStatusFont: LOGFONTW, + pub lfMessageFont: LOGFONTW, +} +pub type NONCLIENTMETRICSW = tagNONCLIENTMETRICSW; +pub type PNONCLIENTMETRICSW = *mut tagNONCLIENTMETRICSW; +pub type LPNONCLIENTMETRICSW = *mut tagNONCLIENTMETRICSW; +pub type NONCLIENTMETRICS = NONCLIENTMETRICSA; +pub type PNONCLIENTMETRICS = PNONCLIENTMETRICSA; +pub type LPNONCLIENTMETRICS = LPNONCLIENTMETRICSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMINIMIZEDMETRICS { + pub cbSize: UINT, + pub iWidth: ::std::os::raw::c_int, + pub iHorzGap: ::std::os::raw::c_int, + pub iVertGap: ::std::os::raw::c_int, + pub iArrange: ::std::os::raw::c_int, +} +pub type MINIMIZEDMETRICS = tagMINIMIZEDMETRICS; +pub type PMINIMIZEDMETRICS = *mut tagMINIMIZEDMETRICS; +pub type LPMINIMIZEDMETRICS = *mut tagMINIMIZEDMETRICS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagICONMETRICSA { + pub cbSize: UINT, + pub iHorzSpacing: ::std::os::raw::c_int, + pub iVertSpacing: ::std::os::raw::c_int, + pub iTitleWrap: ::std::os::raw::c_int, + pub lfFont: LOGFONTA, +} +pub type ICONMETRICSA = tagICONMETRICSA; +pub type PICONMETRICSA = *mut tagICONMETRICSA; +pub type LPICONMETRICSA = *mut tagICONMETRICSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagICONMETRICSW { + pub cbSize: UINT, + pub iHorzSpacing: ::std::os::raw::c_int, + pub iVertSpacing: ::std::os::raw::c_int, + pub iTitleWrap: ::std::os::raw::c_int, + pub lfFont: LOGFONTW, +} +pub type ICONMETRICSW = tagICONMETRICSW; +pub type PICONMETRICSW = *mut tagICONMETRICSW; +pub type LPICONMETRICSW = *mut tagICONMETRICSW; +pub type ICONMETRICS = ICONMETRICSA; +pub type PICONMETRICS = PICONMETRICSA; +pub type LPICONMETRICS = LPICONMETRICSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagANIMATIONINFO { + pub cbSize: UINT, + pub iMinAnimate: ::std::os::raw::c_int, +} +pub type ANIMATIONINFO = tagANIMATIONINFO; +pub type LPANIMATIONINFO = *mut tagANIMATIONINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSERIALKEYSA { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub lpszActivePort: LPSTR, + pub lpszPort: LPSTR, + pub iBaudRate: UINT, + pub iPortState: UINT, + pub iActive: UINT, +} +pub type SERIALKEYSA = tagSERIALKEYSA; +pub type LPSERIALKEYSA = *mut tagSERIALKEYSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSERIALKEYSW { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub lpszActivePort: LPWSTR, + pub lpszPort: LPWSTR, + pub iBaudRate: UINT, + pub iPortState: UINT, + pub iActive: UINT, +} +pub type SERIALKEYSW = tagSERIALKEYSW; +pub type LPSERIALKEYSW = *mut tagSERIALKEYSW; +pub type SERIALKEYS = SERIALKEYSA; +pub type LPSERIALKEYS = LPSERIALKEYSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHIGHCONTRASTA { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub lpszDefaultScheme: LPSTR, +} +pub type HIGHCONTRASTA = tagHIGHCONTRASTA; +pub type LPHIGHCONTRASTA = *mut tagHIGHCONTRASTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagHIGHCONTRASTW { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub lpszDefaultScheme: LPWSTR, +} +pub type HIGHCONTRASTW = tagHIGHCONTRASTW; +pub type LPHIGHCONTRASTW = *mut tagHIGHCONTRASTW; +pub type HIGHCONTRAST = HIGHCONTRASTA; +pub type LPHIGHCONTRAST = LPHIGHCONTRASTA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _VIDEOPARAMETERS { + pub Guid: GUID, + pub dwOffset: ULONG, + pub dwCommand: ULONG, + pub dwFlags: ULONG, + pub dwMode: ULONG, + pub dwTVStandard: ULONG, + pub dwAvailableModes: ULONG, + pub dwAvailableTVStandard: ULONG, + pub dwFlickerFilter: ULONG, + pub dwOverScanX: ULONG, + pub dwOverScanY: ULONG, + pub dwMaxUnscaledX: ULONG, + pub dwMaxUnscaledY: ULONG, + pub dwPositionX: ULONG, + pub dwPositionY: ULONG, + pub dwBrightness: ULONG, + pub dwContrast: ULONG, + pub dwCPType: ULONG, + pub dwCPCommand: ULONG, + pub dwCPStandard: ULONG, + pub dwCPKey: ULONG, + pub bCP_APSTriggerBits: ULONG, + pub bOEMCopyProtection: [UCHAR; 256usize], +} +pub type VIDEOPARAMETERS = _VIDEOPARAMETERS; +pub type PVIDEOPARAMETERS = *mut _VIDEOPARAMETERS; +pub type LPVIDEOPARAMETERS = *mut _VIDEOPARAMETERS; +extern "C" { + pub fn ChangeDisplaySettingsA(lpDevMode: LPDEVMODEA, dwFlags: DWORD) -> LONG; +} +extern "C" { + pub fn ChangeDisplaySettingsW(lpDevMode: LPDEVMODEW, dwFlags: DWORD) -> LONG; +} +extern "C" { + pub fn ChangeDisplaySettingsExA( + lpszDeviceName: LPCSTR, + lpDevMode: LPDEVMODEA, + hwnd: HWND, + dwflags: DWORD, + lParam: LPVOID, + ) -> LONG; +} +extern "C" { + pub fn ChangeDisplaySettingsExW( + lpszDeviceName: LPCWSTR, + lpDevMode: LPDEVMODEW, + hwnd: HWND, + dwflags: DWORD, + lParam: LPVOID, + ) -> LONG; +} +extern "C" { + pub fn EnumDisplaySettingsA( + lpszDeviceName: LPCSTR, + iModeNum: DWORD, + lpDevMode: LPDEVMODEA, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDisplaySettingsW( + lpszDeviceName: LPCWSTR, + iModeNum: DWORD, + lpDevMode: LPDEVMODEW, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDisplaySettingsExA( + lpszDeviceName: LPCSTR, + iModeNum: DWORD, + lpDevMode: LPDEVMODEA, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDisplaySettingsExW( + lpszDeviceName: LPCWSTR, + iModeNum: DWORD, + lpDevMode: LPDEVMODEW, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDisplayDevicesA( + lpDevice: LPCSTR, + iDevNum: DWORD, + lpDisplayDevice: PDISPLAY_DEVICEA, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDisplayDevicesW( + lpDevice: LPCWSTR, + iDevNum: DWORD, + lpDisplayDevice: PDISPLAY_DEVICEW, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn SystemParametersInfoA( + uiAction: UINT, + uiParam: UINT, + pvParam: PVOID, + fWinIni: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn SystemParametersInfoW( + uiAction: UINT, + uiParam: UINT, + pvParam: PVOID, + fWinIni: UINT, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagFILTERKEYS { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub iWaitMSec: DWORD, + pub iDelayMSec: DWORD, + pub iRepeatMSec: DWORD, + pub iBounceMSec: DWORD, +} +pub type FILTERKEYS = tagFILTERKEYS; +pub type LPFILTERKEYS = *mut tagFILTERKEYS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSTICKYKEYS { + pub cbSize: UINT, + pub dwFlags: DWORD, +} +pub type STICKYKEYS = tagSTICKYKEYS; +pub type LPSTICKYKEYS = *mut tagSTICKYKEYS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMOUSEKEYS { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub iMaxSpeed: DWORD, + pub iTimeToMaxSpeed: DWORD, + pub iCtrlSpeed: DWORD, + pub dwReserved1: DWORD, + pub dwReserved2: DWORD, +} +pub type MOUSEKEYS = tagMOUSEKEYS; +pub type LPMOUSEKEYS = *mut tagMOUSEKEYS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagACCESSTIMEOUT { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub iTimeOutMSec: DWORD, +} +pub type ACCESSTIMEOUT = tagACCESSTIMEOUT; +pub type LPACCESSTIMEOUT = *mut tagACCESSTIMEOUT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSOUNDSENTRYA { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub iFSTextEffect: DWORD, + pub iFSTextEffectMSec: DWORD, + pub iFSTextEffectColorBits: DWORD, + pub iFSGrafEffect: DWORD, + pub iFSGrafEffectMSec: DWORD, + pub iFSGrafEffectColor: DWORD, + pub iWindowsEffect: DWORD, + pub iWindowsEffectMSec: DWORD, + pub lpszWindowsEffectDLL: LPSTR, + pub iWindowsEffectOrdinal: DWORD, +} +pub type SOUNDSENTRYA = tagSOUNDSENTRYA; +pub type LPSOUNDSENTRYA = *mut tagSOUNDSENTRYA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSOUNDSENTRYW { + pub cbSize: UINT, + pub dwFlags: DWORD, + pub iFSTextEffect: DWORD, + pub iFSTextEffectMSec: DWORD, + pub iFSTextEffectColorBits: DWORD, + pub iFSGrafEffect: DWORD, + pub iFSGrafEffectMSec: DWORD, + pub iFSGrafEffectColor: DWORD, + pub iWindowsEffect: DWORD, + pub iWindowsEffectMSec: DWORD, + pub lpszWindowsEffectDLL: LPWSTR, + pub iWindowsEffectOrdinal: DWORD, +} +pub type SOUNDSENTRYW = tagSOUNDSENTRYW; +pub type LPSOUNDSENTRYW = *mut tagSOUNDSENTRYW; +pub type SOUNDSENTRY = SOUNDSENTRYA; +pub type LPSOUNDSENTRY = LPSOUNDSENTRYA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTOGGLEKEYS { + pub cbSize: UINT, + pub dwFlags: DWORD, +} +pub type TOGGLEKEYS = tagTOGGLEKEYS; +pub type LPTOGGLEKEYS = *mut tagTOGGLEKEYS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMONITORINFO { + pub cbSize: DWORD, + pub rcMonitor: RECT, + pub rcWork: RECT, + pub dwFlags: DWORD, +} +pub type MONITORINFO = tagMONITORINFO; +pub type LPMONITORINFO = *mut tagMONITORINFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMONITORINFOEXA { + pub __bindgen_anon_1: tagMONITORINFOEXA__bindgen_ty_1, + pub szDevice: [CHAR; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMONITORINFOEXA__bindgen_ty_1 { + pub cbSize: DWORD, + pub rcMonitor: RECT, + pub rcWork: RECT, + pub dwFlags: DWORD, +} +pub type MONITORINFOEXA = tagMONITORINFOEXA; +pub type LPMONITORINFOEXA = *mut tagMONITORINFOEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMONITORINFOEXW { + pub __bindgen_anon_1: tagMONITORINFOEXW__bindgen_ty_1, + pub szDevice: [WCHAR; 32usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMONITORINFOEXW__bindgen_ty_1 { + pub cbSize: DWORD, + pub rcMonitor: RECT, + pub rcWork: RECT, + pub dwFlags: DWORD, +} +pub type MONITORINFOEXW = tagMONITORINFOEXW; +pub type LPMONITORINFOEXW = *mut tagMONITORINFOEXW; +pub type MONITORINFOEX = MONITORINFOEXA; +pub type LPMONITORINFOEX = LPMONITORINFOEXA; +pub type MONITORENUMPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HMONITOR, arg2: HDC, arg3: LPRECT, arg4: LPARAM) -> WINBOOL, +>; +extern "C" { + pub fn SetDebugErrorLevel(dwLevel: DWORD); +} +extern "C" { + pub fn SetLastErrorEx(dwErrCode: DWORD, dwType: DWORD); +} +extern "C" { + pub fn InternalGetWindowText( + hWnd: HWND, + pString: LPWSTR, + cchMaxCount: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn CancelShutdown() -> WINBOOL; +} +extern "C" { + pub fn MonitorFromPoint(pt: POINT, dwFlags: DWORD) -> HMONITOR; +} +extern "C" { + pub fn MonitorFromRect(lprc: LPCRECT, dwFlags: DWORD) -> HMONITOR; +} +extern "C" { + pub fn MonitorFromWindow(hwnd: HWND, dwFlags: DWORD) -> HMONITOR; +} +extern "C" { + pub fn EndTask(hWnd: HWND, fShutDown: WINBOOL, fForce: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetMonitorInfoA(hMonitor: HMONITOR, lpmi: LPMONITORINFO) -> WINBOOL; +} +extern "C" { + pub fn GetMonitorInfoW(hMonitor: HMONITOR, lpmi: LPMONITORINFO) -> WINBOOL; +} +extern "C" { + pub fn EnumDisplayMonitors( + hdc: HDC, + lprcClip: LPCRECT, + lpfnEnum: MONITORENUMPROC, + dwData: LPARAM, + ) -> WINBOOL; +} +pub type WINEVENTPROC = ::std::option::Option< + unsafe extern "C" fn( + hWinEventHook: HWINEVENTHOOK, + event: DWORD, + hwnd: HWND, + idObject: LONG, + idChild: LONG, + idEventThread: DWORD, + dwmsEventTime: DWORD, + ), +>; +extern "C" { + pub fn NotifyWinEvent(event: DWORD, hwnd: HWND, idObject: LONG, idChild: LONG); +} +extern "C" { + pub fn SetWinEventHook( + eventMin: DWORD, + eventMax: DWORD, + hmodWinEventProc: HMODULE, + pfnWinEventProc: WINEVENTPROC, + idProcess: DWORD, + idThread: DWORD, + dwFlags: DWORD, + ) -> HWINEVENTHOOK; +} +extern "C" { + pub fn IsWinEventHookInstalled(event: DWORD) -> WINBOOL; +} +extern "C" { + pub fn UnhookWinEvent(hWinEventHook: HWINEVENTHOOK) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagGUITHREADINFO { + pub cbSize: DWORD, + pub flags: DWORD, + pub hwndActive: HWND, + pub hwndFocus: HWND, + pub hwndCapture: HWND, + pub hwndMenuOwner: HWND, + pub hwndMoveSize: HWND, + pub hwndCaret: HWND, + pub rcCaret: RECT, +} +pub type GUITHREADINFO = tagGUITHREADINFO; +pub type PGUITHREADINFO = *mut tagGUITHREADINFO; +pub type LPGUITHREADINFO = *mut tagGUITHREADINFO; +extern "C" { + pub fn GetGUIThreadInfo(idThread: DWORD, pgui: PGUITHREADINFO) -> WINBOOL; +} +extern "C" { + pub fn BlockInput(fBlockIt: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GetWindowModuleFileNameA(hwnd: HWND, pszFileName: LPSTR, cchFileNameMax: UINT) -> UINT; +} +extern "C" { + pub fn GetWindowModuleFileNameW(hwnd: HWND, pszFileName: LPWSTR, cchFileNameMax: UINT) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCURSORINFO { + pub cbSize: DWORD, + pub flags: DWORD, + pub hCursor: HCURSOR, + pub ptScreenPos: POINT, +} +pub type CURSORINFO = tagCURSORINFO; +pub type PCURSORINFO = *mut tagCURSORINFO; +pub type LPCURSORINFO = *mut tagCURSORINFO; +extern "C" { + pub fn GetCursorInfo(pci: PCURSORINFO) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagWINDOWINFO { + pub cbSize: DWORD, + pub rcWindow: RECT, + pub rcClient: RECT, + pub dwStyle: DWORD, + pub dwExStyle: DWORD, + pub dwWindowStatus: DWORD, + pub cxWindowBorders: UINT, + pub cyWindowBorders: UINT, + pub atomWindowType: ATOM, + pub wCreatorVersion: WORD, +} +pub type WINDOWINFO = tagWINDOWINFO; +pub type PWINDOWINFO = *mut tagWINDOWINFO; +pub type LPWINDOWINFO = *mut tagWINDOWINFO; +extern "C" { + pub fn GetWindowInfo(hwnd: HWND, pwi: PWINDOWINFO) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagTITLEBARINFO { + pub cbSize: DWORD, + pub rcTitleBar: RECT, + pub rgstate: [DWORD; 6usize], +} +pub type TITLEBARINFO = tagTITLEBARINFO; +pub type PTITLEBARINFO = *mut tagTITLEBARINFO; +pub type LPTITLEBARINFO = *mut tagTITLEBARINFO; +extern "C" { + pub fn GetTitleBarInfo(hwnd: HWND, pti: PTITLEBARINFO) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagMENUBARINFO { + pub cbSize: DWORD, + pub rcBar: RECT, + pub hMenu: HMENU, + pub hwndMenu: HWND, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub __bindgen_padding_0: [u8; 7usize], +} +impl tagMENUBARINFO { + #[inline] + pub fn fBarFocused(&self) -> WINBOOL { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_fBarFocused(&mut self, val: WINBOOL) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn fFocused(&self) -> WINBOOL { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_fFocused(&mut self, val: WINBOOL) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + fBarFocused: WINBOOL, + fFocused: WINBOOL, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let fBarFocused: u32 = unsafe { ::std::mem::transmute(fBarFocused) }; + fBarFocused as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let fFocused: u32 = unsafe { ::std::mem::transmute(fFocused) }; + fFocused as u64 + }); + __bindgen_bitfield_unit + } +} +pub type MENUBARINFO = tagMENUBARINFO; +pub type PMENUBARINFO = *mut tagMENUBARINFO; +pub type LPMENUBARINFO = *mut tagMENUBARINFO; +extern "C" { + pub fn GetMenuBarInfo(hwnd: HWND, idObject: LONG, idItem: LONG, pmbi: PMENUBARINFO) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSCROLLBARINFO { + pub cbSize: DWORD, + pub rcScrollBar: RECT, + pub dxyLineButton: ::std::os::raw::c_int, + pub xyThumbTop: ::std::os::raw::c_int, + pub xyThumbBottom: ::std::os::raw::c_int, + pub reserved: ::std::os::raw::c_int, + pub rgstate: [DWORD; 6usize], +} +pub type SCROLLBARINFO = tagSCROLLBARINFO; +pub type PSCROLLBARINFO = *mut tagSCROLLBARINFO; +pub type LPSCROLLBARINFO = *mut tagSCROLLBARINFO; +extern "C" { + pub fn GetScrollBarInfo(hwnd: HWND, idObject: LONG, psbi: PSCROLLBARINFO) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOMBOBOXINFO { + pub cbSize: DWORD, + pub rcItem: RECT, + pub rcButton: RECT, + pub stateButton: DWORD, + pub hwndCombo: HWND, + pub hwndItem: HWND, + pub hwndList: HWND, +} +pub type COMBOBOXINFO = tagCOMBOBOXINFO; +pub type PCOMBOBOXINFO = *mut tagCOMBOBOXINFO; +pub type LPCOMBOBOXINFO = *mut tagCOMBOBOXINFO; +extern "C" { + pub fn GetComboBoxInfo(hwndCombo: HWND, pcbi: PCOMBOBOXINFO) -> WINBOOL; +} +extern "C" { + pub fn GetAncestor(hwnd: HWND, gaFlags: UINT) -> HWND; +} +extern "C" { + pub fn RealChildWindowFromPoint(hwndParent: HWND, ptParentClientCoords: POINT) -> HWND; +} +extern "C" { + pub fn RealGetWindowClassA(hwnd: HWND, ptszClassName: LPSTR, cchClassNameMax: UINT) -> UINT; +} +extern "C" { + pub fn RealGetWindowClassW(hwnd: HWND, ptszClassName: LPWSTR, cchClassNameMax: UINT) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagALTTABINFO { + pub cbSize: DWORD, + pub cItems: ::std::os::raw::c_int, + pub cColumns: ::std::os::raw::c_int, + pub cRows: ::std::os::raw::c_int, + pub iColFocus: ::std::os::raw::c_int, + pub iRowFocus: ::std::os::raw::c_int, + pub cxItem: ::std::os::raw::c_int, + pub cyItem: ::std::os::raw::c_int, + pub ptStart: POINT, +} +pub type ALTTABINFO = tagALTTABINFO; +pub type PALTTABINFO = *mut tagALTTABINFO; +pub type LPALTTABINFO = *mut tagALTTABINFO; +extern "C" { + pub fn GetAltTabInfoA( + hwnd: HWND, + iItem: ::std::os::raw::c_int, + pati: PALTTABINFO, + pszItemText: LPSTR, + cchItemText: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetAltTabInfoW( + hwnd: HWND, + iItem: ::std::os::raw::c_int, + pati: PALTTABINFO, + pszItemText: LPWSTR, + cchItemText: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetListBoxInfo(hwnd: HWND) -> DWORD; +} +extern "C" { + pub fn LockWorkStation() -> WINBOOL; +} +extern "C" { + pub fn UserHandleGrantAccess(hUserHandle: HANDLE, hJob: HANDLE, bGrant: WINBOOL) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HRAWINPUT__ { + pub unused: ::std::os::raw::c_int, +} +pub type HRAWINPUT = *mut HRAWINPUT__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRAWINPUTHEADER { + pub dwType: DWORD, + pub dwSize: DWORD, + pub hDevice: HANDLE, + pub wParam: WPARAM, +} +pub type RAWINPUTHEADER = tagRAWINPUTHEADER; +pub type PRAWINPUTHEADER = *mut tagRAWINPUTHEADER; +pub type LPRAWINPUTHEADER = *mut tagRAWINPUTHEADER; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagRAWMOUSE { + pub usFlags: USHORT, + pub __bindgen_anon_1: tagRAWMOUSE__bindgen_ty_1, + pub ulRawButtons: ULONG, + pub lLastX: LONG, + pub lLastY: LONG, + pub ulExtraInformation: ULONG, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tagRAWMOUSE__bindgen_ty_1 { + pub ulButtons: ULONG, + pub __bindgen_anon_1: tagRAWMOUSE__bindgen_ty_1__bindgen_ty_1, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRAWMOUSE__bindgen_ty_1__bindgen_ty_1 { + pub usButtonFlags: USHORT, + pub usButtonData: USHORT, +} +pub type RAWMOUSE = tagRAWMOUSE; +pub type PRAWMOUSE = *mut tagRAWMOUSE; +pub type LPRAWMOUSE = *mut tagRAWMOUSE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRAWKEYBOARD { + pub MakeCode: USHORT, + pub Flags: USHORT, + pub Reserved: USHORT, + pub VKey: USHORT, + pub Message: UINT, + pub ExtraInformation: ULONG, +} +pub type RAWKEYBOARD = tagRAWKEYBOARD; +pub type PRAWKEYBOARD = *mut tagRAWKEYBOARD; +pub type LPRAWKEYBOARD = *mut tagRAWKEYBOARD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRAWHID { + pub dwSizeHid: DWORD, + pub dwCount: DWORD, + pub bRawData: [BYTE; 1usize], +} +pub type RAWHID = tagRAWHID; +pub type PRAWHID = *mut tagRAWHID; +pub type LPRAWHID = *mut tagRAWHID; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagRAWINPUT { + pub header: RAWINPUTHEADER, + pub data: tagRAWINPUT__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tagRAWINPUT__bindgen_ty_1 { + pub mouse: RAWMOUSE, + pub keyboard: RAWKEYBOARD, + pub hid: RAWHID, + _bindgen_union_align: [u32; 6usize], +} +pub type RAWINPUT = tagRAWINPUT; +pub type PRAWINPUT = *mut tagRAWINPUT; +pub type LPRAWINPUT = *mut tagRAWINPUT; +extern "C" { + pub fn GetRawInputData( + hRawInput: HRAWINPUT, + uiCommand: UINT, + pData: LPVOID, + pcbSize: PUINT, + cbSizeHeader: UINT, + ) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRID_DEVICE_INFO_MOUSE { + pub dwId: DWORD, + pub dwNumberOfButtons: DWORD, + pub dwSampleRate: DWORD, + pub fHasHorizontalWheel: WINBOOL, +} +pub type RID_DEVICE_INFO_MOUSE = tagRID_DEVICE_INFO_MOUSE; +pub type PRID_DEVICE_INFO_MOUSE = *mut tagRID_DEVICE_INFO_MOUSE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRID_DEVICE_INFO_KEYBOARD { + pub dwType: DWORD, + pub dwSubType: DWORD, + pub dwKeyboardMode: DWORD, + pub dwNumberOfFunctionKeys: DWORD, + pub dwNumberOfIndicators: DWORD, + pub dwNumberOfKeysTotal: DWORD, +} +pub type RID_DEVICE_INFO_KEYBOARD = tagRID_DEVICE_INFO_KEYBOARD; +pub type PRID_DEVICE_INFO_KEYBOARD = *mut tagRID_DEVICE_INFO_KEYBOARD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRID_DEVICE_INFO_HID { + pub dwVendorId: DWORD, + pub dwProductId: DWORD, + pub dwVersionNumber: DWORD, + pub usUsagePage: USHORT, + pub usUsage: USHORT, +} +pub type RID_DEVICE_INFO_HID = tagRID_DEVICE_INFO_HID; +pub type PRID_DEVICE_INFO_HID = *mut tagRID_DEVICE_INFO_HID; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagRID_DEVICE_INFO { + pub cbSize: DWORD, + pub dwType: DWORD, + pub __bindgen_anon_1: tagRID_DEVICE_INFO__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tagRID_DEVICE_INFO__bindgen_ty_1 { + pub mouse: RID_DEVICE_INFO_MOUSE, + pub keyboard: RID_DEVICE_INFO_KEYBOARD, + pub hid: RID_DEVICE_INFO_HID, + _bindgen_union_align: [u32; 6usize], +} +pub type RID_DEVICE_INFO = tagRID_DEVICE_INFO; +pub type PRID_DEVICE_INFO = *mut tagRID_DEVICE_INFO; +pub type LPRID_DEVICE_INFO = *mut tagRID_DEVICE_INFO; +extern "C" { + pub fn GetRawInputDeviceInfoA( + hDevice: HANDLE, + uiCommand: UINT, + pData: LPVOID, + pcbSize: PUINT, + ) -> UINT; +} +extern "C" { + pub fn GetRawInputDeviceInfoW( + hDevice: HANDLE, + uiCommand: UINT, + pData: LPVOID, + pcbSize: PUINT, + ) -> UINT; +} +extern "C" { + pub fn GetRawInputBuffer(pData: PRAWINPUT, pcbSize: PUINT, cbSizeHeader: UINT) -> UINT; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRAWINPUTDEVICE { + pub usUsagePage: USHORT, + pub usUsage: USHORT, + pub dwFlags: DWORD, + pub hwndTarget: HWND, +} +pub type RAWINPUTDEVICE = tagRAWINPUTDEVICE; +pub type PRAWINPUTDEVICE = *mut tagRAWINPUTDEVICE; +pub type LPRAWINPUTDEVICE = *mut tagRAWINPUTDEVICE; +pub type PCRAWINPUTDEVICE = *const RAWINPUTDEVICE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRAWINPUTDEVICELIST { + pub hDevice: HANDLE, + pub dwType: DWORD, +} +pub type RAWINPUTDEVICELIST = tagRAWINPUTDEVICELIST; +pub type PRAWINPUTDEVICELIST = *mut tagRAWINPUTDEVICELIST; +extern "C" { + pub fn RegisterRawInputDevices( + pRawInputDevices: PCRAWINPUTDEVICE, + uiNumDevices: UINT, + cbSize: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn GetRegisteredRawInputDevices( + pRawInputDevices: PRAWINPUTDEVICE, + puiNumDevices: PUINT, + cbSize: UINT, + ) -> UINT; +} +extern "C" { + pub fn GetRawInputDeviceList( + pRawInputDeviceList: PRAWINPUTDEVICELIST, + puiNumDevices: PUINT, + cbSize: UINT, + ) -> UINT; +} +extern "C" { + pub fn DefRawInputProc(paRawInput: *mut PRAWINPUT, nInput: INT, cbSizeHeader: UINT) -> LRESULT; +} +extern "C" { + pub fn ShutdownBlockReasonCreate(hWnd: HWND, pwszReason: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn ShutdownBlockReasonQuery(hWnd: HWND, pwszBuff: LPWSTR, pcchBuff: *mut DWORD) -> WINBOOL; +} +extern "C" { + pub fn ShutdownBlockReasonDestroy(hWnd: HWND) -> WINBOOL; +} +extern "C" { + pub fn GetTimeFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpTime: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpTimeStr: LPWSTR, + cchTime: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetDateFormatEx( + lpLocaleName: LPCWSTR, + dwFlags: DWORD, + lpDate: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpDateStr: LPWSTR, + cchDate: ::std::os::raw::c_int, + lpCalendar: LPCWSTR, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetDateFormatA( + Locale: LCID, + dwFlags: DWORD, + lpDate: *const SYSTEMTIME, + lpFormat: LPCSTR, + lpDateStr: LPSTR, + cchDate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetDateFormatW( + Locale: LCID, + dwFlags: DWORD, + lpDate: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpDateStr: LPWSTR, + cchDate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetTimeFormatA( + Locale: LCID, + dwFlags: DWORD, + lpTime: *const SYSTEMTIME, + lpFormat: LPCSTR, + lpTimeStr: LPSTR, + cchTime: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetTimeFormatW( + Locale: LCID, + dwFlags: DWORD, + lpTime: *const SYSTEMTIME, + lpFormat: LPCWSTR, + lpTimeStr: LPWSTR, + cchTime: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +pub type LGRPID = DWORD; +pub type LCTYPE = DWORD; +pub type CALTYPE = DWORD; +pub type CALID = DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _cpinfo { + pub MaxCharSize: UINT, + pub DefaultChar: [BYTE; 2usize], + pub LeadByte: [BYTE; 12usize], +} +pub type CPINFO = _cpinfo; +pub type LPCPINFO = *mut _cpinfo; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _cpinfoexA { + pub MaxCharSize: UINT, + pub DefaultChar: [BYTE; 2usize], + pub LeadByte: [BYTE; 12usize], + pub UnicodeDefaultChar: WCHAR, + pub CodePage: UINT, + pub CodePageName: [CHAR; 260usize], +} +pub type CPINFOEXA = _cpinfoexA; +pub type LPCPINFOEXA = *mut _cpinfoexA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _cpinfoexW { + pub MaxCharSize: UINT, + pub DefaultChar: [BYTE; 2usize], + pub LeadByte: [BYTE; 12usize], + pub UnicodeDefaultChar: WCHAR, + pub CodePage: UINT, + pub CodePageName: [WCHAR; 260usize], +} +pub type CPINFOEXW = _cpinfoexW; +pub type LPCPINFOEXW = *mut _cpinfoexW; +pub type CPINFOEX = CPINFOEXA; +pub type LPCPINFOEX = LPCPINFOEXA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _numberfmtA { + pub NumDigits: UINT, + pub LeadingZero: UINT, + pub Grouping: UINT, + pub lpDecimalSep: LPSTR, + pub lpThousandSep: LPSTR, + pub NegativeOrder: UINT, +} +pub type NUMBERFMTA = _numberfmtA; +pub type LPNUMBERFMTA = *mut _numberfmtA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _numberfmtW { + pub NumDigits: UINT, + pub LeadingZero: UINT, + pub Grouping: UINT, + pub lpDecimalSep: LPWSTR, + pub lpThousandSep: LPWSTR, + pub NegativeOrder: UINT, +} +pub type NUMBERFMTW = _numberfmtW; +pub type LPNUMBERFMTW = *mut _numberfmtW; +pub type NUMBERFMT = NUMBERFMTA; +pub type LPNUMBERFMT = LPNUMBERFMTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _currencyfmtA { + pub NumDigits: UINT, + pub LeadingZero: UINT, + pub Grouping: UINT, + pub lpDecimalSep: LPSTR, + pub lpThousandSep: LPSTR, + pub NegativeOrder: UINT, + pub PositiveOrder: UINT, + pub lpCurrencySymbol: LPSTR, +} +pub type CURRENCYFMTA = _currencyfmtA; +pub type LPCURRENCYFMTA = *mut _currencyfmtA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _currencyfmtW { + pub NumDigits: UINT, + pub LeadingZero: UINT, + pub Grouping: UINT, + pub lpDecimalSep: LPWSTR, + pub lpThousandSep: LPWSTR, + pub NegativeOrder: UINT, + pub PositiveOrder: UINT, + pub lpCurrencySymbol: LPWSTR, +} +pub type CURRENCYFMTW = _currencyfmtW; +pub type LPCURRENCYFMTW = *mut _currencyfmtW; +pub type CURRENCYFMT = CURRENCYFMTA; +pub type LPCURRENCYFMT = LPCURRENCYFMTA; +pub const SYSNLS_FUNCTION_COMPARE_STRING: SYSNLS_FUNCTION = 1; +pub type SYSNLS_FUNCTION = u32; +pub type NLS_FUNCTION = DWORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _nlsversioninfo { + pub dwNLSVersionInfoSize: DWORD, + pub dwNLSVersion: DWORD, + pub dwDefinedVersion: DWORD, +} +pub type NLSVERSIONINFO = _nlsversioninfo; +pub type LPNLSVERSIONINFO = *mut _nlsversioninfo; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _nlsversioninfoex { + pub dwNLSVersionInfoSize: DWORD, + pub dwNLSVersion: DWORD, + pub dwDefinedVersion: DWORD, + pub dwEffectiveId: DWORD, + pub guidCustomVersion: GUID, +} +pub type NLSVERSIONINFOEX = _nlsversioninfoex; +pub type LPNLSVERSIONINFOEX = *mut _nlsversioninfoex; +pub type GEOID = LONG; +pub type GEOTYPE = DWORD; +pub type GEOCLASS = DWORD; +pub const SYSGEOTYPE_GEO_NATION: SYSGEOTYPE = 1; +pub const SYSGEOTYPE_GEO_LATITUDE: SYSGEOTYPE = 2; +pub const SYSGEOTYPE_GEO_LONGITUDE: SYSGEOTYPE = 3; +pub const SYSGEOTYPE_GEO_ISO2: SYSGEOTYPE = 4; +pub const SYSGEOTYPE_GEO_ISO3: SYSGEOTYPE = 5; +pub const SYSGEOTYPE_GEO_RFC1766: SYSGEOTYPE = 6; +pub const SYSGEOTYPE_GEO_LCID: SYSGEOTYPE = 7; +pub const SYSGEOTYPE_GEO_FRIENDLYNAME: SYSGEOTYPE = 8; +pub const SYSGEOTYPE_GEO_OFFICIALNAME: SYSGEOTYPE = 9; +pub const SYSGEOTYPE_GEO_TIMEZONES: SYSGEOTYPE = 10; +pub const SYSGEOTYPE_GEO_OFFICIALLANGUAGES: SYSGEOTYPE = 11; +pub const SYSGEOTYPE_GEO_ISO_UN_NUMBER: SYSGEOTYPE = 12; +pub const SYSGEOTYPE_GEO_PARENT: SYSGEOTYPE = 13; +pub type SYSGEOTYPE = u32; +pub const SYSGEOCLASS_GEOCLASS_NATION: SYSGEOCLASS = 16; +pub const SYSGEOCLASS_GEOCLASS_REGION: SYSGEOCLASS = 14; +pub const SYSGEOCLASS_GEOCLASS_ALL: SYSGEOCLASS = 0; +pub type SYSGEOCLASS = u32; +pub type LANGUAGEGROUP_ENUMPROCA = ::std::option::Option< + unsafe extern "C" fn( + arg1: LGRPID, + arg2: LPSTR, + arg3: LPSTR, + arg4: DWORD, + arg5: LONG_PTR, + ) -> WINBOOL, +>; +pub type LANGGROUPLOCALE_ENUMPROCA = ::std::option::Option< + unsafe extern "C" fn(arg1: LGRPID, arg2: LCID, arg3: LPSTR, arg4: LONG_PTR) -> WINBOOL, +>; +pub type UILANGUAGE_ENUMPROCA = + ::std::option::Option WINBOOL>; +pub type CODEPAGE_ENUMPROCA = ::std::option::Option WINBOOL>; +pub type DATEFMT_ENUMPROCA = ::std::option::Option WINBOOL>; +pub type DATEFMT_ENUMPROCEXA = + ::std::option::Option WINBOOL>; +pub type TIMEFMT_ENUMPROCA = ::std::option::Option WINBOOL>; +pub type CALINFO_ENUMPROCA = ::std::option::Option WINBOOL>; +pub type CALINFO_ENUMPROCEXA = + ::std::option::Option WINBOOL>; +pub type LOCALE_ENUMPROCA = ::std::option::Option WINBOOL>; +pub type LOCALE_ENUMPROCW = ::std::option::Option WINBOOL>; +pub type LANGUAGEGROUP_ENUMPROCW = ::std::option::Option< + unsafe extern "C" fn( + arg1: LGRPID, + arg2: LPWSTR, + arg3: LPWSTR, + arg4: DWORD, + arg5: LONG_PTR, + ) -> WINBOOL, +>; +pub type LANGGROUPLOCALE_ENUMPROCW = ::std::option::Option< + unsafe extern "C" fn(arg1: LGRPID, arg2: LCID, arg3: LPWSTR, arg4: LONG_PTR) -> WINBOOL, +>; +pub type UILANGUAGE_ENUMPROCW = + ::std::option::Option WINBOOL>; +pub type CODEPAGE_ENUMPROCW = ::std::option::Option WINBOOL>; +pub type DATEFMT_ENUMPROCW = ::std::option::Option WINBOOL>; +pub type DATEFMT_ENUMPROCEXW = + ::std::option::Option WINBOOL>; +pub type TIMEFMT_ENUMPROCW = ::std::option::Option WINBOOL>; +pub type CALINFO_ENUMPROCW = ::std::option::Option WINBOOL>; +pub type CALINFO_ENUMPROCEXW = + ::std::option::Option WINBOOL>; +pub type GEO_ENUMPROC = ::std::option::Option WINBOOL>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FILEMUIINFO { + pub dwSize: DWORD, + pub dwVersion: DWORD, + pub dwFileType: DWORD, + pub pChecksum: [BYTE; 16usize], + pub pServiceChecksum: [BYTE; 16usize], + pub dwLanguageNameOffset: DWORD, + pub dwTypeIDMainSize: DWORD, + pub dwTypeIDMainOffset: DWORD, + pub dwTypeNameMainOffset: DWORD, + pub dwTypeIDMUISize: DWORD, + pub dwTypeIDMUIOffset: DWORD, + pub dwTypeNameMUIOffset: DWORD, + pub abBuffer: [BYTE; 8usize], +} +pub type FILEMUIINFO = _FILEMUIINFO; +pub type PFILEMUIINFO = *mut _FILEMUIINFO; +extern "C" { + pub fn CompareStringW( + Locale: LCID, + dwCmpFlags: DWORD, + lpString1: PCNZWCH, + cchCount1: ::std::os::raw::c_int, + lpString2: PCNZWCH, + cchCount2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn FoldStringW( + dwMapFlags: DWORD, + lpSrcStr: LPCWCH, + cchSrc: ::std::os::raw::c_int, + lpDestStr: LPWSTR, + cchDest: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetStringTypeExW( + Locale: LCID, + dwInfoType: DWORD, + lpSrcStr: LPCWCH, + cchSrc: ::std::os::raw::c_int, + lpCharType: LPWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetStringTypeW( + dwInfoType: DWORD, + lpSrcStr: LPCWCH, + cchSrc: ::std::os::raw::c_int, + lpCharType: LPWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn MultiByteToWideChar( + CodePage: UINT, + dwFlags: DWORD, + lpMultiByteStr: LPCCH, + cbMultiByte: ::std::os::raw::c_int, + lpWideCharStr: LPWSTR, + cchWideChar: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn WideCharToMultiByte( + CodePage: UINT, + dwFlags: DWORD, + lpWideCharStr: LPCWCH, + cchWideChar: ::std::os::raw::c_int, + lpMultiByteStr: LPSTR, + cbMultiByte: ::std::os::raw::c_int, + lpDefaultChar: LPCCH, + lpUsedDefaultChar: LPBOOL, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn IsValidCodePage(CodePage: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetACP() -> UINT; +} +extern "C" { + pub fn IsDBCSLeadByteEx(CodePage: UINT, TestChar: BYTE) -> WINBOOL; +} +extern "C" { + pub fn GetOEMCP() -> UINT; +} +extern "C" { + pub fn CompareStringA( + Locale: LCID, + dwCmpFlags: DWORD, + lpString1: PCNZCH, + cchCount1: ::std::os::raw::c_int, + lpString2: PCNZCH, + cchCount2: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn LCMapStringW( + Locale: LCID, + dwMapFlags: DWORD, + lpSrcStr: LPCWSTR, + cchSrc: ::std::os::raw::c_int, + lpDestStr: LPWSTR, + cchDest: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn LCMapStringA( + Locale: LCID, + dwMapFlags: DWORD, + lpSrcStr: LPCSTR, + cchSrc: ::std::os::raw::c_int, + lpDestStr: LPSTR, + cchDest: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetLocaleInfoW( + Locale: LCID, + LCType: LCTYPE, + lpLCData: LPWSTR, + cchData: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetLocaleInfoA( + Locale: LCID, + LCType: LCTYPE, + lpLCData: LPSTR, + cchData: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn IsDBCSLeadByte(TestChar: BYTE) -> WINBOOL; +} +extern "C" { + pub fn GetNumberFormatA( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCSTR, + lpFormat: *const NUMBERFMTA, + lpNumberStr: LPSTR, + cchNumber: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetNumberFormatW( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCWSTR, + lpFormat: *const NUMBERFMTW, + lpNumberStr: LPWSTR, + cchNumber: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetCurrencyFormatA( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCSTR, + lpFormat: *const CURRENCYFMTA, + lpCurrencyStr: LPSTR, + cchCurrency: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetCurrencyFormatW( + Locale: LCID, + dwFlags: DWORD, + lpValue: LPCWSTR, + lpFormat: *const CURRENCYFMTW, + lpCurrencyStr: LPWSTR, + cchCurrency: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumCalendarInfoA( + lpCalInfoEnumProc: CALINFO_ENUMPROCA, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumCalendarInfoW( + lpCalInfoEnumProc: CALINFO_ENUMPROCW, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumCalendarInfoExA( + lpCalInfoEnumProcEx: CALINFO_ENUMPROCEXA, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumCalendarInfoExW( + lpCalInfoEnumProcEx: CALINFO_ENUMPROCEXW, + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumTimeFormatsA( + lpTimeFmtEnumProc: TIMEFMT_ENUMPROCA, + Locale: LCID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumTimeFormatsW( + lpTimeFmtEnumProc: TIMEFMT_ENUMPROCW, + Locale: LCID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDateFormatsA( + lpDateFmtEnumProc: DATEFMT_ENUMPROCA, + Locale: LCID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDateFormatsW( + lpDateFmtEnumProc: DATEFMT_ENUMPROCW, + Locale: LCID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDateFormatsExA( + lpDateFmtEnumProcEx: DATEFMT_ENUMPROCEXA, + Locale: LCID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDateFormatsExW( + lpDateFmtEnumProcEx: DATEFMT_ENUMPROCEXW, + Locale: LCID, + dwFlags: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn IsValidLanguageGroup(LanguageGroup: LGRPID, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetNLSVersion( + Function: NLS_FUNCTION, + Locale: LCID, + lpVersionInformation: LPNLSVERSIONINFO, + ) -> WINBOOL; +} +extern "C" { + pub fn IsNLSDefinedString( + Function: NLS_FUNCTION, + dwFlags: DWORD, + lpVersionInformation: LPNLSVERSIONINFO, + lpString: LPCWSTR, + cchStr: INT, + ) -> WINBOOL; +} +extern "C" { + pub fn IsValidLocale(Locale: LCID, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetLocaleInfoA(Locale: LCID, LCType: LCTYPE, lpLCData: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetLocaleInfoW(Locale: LCID, LCType: LCTYPE, lpLCData: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetCalendarInfoA( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPSTR, + cchData: ::std::os::raw::c_int, + lpValue: LPDWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetCalendarInfoW( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPWSTR, + cchData: ::std::os::raw::c_int, + lpValue: LPDWORD, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SetCalendarInfoA( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetCalendarInfoW( + Locale: LCID, + Calendar: CALID, + CalType: CALTYPE, + lpCalData: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetGeoInfoA( + Location: GEOID, + GeoType: GEOTYPE, + lpGeoData: LPSTR, + cchData: ::std::os::raw::c_int, + LangId: LANGID, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn GetGeoInfoW( + Location: GEOID, + GeoType: GEOTYPE, + lpGeoData: LPWSTR, + cchData: ::std::os::raw::c_int, + LangId: LANGID, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumSystemGeoID( + GeoClass: GEOCLASS, + ParentGeoId: GEOID, + lpGeoEnumProc: GEO_ENUMPROC, + ) -> WINBOOL; +} +extern "C" { + pub fn GetUserGeoID(GeoClass: GEOCLASS) -> GEOID; +} +extern "C" { + pub fn GetCPInfo(CodePage: UINT, lpCPInfo: LPCPINFO) -> WINBOOL; +} +extern "C" { + pub fn GetCPInfoExA(CodePage: UINT, dwFlags: DWORD, lpCPInfoEx: LPCPINFOEXA) -> WINBOOL; +} +extern "C" { + pub fn GetCPInfoExW(CodePage: UINT, dwFlags: DWORD, lpCPInfoEx: LPCPINFOEXW) -> WINBOOL; +} +extern "C" { + pub fn SetUserGeoID(GeoId: GEOID) -> WINBOOL; +} +extern "C" { + pub fn ConvertDefaultLocale(Locale: LCID) -> LCID; +} +extern "C" { + pub fn GetThreadLocale() -> LCID; +} +extern "C" { + pub fn SetThreadLocale(Locale: LCID) -> WINBOOL; +} +extern "C" { + pub fn GetSystemDefaultUILanguage() -> LANGID; +} +extern "C" { + pub fn GetUserDefaultUILanguage() -> LANGID; +} +extern "C" { + pub fn GetSystemDefaultLangID() -> LANGID; +} +extern "C" { + pub fn GetUserDefaultLangID() -> LANGID; +} +extern "C" { + pub fn GetSystemDefaultLCID() -> LCID; +} +extern "C" { + pub fn GetUserDefaultLCID() -> LCID; +} +extern "C" { + pub fn SetThreadUILanguage(LangId: LANGID) -> LANGID; +} +extern "C" { + pub fn GetStringTypeExA( + Locale: LCID, + dwInfoType: DWORD, + lpSrcStr: LPCSTR, + cchSrc: ::std::os::raw::c_int, + lpCharType: LPWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetStringTypeA( + Locale: LCID, + dwInfoType: DWORD, + lpSrcStr: LPCSTR, + cchSrc: ::std::os::raw::c_int, + lpCharType: LPWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FoldStringA( + dwMapFlags: DWORD, + lpSrcStr: LPCSTR, + cchSrc: ::std::os::raw::c_int, + lpDestStr: LPSTR, + cchDest: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn EnumSystemLocalesA(lpLocaleEnumProc: LOCALE_ENUMPROCA, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn EnumSystemLocalesW(lpLocaleEnumProc: LOCALE_ENUMPROCW, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn EnumSystemLanguageGroupsA( + lpLanguageGroupEnumProc: LANGUAGEGROUP_ENUMPROCA, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumSystemLanguageGroupsW( + lpLanguageGroupEnumProc: LANGUAGEGROUP_ENUMPROCW, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumLanguageGroupLocalesA( + lpLangGroupLocaleEnumProc: LANGGROUPLOCALE_ENUMPROCA, + LanguageGroup: LGRPID, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumLanguageGroupLocalesW( + lpLangGroupLocaleEnumProc: LANGGROUPLOCALE_ENUMPROCW, + LanguageGroup: LGRPID, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumUILanguagesA( + lpUILanguageEnumProc: UILANGUAGE_ENUMPROCA, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumUILanguagesW( + lpUILanguageEnumProc: UILANGUAGE_ENUMPROCW, + dwFlags: DWORD, + lParam: LONG_PTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumSystemCodePagesA(lpCodePageEnumProc: CODEPAGE_ENUMPROCA, dwFlags: DWORD) -> WINBOOL; +} +extern "C" { + pub fn EnumSystemCodePagesW(lpCodePageEnumProc: CODEPAGE_ENUMPROCW, dwFlags: DWORD) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _COORD { + pub X: SHORT, + pub Y: SHORT, +} +pub type COORD = _COORD; +pub type PCOORD = *mut _COORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SMALL_RECT { + pub Left: SHORT, + pub Top: SHORT, + pub Right: SHORT, + pub Bottom: SHORT, +} +pub type SMALL_RECT = _SMALL_RECT; +pub type PSMALL_RECT = *mut _SMALL_RECT; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _KEY_EVENT_RECORD { + pub bKeyDown: WINBOOL, + pub wRepeatCount: WORD, + pub wVirtualKeyCode: WORD, + pub wVirtualScanCode: WORD, + pub uChar: _KEY_EVENT_RECORD__bindgen_ty_1, + pub dwControlKeyState: DWORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _KEY_EVENT_RECORD__bindgen_ty_1 { + pub UnicodeChar: WCHAR, + pub AsciiChar: CHAR, + _bindgen_union_align: u16, +} +pub type KEY_EVENT_RECORD = _KEY_EVENT_RECORD; +pub type PKEY_EVENT_RECORD = *mut _KEY_EVENT_RECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MOUSE_EVENT_RECORD { + pub dwMousePosition: COORD, + pub dwButtonState: DWORD, + pub dwControlKeyState: DWORD, + pub dwEventFlags: DWORD, +} +pub type MOUSE_EVENT_RECORD = _MOUSE_EVENT_RECORD; +pub type PMOUSE_EVENT_RECORD = *mut _MOUSE_EVENT_RECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _WINDOW_BUFFER_SIZE_RECORD { + pub dwSize: COORD, +} +pub type WINDOW_BUFFER_SIZE_RECORD = _WINDOW_BUFFER_SIZE_RECORD; +pub type PWINDOW_BUFFER_SIZE_RECORD = *mut _WINDOW_BUFFER_SIZE_RECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MENU_EVENT_RECORD { + pub dwCommandId: UINT, +} +pub type MENU_EVENT_RECORD = _MENU_EVENT_RECORD; +pub type PMENU_EVENT_RECORD = *mut _MENU_EVENT_RECORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _FOCUS_EVENT_RECORD { + pub bSetFocus: WINBOOL, +} +pub type FOCUS_EVENT_RECORD = _FOCUS_EVENT_RECORD; +pub type PFOCUS_EVENT_RECORD = *mut _FOCUS_EVENT_RECORD; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _INPUT_RECORD { + pub EventType: WORD, + pub Event: _INPUT_RECORD__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _INPUT_RECORD__bindgen_ty_1 { + pub KeyEvent: KEY_EVENT_RECORD, + pub MouseEvent: MOUSE_EVENT_RECORD, + pub WindowBufferSizeEvent: WINDOW_BUFFER_SIZE_RECORD, + pub MenuEvent: MENU_EVENT_RECORD, + pub FocusEvent: FOCUS_EVENT_RECORD, + _bindgen_union_align: [u32; 4usize], +} +pub type INPUT_RECORD = _INPUT_RECORD; +pub type PINPUT_RECORD = *mut _INPUT_RECORD; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _CHAR_INFO { + pub Char: _CHAR_INFO__bindgen_ty_1, + pub Attributes: WORD, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _CHAR_INFO__bindgen_ty_1 { + pub UnicodeChar: WCHAR, + pub AsciiChar: CHAR, + _bindgen_union_align: u16, +} +pub type CHAR_INFO = _CHAR_INFO; +pub type PCHAR_INFO = *mut _CHAR_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_SCREEN_BUFFER_INFO { + pub dwSize: COORD, + pub dwCursorPosition: COORD, + pub wAttributes: WORD, + pub srWindow: SMALL_RECT, + pub dwMaximumWindowSize: COORD, +} +pub type CONSOLE_SCREEN_BUFFER_INFO = _CONSOLE_SCREEN_BUFFER_INFO; +pub type PCONSOLE_SCREEN_BUFFER_INFO = *mut _CONSOLE_SCREEN_BUFFER_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_CURSOR_INFO { + pub dwSize: DWORD, + pub bVisible: WINBOOL, +} +pub type CONSOLE_CURSOR_INFO = _CONSOLE_CURSOR_INFO; +pub type PCONSOLE_CURSOR_INFO = *mut _CONSOLE_CURSOR_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_FONT_INFO { + pub nFont: DWORD, + pub dwFontSize: COORD, +} +pub type CONSOLE_FONT_INFO = _CONSOLE_FONT_INFO; +pub type PCONSOLE_FONT_INFO = *mut _CONSOLE_FONT_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_SELECTION_INFO { + pub dwFlags: DWORD, + pub dwSelectionAnchor: COORD, + pub srSelection: SMALL_RECT, +} +pub type CONSOLE_SELECTION_INFO = _CONSOLE_SELECTION_INFO; +pub type PCONSOLE_SELECTION_INFO = *mut _CONSOLE_SELECTION_INFO; +pub type PHANDLER_ROUTINE = ::std::option::Option WINBOOL>; +extern "C" { + pub fn PeekConsoleInputA( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn PeekConsoleInputW( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleInputA( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleInputW( + hConsoleInput: HANDLE, + lpBuffer: PINPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleInputA( + hConsoleInput: HANDLE, + lpBuffer: *const INPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleInputW( + hConsoleInput: HANDLE, + lpBuffer: *const INPUT_RECORD, + nLength: DWORD, + lpNumberOfEventsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleOutputA( + hConsoleOutput: HANDLE, + lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleOutputW( + hConsoleOutput: HANDLE, + lpBuffer: PCHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpReadRegion: PSMALL_RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleOutputA( + hConsoleOutput: HANDLE, + lpBuffer: *const CHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleOutputW( + hConsoleOutput: HANDLE, + lpBuffer: *const CHAR_INFO, + dwBufferSize: COORD, + dwBufferCoord: COORD, + lpWriteRegion: PSMALL_RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleOutputCharacterA( + hConsoleOutput: HANDLE, + lpCharacter: LPSTR, + nLength: DWORD, + dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleOutputCharacterW( + hConsoleOutput: HANDLE, + lpCharacter: LPWSTR, + nLength: DWORD, + dwReadCoord: COORD, + lpNumberOfCharsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleOutputAttribute( + hConsoleOutput: HANDLE, + lpAttribute: LPWORD, + nLength: DWORD, + dwReadCoord: COORD, + lpNumberOfAttrsRead: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleOutputCharacterA( + hConsoleOutput: HANDLE, + lpCharacter: LPCSTR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleOutputCharacterW( + hConsoleOutput: HANDLE, + lpCharacter: LPCWSTR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleOutputAttribute( + hConsoleOutput: HANDLE, + lpAttribute: *const WORD, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfAttrsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FillConsoleOutputCharacterA( + hConsoleOutput: HANDLE, + cCharacter: CHAR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FillConsoleOutputCharacterW( + hConsoleOutput: HANDLE, + cCharacter: WCHAR, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfCharsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn FillConsoleOutputAttribute( + hConsoleOutput: HANDLE, + wAttribute: WORD, + nLength: DWORD, + dwWriteCoord: COORD, + lpNumberOfAttrsWritten: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleMode(hConsoleHandle: HANDLE, lpMode: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn GetNumberOfConsoleInputEvents( + hConsoleInput: HANDLE, + lpNumberOfEvents: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleScreenBufferInfo( + hConsoleOutput: HANDLE, + lpConsoleScreenBufferInfo: PCONSOLE_SCREEN_BUFFER_INFO, + ) -> WINBOOL; +} +extern "C" { + pub fn GetLargestConsoleWindowSize(hConsoleOutput: HANDLE) -> COORD; +} +extern "C" { + pub fn GetConsoleCursorInfo( + hConsoleOutput: HANDLE, + lpConsoleCursorInfo: PCONSOLE_CURSOR_INFO, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentConsoleFont( + hConsoleOutput: HANDLE, + bMaximumWindow: WINBOOL, + lpConsoleCurrentFont: PCONSOLE_FONT_INFO, + ) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleFontSize(hConsoleOutput: HANDLE, nFont: DWORD) -> COORD; +} +extern "C" { + pub fn GetConsoleSelectionInfo(lpConsoleSelectionInfo: PCONSOLE_SELECTION_INFO) -> WINBOOL; +} +extern "C" { + pub fn GetNumberOfConsoleMouseButtons(lpNumberOfMouseButtons: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleMode(hConsoleHandle: HANDLE, dwMode: DWORD) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleActiveScreenBuffer(hConsoleOutput: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn FlushConsoleInputBuffer(hConsoleInput: HANDLE) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleScreenBufferSize(hConsoleOutput: HANDLE, dwSize: COORD) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleCursorPosition(hConsoleOutput: HANDLE, dwCursorPosition: COORD) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleCursorInfo( + hConsoleOutput: HANDLE, + lpConsoleCursorInfo: *const CONSOLE_CURSOR_INFO, + ) -> WINBOOL; +} +extern "C" { + pub fn ScrollConsoleScreenBufferA( + hConsoleOutput: HANDLE, + lpScrollRectangle: *const SMALL_RECT, + lpClipRectangle: *const SMALL_RECT, + dwDestinationOrigin: COORD, + lpFill: *const CHAR_INFO, + ) -> WINBOOL; +} +extern "C" { + pub fn ScrollConsoleScreenBufferW( + hConsoleOutput: HANDLE, + lpScrollRectangle: *const SMALL_RECT, + lpClipRectangle: *const SMALL_RECT, + dwDestinationOrigin: COORD, + lpFill: *const CHAR_INFO, + ) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleWindowInfo( + hConsoleOutput: HANDLE, + bAbsolute: WINBOOL, + lpConsoleWindow: *const SMALL_RECT, + ) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleTextAttribute(hConsoleOutput: HANDLE, wAttributes: WORD) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleCtrlHandler(HandlerRoutine: PHANDLER_ROUTINE, Add: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn GenerateConsoleCtrlEvent(dwCtrlEvent: DWORD, dwProcessGroupId: DWORD) -> WINBOOL; +} +extern "C" { + pub fn AllocConsole() -> WINBOOL; +} +extern "C" { + pub fn FreeConsole() -> WINBOOL; +} +extern "C" { + pub fn AttachConsole(dwProcessId: DWORD) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleTitleA(lpConsoleTitle: LPSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn GetConsoleTitleW(lpConsoleTitle: LPWSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn SetConsoleTitleA(lpConsoleTitle: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleTitleW(lpConsoleTitle: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleA( + hConsoleInput: HANDLE, + lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, + lpNumberOfCharsRead: LPDWORD, + lpReserved: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn ReadConsoleW( + hConsoleInput: HANDLE, + lpBuffer: LPVOID, + nNumberOfCharsToRead: DWORD, + lpNumberOfCharsRead: LPDWORD, + lpReserved: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleA( + hConsoleOutput: HANDLE, + lpBuffer: *const ::std::os::raw::c_void, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, + lpReserved: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn WriteConsoleW( + hConsoleOutput: HANDLE, + lpBuffer: *const ::std::os::raw::c_void, + nNumberOfCharsToWrite: DWORD, + lpNumberOfCharsWritten: LPDWORD, + lpReserved: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateConsoleScreenBuffer( + dwDesiredAccess: DWORD, + dwShareMode: DWORD, + lpSecurityAttributes: *const SECURITY_ATTRIBUTES, + dwFlags: DWORD, + lpScreenBufferData: LPVOID, + ) -> HANDLE; +} +extern "C" { + pub fn GetConsoleCP() -> UINT; +} +extern "C" { + pub fn SetConsoleCP(wCodePageID: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleOutputCP() -> UINT; +} +extern "C" { + pub fn SetConsoleOutputCP(wCodePageID: UINT) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleDisplayMode(lpModeFlags: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleDisplayMode( + hConsoleOutput: HANDLE, + dwFlags: DWORD, + lpNewScreenBufferDimensions: PCOORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleWindow() -> HWND; +} +extern "C" { + pub fn GetConsoleProcessList(lpdwProcessList: LPDWORD, dwProcessCount: DWORD) -> DWORD; +} +extern "C" { + pub fn AddConsoleAliasA(Source: LPSTR, Target: LPSTR, ExeName: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn AddConsoleAliasW(Source: LPWSTR, Target: LPWSTR, ExeName: LPWSTR) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleAliasA( + Source: LPSTR, + TargetBuffer: LPSTR, + TargetBufferLength: DWORD, + ExeName: LPSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasW( + Source: LPWSTR, + TargetBuffer: LPWSTR, + TargetBufferLength: DWORD, + ExeName: LPWSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasesLengthA(ExeName: LPSTR) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasesLengthW(ExeName: LPWSTR) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasExesLengthA() -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasExesLengthW() -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasesA( + AliasBuffer: LPSTR, + AliasBufferLength: DWORD, + ExeName: LPSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasesW( + AliasBuffer: LPWSTR, + AliasBufferLength: DWORD, + ExeName: LPWSTR, + ) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasExesA(ExeNameBuffer: LPSTR, ExeNameBufferLength: DWORD) -> DWORD; +} +extern "C" { + pub fn GetConsoleAliasExesW(ExeNameBuffer: LPWSTR, ExeNameBufferLength: DWORD) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_FONT_INFOEX { + pub cbSize: ULONG, + pub nFont: DWORD, + pub dwFontSize: COORD, + pub FontFamily: UINT, + pub FontWeight: UINT, + pub FaceName: [WCHAR; 32usize], +} +pub type CONSOLE_FONT_INFOEX = _CONSOLE_FONT_INFOEX; +pub type PCONSOLE_FONT_INFOEX = *mut _CONSOLE_FONT_INFOEX; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_HISTORY_INFO { + pub cbSize: UINT, + pub HistoryBufferSize: UINT, + pub NumberOfHistoryBuffers: UINT, + pub dwFlags: DWORD, +} +pub type CONSOLE_HISTORY_INFO = _CONSOLE_HISTORY_INFO; +pub type PCONSOLE_HISTORY_INFO = *mut _CONSOLE_HISTORY_INFO; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_READCONSOLE_CONTROL { + pub nLength: ULONG, + pub nInitialChars: ULONG, + pub dwCtrlWakeupMask: ULONG, + pub dwControlKeyState: ULONG, +} +pub type CONSOLE_READCONSOLE_CONTROL = _CONSOLE_READCONSOLE_CONTROL; +pub type PCONSOLE_READCONSOLE_CONTROL = *mut _CONSOLE_READCONSOLE_CONTROL; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONSOLE_SCREEN_BUFFER_INFOEX { + pub cbSize: ULONG, + pub dwSize: COORD, + pub dwCursorPosition: COORD, + pub wAttributes: WORD, + pub srWindow: SMALL_RECT, + pub dwMaximumWindowSize: COORD, + pub wPopupAttributes: WORD, + pub bFullscreenSupported: WINBOOL, + pub ColorTable: [COLORREF; 16usize], +} +pub type CONSOLE_SCREEN_BUFFER_INFOEX = _CONSOLE_SCREEN_BUFFER_INFOEX; +pub type PCONSOLE_SCREEN_BUFFER_INFOEX = *mut _CONSOLE_SCREEN_BUFFER_INFOEX; +extern "C" { + pub fn GetConsoleHistoryInfo(lpConsoleHistoryInfo: PCONSOLE_HISTORY_INFO) -> WINBOOL; +} +extern "C" { + pub fn GetConsoleScreenBufferInfoEx( + hConsoleOutput: HANDLE, + lpConsoleScreenBufferInfoEx: PCONSOLE_SCREEN_BUFFER_INFOEX, + ) -> WINBOOL; +} +extern "C" { + pub fn GetCurrentConsoleFontEx( + hConsoleOutput: HANDLE, + bMaximumWindow: WINBOOL, + lpConsoleCurrentFontEx: PCONSOLE_FONT_INFOEX, + ) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleHistoryInfo(lpConsoleHistoryInfo: PCONSOLE_HISTORY_INFO) -> WINBOOL; +} +extern "C" { + pub fn SetConsoleScreenBufferInfoEx( + hConsoleOutput: HANDLE, + lpConsoleScreenBufferInfoEx: PCONSOLE_SCREEN_BUFFER_INFOEX, + ) -> WINBOOL; +} +extern "C" { + pub fn SetCurrentConsoleFontEx( + hConsoleOutput: HANDLE, + bMaximumWindow: WINBOOL, + lpConsoleCurrentFontEx: PCONSOLE_FONT_INFOEX, + ) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagVS_FIXEDFILEINFO { + pub dwSignature: DWORD, + pub dwStrucVersion: DWORD, + pub dwFileVersionMS: DWORD, + pub dwFileVersionLS: DWORD, + pub dwProductVersionMS: DWORD, + pub dwProductVersionLS: DWORD, + pub dwFileFlagsMask: DWORD, + pub dwFileFlags: DWORD, + pub dwFileOS: DWORD, + pub dwFileType: DWORD, + pub dwFileSubtype: DWORD, + pub dwFileDateMS: DWORD, + pub dwFileDateLS: DWORD, +} +pub type VS_FIXEDFILEINFO = tagVS_FIXEDFILEINFO; +extern "C" { + pub fn VerFindFileA( + uFlags: DWORD, + szFileName: LPSTR, + szWinDir: LPSTR, + szAppDir: LPSTR, + szCurDir: LPSTR, + lpuCurDirLen: PUINT, + szDestDir: LPSTR, + lpuDestDirLen: PUINT, + ) -> DWORD; +} +extern "C" { + pub fn VerFindFileW( + uFlags: DWORD, + szFileName: LPWSTR, + szWinDir: LPWSTR, + szAppDir: LPWSTR, + szCurDir: LPWSTR, + lpuCurDirLen: PUINT, + szDestDir: LPWSTR, + lpuDestDirLen: PUINT, + ) -> DWORD; +} +extern "C" { + pub fn VerInstallFileA( + uFlags: DWORD, + szSrcFileName: LPSTR, + szDestFileName: LPSTR, + szSrcDir: LPSTR, + szDestDir: LPSTR, + szCurDir: LPSTR, + szTmpFile: LPSTR, + lpuTmpFileLen: PUINT, + ) -> DWORD; +} +extern "C" { + pub fn VerInstallFileW( + uFlags: DWORD, + szSrcFileName: LPWSTR, + szDestFileName: LPWSTR, + szSrcDir: LPWSTR, + szDestDir: LPWSTR, + szCurDir: LPWSTR, + szTmpFile: LPWSTR, + lpuTmpFileLen: PUINT, + ) -> DWORD; +} +extern "C" { + pub fn GetFileVersionInfoSizeA(lptstrFilename: LPCSTR, lpdwHandle: LPDWORD) -> DWORD; +} +extern "C" { + pub fn GetFileVersionInfoSizeW(lptstrFilename: LPCWSTR, lpdwHandle: LPDWORD) -> DWORD; +} +extern "C" { + pub fn GetFileVersionInfoA( + lptstrFilename: LPCSTR, + dwHandle: DWORD, + dwLen: DWORD, + lpData: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn GetFileVersionInfoW( + lptstrFilename: LPCWSTR, + dwHandle: DWORD, + dwLen: DWORD, + lpData: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn VerLanguageNameA(wLang: DWORD, szLang: LPSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn VerLanguageNameW(wLang: DWORD, szLang: LPWSTR, nSize: DWORD) -> DWORD; +} +extern "C" { + pub fn VerQueryValueA( + pBlock: LPCVOID, + lpSubBlock: LPCSTR, + lplpBuffer: *mut LPVOID, + puLen: PUINT, + ) -> WINBOOL; +} +extern "C" { + pub fn VerQueryValueW( + pBlock: LPCVOID, + lpSubBlock: LPCWSTR, + lplpBuffer: *mut LPVOID, + puLen: PUINT, + ) -> WINBOOL; +} +pub type REGSAM = ACCESS_MASK; +pub type LSTATUS = LONG; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct val_context { + pub valuelen: ::std::os::raw::c_int, + pub value_context: LPVOID, + pub val_buff_ptr: LPVOID, +} +pub type PVALCONTEXT = *mut val_context; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pvalueA { + pub pv_valuename: LPSTR, + pub pv_valuelen: ::std::os::raw::c_int, + pub pv_value_context: LPVOID, + pub pv_type: DWORD, +} +pub type PVALUEA = pvalueA; +pub type PPVALUEA = *mut pvalueA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pvalueW { + pub pv_valuename: LPWSTR, + pub pv_valuelen: ::std::os::raw::c_int, + pub pv_value_context: LPVOID, + pub pv_type: DWORD, +} +pub type PVALUEW = pvalueW; +pub type PPVALUEW = *mut pvalueW; +pub type PVALUE = PVALUEA; +pub type PPVALUE = PPVALUEA; +pub type PQUERYHANDLER = ::std::option::Option DWORD>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct provider_info { + pub pi_R0_1val: PQUERYHANDLER, + pub pi_R0_allvals: PQUERYHANDLER, + pub pi_R3_1val: PQUERYHANDLER, + pub pi_R3_allvals: PQUERYHANDLER, + pub pi_flags: DWORD, + pub pi_key_context: LPVOID, +} +pub type REG_PROVIDER = provider_info; +pub type PPROVIDER = *mut provider_info; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct value_entA { + pub ve_valuename: LPSTR, + pub ve_valuelen: DWORD, + pub ve_valueptr: DWORD_PTR, + pub ve_type: DWORD, +} +pub type VALENTA = value_entA; +pub type PVALENTA = *mut value_entA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct value_entW { + pub ve_valuename: LPWSTR, + pub ve_valuelen: DWORD, + pub ve_valueptr: DWORD_PTR, + pub ve_type: DWORD, +} +pub type VALENTW = value_entW; +pub type PVALENTW = *mut value_entW; +pub type VALENT = VALENTA; +pub type PVALENT = PVALENTA; +extern "C" { + pub fn RegCloseKey(hKey: HKEY) -> LONG; +} +extern "C" { + pub fn RegOverridePredefKey(hKey: HKEY, hNewHKey: HKEY) -> LONG; +} +extern "C" { + pub fn RegOpenUserClassesRoot( + hToken: HANDLE, + dwOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LONG; +} +extern "C" { + pub fn RegOpenCurrentUser(samDesired: REGSAM, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegDisablePredefinedCache() -> LONG; +} +extern "C" { + pub fn RegDisablePredefinedCacheEx() -> LONG; +} +extern "C" { + pub fn RegConnectRegistryA(lpMachineName: LPCSTR, hKey: HKEY, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegConnectRegistryW(lpMachineName: LPCWSTR, hKey: HKEY, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegConnectRegistryExA( + lpMachineName: LPCSTR, + hKey: HKEY, + Flags: ULONG, + phkResult: PHKEY, + ) -> LONG; +} +extern "C" { + pub fn RegConnectRegistryExW( + lpMachineName: LPCWSTR, + hKey: HKEY, + Flags: ULONG, + phkResult: PHKEY, + ) -> LONG; +} +extern "C" { + pub fn RegCreateKeyA(hKey: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegCreateKeyW(hKey: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegCreateKeyExA( + hKey: HKEY, + lpSubKey: LPCSTR, + Reserved: DWORD, + lpClass: LPSTR, + dwOptions: DWORD, + samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, + lpdwDisposition: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegCreateKeyExW( + hKey: HKEY, + lpSubKey: LPCWSTR, + Reserved: DWORD, + lpClass: LPWSTR, + dwOptions: DWORD, + samDesired: REGSAM, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + phkResult: PHKEY, + lpdwDisposition: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegDeleteKeyA(hKey: HKEY, lpSubKey: LPCSTR) -> LONG; +} +extern "C" { + pub fn RegDeleteKeyW(hKey: HKEY, lpSubKey: LPCWSTR) -> LONG; +} +extern "C" { + pub fn RegDeleteKeyExA( + hKey: HKEY, + lpSubKey: LPCSTR, + samDesired: REGSAM, + Reserved: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegDeleteKeyExW( + hKey: HKEY, + lpSubKey: LPCWSTR, + samDesired: REGSAM, + Reserved: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegDisableReflectionKey(hBase: HKEY) -> LONG; +} +extern "C" { + pub fn RegEnableReflectionKey(hBase: HKEY) -> LONG; +} +extern "C" { + pub fn RegQueryReflectionKey(hBase: HKEY, bIsReflectionDisabled: *mut WINBOOL) -> LONG; +} +extern "C" { + pub fn RegDeleteValueA(hKey: HKEY, lpValueName: LPCSTR) -> LONG; +} +extern "C" { + pub fn RegDeleteValueW(hKey: HKEY, lpValueName: LPCWSTR) -> LONG; +} +extern "C" { + pub fn RegEnumKeyA(hKey: HKEY, dwIndex: DWORD, lpName: LPSTR, cchName: DWORD) -> LONG; +} +extern "C" { + pub fn RegEnumKeyW(hKey: HKEY, dwIndex: DWORD, lpName: LPWSTR, cchName: DWORD) -> LONG; +} +extern "C" { + pub fn RegEnumKeyExA( + hKey: HKEY, + dwIndex: DWORD, + lpName: LPSTR, + lpcchName: LPDWORD, + lpReserved: LPDWORD, + lpClass: LPSTR, + lpcchClass: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LONG; +} +extern "C" { + pub fn RegEnumKeyExW( + hKey: HKEY, + dwIndex: DWORD, + lpName: LPWSTR, + lpcchName: LPDWORD, + lpReserved: LPDWORD, + lpClass: LPWSTR, + lpcchClass: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LONG; +} +extern "C" { + pub fn RegEnumValueA( + hKey: HKEY, + dwIndex: DWORD, + lpValueName: LPSTR, + lpcchValueName: LPDWORD, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegEnumValueW( + hKey: HKEY, + dwIndex: DWORD, + lpValueName: LPWSTR, + lpcchValueName: LPDWORD, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegFlushKey(hKey: HKEY) -> LONG; +} +extern "C" { + pub fn RegGetKeySecurity( + hKey: HKEY, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + lpcbSecurityDescriptor: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegLoadKeyA(hKey: HKEY, lpSubKey: LPCSTR, lpFile: LPCSTR) -> LONG; +} +extern "C" { + pub fn RegLoadKeyW(hKey: HKEY, lpSubKey: LPCWSTR, lpFile: LPCWSTR) -> LONG; +} +extern "C" { + pub fn RegNotifyChangeKeyValue( + hKey: HKEY, + bWatchSubtree: WINBOOL, + dwNotifyFilter: DWORD, + hEvent: HANDLE, + fAsynchronous: WINBOOL, + ) -> LONG; +} +extern "C" { + pub fn RegOpenKeyA(hKey: HKEY, lpSubKey: LPCSTR, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegOpenKeyW(hKey: HKEY, lpSubKey: LPCWSTR, phkResult: PHKEY) -> LONG; +} +extern "C" { + pub fn RegOpenKeyExA( + hKey: HKEY, + lpSubKey: LPCSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LONG; +} +extern "C" { + pub fn RegOpenKeyExW( + hKey: HKEY, + lpSubKey: LPCWSTR, + ulOptions: DWORD, + samDesired: REGSAM, + phkResult: PHKEY, + ) -> LONG; +} +extern "C" { + pub fn RegQueryInfoKeyA( + hKey: HKEY, + lpClass: LPSTR, + lpcchClass: LPDWORD, + lpReserved: LPDWORD, + lpcSubKeys: LPDWORD, + lpcbMaxSubKeyLen: LPDWORD, + lpcbMaxClassLen: LPDWORD, + lpcValues: LPDWORD, + lpcbMaxValueNameLen: LPDWORD, + lpcbMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LONG; +} +extern "C" { + pub fn RegQueryInfoKeyW( + hKey: HKEY, + lpClass: LPWSTR, + lpcchClass: LPDWORD, + lpReserved: LPDWORD, + lpcSubKeys: LPDWORD, + lpcbMaxSubKeyLen: LPDWORD, + lpcbMaxClassLen: LPDWORD, + lpcValues: LPDWORD, + lpcbMaxValueNameLen: LPDWORD, + lpcbMaxValueLen: LPDWORD, + lpcbSecurityDescriptor: LPDWORD, + lpftLastWriteTime: PFILETIME, + ) -> LONG; +} +extern "C" { + pub fn RegQueryValueA(hKey: HKEY, lpSubKey: LPCSTR, lpData: LPSTR, lpcbData: PLONG) -> LONG; +} +extern "C" { + pub fn RegQueryValueW(hKey: HKEY, lpSubKey: LPCWSTR, lpData: LPWSTR, lpcbData: PLONG) -> LONG; +} +extern "C" { + pub fn RegQueryMultipleValuesA( + hKey: HKEY, + val_list: PVALENTA, + num_vals: DWORD, + lpValueBuf: LPSTR, + ldwTotsize: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegQueryMultipleValuesW( + hKey: HKEY, + val_list: PVALENTW, + num_vals: DWORD, + lpValueBuf: LPWSTR, + ldwTotsize: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegQueryValueExA( + hKey: HKEY, + lpValueName: LPCSTR, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegQueryValueExW( + hKey: HKEY, + lpValueName: LPCWSTR, + lpReserved: LPDWORD, + lpType: LPDWORD, + lpData: LPBYTE, + lpcbData: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegReplaceKeyA( + hKey: HKEY, + lpSubKey: LPCSTR, + lpNewFile: LPCSTR, + lpOldFile: LPCSTR, + ) -> LONG; +} +extern "C" { + pub fn RegReplaceKeyW( + hKey: HKEY, + lpSubKey: LPCWSTR, + lpNewFile: LPCWSTR, + lpOldFile: LPCWSTR, + ) -> LONG; +} +extern "C" { + pub fn RegRestoreKeyA(hKey: HKEY, lpFile: LPCSTR, dwFlags: DWORD) -> LONG; +} +extern "C" { + pub fn RegRestoreKeyW(hKey: HKEY, lpFile: LPCWSTR, dwFlags: DWORD) -> LONG; +} +extern "C" { + pub fn RegSaveKeyA( + hKey: HKEY, + lpFile: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> LONG; +} +extern "C" { + pub fn RegSaveKeyW( + hKey: HKEY, + lpFile: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + ) -> LONG; +} +extern "C" { + pub fn RegSetKeySecurity( + hKey: HKEY, + SecurityInformation: SECURITY_INFORMATION, + pSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> LONG; +} +extern "C" { + pub fn RegSetValueA( + hKey: HKEY, + lpSubKey: LPCSTR, + dwType: DWORD, + lpData: LPCSTR, + cbData: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegSetValueW( + hKey: HKEY, + lpSubKey: LPCWSTR, + dwType: DWORD, + lpData: LPCWSTR, + cbData: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegSetValueExA( + hKey: HKEY, + lpValueName: LPCSTR, + Reserved: DWORD, + dwType: DWORD, + lpData: *const BYTE, + cbData: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegSetValueExW( + hKey: HKEY, + lpValueName: LPCWSTR, + Reserved: DWORD, + dwType: DWORD, + lpData: *const BYTE, + cbData: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegUnLoadKeyA(hKey: HKEY, lpSubKey: LPCSTR) -> LONG; +} +extern "C" { + pub fn RegUnLoadKeyW(hKey: HKEY, lpSubKey: LPCWSTR) -> LONG; +} +extern "C" { + pub fn RegGetValueA( + hkey: HKEY, + lpSubKey: LPCSTR, + lpValue: LPCSTR, + dwFlags: DWORD, + pdwType: LPDWORD, + pvData: PVOID, + pcbData: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn RegGetValueW( + hkey: HKEY, + lpSubKey: LPCWSTR, + lpValue: LPCWSTR, + dwFlags: DWORD, + pdwType: LPDWORD, + pvData: PVOID, + pcbData: LPDWORD, + ) -> LONG; +} +extern "C" { + pub fn InitiateSystemShutdownA( + lpMachineName: LPSTR, + lpMessage: LPSTR, + dwTimeout: DWORD, + bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn InitiateSystemShutdownW( + lpMachineName: LPWSTR, + lpMessage: LPWSTR, + dwTimeout: DWORD, + bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn AbortSystemShutdownA(lpMachineName: LPSTR) -> WINBOOL; +} +extern "C" { + pub fn AbortSystemShutdownW(lpMachineName: LPWSTR) -> WINBOOL; +} +extern "C" { + pub fn InitiateSystemShutdownExA( + lpMachineName: LPSTR, + lpMessage: LPSTR, + dwTimeout: DWORD, + bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL, + dwReason: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn InitiateSystemShutdownExW( + lpMachineName: LPWSTR, + lpMessage: LPWSTR, + dwTimeout: DWORD, + bForceAppsClosed: WINBOOL, + bRebootAfterShutdown: WINBOOL, + dwReason: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn RegSaveKeyExA( + hKey: HKEY, + lpFile: LPCSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + Flags: DWORD, + ) -> LONG; +} +extern "C" { + pub fn RegSaveKeyExW( + hKey: HKEY, + lpFile: LPCWSTR, + lpSecurityAttributes: LPSECURITY_ATTRIBUTES, + Flags: DWORD, + ) -> LONG; +} +extern "C" { + pub fn Wow64Win32ApiEntry(dwFuncNumber: DWORD, dwFlag: DWORD, dwRes: DWORD) -> LONG; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NETRESOURCEA { + pub dwScope: DWORD, + pub dwType: DWORD, + pub dwDisplayType: DWORD, + pub dwUsage: DWORD, + pub lpLocalName: LPSTR, + pub lpRemoteName: LPSTR, + pub lpComment: LPSTR, + pub lpProvider: LPSTR, +} +pub type NETRESOURCEA = _NETRESOURCEA; +pub type LPNETRESOURCEA = *mut _NETRESOURCEA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NETRESOURCEW { + pub dwScope: DWORD, + pub dwType: DWORD, + pub dwDisplayType: DWORD, + pub dwUsage: DWORD, + pub lpLocalName: LPWSTR, + pub lpRemoteName: LPWSTR, + pub lpComment: LPWSTR, + pub lpProvider: LPWSTR, +} +pub type NETRESOURCEW = _NETRESOURCEW; +pub type LPNETRESOURCEW = *mut _NETRESOURCEW; +pub type NETRESOURCE = NETRESOURCEA; +pub type LPNETRESOURCE = LPNETRESOURCEA; +extern "C" { + pub fn WNetAddConnectionA( + lpRemoteName: LPCSTR, + lpPassword: LPCSTR, + lpLocalName: LPCSTR, + ) -> DWORD; +} +extern "C" { + pub fn WNetAddConnectionW( + lpRemoteName: LPCWSTR, + lpPassword: LPCWSTR, + lpLocalName: LPCWSTR, + ) -> DWORD; +} +extern "C" { + pub fn WNetAddConnection2A( + lpNetResource: LPNETRESOURCEA, + lpPassword: LPCSTR, + lpUserName: LPCSTR, + dwFlags: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetAddConnection2W( + lpNetResource: LPNETRESOURCEW, + lpPassword: LPCWSTR, + lpUserName: LPCWSTR, + dwFlags: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetAddConnection3A( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEA, + lpPassword: LPCSTR, + lpUserName: LPCSTR, + dwFlags: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetAddConnection3W( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEW, + lpPassword: LPCWSTR, + lpUserName: LPCWSTR, + dwFlags: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetCancelConnectionA(lpName: LPCSTR, fForce: WINBOOL) -> DWORD; +} +extern "C" { + pub fn WNetCancelConnectionW(lpName: LPCWSTR, fForce: WINBOOL) -> DWORD; +} +extern "C" { + pub fn WNetCancelConnection2A(lpName: LPCSTR, dwFlags: DWORD, fForce: WINBOOL) -> DWORD; +} +extern "C" { + pub fn WNetCancelConnection2W(lpName: LPCWSTR, dwFlags: DWORD, fForce: WINBOOL) -> DWORD; +} +extern "C" { + pub fn WNetGetConnectionA( + lpLocalName: LPCSTR, + lpRemoteName: LPSTR, + lpnLength: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetConnectionW( + lpLocalName: LPCWSTR, + lpRemoteName: LPWSTR, + lpnLength: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetRestoreConnectionA(hwndParent: HWND, lpDevice: LPCSTR) -> DWORD; +} +extern "C" { + pub fn WNetUseConnectionA( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEA, + lpPassword: LPCSTR, + lpUserID: LPCSTR, + dwFlags: DWORD, + lpAccessName: LPSTR, + lpBufferSize: LPDWORD, + lpResult: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetUseConnectionW( + hwndOwner: HWND, + lpNetResource: LPNETRESOURCEW, + lpPassword: LPCWSTR, + lpUserID: LPCWSTR, + dwFlags: DWORD, + lpAccessName: LPWSTR, + lpBufferSize: LPDWORD, + lpResult: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetConnectionDialog(hwnd: HWND, dwType: DWORD) -> DWORD; +} +extern "C" { + pub fn WNetDisconnectDialog(hwnd: HWND, dwType: DWORD) -> DWORD; +} +extern "C" { + pub fn WNetRestoreConnectionW(hwndParent: HWND, lpDevice: LPCWSTR) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONNECTDLGSTRUCTA { + pub cbStructure: DWORD, + pub hwndOwner: HWND, + pub lpConnRes: LPNETRESOURCEA, + pub dwFlags: DWORD, + pub dwDevNum: DWORD, +} +pub type CONNECTDLGSTRUCTA = _CONNECTDLGSTRUCTA; +pub type LPCONNECTDLGSTRUCTA = *mut _CONNECTDLGSTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _CONNECTDLGSTRUCTW { + pub cbStructure: DWORD, + pub hwndOwner: HWND, + pub lpConnRes: LPNETRESOURCEW, + pub dwFlags: DWORD, + pub dwDevNum: DWORD, +} +pub type CONNECTDLGSTRUCTW = _CONNECTDLGSTRUCTW; +pub type LPCONNECTDLGSTRUCTW = *mut _CONNECTDLGSTRUCTW; +pub type CONNECTDLGSTRUCT = CONNECTDLGSTRUCTA; +pub type LPCONNECTDLGSTRUCT = LPCONNECTDLGSTRUCTA; +extern "C" { + pub fn WNetConnectionDialog1A(lpConnDlgStruct: LPCONNECTDLGSTRUCTA) -> DWORD; +} +extern "C" { + pub fn WNetConnectionDialog1W(lpConnDlgStruct: LPCONNECTDLGSTRUCTW) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DISCDLGSTRUCTA { + pub cbStructure: DWORD, + pub hwndOwner: HWND, + pub lpLocalName: LPSTR, + pub lpRemoteName: LPSTR, + pub dwFlags: DWORD, +} +pub type DISCDLGSTRUCTA = _DISCDLGSTRUCTA; +pub type LPDISCDLGSTRUCTA = *mut _DISCDLGSTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DISCDLGSTRUCTW { + pub cbStructure: DWORD, + pub hwndOwner: HWND, + pub lpLocalName: LPWSTR, + pub lpRemoteName: LPWSTR, + pub dwFlags: DWORD, +} +pub type DISCDLGSTRUCTW = _DISCDLGSTRUCTW; +pub type LPDISCDLGSTRUCTW = *mut _DISCDLGSTRUCTW; +pub type DISCDLGSTRUCT = DISCDLGSTRUCTA; +pub type LPDISCDLGSTRUCT = LPDISCDLGSTRUCTA; +extern "C" { + pub fn WNetDisconnectDialog1A(lpConnDlgStruct: LPDISCDLGSTRUCTA) -> DWORD; +} +extern "C" { + pub fn WNetDisconnectDialog1W(lpConnDlgStruct: LPDISCDLGSTRUCTW) -> DWORD; +} +extern "C" { + pub fn WNetOpenEnumA( + dwScope: DWORD, + dwType: DWORD, + dwUsage: DWORD, + lpNetResource: LPNETRESOURCEA, + lphEnum: LPHANDLE, + ) -> DWORD; +} +extern "C" { + pub fn WNetOpenEnumW( + dwScope: DWORD, + dwType: DWORD, + dwUsage: DWORD, + lpNetResource: LPNETRESOURCEW, + lphEnum: LPHANDLE, + ) -> DWORD; +} +extern "C" { + pub fn WNetEnumResourceA( + hEnum: HANDLE, + lpcCount: LPDWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetEnumResourceW( + hEnum: HANDLE, + lpcCount: LPDWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetCloseEnum(hEnum: HANDLE) -> DWORD; +} +extern "C" { + pub fn WNetGetResourceParentA( + lpNetResource: LPNETRESOURCEA, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetResourceParentW( + lpNetResource: LPNETRESOURCEW, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetResourceInformationA( + lpNetResource: LPNETRESOURCEA, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + lplpSystem: *mut LPSTR, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetResourceInformationW( + lpNetResource: LPNETRESOURCEW, + lpBuffer: LPVOID, + lpcbBuffer: LPDWORD, + lplpSystem: *mut LPWSTR, + ) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _UNIVERSAL_NAME_INFOA { + pub lpUniversalName: LPSTR, +} +pub type UNIVERSAL_NAME_INFOA = _UNIVERSAL_NAME_INFOA; +pub type LPUNIVERSAL_NAME_INFOA = *mut _UNIVERSAL_NAME_INFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _UNIVERSAL_NAME_INFOW { + pub lpUniversalName: LPWSTR, +} +pub type UNIVERSAL_NAME_INFOW = _UNIVERSAL_NAME_INFOW; +pub type LPUNIVERSAL_NAME_INFOW = *mut _UNIVERSAL_NAME_INFOW; +pub type UNIVERSAL_NAME_INFO = UNIVERSAL_NAME_INFOA; +pub type LPUNIVERSAL_NAME_INFO = LPUNIVERSAL_NAME_INFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REMOTE_NAME_INFOA { + pub lpUniversalName: LPSTR, + pub lpConnectionName: LPSTR, + pub lpRemainingPath: LPSTR, +} +pub type REMOTE_NAME_INFOA = _REMOTE_NAME_INFOA; +pub type LPREMOTE_NAME_INFOA = *mut _REMOTE_NAME_INFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _REMOTE_NAME_INFOW { + pub lpUniversalName: LPWSTR, + pub lpConnectionName: LPWSTR, + pub lpRemainingPath: LPWSTR, +} +pub type REMOTE_NAME_INFOW = _REMOTE_NAME_INFOW; +pub type LPREMOTE_NAME_INFOW = *mut _REMOTE_NAME_INFOW; +pub type REMOTE_NAME_INFO = REMOTE_NAME_INFOA; +pub type LPREMOTE_NAME_INFO = LPREMOTE_NAME_INFOA; +extern "C" { + pub fn WNetGetUniversalNameA( + lpLocalPath: LPCSTR, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetUniversalNameW( + lpLocalPath: LPCWSTR, + dwInfoLevel: DWORD, + lpBuffer: LPVOID, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetUserA(lpName: LPCSTR, lpUserName: LPSTR, lpnLength: LPDWORD) -> DWORD; +} +extern "C" { + pub fn WNetGetUserW(lpName: LPCWSTR, lpUserName: LPWSTR, lpnLength: LPDWORD) -> DWORD; +} +extern "C" { + pub fn WNetGetProviderNameA( + dwNetType: DWORD, + lpProviderName: LPSTR, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetProviderNameW( + dwNetType: DWORD, + lpProviderName: LPWSTR, + lpBufferSize: LPDWORD, + ) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NETINFOSTRUCT { + pub cbStructure: DWORD, + pub dwProviderVersion: DWORD, + pub dwStatus: DWORD, + pub dwCharacteristics: DWORD, + pub dwHandle: ULONG_PTR, + pub wNetType: WORD, + pub dwPrinters: DWORD, + pub dwDrives: DWORD, +} +pub type NETINFOSTRUCT = _NETINFOSTRUCT; +pub type LPNETINFOSTRUCT = *mut _NETINFOSTRUCT; +extern "C" { + pub fn WNetGetNetworkInformationA( + lpProvider: LPCSTR, + lpNetInfoStruct: LPNETINFOSTRUCT, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetNetworkInformationW( + lpProvider: LPCWSTR, + lpNetInfoStruct: LPNETINFOSTRUCT, + ) -> DWORD; +} +pub type PFNGETPROFILEPATHA = ::std::option::Option< + unsafe extern "C" fn(pszUsername: LPCSTR, pszBuffer: LPSTR, cbBuffer: UINT) -> UINT, +>; +pub type PFNGETPROFILEPATHW = ::std::option::Option< + unsafe extern "C" fn(pszUsername: LPCWSTR, pszBuffer: LPWSTR, cbBuffer: UINT) -> UINT, +>; +pub type PFNRECONCILEPROFILEA = ::std::option::Option< + unsafe extern "C" fn(pszCentralFile: LPCSTR, pszLocalFile: LPCSTR, dwFlags: DWORD) -> UINT, +>; +pub type PFNRECONCILEPROFILEW = ::std::option::Option< + unsafe extern "C" fn(pszCentralFile: LPCWSTR, pszLocalFile: LPCWSTR, dwFlags: DWORD) -> UINT, +>; +pub type PFNPROCESSPOLICIESA = ::std::option::Option< + unsafe extern "C" fn( + hwnd: HWND, + pszPath: LPCSTR, + pszUsername: LPCSTR, + pszComputerName: LPCSTR, + dwFlags: DWORD, + ) -> WINBOOL, +>; +pub type PFNPROCESSPOLICIESW = ::std::option::Option< + unsafe extern "C" fn( + hwnd: HWND, + pszPath: LPCWSTR, + pszUsername: LPCWSTR, + pszComputerName: LPCWSTR, + dwFlags: DWORD, + ) -> WINBOOL, +>; +extern "C" { + pub fn WNetGetLastErrorA( + lpError: LPDWORD, + lpErrorBuf: LPSTR, + nErrorBufSize: DWORD, + lpNameBuf: LPSTR, + nNameBufSize: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn WNetGetLastErrorW( + lpError: LPDWORD, + lpErrorBuf: LPWSTR, + nErrorBufSize: DWORD, + lpNameBuf: LPWSTR, + nNameBufSize: DWORD, + ) -> DWORD; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NETCONNECTINFOSTRUCT { + pub cbStructure: DWORD, + pub dwFlags: DWORD, + pub dwSpeed: DWORD, + pub dwDelay: DWORD, + pub dwOptDataSize: DWORD, +} +pub type NETCONNECTINFOSTRUCT = _NETCONNECTINFOSTRUCT; +pub type LPNETCONNECTINFOSTRUCT = *mut _NETCONNECTINFOSTRUCT; +extern "C" { + pub fn MultinetGetConnectionPerformanceA( + lpNetResource: LPNETRESOURCEA, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT, + ) -> DWORD; +} +extern "C" { + pub fn MultinetGetConnectionPerformanceW( + lpNetResource: LPNETRESOURCEW, + lpNetConnectInfoStruct: LPNETCONNECTINFOSTRUCT, + ) -> DWORD; +} +extern "C" { + pub fn uaw_CharUpperW(String: LPUWSTR) -> LPUWSTR; +} +extern "C" { + pub fn uaw_lstrcmpW(String1: PCUWSTR, String2: PCUWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn uaw_lstrcmpiW(String1: PCUWSTR, String2: PCUWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn uaw_lstrlenW(String: LPCUWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn uaw_wcschr(String: PCUWSTR, Character: WCHAR) -> PUWSTR; +} +extern "C" { + pub fn uaw_wcscpy(Destination: PUWSTR, Source: PCUWSTR) -> PUWSTR; +} +extern "C" { + pub fn uaw_wcsicmp(String1: PCUWSTR, String2: PCUWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn uaw_wcslen(String: PCUWSTR) -> usize; +} +extern "C" { + pub fn uaw_wcsrchr(String: PCUWSTR, Character: WCHAR) -> PUWSTR; +} +extern "C" { + pub fn ua_CharUpperW(String: LPUWSTR) -> LPUWSTR; +} +extern "C" { + pub fn ua_lstrcmpW(String1: LPCUWSTR, String2: LPCUWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ua_lstrcmpiW(String1: LPCUWSTR, String2: LPCUWSTR) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ua_lstrlenW(String: LPCUWSTR) -> ::std::os::raw::c_int; +} +pub type PUWSTR_C = *mut WCHAR; +extern "C" { + pub fn ua_wcschr(String: PCUWSTR, Character: WCHAR) -> PUWSTR_C; +} +extern "C" { + pub fn ua_wcsrchr(String: PCUWSTR, Character: WCHAR) -> PUWSTR_C; +} +extern "C" { + pub fn ua_wcscpy(Destination: PUWSTR, Source: PCUWSTR) -> PUWSTR; +} +extern "C" { + pub fn ua_wcslen(String: PCUWSTR) -> usize; +} +extern "C" { + pub fn ua_wcsicmp(String1: LPCUWSTR, String2: LPCUWSTR) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_DESCRIPTIONA { + pub lpDescription: LPSTR, +} +pub type SERVICE_DESCRIPTIONA = _SERVICE_DESCRIPTIONA; +pub type LPSERVICE_DESCRIPTIONA = *mut _SERVICE_DESCRIPTIONA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_DESCRIPTIONW { + pub lpDescription: LPWSTR, +} +pub type SERVICE_DESCRIPTIONW = _SERVICE_DESCRIPTIONW; +pub type LPSERVICE_DESCRIPTIONW = *mut _SERVICE_DESCRIPTIONW; +pub type SERVICE_DESCRIPTION = SERVICE_DESCRIPTIONA; +pub type LPSERVICE_DESCRIPTION = LPSERVICE_DESCRIPTIONA; +pub const _SC_ACTION_TYPE_SC_ACTION_NONE: _SC_ACTION_TYPE = 0; +pub const _SC_ACTION_TYPE_SC_ACTION_RESTART: _SC_ACTION_TYPE = 1; +pub const _SC_ACTION_TYPE_SC_ACTION_REBOOT: _SC_ACTION_TYPE = 2; +pub const _SC_ACTION_TYPE_SC_ACTION_RUN_COMMAND: _SC_ACTION_TYPE = 3; +pub type _SC_ACTION_TYPE = u32; +pub use self::_SC_ACTION_TYPE as SC_ACTION_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SC_ACTION { + pub Type: SC_ACTION_TYPE, + pub Delay: DWORD, +} +pub type SC_ACTION = _SC_ACTION; +pub type LPSC_ACTION = *mut _SC_ACTION; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_FAILURE_ACTIONSA { + pub dwResetPeriod: DWORD, + pub lpRebootMsg: LPSTR, + pub lpCommand: LPSTR, + pub cActions: DWORD, + pub lpsaActions: *mut SC_ACTION, +} +pub type SERVICE_FAILURE_ACTIONSA = _SERVICE_FAILURE_ACTIONSA; +pub type LPSERVICE_FAILURE_ACTIONSA = *mut _SERVICE_FAILURE_ACTIONSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_FAILURE_ACTIONSW { + pub dwResetPeriod: DWORD, + pub lpRebootMsg: LPWSTR, + pub lpCommand: LPWSTR, + pub cActions: DWORD, + pub lpsaActions: *mut SC_ACTION, +} +pub type SERVICE_FAILURE_ACTIONSW = _SERVICE_FAILURE_ACTIONSW; +pub type LPSERVICE_FAILURE_ACTIONSW = *mut _SERVICE_FAILURE_ACTIONSW; +pub type SERVICE_FAILURE_ACTIONS = SERVICE_FAILURE_ACTIONSA; +pub type LPSERVICE_FAILURE_ACTIONS = LPSERVICE_FAILURE_ACTIONSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SC_HANDLE__ { + pub unused: ::std::os::raw::c_int, +} +pub type SC_HANDLE = *mut SC_HANDLE__; +pub type LPSC_HANDLE = *mut SC_HANDLE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SERVICE_STATUS_HANDLE__ { + pub unused: ::std::os::raw::c_int, +} +pub type SERVICE_STATUS_HANDLE = *mut SERVICE_STATUS_HANDLE__; +pub const _SC_STATUS_TYPE_SC_STATUS_PROCESS_INFO: _SC_STATUS_TYPE = 0; +pub type _SC_STATUS_TYPE = u32; +pub use self::_SC_STATUS_TYPE as SC_STATUS_TYPE; +pub const _SC_ENUM_TYPE_SC_ENUM_PROCESS_INFO: _SC_ENUM_TYPE = 0; +pub type _SC_ENUM_TYPE = u32; +pub use self::_SC_ENUM_TYPE as SC_ENUM_TYPE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_STATUS { + pub dwServiceType: DWORD, + pub dwCurrentState: DWORD, + pub dwControlsAccepted: DWORD, + pub dwWin32ExitCode: DWORD, + pub dwServiceSpecificExitCode: DWORD, + pub dwCheckPoint: DWORD, + pub dwWaitHint: DWORD, +} +pub type SERVICE_STATUS = _SERVICE_STATUS; +pub type LPSERVICE_STATUS = *mut _SERVICE_STATUS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_STATUS_PROCESS { + pub dwServiceType: DWORD, + pub dwCurrentState: DWORD, + pub dwControlsAccepted: DWORD, + pub dwWin32ExitCode: DWORD, + pub dwServiceSpecificExitCode: DWORD, + pub dwCheckPoint: DWORD, + pub dwWaitHint: DWORD, + pub dwProcessId: DWORD, + pub dwServiceFlags: DWORD, +} +pub type SERVICE_STATUS_PROCESS = _SERVICE_STATUS_PROCESS; +pub type LPSERVICE_STATUS_PROCESS = *mut _SERVICE_STATUS_PROCESS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ENUM_SERVICE_STATUSA { + pub lpServiceName: LPSTR, + pub lpDisplayName: LPSTR, + pub ServiceStatus: SERVICE_STATUS, +} +pub type ENUM_SERVICE_STATUSA = _ENUM_SERVICE_STATUSA; +pub type LPENUM_SERVICE_STATUSA = *mut _ENUM_SERVICE_STATUSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ENUM_SERVICE_STATUSW { + pub lpServiceName: LPWSTR, + pub lpDisplayName: LPWSTR, + pub ServiceStatus: SERVICE_STATUS, +} +pub type ENUM_SERVICE_STATUSW = _ENUM_SERVICE_STATUSW; +pub type LPENUM_SERVICE_STATUSW = *mut _ENUM_SERVICE_STATUSW; +pub type ENUM_SERVICE_STATUS = ENUM_SERVICE_STATUSA; +pub type LPENUM_SERVICE_STATUS = LPENUM_SERVICE_STATUSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ENUM_SERVICE_STATUS_PROCESSA { + pub lpServiceName: LPSTR, + pub lpDisplayName: LPSTR, + pub ServiceStatusProcess: SERVICE_STATUS_PROCESS, +} +pub type ENUM_SERVICE_STATUS_PROCESSA = _ENUM_SERVICE_STATUS_PROCESSA; +pub type LPENUM_SERVICE_STATUS_PROCESSA = *mut _ENUM_SERVICE_STATUS_PROCESSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ENUM_SERVICE_STATUS_PROCESSW { + pub lpServiceName: LPWSTR, + pub lpDisplayName: LPWSTR, + pub ServiceStatusProcess: SERVICE_STATUS_PROCESS, +} +pub type ENUM_SERVICE_STATUS_PROCESSW = _ENUM_SERVICE_STATUS_PROCESSW; +pub type LPENUM_SERVICE_STATUS_PROCESSW = *mut _ENUM_SERVICE_STATUS_PROCESSW; +pub type ENUM_SERVICE_STATUS_PROCESS = ENUM_SERVICE_STATUS_PROCESSA; +pub type LPENUM_SERVICE_STATUS_PROCESS = LPENUM_SERVICE_STATUS_PROCESSA; +pub type SC_LOCK = LPVOID; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _QUERY_SERVICE_LOCK_STATUSA { + pub fIsLocked: DWORD, + pub lpLockOwner: LPSTR, + pub dwLockDuration: DWORD, +} +pub type QUERY_SERVICE_LOCK_STATUSA = _QUERY_SERVICE_LOCK_STATUSA; +pub type LPQUERY_SERVICE_LOCK_STATUSA = *mut _QUERY_SERVICE_LOCK_STATUSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _QUERY_SERVICE_LOCK_STATUSW { + pub fIsLocked: DWORD, + pub lpLockOwner: LPWSTR, + pub dwLockDuration: DWORD, +} +pub type QUERY_SERVICE_LOCK_STATUSW = _QUERY_SERVICE_LOCK_STATUSW; +pub type LPQUERY_SERVICE_LOCK_STATUSW = *mut _QUERY_SERVICE_LOCK_STATUSW; +pub type QUERY_SERVICE_LOCK_STATUS = QUERY_SERVICE_LOCK_STATUSA; +pub type LPQUERY_SERVICE_LOCK_STATUS = LPQUERY_SERVICE_LOCK_STATUSA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _QUERY_SERVICE_CONFIGA { + pub dwServiceType: DWORD, + pub dwStartType: DWORD, + pub dwErrorControl: DWORD, + pub lpBinaryPathName: LPSTR, + pub lpLoadOrderGroup: LPSTR, + pub dwTagId: DWORD, + pub lpDependencies: LPSTR, + pub lpServiceStartName: LPSTR, + pub lpDisplayName: LPSTR, +} +pub type QUERY_SERVICE_CONFIGA = _QUERY_SERVICE_CONFIGA; +pub type LPQUERY_SERVICE_CONFIGA = *mut _QUERY_SERVICE_CONFIGA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _QUERY_SERVICE_CONFIGW { + pub dwServiceType: DWORD, + pub dwStartType: DWORD, + pub dwErrorControl: DWORD, + pub lpBinaryPathName: LPWSTR, + pub lpLoadOrderGroup: LPWSTR, + pub dwTagId: DWORD, + pub lpDependencies: LPWSTR, + pub lpServiceStartName: LPWSTR, + pub lpDisplayName: LPWSTR, +} +pub type QUERY_SERVICE_CONFIGW = _QUERY_SERVICE_CONFIGW; +pub type LPQUERY_SERVICE_CONFIGW = *mut _QUERY_SERVICE_CONFIGW; +pub type QUERY_SERVICE_CONFIG = QUERY_SERVICE_CONFIGA; +pub type LPQUERY_SERVICE_CONFIG = LPQUERY_SERVICE_CONFIGA; +pub type LPSERVICE_MAIN_FUNCTIONW = ::std::option::Option< + unsafe extern "C" fn(dwNumServicesArgs: DWORD, lpServiceArgVectors: *mut LPWSTR), +>; +pub type LPSERVICE_MAIN_FUNCTIONA = ::std::option::Option< + unsafe extern "C" fn(dwNumServicesArgs: DWORD, lpServiceArgVectors: *mut LPSTR), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_TABLE_ENTRYA { + pub lpServiceName: LPSTR, + pub lpServiceProc: LPSERVICE_MAIN_FUNCTIONA, +} +pub type SERVICE_TABLE_ENTRYA = _SERVICE_TABLE_ENTRYA; +pub type LPSERVICE_TABLE_ENTRYA = *mut _SERVICE_TABLE_ENTRYA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SERVICE_TABLE_ENTRYW { + pub lpServiceName: LPWSTR, + pub lpServiceProc: LPSERVICE_MAIN_FUNCTIONW, +} +pub type SERVICE_TABLE_ENTRYW = _SERVICE_TABLE_ENTRYW; +pub type LPSERVICE_TABLE_ENTRYW = *mut _SERVICE_TABLE_ENTRYW; +pub type SERVICE_TABLE_ENTRY = SERVICE_TABLE_ENTRYA; +pub type LPSERVICE_TABLE_ENTRY = LPSERVICE_TABLE_ENTRYA; +pub type LPHANDLER_FUNCTION = ::std::option::Option; +pub type LPHANDLER_FUNCTION_EX = ::std::option::Option< + unsafe extern "C" fn( + dwControl: DWORD, + dwEventType: DWORD, + lpEventData: LPVOID, + lpContext: LPVOID, + ) -> DWORD, +>; +extern "C" { + pub fn ChangeServiceConfigA( + hService: SC_HANDLE, + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCSTR, + lpLoadOrderGroup: LPCSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCSTR, + lpServiceStartName: LPCSTR, + lpPassword: LPCSTR, + lpDisplayName: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ChangeServiceConfigW( + hService: SC_HANDLE, + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, + lpServiceStartName: LPCWSTR, + lpPassword: LPCWSTR, + lpDisplayName: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ChangeServiceConfig2A( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpInfo: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn ChangeServiceConfig2W( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpInfo: LPVOID, + ) -> WINBOOL; +} +extern "C" { + pub fn CloseServiceHandle(hSCObject: SC_HANDLE) -> WINBOOL; +} +extern "C" { + pub fn ControlService( + hService: SC_HANDLE, + dwControl: DWORD, + lpServiceStatus: LPSERVICE_STATUS, + ) -> WINBOOL; +} +extern "C" { + pub fn CreateServiceA( + hSCManager: SC_HANDLE, + lpServiceName: LPCSTR, + lpDisplayName: LPCSTR, + dwDesiredAccess: DWORD, + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCSTR, + lpLoadOrderGroup: LPCSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCSTR, + lpServiceStartName: LPCSTR, + lpPassword: LPCSTR, + ) -> SC_HANDLE; +} +extern "C" { + pub fn CreateServiceW( + hSCManager: SC_HANDLE, + lpServiceName: LPCWSTR, + lpDisplayName: LPCWSTR, + dwDesiredAccess: DWORD, + dwServiceType: DWORD, + dwStartType: DWORD, + dwErrorControl: DWORD, + lpBinaryPathName: LPCWSTR, + lpLoadOrderGroup: LPCWSTR, + lpdwTagId: LPDWORD, + lpDependencies: LPCWSTR, + lpServiceStartName: LPCWSTR, + lpPassword: LPCWSTR, + ) -> SC_HANDLE; +} +extern "C" { + pub fn DeleteService(hService: SC_HANDLE) -> WINBOOL; +} +extern "C" { + pub fn EnumDependentServicesA( + hService: SC_HANDLE, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumDependentServicesW( + hService: SC_HANDLE, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumServicesStatusA( + hSCManager: SC_HANDLE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumServicesStatusW( + hSCManager: SC_HANDLE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPENUM_SERVICE_STATUSW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumServicesStatusExA( + hSCManager: SC_HANDLE, + InfoLevel: SC_ENUM_TYPE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + pszGroupName: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn EnumServicesStatusExW( + hSCManager: SC_HANDLE, + InfoLevel: SC_ENUM_TYPE, + dwServiceType: DWORD, + dwServiceState: DWORD, + lpServices: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + lpServicesReturned: LPDWORD, + lpResumeHandle: LPDWORD, + pszGroupName: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn GetServiceKeyNameA( + hSCManager: SC_HANDLE, + lpDisplayName: LPCSTR, + lpServiceName: LPSTR, + lpcchBuffer: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetServiceKeyNameW( + hSCManager: SC_HANDLE, + lpDisplayName: LPCWSTR, + lpServiceName: LPWSTR, + lpcchBuffer: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetServiceDisplayNameA( + hSCManager: SC_HANDLE, + lpServiceName: LPCSTR, + lpDisplayName: LPSTR, + lpcchBuffer: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn GetServiceDisplayNameW( + hSCManager: SC_HANDLE, + lpServiceName: LPCWSTR, + lpDisplayName: LPWSTR, + lpcchBuffer: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn LockServiceDatabase(hSCManager: SC_HANDLE) -> SC_LOCK; +} +extern "C" { + pub fn NotifyBootConfigStatus(BootAcceptable: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn OpenSCManagerA( + lpMachineName: LPCSTR, + lpDatabaseName: LPCSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; +} +extern "C" { + pub fn OpenSCManagerW( + lpMachineName: LPCWSTR, + lpDatabaseName: LPCWSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; +} +extern "C" { + pub fn OpenServiceA( + hSCManager: SC_HANDLE, + lpServiceName: LPCSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; +} +extern "C" { + pub fn OpenServiceW( + hSCManager: SC_HANDLE, + lpServiceName: LPCWSTR, + dwDesiredAccess: DWORD, + ) -> SC_HANDLE; +} +extern "C" { + pub fn QueryServiceConfigA( + hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIGA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceConfigW( + hService: SC_HANDLE, + lpServiceConfig: LPQUERY_SERVICE_CONFIGW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceConfig2A( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpBuffer: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceConfig2W( + hService: SC_HANDLE, + dwInfoLevel: DWORD, + lpBuffer: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceLockStatusA( + hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUSA, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceLockStatusW( + hSCManager: SC_HANDLE, + lpLockStatus: LPQUERY_SERVICE_LOCK_STATUSW, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceObjectSecurity( + hService: SC_HANDLE, + dwSecurityInformation: SECURITY_INFORMATION, + lpSecurityDescriptor: PSECURITY_DESCRIPTOR, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceStatus(hService: SC_HANDLE, lpServiceStatus: LPSERVICE_STATUS) -> WINBOOL; +} +extern "C" { + pub fn QueryServiceStatusEx( + hService: SC_HANDLE, + InfoLevel: SC_STATUS_TYPE, + lpBuffer: LPBYTE, + cbBufSize: DWORD, + pcbBytesNeeded: LPDWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn RegisterServiceCtrlHandlerA( + lpServiceName: LPCSTR, + lpHandlerProc: LPHANDLER_FUNCTION, + ) -> SERVICE_STATUS_HANDLE; +} +extern "C" { + pub fn RegisterServiceCtrlHandlerW( + lpServiceName: LPCWSTR, + lpHandlerProc: LPHANDLER_FUNCTION, + ) -> SERVICE_STATUS_HANDLE; +} +extern "C" { + pub fn RegisterServiceCtrlHandlerExA( + lpServiceName: LPCSTR, + lpHandlerProc: LPHANDLER_FUNCTION_EX, + lpContext: LPVOID, + ) -> SERVICE_STATUS_HANDLE; +} +extern "C" { + pub fn RegisterServiceCtrlHandlerExW( + lpServiceName: LPCWSTR, + lpHandlerProc: LPHANDLER_FUNCTION_EX, + lpContext: LPVOID, + ) -> SERVICE_STATUS_HANDLE; +} +extern "C" { + pub fn SetServiceObjectSecurity( + hService: SC_HANDLE, + dwSecurityInformation: SECURITY_INFORMATION, + lpSecurityDescriptor: PSECURITY_DESCRIPTOR, + ) -> WINBOOL; +} +extern "C" { + pub fn SetServiceStatus( + hServiceStatus: SERVICE_STATUS_HANDLE, + lpServiceStatus: LPSERVICE_STATUS, + ) -> WINBOOL; +} +extern "C" { + pub fn StartServiceCtrlDispatcherA(lpServiceStartTable: *const SERVICE_TABLE_ENTRYA) + -> WINBOOL; +} +extern "C" { + pub fn StartServiceCtrlDispatcherW(lpServiceStartTable: *const SERVICE_TABLE_ENTRYW) + -> WINBOOL; +} +extern "C" { + pub fn StartServiceA( + hService: SC_HANDLE, + dwNumServiceArgs: DWORD, + lpServiceArgVectors: *mut LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn StartServiceW( + hService: SC_HANDLE, + dwNumServiceArgs: DWORD, + lpServiceArgVectors: *mut LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn UnlockServiceDatabase(ScLock: SC_LOCK) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MODEMDEVCAPS { + pub dwActualSize: DWORD, + pub dwRequiredSize: DWORD, + pub dwDevSpecificOffset: DWORD, + pub dwDevSpecificSize: DWORD, + pub dwModemProviderVersion: DWORD, + pub dwModemManufacturerOffset: DWORD, + pub dwModemManufacturerSize: DWORD, + pub dwModemModelOffset: DWORD, + pub dwModemModelSize: DWORD, + pub dwModemVersionOffset: DWORD, + pub dwModemVersionSize: DWORD, + pub dwDialOptions: DWORD, + pub dwCallSetupFailTimer: DWORD, + pub dwInactivityTimeout: DWORD, + pub dwSpeakerVolume: DWORD, + pub dwSpeakerMode: DWORD, + pub dwModemOptions: DWORD, + pub dwMaxDTERate: DWORD, + pub dwMaxDCERate: DWORD, + pub abVariablePortion: [BYTE; 1usize], +} +pub type MODEMDEVCAPS = _MODEMDEVCAPS; +pub type PMODEMDEVCAPS = *mut _MODEMDEVCAPS; +pub type LPMODEMDEVCAPS = *mut _MODEMDEVCAPS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _MODEMSETTINGS { + pub dwActualSize: DWORD, + pub dwRequiredSize: DWORD, + pub dwDevSpecificOffset: DWORD, + pub dwDevSpecificSize: DWORD, + pub dwCallSetupFailTimer: DWORD, + pub dwInactivityTimeout: DWORD, + pub dwSpeakerVolume: DWORD, + pub dwSpeakerMode: DWORD, + pub dwPreferredModemOptions: DWORD, + pub dwNegotiatedModemOptions: DWORD, + pub dwNegotiatedDCERate: DWORD, + pub abVariablePortion: [BYTE; 1usize], +} +pub type MODEMSETTINGS = _MODEMSETTINGS; +pub type PMODEMSETTINGS = *mut _MODEMSETTINGS; +pub type LPMODEMSETTINGS = *mut _MODEMSETTINGS; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HIMC__ { + pub unused: ::std::os::raw::c_int, +} +pub type HIMC = *mut HIMC__; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HIMCC__ { + pub unused: ::std::os::raw::c_int, +} +pub type HIMCC = *mut HIMCC__; +pub type LPHKL = *mut HKL; +pub type LPUINT = *mut UINT; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCOMPOSITIONFORM { + pub dwStyle: DWORD, + pub ptCurrentPos: POINT, + pub rcArea: RECT, +} +pub type COMPOSITIONFORM = tagCOMPOSITIONFORM; +pub type PCOMPOSITIONFORM = *mut tagCOMPOSITIONFORM; +pub type NPCOMPOSITIONFORM = *mut tagCOMPOSITIONFORM; +pub type LPCOMPOSITIONFORM = *mut tagCOMPOSITIONFORM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCANDIDATEFORM { + pub dwIndex: DWORD, + pub dwStyle: DWORD, + pub ptCurrentPos: POINT, + pub rcArea: RECT, +} +pub type CANDIDATEFORM = tagCANDIDATEFORM; +pub type PCANDIDATEFORM = *mut tagCANDIDATEFORM; +pub type NPCANDIDATEFORM = *mut tagCANDIDATEFORM; +pub type LPCANDIDATEFORM = *mut tagCANDIDATEFORM; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagCANDIDATELIST { + pub dwSize: DWORD, + pub dwStyle: DWORD, + pub dwCount: DWORD, + pub dwSelection: DWORD, + pub dwPageStart: DWORD, + pub dwPageSize: DWORD, + pub dwOffset: [DWORD; 1usize], +} +pub type CANDIDATELIST = tagCANDIDATELIST; +pub type PCANDIDATELIST = *mut tagCANDIDATELIST; +pub type NPCANDIDATELIST = *mut tagCANDIDATELIST; +pub type LPCANDIDATELIST = *mut tagCANDIDATELIST; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagREGISTERWORDA { + pub lpReading: LPSTR, + pub lpWord: LPSTR, +} +pub type REGISTERWORDA = tagREGISTERWORDA; +pub type PREGISTERWORDA = *mut tagREGISTERWORDA; +pub type NPREGISTERWORDA = *mut tagREGISTERWORDA; +pub type LPREGISTERWORDA = *mut tagREGISTERWORDA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagREGISTERWORDW { + pub lpReading: LPWSTR, + pub lpWord: LPWSTR, +} +pub type REGISTERWORDW = tagREGISTERWORDW; +pub type PREGISTERWORDW = *mut tagREGISTERWORDW; +pub type NPREGISTERWORDW = *mut tagREGISTERWORDW; +pub type LPREGISTERWORDW = *mut tagREGISTERWORDW; +pub type REGISTERWORD = REGISTERWORDA; +pub type PREGISTERWORD = PREGISTERWORDA; +pub type NPREGISTERWORD = NPREGISTERWORDA; +pub type LPREGISTERWORD = LPREGISTERWORDA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagRECONVERTSTRING { + pub dwSize: DWORD, + pub dwVersion: DWORD, + pub dwStrLen: DWORD, + pub dwStrOffset: DWORD, + pub dwCompStrLen: DWORD, + pub dwCompStrOffset: DWORD, + pub dwTargetStrLen: DWORD, + pub dwTargetStrOffset: DWORD, +} +pub type RECONVERTSTRING = tagRECONVERTSTRING; +pub type PRECONVERTSTRING = *mut tagRECONVERTSTRING; +pub type NPRECONVERTSTRING = *mut tagRECONVERTSTRING; +pub type LPRECONVERTSTRING = *mut tagRECONVERTSTRING; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSTYLEBUFA { + pub dwStyle: DWORD, + pub szDescription: [CHAR; 32usize], +} +pub type STYLEBUFA = tagSTYLEBUFA; +pub type PSTYLEBUFA = *mut tagSTYLEBUFA; +pub type NPSTYLEBUFA = *mut tagSTYLEBUFA; +pub type LPSTYLEBUFA = *mut tagSTYLEBUFA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagSTYLEBUFW { + pub dwStyle: DWORD, + pub szDescription: [WCHAR; 32usize], +} +pub type STYLEBUFW = tagSTYLEBUFW; +pub type PSTYLEBUFW = *mut tagSTYLEBUFW; +pub type NPSTYLEBUFW = *mut tagSTYLEBUFW; +pub type LPSTYLEBUFW = *mut tagSTYLEBUFW; +pub type STYLEBUF = STYLEBUFA; +pub type PSTYLEBUF = PSTYLEBUFA; +pub type NPSTYLEBUF = NPSTYLEBUFA; +pub type LPSTYLEBUF = LPSTYLEBUFA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagIMEMENUITEMINFOA { + pub cbSize: UINT, + pub fType: UINT, + pub fState: UINT, + pub wID: UINT, + pub hbmpChecked: HBITMAP, + pub hbmpUnchecked: HBITMAP, + pub dwItemData: DWORD, + pub szString: [CHAR; 80usize], + pub hbmpItem: HBITMAP, +} +pub type IMEMENUITEMINFOA = tagIMEMENUITEMINFOA; +pub type PIMEMENUITEMINFOA = *mut tagIMEMENUITEMINFOA; +pub type NPIMEMENUITEMINFOA = *mut tagIMEMENUITEMINFOA; +pub type LPIMEMENUITEMINFOA = *mut tagIMEMENUITEMINFOA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct tagIMEMENUITEMINFOW { + pub cbSize: UINT, + pub fType: UINT, + pub fState: UINT, + pub wID: UINT, + pub hbmpChecked: HBITMAP, + pub hbmpUnchecked: HBITMAP, + pub dwItemData: DWORD, + pub szString: [WCHAR; 80usize], + pub hbmpItem: HBITMAP, +} +pub type IMEMENUITEMINFOW = tagIMEMENUITEMINFOW; +pub type PIMEMENUITEMINFOW = *mut tagIMEMENUITEMINFOW; +pub type NPIMEMENUITEMINFOW = *mut tagIMEMENUITEMINFOW; +pub type LPIMEMENUITEMINFOW = *mut tagIMEMENUITEMINFOW; +pub type IMEMENUITEMINFO = IMEMENUITEMINFOA; +pub type PIMEMENUITEMINFO = PIMEMENUITEMINFOA; +pub type NPIMEMENUITEMINFO = NPIMEMENUITEMINFOA; +pub type LPIMEMENUITEMINFO = LPIMEMENUITEMINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tagIMECHARPOSITION { + pub dwSize: DWORD, + pub dwCharPos: DWORD, + pub pt: POINT, + pub cLineHeight: UINT, + pub rcDocument: RECT, +} +pub type IMECHARPOSITION = tagIMECHARPOSITION; +pub type PIMECHARPOSITION = *mut tagIMECHARPOSITION; +pub type NPIMECHARPOSITION = *mut tagIMECHARPOSITION; +pub type LPIMECHARPOSITION = *mut tagIMECHARPOSITION; +pub type IMCENUMPROC = + ::std::option::Option WINBOOL>; +extern "C" { + pub fn ImmInstallIMEA(lpszIMEFileName: LPCSTR, lpszLayoutText: LPCSTR) -> HKL; +} +extern "C" { + pub fn ImmInstallIMEW(lpszIMEFileName: LPCWSTR, lpszLayoutText: LPCWSTR) -> HKL; +} +extern "C" { + pub fn ImmGetDefaultIMEWnd(arg1: HWND) -> HWND; +} +extern "C" { + pub fn ImmGetDescriptionA(arg1: HKL, arg2: LPSTR, uBufLen: UINT) -> UINT; +} +extern "C" { + pub fn ImmGetDescriptionW(arg1: HKL, arg2: LPWSTR, uBufLen: UINT) -> UINT; +} +extern "C" { + pub fn ImmGetIMEFileNameA(arg1: HKL, arg2: LPSTR, uBufLen: UINT) -> UINT; +} +extern "C" { + pub fn ImmGetIMEFileNameW(arg1: HKL, arg2: LPWSTR, uBufLen: UINT) -> UINT; +} +extern "C" { + pub fn ImmGetProperty(arg1: HKL, arg2: DWORD) -> DWORD; +} +extern "C" { + pub fn ImmIsIME(arg1: HKL) -> WINBOOL; +} +extern "C" { + pub fn ImmSimulateHotKey(arg1: HWND, arg2: DWORD) -> WINBOOL; +} +extern "C" { + pub fn ImmCreateContext() -> HIMC; +} +extern "C" { + pub fn ImmDestroyContext(arg1: HIMC) -> WINBOOL; +} +extern "C" { + pub fn ImmGetContext(arg1: HWND) -> HIMC; +} +extern "C" { + pub fn ImmReleaseContext(arg1: HWND, arg2: HIMC) -> WINBOOL; +} +extern "C" { + pub fn ImmAssociateContext(arg1: HWND, arg2: HIMC) -> HIMC; +} +extern "C" { + pub fn ImmAssociateContextEx(arg1: HWND, arg2: HIMC, arg3: DWORD) -> WINBOOL; +} +extern "C" { + pub fn ImmGetCompositionStringA(arg1: HIMC, arg2: DWORD, arg3: LPVOID, arg4: DWORD) -> LONG; +} +extern "C" { + pub fn ImmGetCompositionStringW(arg1: HIMC, arg2: DWORD, arg3: LPVOID, arg4: DWORD) -> LONG; +} +extern "C" { + pub fn ImmSetCompositionStringA( + arg1: HIMC, + dwIndex: DWORD, + lpComp: LPVOID, + arg2: DWORD, + lpRead: LPVOID, + arg3: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ImmSetCompositionStringW( + arg1: HIMC, + dwIndex: DWORD, + lpComp: LPVOID, + arg2: DWORD, + lpRead: LPVOID, + arg3: DWORD, + ) -> WINBOOL; +} +extern "C" { + pub fn ImmGetCandidateListCountA(arg1: HIMC, lpdwListCount: LPDWORD) -> DWORD; +} +extern "C" { + pub fn ImmGetCandidateListCountW(arg1: HIMC, lpdwListCount: LPDWORD) -> DWORD; +} +extern "C" { + pub fn ImmGetCandidateListA( + arg1: HIMC, + deIndex: DWORD, + arg2: LPCANDIDATELIST, + dwBufLen: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn ImmGetCandidateListW( + arg1: HIMC, + deIndex: DWORD, + arg2: LPCANDIDATELIST, + dwBufLen: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn ImmGetGuideLineA(arg1: HIMC, dwIndex: DWORD, arg2: LPSTR, dwBufLen: DWORD) -> DWORD; +} +extern "C" { + pub fn ImmGetGuideLineW(arg1: HIMC, dwIndex: DWORD, arg2: LPWSTR, dwBufLen: DWORD) -> DWORD; +} +extern "C" { + pub fn ImmGetConversionStatus(arg1: HIMC, arg2: LPDWORD, arg3: LPDWORD) -> WINBOOL; +} +extern "C" { + pub fn ImmSetConversionStatus(arg1: HIMC, arg2: DWORD, arg3: DWORD) -> WINBOOL; +} +extern "C" { + pub fn ImmGetOpenStatus(arg1: HIMC) -> WINBOOL; +} +extern "C" { + pub fn ImmSetOpenStatus(arg1: HIMC, arg2: WINBOOL) -> WINBOOL; +} +extern "C" { + pub fn ImmGetCompositionFontA(arg1: HIMC, arg2: LPLOGFONTA) -> WINBOOL; +} +extern "C" { + pub fn ImmGetCompositionFontW(arg1: HIMC, arg2: LPLOGFONTW) -> WINBOOL; +} +extern "C" { + pub fn ImmSetCompositionFontA(arg1: HIMC, arg2: LPLOGFONTA) -> WINBOOL; +} +extern "C" { + pub fn ImmSetCompositionFontW(arg1: HIMC, arg2: LPLOGFONTW) -> WINBOOL; +} +pub type REGISTERWORDENUMPROCA = ::std::option::Option< + unsafe extern "C" fn( + arg1: LPCSTR, + arg2: DWORD, + arg3: LPCSTR, + arg4: LPVOID, + ) -> ::std::os::raw::c_int, +>; +pub type REGISTERWORDENUMPROCW = ::std::option::Option< + unsafe extern "C" fn( + arg1: LPCWSTR, + arg2: DWORD, + arg3: LPCWSTR, + arg4: LPVOID, + ) -> ::std::os::raw::c_int, +>; +extern "C" { + pub fn ImmConfigureIMEA(arg1: HKL, arg2: HWND, arg3: DWORD, arg4: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn ImmConfigureIMEW(arg1: HKL, arg2: HWND, arg3: DWORD, arg4: LPVOID) -> WINBOOL; +} +extern "C" { + pub fn ImmEscapeA(arg1: HKL, arg2: HIMC, arg3: UINT, arg4: LPVOID) -> LRESULT; +} +extern "C" { + pub fn ImmEscapeW(arg1: HKL, arg2: HIMC, arg3: UINT, arg4: LPVOID) -> LRESULT; +} +extern "C" { + pub fn ImmGetConversionListA( + arg1: HKL, + arg2: HIMC, + arg3: LPCSTR, + arg4: LPCANDIDATELIST, + dwBufLen: DWORD, + uFlag: UINT, + ) -> DWORD; +} +extern "C" { + pub fn ImmGetConversionListW( + arg1: HKL, + arg2: HIMC, + arg3: LPCWSTR, + arg4: LPCANDIDATELIST, + dwBufLen: DWORD, + uFlag: UINT, + ) -> DWORD; +} +extern "C" { + pub fn ImmNotifyIME(arg1: HIMC, dwAction: DWORD, dwIndex: DWORD, dwValue: DWORD) -> WINBOOL; +} +extern "C" { + pub fn ImmGetStatusWindowPos(arg1: HIMC, arg2: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn ImmSetStatusWindowPos(arg1: HIMC, arg2: LPPOINT) -> WINBOOL; +} +extern "C" { + pub fn ImmGetCompositionWindow(arg1: HIMC, arg2: LPCOMPOSITIONFORM) -> WINBOOL; +} +extern "C" { + pub fn ImmSetCompositionWindow(arg1: HIMC, arg2: LPCOMPOSITIONFORM) -> WINBOOL; +} +extern "C" { + pub fn ImmGetCandidateWindow(arg1: HIMC, arg2: DWORD, arg3: LPCANDIDATEFORM) -> WINBOOL; +} +extern "C" { + pub fn ImmSetCandidateWindow(arg1: HIMC, arg2: LPCANDIDATEFORM) -> WINBOOL; +} +extern "C" { + pub fn ImmIsUIMessageA(arg1: HWND, arg2: UINT, arg3: WPARAM, arg4: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn ImmIsUIMessageW(arg1: HWND, arg2: UINT, arg3: WPARAM, arg4: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn ImmGetVirtualKey(arg1: HWND) -> UINT; +} +extern "C" { + pub fn ImmRegisterWordA( + arg1: HKL, + lpszReading: LPCSTR, + arg2: DWORD, + lpszRegister: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ImmRegisterWordW( + arg1: HKL, + lpszReading: LPCWSTR, + arg2: DWORD, + lpszRegister: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ImmUnregisterWordA( + arg1: HKL, + lpszReading: LPCSTR, + arg2: DWORD, + lpszUnregister: LPCSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ImmUnregisterWordW( + arg1: HKL, + lpszReading: LPCWSTR, + arg2: DWORD, + lpszUnregister: LPCWSTR, + ) -> WINBOOL; +} +extern "C" { + pub fn ImmGetRegisterWordStyleA(arg1: HKL, nItem: UINT, arg2: LPSTYLEBUFA) -> UINT; +} +extern "C" { + pub fn ImmGetRegisterWordStyleW(arg1: HKL, nItem: UINT, arg2: LPSTYLEBUFW) -> UINT; +} +extern "C" { + pub fn ImmEnumRegisterWordA( + arg1: HKL, + arg2: REGISTERWORDENUMPROCA, + lpszReading: LPCSTR, + arg3: DWORD, + lpszRegister: LPCSTR, + arg4: LPVOID, + ) -> UINT; +} +extern "C" { + pub fn ImmEnumRegisterWordW( + arg1: HKL, + arg2: REGISTERWORDENUMPROCW, + lpszReading: LPCWSTR, + arg3: DWORD, + lpszRegister: LPCWSTR, + arg4: LPVOID, + ) -> UINT; +} +extern "C" { + pub fn ImmDisableIME(arg1: DWORD) -> WINBOOL; +} +extern "C" { + pub fn ImmEnumInputContext(idThread: DWORD, lpfn: IMCENUMPROC, lParam: LPARAM) -> WINBOOL; +} +extern "C" { + pub fn ImmGetImeMenuItemsA( + arg1: HIMC, + arg2: DWORD, + arg3: DWORD, + arg4: LPIMEMENUITEMINFOA, + arg5: LPIMEMENUITEMINFOA, + arg6: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn ImmGetImeMenuItemsW( + arg1: HIMC, + arg2: DWORD, + arg3: DWORD, + arg4: LPIMEMENUITEMINFOW, + arg5: LPIMEMENUITEMINFOW, + arg6: DWORD, + ) -> DWORD; +} +extern "C" { + pub fn ImmDisableTextFrameService(idThread: DWORD) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HDROP__ { + pub unused: ::std::os::raw::c_int, +} +pub type HDROP = *mut HDROP__; +extern "C" { + pub fn DragQueryFileA(hDrop: HDROP, iFile: UINT, lpszFile: LPSTR, cch: UINT) -> UINT; +} +extern "C" { + pub fn DragQueryFileW(hDrop: HDROP, iFile: UINT, lpszFile: LPWSTR, cch: UINT) -> UINT; +} +extern "C" { + pub fn DragQueryPoint(hDrop: HDROP, ppt: *mut POINT) -> WINBOOL; +} +extern "C" { + pub fn DragFinish(hDrop: HDROP); +} +extern "C" { + pub fn DragAcceptFiles(hWnd: HWND, fAccept: WINBOOL); +} +extern "C" { + pub fn ShellExecuteA( + hwnd: HWND, + lpOperation: LPCSTR, + lpFile: LPCSTR, + lpParameters: LPCSTR, + lpDirectory: LPCSTR, + nShowCmd: INT, + ) -> HINSTANCE; +} +extern "C" { + pub fn ShellExecuteW( + hwnd: HWND, + lpOperation: LPCWSTR, + lpFile: LPCWSTR, + lpParameters: LPCWSTR, + lpDirectory: LPCWSTR, + nShowCmd: INT, + ) -> HINSTANCE; +} +extern "C" { + pub fn FindExecutableA(lpFile: LPCSTR, lpDirectory: LPCSTR, lpResult: LPSTR) -> HINSTANCE; +} +extern "C" { + pub fn FindExecutableW(lpFile: LPCWSTR, lpDirectory: LPCWSTR, lpResult: LPWSTR) -> HINSTANCE; +} +extern "C" { + pub fn CommandLineToArgvW( + lpCmdLine: LPCWSTR, + pNumArgs: *mut ::std::os::raw::c_int, + ) -> *mut LPWSTR; +} +extern "C" { + pub fn ShellAboutA(hWnd: HWND, szApp: LPCSTR, szOtherStuff: LPCSTR, hIcon: HICON) -> INT; +} +extern "C" { + pub fn ShellAboutW(hWnd: HWND, szApp: LPCWSTR, szOtherStuff: LPCWSTR, hIcon: HICON) -> INT; +} +extern "C" { + pub fn DuplicateIcon(hInst: HINSTANCE, hIcon: HICON) -> HICON; +} +extern "C" { + pub fn ExtractAssociatedIconA(hInst: HINSTANCE, pszIconPath: LPSTR, piIcon: *mut WORD) + -> HICON; +} +extern "C" { + pub fn ExtractAssociatedIconW( + hInst: HINSTANCE, + pszIconPath: LPWSTR, + piIcon: *mut WORD, + ) -> HICON; +} +extern "C" { + pub fn ExtractAssociatedIconExA( + hInst: HINSTANCE, + pszIconPath: LPSTR, + piIconIndex: *mut WORD, + piIconId: *mut WORD, + ) -> HICON; +} +extern "C" { + pub fn ExtractAssociatedIconExW( + hInst: HINSTANCE, + pszIconPath: LPWSTR, + piIconIndex: *mut WORD, + piIconId: *mut WORD, + ) -> HICON; +} +extern "C" { + pub fn ExtractIconA(hInst: HINSTANCE, pszExeFileName: LPCSTR, nIconIndex: UINT) -> HICON; +} +extern "C" { + pub fn ExtractIconW(hInst: HINSTANCE, pszExeFileName: LPCWSTR, nIconIndex: UINT) -> HICON; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DRAGINFOA { + pub uSize: UINT, + pub pt: POINT, + pub fNC: WINBOOL, + pub lpFileList: LPSTR, + pub grfKeyState: DWORD, +} +pub type DRAGINFOA = _DRAGINFOA; +pub type LPDRAGINFOA = *mut _DRAGINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _DRAGINFOW { + pub uSize: UINT, + pub pt: POINT, + pub fNC: WINBOOL, + pub lpFileList: LPWSTR, + pub grfKeyState: DWORD, +} +pub type DRAGINFOW = _DRAGINFOW; +pub type LPDRAGINFOW = *mut _DRAGINFOW; +pub type DRAGINFO = DRAGINFOA; +pub type LPDRAGINFO = LPDRAGINFOA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _AppBarData { + pub cbSize: DWORD, + pub hWnd: HWND, + pub uCallbackMessage: UINT, + pub uEdge: UINT, + pub rc: RECT, + pub lParam: LPARAM, +} +pub type APPBARDATA = _AppBarData; +pub type PAPPBARDATA = *mut _AppBarData; +extern "C" { + pub fn SHAppBarMessage(dwMessage: DWORD, pData: PAPPBARDATA) -> UINT_PTR; +} +extern "C" { + pub fn DoEnvironmentSubstA(pszSrc: LPSTR, cchSrc: UINT) -> DWORD; +} +extern "C" { + pub fn DoEnvironmentSubstW(pszSrc: LPWSTR, cchSrc: UINT) -> DWORD; +} +extern "C" { + pub fn ExtractIconExA( + lpszFile: LPCSTR, + nIconIndex: ::std::os::raw::c_int, + phiconLarge: *mut HICON, + phiconSmall: *mut HICON, + nIcons: UINT, + ) -> UINT; +} +extern "C" { + pub fn ExtractIconExW( + lpszFile: LPCWSTR, + nIconIndex: ::std::os::raw::c_int, + phiconLarge: *mut HICON, + phiconSmall: *mut HICON, + nIcons: UINT, + ) -> UINT; +} +pub type FILEOP_FLAGS = WORD; +pub type PRINTEROP_FLAGS = WORD; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SHFILEOPSTRUCTA { + pub hwnd: HWND, + pub wFunc: UINT, + pub pFrom: LPCSTR, + pub pTo: LPCSTR, + pub fFlags: FILEOP_FLAGS, + pub fAnyOperationsAborted: WINBOOL, + pub hNameMappings: LPVOID, + pub lpszProgressTitle: PCSTR, +} +pub type SHFILEOPSTRUCTA = _SHFILEOPSTRUCTA; +pub type LPSHFILEOPSTRUCTA = *mut _SHFILEOPSTRUCTA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SHFILEOPSTRUCTW { + pub hwnd: HWND, + pub wFunc: UINT, + pub pFrom: LPCWSTR, + pub pTo: LPCWSTR, + pub fFlags: FILEOP_FLAGS, + pub fAnyOperationsAborted: WINBOOL, + pub hNameMappings: LPVOID, + pub lpszProgressTitle: PCWSTR, +} +pub type SHFILEOPSTRUCTW = _SHFILEOPSTRUCTW; +pub type LPSHFILEOPSTRUCTW = *mut _SHFILEOPSTRUCTW; +pub type SHFILEOPSTRUCT = SHFILEOPSTRUCTA; +pub type LPSHFILEOPSTRUCT = LPSHFILEOPSTRUCTA; +extern "C" { + pub fn SHFileOperationA(lpFileOp: LPSHFILEOPSTRUCTA) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SHFileOperationW(lpFileOp: LPSHFILEOPSTRUCTW) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn SHFreeNameMappings(hNameMappings: HANDLE); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SHNAMEMAPPINGA { + pub pszOldPath: LPSTR, + pub pszNewPath: LPSTR, + pub cchOldPath: ::std::os::raw::c_int, + pub cchNewPath: ::std::os::raw::c_int, +} +pub type SHNAMEMAPPINGA = _SHNAMEMAPPINGA; +pub type LPSHNAMEMAPPINGA = *mut _SHNAMEMAPPINGA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SHNAMEMAPPINGW { + pub pszOldPath: LPWSTR, + pub pszNewPath: LPWSTR, + pub cchOldPath: ::std::os::raw::c_int, + pub cchNewPath: ::std::os::raw::c_int, +} +pub type SHNAMEMAPPINGW = _SHNAMEMAPPINGW; +pub type LPSHNAMEMAPPINGW = *mut _SHNAMEMAPPINGW; +pub type SHNAMEMAPPING = SHNAMEMAPPINGA; +pub type LPSHNAMEMAPPING = LPSHNAMEMAPPINGA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SHELLEXECUTEINFOA { + pub cbSize: DWORD, + pub fMask: ULONG, + pub hwnd: HWND, + pub lpVerb: LPCSTR, + pub lpFile: LPCSTR, + pub lpParameters: LPCSTR, + pub lpDirectory: LPCSTR, + pub nShow: ::std::os::raw::c_int, + pub hInstApp: HINSTANCE, + pub lpIDList: *mut ::std::os::raw::c_void, + pub lpClass: LPCSTR, + pub hkeyClass: HKEY, + pub dwHotKey: DWORD, + pub __bindgen_anon_1: _SHELLEXECUTEINFOA__bindgen_ty_1, + pub hProcess: HANDLE, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _SHELLEXECUTEINFOA__bindgen_ty_1 { + pub hIcon: HANDLE, + pub hMonitor: HANDLE, + _bindgen_union_align: u64, +} +pub type SHELLEXECUTEINFOA = _SHELLEXECUTEINFOA; +pub type LPSHELLEXECUTEINFOA = *mut _SHELLEXECUTEINFOA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SHELLEXECUTEINFOW { + pub cbSize: DWORD, + pub fMask: ULONG, + pub hwnd: HWND, + pub lpVerb: LPCWSTR, + pub lpFile: LPCWSTR, + pub lpParameters: LPCWSTR, + pub lpDirectory: LPCWSTR, + pub nShow: ::std::os::raw::c_int, + pub hInstApp: HINSTANCE, + pub lpIDList: *mut ::std::os::raw::c_void, + pub lpClass: LPCWSTR, + pub hkeyClass: HKEY, + pub dwHotKey: DWORD, + pub __bindgen_anon_1: _SHELLEXECUTEINFOW__bindgen_ty_1, + pub hProcess: HANDLE, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _SHELLEXECUTEINFOW__bindgen_ty_1 { + pub hIcon: HANDLE, + pub hMonitor: HANDLE, + _bindgen_union_align: u64, +} +pub type SHELLEXECUTEINFOW = _SHELLEXECUTEINFOW; +pub type LPSHELLEXECUTEINFOW = *mut _SHELLEXECUTEINFOW; +pub type SHELLEXECUTEINFO = SHELLEXECUTEINFOA; +pub type LPSHELLEXECUTEINFO = LPSHELLEXECUTEINFOA; +extern "C" { + pub fn ShellExecuteExA(pExecInfo: *mut SHELLEXECUTEINFOA) -> WINBOOL; +} +extern "C" { + pub fn ShellExecuteExW(pExecInfo: *mut SHELLEXECUTEINFOW) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SHCREATEPROCESSINFOW { + pub cbSize: DWORD, + pub fMask: ULONG, + pub hwnd: HWND, + pub pszFile: LPCWSTR, + pub pszParameters: LPCWSTR, + pub pszCurrentDirectory: LPCWSTR, + pub hUserToken: HANDLE, + pub lpProcessAttributes: LPSECURITY_ATTRIBUTES, + pub lpThreadAttributes: LPSECURITY_ATTRIBUTES, + pub bInheritHandles: WINBOOL, + pub dwCreationFlags: DWORD, + pub lpStartupInfo: LPSTARTUPINFOW, + pub lpProcessInformation: LPPROCESS_INFORMATION, +} +pub type SHCREATEPROCESSINFOW = _SHCREATEPROCESSINFOW; +pub type PSHCREATEPROCESSINFOW = *mut _SHCREATEPROCESSINFOW; +extern "C" { + pub fn SHCreateProcessAsUserW(pscpi: PSHCREATEPROCESSINFOW) -> WINBOOL; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _SHQUERYRBINFO { + pub cbSize: DWORD, + pub i64Size: ::std::os::raw::c_longlong, + pub i64NumItems: ::std::os::raw::c_longlong, +} +pub type SHQUERYRBINFO = _SHQUERYRBINFO; +pub type LPSHQUERYRBINFO = *mut _SHQUERYRBINFO; +extern "C" { + pub fn SHQueryRecycleBinA(pszRootPath: LPCSTR, pSHQueryRBInfo: LPSHQUERYRBINFO) -> HRESULT; +} +extern "C" { + pub fn SHQueryRecycleBinW(pszRootPath: LPCWSTR, pSHQueryRBInfo: LPSHQUERYRBINFO) -> HRESULT; +} +extern "C" { + pub fn SHEmptyRecycleBinA(hwnd: HWND, pszRootPath: LPCSTR, dwFlags: DWORD) -> HRESULT; +} +extern "C" { + pub fn SHEmptyRecycleBinW(hwnd: HWND, pszRootPath: LPCWSTR, dwFlags: DWORD) -> HRESULT; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NOTIFYICONDATAA { + pub cbSize: DWORD, + pub hWnd: HWND, + pub uID: UINT, + pub uFlags: UINT, + pub uCallbackMessage: UINT, + pub hIcon: HICON, + pub szTip: [CHAR; 128usize], + pub dwState: DWORD, + pub dwStateMask: DWORD, + pub szInfo: [CHAR; 256usize], + pub __bindgen_anon_1: _NOTIFYICONDATAA__bindgen_ty_1, + pub szInfoTitle: [CHAR; 64usize], + pub dwInfoFlags: DWORD, + pub guidItem: GUID, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NOTIFYICONDATAA__bindgen_ty_1 { + pub uTimeout: UINT, + pub uVersion: UINT, + _bindgen_union_align: u32, +} +pub type NOTIFYICONDATAA = _NOTIFYICONDATAA; +pub type PNOTIFYICONDATAA = *mut _NOTIFYICONDATAA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _NOTIFYICONDATAW { + pub cbSize: DWORD, + pub hWnd: HWND, + pub uID: UINT, + pub uFlags: UINT, + pub uCallbackMessage: UINT, + pub hIcon: HICON, + pub szTip: [WCHAR; 128usize], + pub dwState: DWORD, + pub dwStateMask: DWORD, + pub szInfo: [WCHAR; 256usize], + pub __bindgen_anon_1: _NOTIFYICONDATAW__bindgen_ty_1, + pub szInfoTitle: [WCHAR; 64usize], + pub dwInfoFlags: DWORD, + pub guidItem: GUID, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _NOTIFYICONDATAW__bindgen_ty_1 { + pub uTimeout: UINT, + pub uVersion: UINT, + _bindgen_union_align: u32, +} +pub type NOTIFYICONDATAW = _NOTIFYICONDATAW; +pub type PNOTIFYICONDATAW = *mut _NOTIFYICONDATAW; +pub type NOTIFYICONDATA = NOTIFYICONDATAA; +pub type PNOTIFYICONDATA = PNOTIFYICONDATAA; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _NOTIFYICONIDENTIFIER { + pub cbSize: DWORD, + pub hWnd: HWND, + pub uID: UINT, + pub guidItem: GUID, +} +pub type NOTIFYICONIDENTIFIER = _NOTIFYICONIDENTIFIER; +pub type PNOTIFYICONIDENTIFIER = *mut _NOTIFYICONIDENTIFIER; +extern "C" { + pub fn Shell_NotifyIconA(dwMessage: DWORD, lpData: PNOTIFYICONDATAA) -> WINBOOL; +} +extern "C" { + pub fn Shell_NotifyIconW(dwMessage: DWORD, lpData: PNOTIFYICONDATAW) -> WINBOOL; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SHFILEINFOA { + pub hIcon: HICON, + pub iIcon: ::std::os::raw::c_int, + pub dwAttributes: DWORD, + pub szDisplayName: [CHAR; 260usize], + pub szTypeName: [CHAR; 80usize], +} +pub type SHFILEINFOA = _SHFILEINFOA; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _SHFILEINFOW { + pub hIcon: HICON, + pub iIcon: ::std::os::raw::c_int, + pub dwAttributes: DWORD, + pub szDisplayName: [WCHAR; 260usize], + pub szTypeName: [WCHAR; 80usize], +} +pub type SHFILEINFOW = _SHFILEINFOW; +pub type SHFILEINFO = SHFILEINFOA; +extern "C" { + pub fn SHGetFileInfoA( + pszPath: LPCSTR, + dwFileAttributes: DWORD, + psfi: *mut SHFILEINFOA, + cbFileInfo: UINT, + uFlags: UINT, + ) -> DWORD_PTR; +} +extern "C" { + pub fn SHGetFileInfoW( + pszPath: LPCWSTR, + dwFileAttributes: DWORD, + psfi: *mut SHFILEINFOW, + cbFileInfo: UINT, + uFlags: UINT, + ) -> DWORD_PTR; +} +extern "C" { + pub fn SHGetDiskFreeSpaceExA( + pszDirectoryName: LPCSTR, + pulFreeBytesAvailableToCaller: *mut ULARGE_INTEGER, + pulTotalNumberOfBytes: *mut ULARGE_INTEGER, + pulTotalNumberOfFreeBytes: *mut ULARGE_INTEGER, + ) -> WINBOOL; +} +extern "C" { + pub fn SHGetDiskFreeSpaceExW( + pszDirectoryName: LPCWSTR, + pulFreeBytesAvailableToCaller: *mut ULARGE_INTEGER, + pulTotalNumberOfBytes: *mut ULARGE_INTEGER, + pulTotalNumberOfFreeBytes: *mut ULARGE_INTEGER, + ) -> WINBOOL; +} +extern "C" { + pub fn SHGetNewLinkInfoA( + pszLinkTo: LPCSTR, + pszDir: LPCSTR, + pszName: LPSTR, + pfMustCopy: *mut WINBOOL, + uFlags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn SHGetNewLinkInfoW( + pszLinkTo: LPCWSTR, + pszDir: LPCWSTR, + pszName: LPWSTR, + pfMustCopy: *mut WINBOOL, + uFlags: UINT, + ) -> WINBOOL; +} +extern "C" { + pub fn SHInvokePrinterCommandA( + hwnd: HWND, + uAction: UINT, + lpBuf1: LPCSTR, + lpBuf2: LPCSTR, + fModal: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SHInvokePrinterCommandW( + hwnd: HWND, + uAction: UINT, + lpBuf1: LPCWSTR, + lpBuf2: LPCWSTR, + fModal: WINBOOL, + ) -> WINBOOL; +} +extern "C" { + pub fn SHLoadNonloadedIconOverlayIdentifiers() -> HRESULT; +} +extern "C" { + pub fn SHIsFileAvailableOffline(pwszPath: PCWSTR, pdwStatus: *mut DWORD) -> HRESULT; +} +extern "C" { + pub fn SHSetLocalizedName( + pszPath: PCWSTR, + pszResModule: PCWSTR, + idsRes: ::std::os::raw::c_int, + ) -> HRESULT; +} +extern "C" { + pub fn ShellMessageBoxA( + hAppInst: HINSTANCE, + hWnd: HWND, + lpcText: LPCSTR, + lpcTitle: LPCSTR, + fuStyle: UINT, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ShellMessageBoxW( + hAppInst: HINSTANCE, + hWnd: HWND, + lpcText: LPCWSTR, + lpcTitle: LPCWSTR, + fuStyle: UINT, + ... + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn IsLFNDriveA(pszPath: LPCSTR) -> WINBOOL; +} +extern "C" { + pub fn IsLFNDriveW(pszPath: LPCWSTR) -> WINBOOL; +} +extern "C" { + pub fn SHEnumerateUnreadMailAccountsA( + hKeyUser: HKEY, + dwIndex: DWORD, + pszMailAddress: LPSTR, + cchMailAddress: ::std::os::raw::c_int, + ) -> HRESULT; +} +extern "C" { + pub fn SHEnumerateUnreadMailAccountsW( + hKeyUser: HKEY, + dwIndex: DWORD, + pszMailAddress: LPWSTR, + cchMailAddress: ::std::os::raw::c_int, + ) -> HRESULT; +} +extern "C" { + pub fn SHGetUnreadMailCountA( + hKeyUser: HKEY, + pszMailAddress: LPCSTR, + pdwCount: *mut DWORD, + pFileTime: *mut FILETIME, + pszShellExecuteCommand: LPSTR, + cchShellExecuteCommand: ::std::os::raw::c_int, + ) -> HRESULT; +} +extern "C" { + pub fn SHGetUnreadMailCountW( + hKeyUser: HKEY, + pszMailAddress: LPCWSTR, + pdwCount: *mut DWORD, + pFileTime: *mut FILETIME, + pszShellExecuteCommand: LPWSTR, + cchShellExecuteCommand: ::std::os::raw::c_int, + ) -> HRESULT; +} +extern "C" { + pub fn SHSetUnreadMailCountA( + pszMailAddress: LPCSTR, + dwCount: DWORD, + pszShellExecuteCommand: LPCSTR, + ) -> HRESULT; +} +extern "C" { + pub fn SHSetUnreadMailCountW( + pszMailAddress: LPCWSTR, + dwCount: DWORD, + pszShellExecuteCommand: LPCWSTR, + ) -> HRESULT; +} +extern "C" { + pub fn SHTestTokenMembership(hToken: HANDLE, ulRID: ULONG) -> WINBOOL; +} +extern "C" { + pub fn SHGetImageList( + iImageList: ::std::os::raw::c_int, + riid: *const IID, + ppvObj: *mut *mut ::std::os::raw::c_void, + ) -> HRESULT; +} +pub type PFNCANSHAREFOLDERW = + ::std::option::Option HRESULT>; +pub type PFNSHOWSHAREFOLDERUIW = + ::std::option::Option HRESULT>; +pub const PROCESS_DPI_AWARENESS_PROCESS_DPI_UNAWARE: PROCESS_DPI_AWARENESS = 0; +pub const PROCESS_DPI_AWARENESS_PROCESS_SYSTEM_DPI_AWARE: PROCESS_DPI_AWARENESS = 1; +pub const PROCESS_DPI_AWARENESS_PROCESS_PER_MONITOR_DPI_AWARE: PROCESS_DPI_AWARENESS = 2; +pub type PROCESS_DPI_AWARENESS = u32; +pub const MONITOR_DPI_TYPE_MDT_EFFECTIVE_DPI: MONITOR_DPI_TYPE = 0; +pub const MONITOR_DPI_TYPE_MDT_ANGULAR_DPI: MONITOR_DPI_TYPE = 1; +pub const MONITOR_DPI_TYPE_MDT_RAW_DPI: MONITOR_DPI_TYPE = 2; +pub const MONITOR_DPI_TYPE_MDT_DEFAULT: MONITOR_DPI_TYPE = 0; +pub type MONITOR_DPI_TYPE = u32; +extern "C" { + pub static mut _sapp_win32_hwnd: HWND; +} +extern "C" { + pub static mut _sapp_win32_dc: HDC; +} +extern "C" { + pub static mut _sapp_win32_in_create_window: bool; +} +extern "C" { + pub static mut _sapp_win32_dpi_aware: bool; +} +extern "C" { + pub static mut _sapp_win32_content_scale: f32; +} +extern "C" { + pub static mut _sapp_win32_window_scale: f32; +} +extern "C" { + pub static mut _sapp_win32_mouse_scale: f32; +} +extern "C" { + pub static mut _sapp_win32_iconified: bool; +} +pub type SETPROCESSDPIAWARE_T = ::std::option::Option BOOL>; +pub type SETPROCESSDPIAWARENESS_T = + ::std::option::Option HRESULT>; +pub type GETDPIFORMONITOR_T = ::std::option::Option< + unsafe extern "C" fn( + arg1: HMONITOR, + arg2: MONITOR_DPI_TYPE, + arg3: *mut UINT, + arg4: *mut UINT, + ) -> HRESULT, +>; +extern "C" { + pub static mut _sapp_win32_setprocessdpiaware: SETPROCESSDPIAWARE_T; +} +extern "C" { + pub static mut _sapp_win32_setprocessdpiawareness: SETPROCESSDPIAWARENESS_T; +} +extern "C" { + pub static mut _sapp_win32_getdpiformonitor: GETDPIFORMONITOR_T; +} +pub type PFNWGLSWAPINTERVALEXTPROC = + ::std::option::Option BOOL>; +pub type PFNWGLGETPIXELFORMATATTRIBIVARBPROC = ::std::option::Option< + unsafe extern "C" fn( + arg1: HDC, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: UINT, + arg5: *const ::std::os::raw::c_int, + arg6: *mut ::std::os::raw::c_int, + ) -> BOOL, +>; +pub type PFNWGLGETEXTENSIONSSTRINGEXTPROC = + ::std::option::Option *const ::std::os::raw::c_char>; +pub type PFNWGLGETEXTENSIONSSTRINGARBPROC = + ::std::option::Option *const ::std::os::raw::c_char>; +pub type PFNWGLCREATECONTEXTATTRIBSARBPROC = ::std::option::Option< + unsafe extern "C" fn(arg1: HDC, arg2: HGLRC, arg3: *const ::std::os::raw::c_int) -> HGLRC, +>; +pub type PFN_wglCreateContext = ::std::option::Option HGLRC>; +pub type PFN_wglDeleteContext = ::std::option::Option BOOL>; +pub type PFN_wglGetProcAddress = ::std::option::Option PROC>; +pub type PFN_wglGetCurrentDC = ::std::option::Option HDC>; +pub type PFN_wglMakeCurrent = + ::std::option::Option BOOL>; +extern "C" { + pub static mut _sapp_opengl32: HINSTANCE; +} +extern "C" { + pub static mut _sapp_gl_ctx: HGLRC; +} +extern "C" { + pub static mut _sapp_wglCreateContext: PFN_wglCreateContext; +} +extern "C" { + pub static mut _sapp_wglDeleteContext: PFN_wglDeleteContext; +} +extern "C" { + pub static mut _sapp_wglGetProcAddress: PFN_wglGetProcAddress; +} +extern "C" { + pub static mut _sapp_wglGetCurrentDC: PFN_wglGetCurrentDC; +} +extern "C" { + pub static mut _sapp_wglMakeCurrent: PFN_wglMakeCurrent; +} +extern "C" { + pub static mut _sapp_SwapIntervalEXT: PFNWGLSWAPINTERVALEXTPROC; +} +extern "C" { + pub static mut _sapp_GetPixelFormatAttribivARB: PFNWGLGETPIXELFORMATATTRIBIVARBPROC; +} +extern "C" { + pub static mut _sapp_GetExtensionsStringEXT: PFNWGLGETEXTENSIONSSTRINGEXTPROC; +} +extern "C" { + pub static mut _sapp_GetExtensionsStringARB: PFNWGLGETEXTENSIONSSTRINGARBPROC; +} +extern "C" { + pub static mut _sapp_CreateContextAttribsARB: PFNWGLCREATECONTEXTATTRIBSARBPROC; +} +extern "C" { + pub static mut _sapp_ext_swap_control: bool; +} +extern "C" { + pub static mut _sapp_arb_multisample: bool; +} +extern "C" { + pub static mut _sapp_arb_pixel_format: bool; +} +extern "C" { + pub static mut _sapp_arb_create_context: bool; +} +extern "C" { + pub static mut _sapp_arb_create_context_profile: bool; +} +extern "C" { + pub static mut _sapp_win32_msg_hwnd: HWND; +} +extern "C" { + pub static mut _sapp_win32_msg_dc: HDC; +} +pub type GLenum = ::std::os::raw::c_uint; +pub type GLuint = ::std::os::raw::c_uint; +pub type GLsizei = ::std::os::raw::c_int; +pub type GLchar = ::std::os::raw::c_char; +pub type GLintptr = isize; +pub type GLsizeiptr = ::std::os::raw::c_longlong; +pub type GLclampd = f64; +pub type GLushort = ::std::os::raw::c_ushort; +pub type GLubyte = ::std::os::raw::c_uchar; +pub type GLboolean = ::std::os::raw::c_uchar; +pub type GLuint64 = u64; +pub type GLdouble = f64; +pub type GLhalf = ::std::os::raw::c_ushort; +pub type GLclampf = f32; +pub type GLbitfield = ::std::os::raw::c_uint; +pub type GLbyte = ::std::os::raw::c_schar; +pub type GLshort = ::std::os::raw::c_short; +pub type GLvoid = ::std::os::raw::c_void; +pub type GLint64 = i64; +pub type GLfloat = f32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __GLsync { + _unused: [u8; 0], +} +pub type GLsync = *mut __GLsync; +pub type GLint = ::std::os::raw::c_int; +pub type PFN_glCreateTextures = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glCreateTextures: PFN_glCreateTextures; +} +extern "C" { + pub fn glCreateTextures(target: GLenum, n: GLsizei, textures: *mut GLuint); +} +pub type PFN_glCreateBuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glCreateBuffers: PFN_glCreateBuffers; +} +extern "C" { + pub fn glCreateBuffers(n: GLsizei, buffers: *mut GLuint); +} +pub type PFN_glBindVertexArray = ::std::option::Option; +extern "C" { + pub static mut _sapp_glBindVertexArray: PFN_glBindVertexArray; +} +extern "C" { + pub fn glBindVertexArray(array: GLuint); +} +pub type PFN_glFramebufferTextureLayer = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + texture: GLuint, + level: GLint, + layer: GLint, + ), +>; +extern "C" { + pub static mut _sapp_glFramebufferTextureLayer: PFN_glFramebufferTextureLayer; +} +pub type PFN_glGenFramebuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGenFramebuffers: PFN_glGenFramebuffers; +} +extern "C" { + pub fn glGenFramebuffers(n: GLsizei, framebuffers: *mut GLuint); +} +pub type PFN_glBindFramebuffer = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glBindFramebuffer: PFN_glBindFramebuffer; +} +extern "C" { + pub fn glBindFramebuffer(target: GLenum, framebuffer: GLuint); +} +pub type PFN_glBindRenderbuffer = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glBindRenderbuffer: PFN_glBindRenderbuffer; +} +pub type PFN_glGetStringi = + ::std::option::Option *const GLubyte>; +extern "C" { + pub static mut _sapp_glGetStringi: PFN_glGetStringi; +} +pub type PFN_glClearBufferfi = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint), +>; +extern "C" { + pub static mut _sapp_glClearBufferfi: PFN_glClearBufferfi; +} +pub type PFN_glClearBufferfv = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat), +>; +extern "C" { + pub static mut _sapp_glClearBufferfv: PFN_glClearBufferfv; +} +pub type PFN_glClearBufferuiv = ::std::option::Option< + unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLuint), +>; +extern "C" { + pub static mut _sapp_glClearBufferuiv: PFN_glClearBufferuiv; +} +pub type PFN_glDeleteRenderbuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteRenderbuffers: PFN_glDeleteRenderbuffers; +} +pub type PFN_glUniform4fv = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +extern "C" { + pub static mut _sapp_glUniform4fv: PFN_glUniform4fv; +} +extern "C" { + pub fn glUniform4fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +pub type PFN_glUniform2fv = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +extern "C" { + pub static mut _sapp_glUniform2fv: PFN_glUniform2fv; +} +extern "C" { + pub fn glUniform2fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +pub type PFN_glUseProgram = ::std::option::Option; +extern "C" { + pub static mut _sapp_glUseProgram: PFN_glUseProgram; +} +extern "C" { + pub fn glUseProgram(program: GLuint); +} +pub type PFN_glShaderSource = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + count: GLsizei, + string: *const *const GLchar, + length: *const GLint, + ), +>; +extern "C" { + pub static mut _sapp_glShaderSource: PFN_glShaderSource; +} +extern "C" { + pub fn glShaderSource( + shader: GLuint, + count: GLsizei, + string: *const *const GLchar, + length: *const GLint, + ); +} +pub type PFN_glLinkProgram = ::std::option::Option; +extern "C" { + pub static mut _sapp_glLinkProgram: PFN_glLinkProgram; +} +extern "C" { + pub fn glLinkProgram(program: GLuint); +} +pub type PFN_glGetUniformLocation = + ::std::option::Option GLint>; +extern "C" { + pub static mut _sapp_glGetUniformLocation: PFN_glGetUniformLocation; +} +extern "C" { + pub fn glGetUniformLocation(program: GLuint, name: *const GLchar) -> GLint; +} +pub type PFN_glGetShaderiv = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGetShaderiv: PFN_glGetShaderiv; +} +extern "C" { + pub fn glGetShaderiv(shader: GLuint, pname: GLenum, params: *mut GLint); +} +pub type PFN_glGetProgramInfoLog = ::std::option::Option< + unsafe extern "C" fn( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ), +>; +extern "C" { + pub static mut _sapp_glGetProgramInfoLog: PFN_glGetProgramInfoLog; +} +extern "C" { + pub fn glGetProgramInfoLog( + program: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +pub type PFN_glGetAttribLocation = + ::std::option::Option GLint>; +extern "C" { + pub static mut _sapp_glGetAttribLocation: PFN_glGetAttribLocation; +} +extern "C" { + pub fn glGetAttribLocation(program: GLuint, name: *const GLchar) -> GLint; +} +pub type PFN_glDisableVertexAttribArray = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDisableVertexAttribArray: PFN_glDisableVertexAttribArray; +} +extern "C" { + pub fn glDisableVertexAttribArray(index: GLuint); +} +pub type PFN_glDeleteShader = ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteShader: PFN_glDeleteShader; +} +extern "C" { + pub fn glDeleteShader(shader: GLuint); +} +pub type PFN_glDeleteProgram = ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteProgram: PFN_glDeleteProgram; +} +pub type PFN_glCompileShader = ::std::option::Option; +extern "C" { + pub static mut _sapp_glCompileShader: PFN_glCompileShader; +} +extern "C" { + pub fn glCompileShader(shader: GLuint); +} +pub type PFN_glStencilFuncSeparate = ::std::option::Option< + unsafe extern "C" fn(face: GLenum, func: GLenum, ref_: GLint, mask: GLuint), +>; +extern "C" { + pub static mut _sapp_glStencilFuncSeparate: PFN_glStencilFuncSeparate; +} +pub type PFN_glStencilOpSeparate = ::std::option::Option< + unsafe extern "C" fn(face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum), +>; +extern "C" { + pub static mut _sapp_glStencilOpSeparate: PFN_glStencilOpSeparate; +} +pub type PFN_glRenderbufferStorageMultisample = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + samples: GLsizei, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + ), +>; +extern "C" { + pub static mut _sapp_glRenderbufferStorageMultisample: PFN_glRenderbufferStorageMultisample; +} +pub type PFN_glDrawBuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDrawBuffers: PFN_glDrawBuffers; +} +pub type PFN_glVertexAttribDivisor = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glVertexAttribDivisor: PFN_glVertexAttribDivisor; +} +pub type PFN_glBufferSubData = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glBufferSubData: PFN_glBufferSubData; +} +extern "C" { + pub fn glBufferSubData( + target: GLenum, + offset: GLintptr, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + ); +} +pub type PFN_glGenBuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGenBuffers: PFN_glGenBuffers; +} +extern "C" { + pub fn glGenBuffers(n: GLsizei, buffers: *mut GLuint); +} +pub type PFN_glCheckFramebufferStatus = + ::std::option::Option GLenum>; +extern "C" { + pub static mut _sapp_glCheckFramebufferStatus: PFN_glCheckFramebufferStatus; +} +pub type PFN_glFramebufferRenderbuffer = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + renderbuffertarget: GLenum, + renderbuffer: GLuint, + ), +>; +extern "C" { + pub static mut _sapp_glFramebufferRenderbuffer: PFN_glFramebufferRenderbuffer; +} +pub type PFN_glCompressedTexImage2D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glCompressedTexImage2D: PFN_glCompressedTexImage2D; +} +pub type PFN_glCompressedTexImage3D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLenum, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + imageSize: GLsizei, + data: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glCompressedTexImage3D: PFN_glCompressedTexImage3D; +} +pub type PFN_glActiveTexture = ::std::option::Option; +extern "C" { + pub static mut _sapp_glActiveTexture: PFN_glActiveTexture; +} +extern "C" { + pub fn glActiveTexture(texture: GLenum); +} +pub type PFN_glTexSubImage3D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + zoffset: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glTexSubImage3D: PFN_glTexSubImage3D; +} +pub type PFN_glUniformMatrix4fv = ::std::option::Option< + unsafe extern "C" fn( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ), +>; +extern "C" { + pub static mut _sapp_glUniformMatrix4fv: PFN_glUniformMatrix4fv; +} +extern "C" { + pub fn glUniformMatrix4fv( + location: GLint, + count: GLsizei, + transpose: GLboolean, + value: *const GLfloat, + ); +} +pub type PFN_glRenderbufferStorage = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei), +>; +extern "C" { + pub static mut _sapp_glRenderbufferStorage: PFN_glRenderbufferStorage; +} +pub type PFN_glGenTextures = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGenTextures: PFN_glGenTextures; +} +extern "C" { + pub fn glGenTextures(n: GLsizei, textures: *mut GLuint); +} +pub type PFN_glPolygonOffset = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glPolygonOffset: PFN_glPolygonOffset; +} +pub type PFN_glDrawElements = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glDrawElements: PFN_glDrawElements; +} +extern "C" { + pub fn glDrawElements( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + ); +} +pub type PFN_glDeleteFramebuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteFramebuffers: PFN_glDeleteFramebuffers; +} +pub type PFN_glBlendEquationSeparate = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glBlendEquationSeparate: PFN_glBlendEquationSeparate; +} +extern "C" { + pub fn glBlendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum); +} +pub type PFN_glDeleteTextures = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteTextures: PFN_glDeleteTextures; +} +pub type PFN_glGetProgramiv = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGetProgramiv: PFN_glGetProgramiv; +} +extern "C" { + pub fn glGetProgramiv(program: GLuint, pname: GLenum, params: *mut GLint); +} +pub type PFN_glBindTexture = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glBindTexture: PFN_glBindTexture; +} +extern "C" { + pub fn glBindTexture(target: GLenum, texture: GLuint); +} +pub type PFN_glTexImage3D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + depth: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glTexImage3D: PFN_glTexImage3D; +} +pub type PFN_glCreateShader = ::std::option::Option GLuint>; +extern "C" { + pub static mut _sapp_glCreateShader: PFN_glCreateShader; +} +extern "C" { + pub fn glCreateShader(type_: GLenum) -> GLuint; +} +pub type PFN_glTexSubImage2D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + xoffset: GLint, + yoffset: GLint, + width: GLsizei, + height: GLsizei, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glTexSubImage2D: PFN_glTexSubImage2D; +} +pub type PFN_glClearDepth = ::std::option::Option; +extern "C" { + pub static mut _sapp_glClearDepth: PFN_glClearDepth; +} +extern "C" { + pub fn glClearDepth(depth: GLdouble); +} +pub type PFN_glClearDepthf = ::std::option::Option; +extern "C" { + pub static mut _sapp_glClearDepthf: PFN_glClearDepthf; +} +extern "C" { + pub fn glClearDepthf(depth: GLfloat); +} +pub type PFN_glFramebufferTexture2D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ), +>; +extern "C" { + pub static mut _sapp_glFramebufferTexture2D: PFN_glFramebufferTexture2D; +} +extern "C" { + pub fn glFramebufferTexture2D( + target: GLenum, + attachment: GLenum, + textarget: GLenum, + texture: GLuint, + level: GLint, + ); +} +pub type PFN_glCreateProgram = ::std::option::Option GLuint>; +extern "C" { + pub static mut _sapp_glCreateProgram: PFN_glCreateProgram; +} +extern "C" { + pub fn glCreateProgram() -> GLuint; +} +pub type PFN_glViewport = ::std::option::Option< + unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), +>; +extern "C" { + pub static mut _sapp_glViewport: PFN_glViewport; +} +extern "C" { + pub fn glViewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei); +} +pub type PFN_glDeleteBuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteBuffers: PFN_glDeleteBuffers; +} +pub type PFN_glDrawArrays = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDrawArrays: PFN_glDrawArrays; +} +extern "C" { + pub fn glDrawArrays(mode: GLenum, first: GLint, count: GLsizei); +} +pub type PFN_glDrawElementsInstanced = ::std::option::Option< + unsafe extern "C" fn( + mode: GLenum, + count: GLsizei, + type_: GLenum, + indices: *const ::std::os::raw::c_void, + instancecount: GLsizei, + ), +>; +extern "C" { + pub static mut _sapp_glDrawElementsInstanced: PFN_glDrawElementsInstanced; +} +pub type PFN_glVertexAttribPointer = ::std::option::Option< + unsafe extern "C" fn( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glVertexAttribPointer: PFN_glVertexAttribPointer; +} +extern "C" { + pub fn glVertexAttribPointer( + index: GLuint, + size: GLint, + type_: GLenum, + normalized: GLboolean, + stride: GLsizei, + pointer: *const ::std::os::raw::c_void, + ); +} +pub type PFN_glUniform1i = ::std::option::Option; +extern "C" { + pub static mut _sapp_glUniform1i: PFN_glUniform1i; +} +extern "C" { + pub fn glUniform1i(location: GLint, v0: GLint); +} +pub type PFN_glDisable = ::std::option::Option; +extern "C" { + pub static mut _sapp_glDisable: PFN_glDisable; +} +extern "C" { + pub fn glDisable(cap: GLenum); +} +pub type PFN_glColorMask = ::std::option::Option< + unsafe extern "C" fn(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean), +>; +extern "C" { + pub static mut _sapp_glColorMask: PFN_glColorMask; +} +pub type PFN_glBindBuffer = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glBindBuffer: PFN_glBindBuffer; +} +extern "C" { + pub fn glBindBuffer(target: GLenum, buffer: GLuint); +} +pub type PFN_glDeleteVertexArrays = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glDeleteVertexArrays: PFN_glDeleteVertexArrays; +} +pub type PFN_glDepthMask = ::std::option::Option; +extern "C" { + pub static mut _sapp_glDepthMask: PFN_glDepthMask; +} +pub type PFN_glDrawArraysInstanced = ::std::option::Option< + unsafe extern "C" fn(mode: GLenum, first: GLint, count: GLsizei, instancecount: GLsizei), +>; +extern "C" { + pub static mut _sapp_glDrawArraysInstanced: PFN_glDrawArraysInstanced; +} +pub type PFN_glClearStencil = ::std::option::Option; +extern "C" { + pub static mut _sapp_glClearStencil: PFN_glClearStencil; +} +extern "C" { + pub fn glClearStencil(s: GLint); +} +pub type PFN_glScissor = ::std::option::Option< + unsafe extern "C" fn(x: GLint, y: GLint, width: GLsizei, height: GLsizei), +>; +extern "C" { + pub static mut _sapp_glScissor: PFN_glScissor; +} +pub type PFN_glUniform3fv = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +extern "C" { + pub static mut _sapp_glUniform3fv: PFN_glUniform3fv; +} +extern "C" { + pub fn glUniform3fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +pub type PFN_glGenRenderbuffers = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGenRenderbuffers: PFN_glGenRenderbuffers; +} +pub type PFN_glBufferData = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ), +>; +extern "C" { + pub static mut _sapp_glBufferData: PFN_glBufferData; +} +extern "C" { + pub fn glBufferData( + target: GLenum, + size: GLsizeiptr, + data: *const ::std::os::raw::c_void, + usage: GLenum, + ); +} +pub type PFN_glBlendFuncSeparate = ::std::option::Option< + unsafe extern "C" fn( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ), +>; +extern "C" { + pub static mut _sapp_glBlendFuncSeparate: PFN_glBlendFuncSeparate; +} +extern "C" { + pub fn glBlendFuncSeparate( + sfactorRGB: GLenum, + dfactorRGB: GLenum, + sfactorAlpha: GLenum, + dfactorAlpha: GLenum, + ); +} +pub type PFN_glTexParameteri = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glTexParameteri: PFN_glTexParameteri; +} +extern "C" { + pub fn glTexParameteri(target: GLenum, pname: GLenum, param: GLint); +} +pub type PFN_glGetIntegerv = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGetIntegerv: PFN_glGetIntegerv; +} +extern "C" { + pub fn glGetIntegerv(pname: GLenum, data: *mut GLint); +} +pub type PFN_glEnable = ::std::option::Option; +extern "C" { + pub static mut _sapp_glEnable: PFN_glEnable; +} +extern "C" { + pub fn glEnable(cap: GLenum); +} +pub type PFN_glBlitFramebuffer = ::std::option::Option< + unsafe extern "C" fn( + srcX0: GLint, + srcY0: GLint, + srcX1: GLint, + srcY1: GLint, + dstX0: GLint, + dstY0: GLint, + dstX1: GLint, + dstY1: GLint, + mask: GLbitfield, + filter: GLenum, + ), +>; +extern "C" { + pub static mut _sapp_glBlitFramebuffer: PFN_glBlitFramebuffer; +} +pub type PFN_glStencilMask = ::std::option::Option; +extern "C" { + pub static mut _sapp_glStencilMask: PFN_glStencilMask; +} +pub type PFN_glAttachShader = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glAttachShader: PFN_glAttachShader; +} +extern "C" { + pub fn glAttachShader(program: GLuint, shader: GLuint); +} +pub type PFN_glGetError = ::std::option::Option GLenum>; +extern "C" { + pub static mut _sapp_glGetError: PFN_glGetError; +} +pub type PFN_glClearColor = ::std::option::Option< + unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), +>; +extern "C" { + pub static mut _sapp_glClearColor: PFN_glClearColor; +} +extern "C" { + pub fn glClearColor(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat); +} +pub type PFN_glBlendColor = ::std::option::Option< + unsafe extern "C" fn(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat), +>; +extern "C" { + pub static mut _sapp_glBlendColor: PFN_glBlendColor; +} +pub type PFN_glTexParameterf = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glTexParameterf: PFN_glTexParameterf; +} +pub type PFN_glTexParameterfv = ::std::option::Option< + unsafe extern "C" fn(target: GLenum, pname: GLenum, params: *mut GLfloat), +>; +extern "C" { + pub static mut _sapp_glTexParameterfv: PFN_glTexParameterfv; +} +pub type PFN_glGetShaderInfoLog = ::std::option::Option< + unsafe extern "C" fn( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ), +>; +extern "C" { + pub static mut _sapp_glGetShaderInfoLog: PFN_glGetShaderInfoLog; +} +extern "C" { + pub fn glGetShaderInfoLog( + shader: GLuint, + bufSize: GLsizei, + length: *mut GLsizei, + infoLog: *mut GLchar, + ); +} +pub type PFN_glDepthFunc = ::std::option::Option; +extern "C" { + pub static mut _sapp_glDepthFunc: PFN_glDepthFunc; +} +extern "C" { + pub fn glDepthFunc(func: GLenum); +} +pub type PFN_glStencilOp = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glStencilOp: PFN_glStencilOp; +} +pub type PFN_glStencilFunc = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glStencilFunc: PFN_glStencilFunc; +} +pub type PFN_glEnableVertexAttribArray = ::std::option::Option; +extern "C" { + pub static mut _sapp_glEnableVertexAttribArray: PFN_glEnableVertexAttribArray; +} +extern "C" { + pub fn glEnableVertexAttribArray(index: GLuint); +} +pub type PFN_glBlendFunc = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glBlendFunc: PFN_glBlendFunc; +} +extern "C" { + pub fn glBlendFunc(sfactor: GLenum, dfactor: GLenum); +} +pub type PFN_glUniform1fv = ::std::option::Option< + unsafe extern "C" fn(location: GLint, count: GLsizei, value: *const GLfloat), +>; +extern "C" { + pub static mut _sapp_glUniform1fv: PFN_glUniform1fv; +} +extern "C" { + pub fn glUniform1fv(location: GLint, count: GLsizei, value: *const GLfloat); +} +pub type PFN_glUniform1f = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glUniform1f: PFN_glUniform1f; +} +extern "C" { + pub fn glUniform1f(location: GLint, value: GLfloat); +} +pub type PFN_glReadBuffer = ::std::option::Option; +extern "C" { + pub static mut _sapp_glReadBuffer: PFN_glReadBuffer; +} +pub type PFN_glClear = ::std::option::Option; +extern "C" { + pub static mut _sapp_glClear: PFN_glClear; +} +extern "C" { + pub fn glClear(mask: GLbitfield); +} +pub type PFN_glTexImage2D = ::std::option::Option< + unsafe extern "C" fn( + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ), +>; +extern "C" { + pub static mut _sapp_glTexImage2D: PFN_glTexImage2D; +} +extern "C" { + pub fn glTexImage2D( + target: GLenum, + level: GLint, + internalformat: GLint, + width: GLsizei, + height: GLsizei, + border: GLint, + format: GLenum, + type_: GLenum, + pixels: *const ::std::os::raw::c_void, + ); +} +pub type PFN_glGenVertexArrays = + ::std::option::Option; +extern "C" { + pub static mut _sapp_glGenVertexArrays: PFN_glGenVertexArrays; +} +extern "C" { + pub fn glGenVertexArrays(n: GLsizei, arrays: *mut GLuint); +} +pub type PFN_glFrontFace = ::std::option::Option; +extern "C" { + pub static mut _sapp_glFrontFace: PFN_glFrontFace; +} +pub type PFN_glCullFace = ::std::option::Option; +extern "C" { + pub static mut _sapp_glCullFace: PFN_glCullFace; +} +pub type __builtin_va_list = *mut ::std::os::raw::c_char; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct lconv { + pub _address: u8, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _ACTIVATION_CONTEXT { + pub _address: u8, +} diff --git a/src/conf.rs b/src/conf.rs new file mode 100644 index 00000000..a018cf40 --- /dev/null +++ b/src/conf.rs @@ -0,0 +1,55 @@ +//use crate::goodies::loading_page::LoadingPage; + +#[derive(Debug)] +pub enum Cache { + /// No preloading at all, filesystem::open will always panic. + No, + /// Load /index.txt first, and cache all the files specified. + /// Game will not start until all the files will be cached + Index, + /// Same as Index, but with the files list instead of index.txt + List(Vec<&'static str>), + /// Tar archive contents, usually from include_bytes! + Tar(&'static [u8]), +} + +#[derive(Debug)] +pub enum Loading { + /// No progressbar at all, no html special requirements + No, + /// Will look for some specific html elements and show default progress bar + Embedded, + //Custom(Box), +} + +#[derive(Debug)] +pub struct Conf { + pub cache: Cache, + pub loading: Loading, +} + +impl Default for Conf { + fn default() -> Conf { + Conf { + cache: Cache::No, + loading: Loading::No, + } + } +} + +/// The possible number of samples for multisample anti-aliasing. +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum NumSamples { + /// Multisampling disabled. + Zero = 0, + /// One sample + One = 1, + /// Two samples + Two = 2, + /// Four samples + Four = 4, + /// Eight samples + Eight = 8, + /// Sixteen samples + Sixteen = 16, +} diff --git a/src/event.rs b/src/event.rs new file mode 100644 index 00000000..6095a3d7 --- /dev/null +++ b/src/event.rs @@ -0,0 +1,57 @@ +use crate::Context; + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum MouseButton { + Right, + Left, +} +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum KeyCode { + W, + A, + S, + D, + Left, + Up, + Right, + Down, +} +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum KeyMods { + No, +} + +pub trait EventHandler { + fn update(&mut self, _ctx: &mut Context); + fn draw(&mut self, _ctx: &mut Context); + fn resize_event(&mut self, _ctx: &mut Context, _width: f32, _height: f32) {} + fn mouse_motion_event(&mut self, _ctx: &mut Context, _x: f32, _y: f32, _dx: f32, _dy: f32) {} + fn mouse_wheel_event(&mut self, _ctx: &mut Context, _x: f32, _y: f32) {} + fn mouse_button_down_event( + &mut self, + _ctx: &mut Context, + _button: MouseButton, + _x: f32, + _y: f32, + ) { + } + fn mouse_button_up_event( + &mut self, + _ctx: &mut Context, + _button: MouseButton, + _x: f32, + _y: f32, + ) { + } + + fn key_down_event( + &mut self, + _ctx: &mut Context, + _keycode: KeyCode, + _keymods: KeyMods, + _repeat: bool, + ) { + } + + fn key_up_event(&mut self, _ctx: &mut Context, _keycode: KeyCode, _keymods: KeyMods) {} +} diff --git a/src/graphics.rs b/src/graphics.rs new file mode 100644 index 00000000..e2f800dc --- /dev/null +++ b/src/graphics.rs @@ -0,0 +1,759 @@ +use std::{ffi::CString, mem}; + +use sokol_app_sys::sokol_app::*; +use std::option::Option::None; + +pub const LINEAR_FILTER: i32 = GL_LINEAR as i32; +pub const NEAREST_FILTER: i32 = GL_NEAREST as i32; + +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Texture { + texture: GLuint, +} + +impl Texture { + pub fn from_rgba8(width: u16, height: u16, bytes: &[u8]) -> Texture { + unsafe { + let mut texture: GLuint = 0; + glGenTextures(1, &mut texture as *mut _); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, texture); + glTexImage2D( + GL_TEXTURE_2D, + 0, + GL_RGBA as i32, + width as i32, + height as i32, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + bytes.as_ptr() as *const _, + ); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE as i32); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE as i32); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR as i32); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR as i32); + + Texture { texture } + } + } + + pub fn set_filter(&self, filter: i32) { + unsafe { + glBindTexture(GL_TEXTURE_2D, self.texture); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); + } + } +} + +fn get_uniform_location(program: GLuint, name: &str) -> i32 { + let cname = CString::new(name).unwrap_or_else(|e| panic!(e)); + let location = unsafe { glGetUniformLocation(program, cname.as_ptr()) }; + + assert!( + location != -1, + format!("Cant get \"{}\" uniform location", name) + ); + + location +} + +#[derive(Clone, Copy, Debug)] +pub enum UniformType { + Float1, + Float2, + Float3, + Float4, + Mat4, +} + +impl UniformType { + fn size(&self, count: usize) -> usize { + match self { + UniformType::Float1 => 4 * count, + UniformType::Float2 => 8 * count, + UniformType::Float3 => 12 * count, + UniformType::Float4 => 16 * count, + UniformType::Mat4 => 64 * count, + } + } +} + +struct Uniform { + gl_loc: GLint, + uniform_type: UniformType, +} + +pub struct UniformBlockLayout { + pub uniforms: &'static [(&'static str, UniformType)], +} + +pub struct ShaderMeta { + pub uniforms: UniformBlockLayout, + pub images: &'static [&'static str], +} + +#[derive(Clone, Copy, Debug)] +pub enum VertexFormat { + Float1, + Float2, + Float3, +} + +impl VertexFormat { + pub fn size(&self) -> i32 { + match self { + VertexFormat::Float1 => 1, + VertexFormat::Float2 => 2, + VertexFormat::Float3 => 3, + } + } +} + +#[derive(Clone)] +pub enum VertexAttribute { + Position, + Normal, + TexCoord0, + Custom(&'static str), +} + +#[derive(Clone)] +pub struct VertexLayout { + pub attributes: &'static [(VertexAttribute, VertexFormat)], + len: i32, +} +impl VertexLayout { + pub fn new(attributes: &'static [(VertexAttribute, VertexFormat)]) -> Self { + let len = attributes.iter().map(|(_, f)| f.size()).sum(); + + VertexLayout { attributes, len } + } +} + +pub struct Shader(usize); + +impl Shader { + pub fn new( + ctx: &mut Context, + vertex_shader: &str, + fragment_shader: &str, + meta: ShaderMeta, + ) -> Shader { + let shader = load_shader_Internal(vertex_shader, fragment_shader, meta); + ctx.shaders.push(shader); + Shader(ctx.shaders.len() - 1) + } +} + +pub struct ShaderImage { + gl_loc: GLint, +} + +#[derive(Debug)] +pub struct ShaderUniform { + gl_loc: GLint, + offset: usize, + size: usize, + uniform_type: UniformType, +} + +pub struct ShaderInternal { + pub program: GLuint, + pub images: Vec, + pub uniforms: Vec, +} + +type BlendState = Option<(Equation, BlendFactor, BlendFactor)>; + +pub struct GlCache { + stored_index_buffer: GLuint, + stored_vertex_buffer: GLuint, + index_buffer: GLuint, + vertex_buffer: GLuint, + cur_pipeline: Option, + blend: BlendState, +} + +pub const MAX_VERTEX_ATTRIBUTES: usize = 16; + +pub struct Context { + pub screen_rect: (f32, f32, f32, f32), + shaders: Vec, + pipelines: Vec, + //default_framebuffer: GLint, + cache: GlCache, + attributes: [Option; MAX_VERTEX_ATTRIBUTES], +} + +impl Context { + pub fn new() -> Context { + unsafe { + let screen_rect = (-1., -1., 2., 2.); + //let mut default_framebuffer: GLint = 0; + unsafe { + //glGetIntegerv(GL_FRAMEBUFFER_BINDING, &mut default_framebuffer as *mut _); + } + + let mut vao = 0; + unsafe { + glGenVertexArrays(1, &mut vao as *mut _); + glBindVertexArray(vao); + } + + Context { + screen_rect, + //default_framebuffer, + shaders: vec![], + pipelines: vec![], + cache: GlCache { + stored_index_buffer: 0, + stored_vertex_buffer: 0, + index_buffer: 0, + vertex_buffer: 0, + cur_pipeline: None, + blend: None, + }, + attributes: [None; 16], + } + } + } + + pub(crate) fn resize(&mut self, w: u32, h: u32) { + unsafe { + glViewport(0, 0, w as i32, h as i32); + } + } + + pub fn screen_size(&self) -> (f32, f32) { + unsafe { (sapp_width() as f32, sapp_height() as f32) } + } + + fn bind_buffer(&mut self, target: GLenum, buffer: GLuint) { + if target == GL_ARRAY_BUFFER { + if self.cache.vertex_buffer != buffer { + self.cache.vertex_buffer = buffer; + unsafe { + glBindBuffer(target, buffer); + } + } + } else { + if self.cache.index_buffer != buffer { + self.cache.index_buffer = buffer; + unsafe { + glBindBuffer(target, buffer); + } + } + } + } + + fn store_buffer_binding(&mut self, target: GLenum) { + if target == GL_ARRAY_BUFFER { + self.cache.stored_vertex_buffer = self.cache.vertex_buffer; + } else { + self.cache.stored_index_buffer = self.cache.index_buffer; + } + } + + fn restore_buffer_binding(&mut self, target: GLenum) { + if target == GL_ARRAY_BUFFER { + self.bind_buffer(target, self.cache.stored_vertex_buffer); + } else { + self.bind_buffer(target, self.cache.stored_index_buffer); + } + } + + pub fn apply_pipeline(&mut self, pipeline: &Pipeline) { + self.cache.cur_pipeline = Some(*pipeline); + + let pipeline = &mut self.pipelines[pipeline.0]; + let shader = &mut self.shaders[pipeline.shader.0]; + unsafe { + glUseProgram(shader.program); + } + + if self.cache.blend != pipeline.params.color_blend { + unsafe { + if let Some((equation, src, dst)) = pipeline.params.color_blend { + if self.cache.blend.is_none() { + glEnable(GL_BLEND); + } + + glBlendFunc(src.into(), dst.into()); + glBlendEquationSeparate(equation.into(), equation.into()); + } else if self.cache.blend.is_some() { + glDisable(GL_BLEND); + } + + self.cache.blend = pipeline.params.color_blend; + } + } + } + + pub fn apply_bindings(&mut self, bindings: &Bindings) { + let pip = &self.pipelines[self.cache.cur_pipeline.unwrap().0]; + let shader = &self.shaders[pip.shader.0]; + + for (n, image) in shader.images.iter().enumerate() { + unsafe { + glActiveTexture(GL_TEXTURE0 + n as u32); + glBindTexture(GL_TEXTURE_2D, bindings.images[n].texture); + glUniform1i(image.gl_loc, n as i32); + } + } + + let vb_dirty = self.cache.vertex_buffer != bindings.vertex_buffer.gl_buf; + + self.bind_buffer(GL_ELEMENT_ARRAY_BUFFER, bindings.index_buffer.gl_buf); + self.bind_buffer(GL_ARRAY_BUFFER, bindings.vertex_buffer.gl_buf); + + let pip = &self.pipelines[self.cache.cur_pipeline.unwrap().0]; + let shader = &self.shaders[pip.shader.0]; + + let mut offset = 0; + + for i in 0..MAX_VERTEX_ATTRIBUTES { + let mut cached_attribute = &mut self.attributes[i]; + let pip_attribute = pip.layout.get(i).copied(); + + match (&cached_attribute, pip_attribute) { + // cached and the new one are the same + (Some(old), Some(new)) if *old == new && vb_dirty == false => {} + // there was no cached attribute or cached and the new are different + (None, Some(new)) | (Some(_), Some(new)) => { + unsafe { + glVertexAttribPointer( + new.gl_loc, + new.size, + GL_FLOAT, + GL_FALSE as u8, + new.stride as i32, + new.offset as *mut _, + ); + glEnableVertexAttribArray(new.gl_loc); + }; + } + (Some(attr), None) => unsafe { + glDisableVertexAttribArray(attr.gl_loc); + }, + // attributes are always consecutive in the cache, so its safe to just break from the loop when both + // cached and the new attributes are None + (None, None) => break, + } + *cached_attribute = pip_attribute; + } + } + + pub unsafe fn apply_uniforms(&mut self, uniforms: &U) { + let pip = &self.pipelines[self.cache.cur_pipeline.unwrap().0]; + let shader = &self.shaders[pip.shader.0]; + + let mut offset = 0; + + for (n, uniform) in shader.uniforms.iter().enumerate() { + use UniformType::*; + + unsafe { + let data = (uniforms as *const _ as *const f32).offset(offset / 4); + + match uniform.uniform_type { + Float1 => { + glUniform1fv(uniform.gl_loc, 1, data); + } + Float2 => { + glUniform2fv(uniform.gl_loc, 1, data); + } + Float3 => { + glUniform3fv(uniform.gl_loc, 1, data); + } + Float4 => { + glUniform4fv(uniform.gl_loc, 1, data); + } + Mat4 => { + glUniformMatrix4fv(uniform.gl_loc, 1, 0, data); + } + } + offset += uniform.uniform_type.size(1) as isize; + } + } + } + + pub fn clear(&self, color: (f32, f32, f32, f32)) { + unsafe { + glClearColor(color.0, color.1, color.2, color.3); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + } + } + + pub fn begin_render_pass(&self) { + } + + pub fn end_render_pass(&self) {} + + pub fn commit_frame(&self) {} + + pub fn draw(&self, num_elements: i32) { + let p_type = GL_TRIANGLES; + unsafe { + glDrawElements(p_type, num_elements, GL_UNSIGNED_SHORT, std::ptr::null()); + } + } +} + +fn load_shader_Internal( + vertex_shader: &str, + fragment_shader: &str, + meta: ShaderMeta, +) -> ShaderInternal { + unsafe { + let vertex_shader = load_shader(GL_VERTEX_SHADER, vertex_shader); + let fragment_shader = load_shader(GL_FRAGMENT_SHADER, fragment_shader); + + let program = glCreateProgram(); + glAttachShader(program, vertex_shader); + glAttachShader(program, fragment_shader); + glLinkProgram(program); + + let mut link_status = 0; + glGetProgramiv(program, GL_LINK_STATUS, &mut link_status as *mut _); + if link_status == 0 { + let mut max_length = 100; + let mut error_message = vec![0u8; max_length as usize + 1]; + glGetProgramInfoLog( + program, + max_length, + &mut max_length as *mut _, + error_message.as_mut_ptr() as *mut _, + ); + + let error_message = std::string::String::from_utf8_lossy(&error_message); + panic!("{}", error_message); + } + + glUseProgram(program); + + #[rustfmt::skip] + let images = meta.images.iter().map(|name| ShaderImage { + gl_loc: get_uniform_location(program, name), + }).collect(); + #[rustfmt::skip] + let uniforms = meta.uniforms.uniforms.iter().scan(0, |offset, uniform| { + let res = ShaderUniform { + gl_loc: get_uniform_location(program, uniform.0), + offset: *offset, + size: uniform.1.size(1), + uniform_type: uniform.1 + }; + *offset += uniform.1.size(1); + Some(res) + }).collect(); + ShaderInternal { + program, + images, + uniforms, + } + } +} + +pub fn load_shader(shader_type: GLenum, source: &str) -> GLuint { + unsafe { + let shader = glCreateShader(shader_type); + + assert!(shader != 0); + + let cstring = CString::new(source).unwrap_or_else(|e| panic!(e)); + let csource = [cstring]; + glShaderSource(shader, 1, csource.as_ptr() as *const _, std::ptr::null()); + glCompileShader(shader); + + let mut is_compiled = 0; + glGetShaderiv(shader, GL_COMPILE_STATUS, &mut is_compiled as *mut _); + if is_compiled == 0 { + let mut max_length: i32 = 0; + glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &mut max_length as *mut _); + + let mut error_message = vec![0u8; max_length as usize + 1]; + glGetShaderInfoLog( + shader, + max_length, + &mut max_length as *mut _, + error_message.as_mut_ptr() as *mut _, + ); + + #[cfg(target_arch = "wasm32")] + test_log(error_message.as_ptr() as *const _); + + let error_message = std::string::String::from_utf8_lossy(&error_message); + eprintln!("{} {:?}", max_length, error_message); + glDeleteShader(shader); + panic!("cant compile shader!"); + } + + shader + } +} + +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FilterMode { + Linear = LINEAR_FILTER as isize, + Nearest = NEAREST_FILTER as isize, +} + +/// Specify whether front- or back-facing polygons can be culled. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum CullFace { + Nothing, + Front, + Back, +} + +/// Define front- and back-facing polygons. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum FrontFaceOrder { + Clockwise, + CounterClockwise, +} + +/// A pixel-wise comparison function. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum Comparison { + Never, + Less, + LessOrEqual, + Greater, + GreaterOrEqual, + Equal, + NotEqual, + Always, +} +/// Specifies how incoming RGBA values (source) and the RGBA in framebuffer (destination) +/// are combined. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum Equation { + /// Adds source and destination. Source and destination are multiplied + /// by blending parameters before addition. + Add, + /// Subtracts destination from source. Source and destination are + /// multiplied by blending parameters before subtraction. + Subtract, + /// Subtracts source from destination. Source and destination are + /// multiplied by blending parameters before subtraction. + ReverseSubtract, +} + +/// Blend values. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum BlendValue { + SourceColor, + SourceAlpha, + DestinationColor, + DestinationAlpha, +} + +/// Blend factors. +#[derive(Debug, PartialEq, Eq, Clone, Copy)] +pub enum BlendFactor { + Zero, + One, + Value(BlendValue), + OneMinusValue(BlendValue), +} + +impl From for GLenum { + fn from(eq: Equation) -> Self { + match eq { + Equation::Add => GL_FUNC_ADD, + Equation::Subtract => GL_FUNC_SUBTRACT, + Equation::ReverseSubtract => GL_FUNC_REVERSE_SUBTRACT, + } + } +} + +impl From for GLenum { + fn from(factor: BlendFactor) -> GLenum { + match factor { + BlendFactor::Zero => GL_ZERO, + BlendFactor::One => GL_ONE, + BlendFactor::Value(BlendValue::SourceColor) => GL_SRC_COLOR, + BlendFactor::Value(BlendValue::SourceAlpha) => GL_SRC_ALPHA, + BlendFactor::Value(BlendValue::DestinationColor) => GL_DST_COLOR, + BlendFactor::Value(BlendValue::DestinationAlpha) => GL_DST_ALPHA, + BlendFactor::OneMinusValue(BlendValue::SourceColor) => GL_ONE_MINUS_SRC_COLOR, + BlendFactor::OneMinusValue(BlendValue::SourceAlpha) => GL_ONE_MINUS_SRC_ALPHA, + BlendFactor::OneMinusValue(BlendValue::DestinationColor) => GL_ONE_MINUS_DST_COLOR, + BlendFactor::OneMinusValue(BlendValue::DestinationAlpha) => GL_ONE_MINUS_DST_ALPHA, + } + } +} + +#[derive(Debug, PartialEq, Clone, Copy)] +pub struct PipelineParams { + pub cull_face: CullFace, + pub front_face_order: FrontFaceOrder, + pub depth_test: Comparison, + pub depth_write: bool, + pub depth_write_offset: Option<(f32, f32)>, + pub color_blend: BlendState, + pub color_write: (bool, bool, bool, bool), +} + +#[derive(Copy, Clone, Debug)] +pub struct Pipeline(usize); + +impl Default for PipelineParams { + fn default() -> PipelineParams { + PipelineParams { + cull_face: CullFace::Nothing, + front_face_order: FrontFaceOrder::CounterClockwise, + depth_test: Comparison::Always, // no depth test, + depth_write: false, // no depth write, + depth_write_offset: None, + color_blend: None, + color_write: (true, true, true, true), + } + } +} + +impl Pipeline { + pub fn new(ctx: &mut Context, layout: VertexLayout, shader: Shader) -> Pipeline { + Self::with_params(ctx, layout, shader, Default::default()) + } + + pub fn with_params( + ctx: &mut Context, + layout: VertexLayout, + shader: Shader, + params: PipelineParams, + ) -> Pipeline { + let program = ctx.shaders[shader.0].program; + + let attributes = layout + .attributes + .iter() + .scan(0, |mut offset, (attribute, format)| { + let gl_loc = match attribute { + VertexAttribute::Position => unimplemented!(), + VertexAttribute::Normal => unimplemented!(), + VertexAttribute::TexCoord0 => unimplemented!(), + VertexAttribute::Custom(name) => { + let cname = CString::new(*name).unwrap_or_else(|e| panic!(e)); + let attrib = + unsafe { glGetAttribLocation(program, cname.as_ptr() as *const _) }; + if attrib == -1 { + panic!(); + } + attrib as u32 + } + }; + let attr = VertexAttributeInternal { + gl_loc, + size: format.size(), + offset: *offset, + stride: std::mem::size_of::() as i32 * layout.len, + }; + + *offset += (std::mem::size_of::() as i32 * format.size()) as i64; + + Some(attr) + }) + .collect::>(); + + let pipeline = PipelineInternal { + layout: attributes, + layout_len: layout.len, + shader, + params, + }; + ctx.pipelines.push(pipeline); + Pipeline(ctx.pipelines.len() - 1) + } +} + +#[derive(Clone, Copy, Debug, PartialEq)] +struct VertexAttributeInternal { + gl_loc: GLuint, + size: i32, + offset: i64, + stride: i32, +} + +struct PipelineInternal { + layout: Vec, + layout_len: i32, + shader: Shader, + params: PipelineParams, +} + +#[derive(Clone, Debug)] +pub struct Bindings { + pub vertex_buffer: Buffer, + pub index_buffer: Buffer, + pub images: Vec, +} + +#[derive(Clone, Copy, Debug)] +pub enum BufferType { + VertexBuffer, + IndexBuffer, +} + +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum Usage { + Immutable, + Dynamic, + Stream, +} + +fn gl_buffer_target(buffer_type: &BufferType) -> GLenum { + match buffer_type { + BufferType::VertexBuffer => GL_ARRAY_BUFFER, + BufferType::IndexBuffer => GL_ELEMENT_ARRAY_BUFFER, + } +} + +fn gl_usage(usage: &Usage) -> GLenum { + match usage { + Usage::Immutable => GL_STATIC_DRAW, + Usage::Dynamic => GL_DYNAMIC_DRAW, + Usage::Stream => GL_STREAM_DRAW, + } +} + +#[derive(Clone, Debug)] +pub struct Buffer { + gl_buf: GLuint, +} + +impl Buffer { + pub unsafe fn new( + ctx: &mut Context, + buffer_type: BufferType, + usage: Usage, + data: &[T], + ) -> Buffer { + if usage != Usage::Immutable { + unimplemented!(); + } + //println!("{} {}", mem::size_of::(), mem::size_of_val(data)); + let gl_target = gl_buffer_target(&buffer_type); + let gl_usage = gl_usage(&usage); + let size = mem::size_of_val(data) as i64; + let mut gl_buf: u32 = 0; + + unsafe { + glGenBuffers(1, &mut gl_buf as *mut _); + ctx.store_buffer_binding(gl_target); + ctx.bind_buffer(gl_target, gl_buf); + glBufferData(gl_target, size as _, std::ptr::null() as *const _, gl_usage); + if usage == Usage::Immutable { + glBufferSubData(gl_target, 0, size as _, data.as_ptr() as *const _) + } + ctx.restore_buffer_binding(gl_target); + } + + Buffer { gl_buf } + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..76e816c6 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,183 @@ +#![allow(warnings)] +pub mod conf; +mod event; +pub mod graphics; + +pub use event::*; + +pub use graphics::*; + +use sokol_app_sys::sokol_app; +use std::ffi::CString; + +pub use sokol_app_sys::sokol_app::{rand, RAND_MAX}; + +pub mod date { + #[cfg(not(target_arch = "wasm32"))] + pub fn now() -> f64 { + use std::time::SystemTime; + + let time = SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .unwrap_or_else(|e| panic!(e)); + time.as_secs_f64() + } + + #[cfg(target_arch = "wasm32")] + pub fn now() -> f64 { + unsafe { sokol_app_sys::sokol_app::time() as f64 } + } +} + +struct UserData { + event_handler: Box, + context: Context, +} + +enum UserDataState { + Uninitialized(Box Box>), + Intialized(UserData), + Empty, +} + +extern "C" fn init(user_data: *mut ::std::os::raw::c_void) { + let data: &mut UserDataState = unsafe { &mut *(user_data as *mut UserDataState) }; + let empty = UserDataState::Empty; + + let f = std::mem::replace(data, empty); + let f = if let UserDataState::Uninitialized(f) = f { + f + } else { + panic!(); + }; + let mut context = graphics::Context::new(); + + let user_data = UserData { + event_handler: f(&mut context), + context, + }; + std::mem::replace(data, UserDataState::Intialized(user_data)); +} + +extern "C" fn frame(user_data: *mut ::std::os::raw::c_void) { + let data: &mut UserDataState = unsafe { &mut *(user_data as *mut UserDataState) }; + + let data = if let UserDataState::Intialized(ref mut data) = data { + data + } else { + panic!() + }; + + data.event_handler.update(&mut data.context); + data.event_handler.draw(&mut data.context); +} + +extern "C" fn event(event: *const sokol_app::sapp_event, user_data: *mut ::std::os::raw::c_void) { + let data: &mut UserDataState = unsafe { &mut *(user_data as *mut UserDataState) }; + let event = unsafe { &*event }; + + let data = if let UserDataState::Intialized(ref mut data) = data { + data + } else { + panic!() + }; + + match event.type_ { + sokol_app::sapp_event_type_SAPP_EVENTTYPE_MOUSE_MOVE => { + data.event_handler.mouse_motion_event( + &mut data.context, + event.mouse_x, + event.mouse_y, + 0., + 0., + ); + } + sokol_app::sapp_event_type_SAPP_EVENTTYPE_MOUSE_DOWN => { + data.event_handler.mouse_button_down_event( + &mut data.context, + MouseButton::Left, + event.mouse_x, + event.mouse_y, + ); + } + sokol_app::sapp_event_type_SAPP_EVENTTYPE_MOUSE_UP => { + data.event_handler.mouse_button_up_event( + &mut data.context, + MouseButton::Left, + event.mouse_x, + event.mouse_y, + ); + } + sokol_app::sapp_event_type_SAPP_EVENTTYPE_KEY_DOWN => match event.key_code { + sokol_app::sapp_keycode_SAPP_KEYCODE_W => { + data.event_handler + .key_down_event(&mut data.context, KeyCode::W, KeyMods::No, false) + } + sokol_app::sapp_keycode_SAPP_KEYCODE_A => { + data.event_handler + .key_down_event(&mut data.context, KeyCode::A, KeyMods::No, false) + } + sokol_app::sapp_keycode_SAPP_KEYCODE_S => { + data.event_handler + .key_down_event(&mut data.context, KeyCode::S, KeyMods::No, false) + } + sokol_app::sapp_keycode_SAPP_KEYCODE_D => { + data.event_handler + .key_down_event(&mut data.context, KeyCode::D, KeyMods::No, false) + } + _ => {} + }, + sokol_app::sapp_event_type_SAPP_EVENTTYPE_KEY_UP => match event.key_code { + sokol_app::sapp_keycode_SAPP_KEYCODE_W => { + data.event_handler + .key_up_event(&mut data.context, KeyCode::W, KeyMods::No) + } + sokol_app::sapp_keycode_SAPP_KEYCODE_A => { + data.event_handler + .key_up_event(&mut data.context, KeyCode::A, KeyMods::No) + } + sokol_app::sapp_keycode_SAPP_KEYCODE_S => { + data.event_handler + .key_up_event(&mut data.context, KeyCode::S, KeyMods::No) + } + sokol_app::sapp_keycode_SAPP_KEYCODE_D => { + data.event_handler + .key_up_event(&mut data.context, KeyCode::D, KeyMods::No) + } + _ => {} + }, + sokol_app::sapp_event_type_SAPP_EVENTTYPE_RESIZED => { + data.context + .resize(event.window_width as u32, event.window_height as u32); + data.event_handler.resize_event( + &mut data.context, + event.window_width as f32, + event.window_height as f32, + ); + } + _ => {} + } +} + +pub fn start(_conf: conf::Conf, f: F) +where + F: 'static + FnOnce(&mut Context) -> Box, +{ + let mut desc: sokol_app::sapp_desc = unsafe { std::mem::zeroed() }; + + let title = CString::new("").unwrap_or_else(|e| panic!(e)); + + let mut user_data = Box::new(UserDataState::Uninitialized(Box::new(f))); + + desc.width = 800; + desc.height = 600; + desc.window_title = title.as_ptr(); + desc.user_data = &mut *user_data as *mut _ as *mut _; + desc.init_userdata_cb = Some(init); + desc.frame_userdata_cb = Some(frame); + desc.event_userdata_cb = Some(event); + + std::mem::forget(user_data); + + unsafe { sokol_app::sapp_run(&desc as *const _) }; +}