From a7690e7cdde7f35cfce69a056ea246136c2e93d4 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Mon, 21 Nov 2022 21:56:50 -0500 Subject: [PATCH] Only generate citro3d-specific types/funcs, etc. --- citro3d-sys/Cargo.toml | 1 + citro3d-sys/bindgen.sh | 19 +- citro3d-sys/src/bindings.rs | 1295 ++++++++++++++--------------------- citro3d-sys/src/gx.rs | 2 +- citro3d-sys/src/texenv.rs | 1 + citro3d-sys/src/uniforms.rs | 4 +- 6 files changed, 521 insertions(+), 801 deletions(-) diff --git a/citro3d-sys/Cargo.toml b/citro3d-sys/Cargo.toml index 29379ee..4c5a246 100644 --- a/citro3d-sys/Cargo.toml +++ b/citro3d-sys/Cargo.toml @@ -6,3 +6,4 @@ edition = "2021" [dependencies] libc = "0.2.116" +ctru-sys = { git = "https://github.com/rust3ds/ctru-rs.git" } diff --git a/citro3d-sys/bindgen.sh b/citro3d-sys/bindgen.sh index ac378f0..ebede4c 100755 --- a/citro3d-sys/bindgen.sh +++ b/citro3d-sys/bindgen.sh @@ -2,7 +2,7 @@ set -euxo pipefail -bindgen "$DEVKITPRO/libctru/include/citro3d.h" \ +bindgen "$DEVKITPRO/libctru/include/tex3ds.h" \ --rust-target nightly \ --use-core \ --distrust-clang-mangling \ @@ -10,26 +10,15 @@ bindgen "$DEVKITPRO/libctru/include/citro3d.h" \ --ctypes-prefix "::libc" \ --no-prepend-enum-name \ --fit-macro-constant-types \ + --raw-line "use ctru_sys::*;" \ --must-use-type "Result" \ --generate "functions,types,vars" \ --blocklist-type "u(8|16|32|64)" \ --opaque-type "GPU_.*" \ --opaque-type "GFX_.*" \ --opaque-type "float24Uniform_s" \ - --allowlist-type "C3D_.*" \ - --allowlist-type "DVLB_.*" \ - --allowlist-type "shader.*" \ - --allowlist-type "float24Uniform_s" \ - --allowlist-function "C3D_.*" \ - --allowlist-function "shader.*" \ - --allowlist-function "DVLB_.*" \ - --allowlist-function "linear.*" \ - --allowlist-var "C3D_.*" \ - --allowlist-type "GPU_.*" \ - --allowlist-type "GX_.*" \ - --allowlist-function 'AttrInfo_(Init|AddLoader|AddFixed)' \ - --allowlist-function 'BufInfo_(Init|Add)' \ - --allowlist-function 'Mtx_.*' \ + --allowlist-file ".*/c3d/.*[.]h" \ + --allowlist-file ".*/tex3ds[.]h" \ -- \ --target=arm-none-eabi \ --sysroot=$DEVKITARM/arm-none-eabi \ diff --git a/citro3d-sys/src/bindings.rs b/citro3d-sys/src/bindings.rs index 862e4d8..0f750e1 100644 --- a/citro3d-sys/src/bindings.rs +++ b/citro3d-sys/src/bindings.rs @@ -1,4 +1,6 @@ -/* automatically generated by rust-bindgen 0.60.1 */ +/* automatically generated by rust-bindgen 0.62.0 */ + +use ctru_sys::*; #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -80,26 +82,29 @@ where } } } +pub const M_TAU: f64 = 6.283185307179586; pub const C3D_AspectRatioTop: f64 = 1.6666666666666667; pub const C3D_AspectRatioBot: f64 = 1.3333333333333333; pub const C3D_MTXSTACK_SIZE: u8 = 8; pub const C3D_FVUNIF_COUNT: u8 = 96; pub const C3D_IVUNIF_COUNT: u8 = 4; pub const C3D_DEFAULT_CMDBUF_SIZE: u32 = 262144; -pub type __int8_t = ::libc::c_schar; -pub type __uint8_t = ::libc::c_uchar; -pub type __uint16_t = ::libc::c_ushort; -pub type __int32_t = ::libc::c_int; -pub type __uint32_t = ::libc::c_uint; -pub type __uint64_t = ::libc::c_ulonglong; -pub type size_t = ::libc::c_uint; +pub const C3DF_LightEnv_IsCP_Any: u32 = 66846720; +pub const C3DF_LightEnv_LutDirtyAll: u32 = 4227858432; +pub type __int64_t = ::libc::c_longlong; pub type u8_ = u8; pub type u16_ = u16; pub type u32_ = u32; pub type u64_ = u64; -pub type s8 = i8; -pub type s32 = i32; -pub type Result = s32; +pub type _LOCK_T = i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __lock_t { + pub lock: _LOCK_T, + pub thread_tag: u32, + pub counter: u32, +} +pub type _LOCK_RECURSIVE_T = __lock_t; #[doc = "< Top screen"] pub const GFX_TOP: gfxScreen_t = 0; #[doc = "< Bottom screen"] @@ -115,644 +120,209 @@ pub const GFX_RIGHT: gfx3dSide_t = 1; #[doc = " This is only meaningful when stereoscopic 3D is enabled on the top screen."] #[doc = " In any other case, use \\ref GFX_LEFT."] pub type gfx3dSide_t = ::libc::c_uint; -extern "C" { - #[doc = " @brief Allocates a 0x80-byte aligned buffer."] - #[doc = " @param size Size of the buffer to allocate."] - #[doc = " @return The allocated buffer."] - pub fn linearAlloc(size: size_t) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = " @brief Allocates a buffer aligned to the given size."] - #[doc = " @param size Size of the buffer to allocate."] - #[doc = " @param alignment Alignment to use."] - #[doc = " @return The allocated buffer."] - pub fn linearMemAlign(size: size_t, alignment: size_t) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = " @brief Reallocates a buffer."] - #[doc = " Note: Not implemented yet."] - #[doc = " @param mem Buffer to reallocate."] - #[doc = " @param size Size of the buffer to allocate."] - #[doc = " @return The reallocated buffer."] - pub fn linearRealloc(mem: *mut ::libc::c_void, size: size_t) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = " @brief Retrieves the allocated size of a buffer."] - #[doc = " @return The size of the buffer."] - pub fn linearGetSize(mem: *mut ::libc::c_void) -> size_t; -} -extern "C" { - #[doc = " @brief Frees a buffer."] - #[doc = " @param mem Buffer to free."] - pub fn linearFree(mem: *mut ::libc::c_void); -} -extern "C" { - #[doc = " @brief Gets the current linear free space."] - #[doc = " @return The current linear free space."] - pub fn linearSpaceFree() -> u32_; -} -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] -pub const GX_TRANSFER_FMT_RGB8: GX_TRANSFER_FORMAT = 1; -#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] -pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2; -#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3; -#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4; -#[doc = " @brief Supported transfer pixel formats."] -#[doc = " @sa GSPGPU_FramebufferFormat"] -pub type GX_TRANSFER_FORMAT = ::libc::c_uint; -#[doc = "< No anti-aliasing"] -pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; -#[doc = "< 2x1 anti-aliasing"] -pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1; -#[doc = "< 2x2 anti-aliasing"] -pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2; -#[doc = " @brief Anti-aliasing modes"] -#[doc = ""] -#[doc = " Please remember that the framebuffer is sideways."] -#[doc = " Hence if you activate 2x1 anti-aliasing the destination dimensions are w = 240*2 and h = 400"] -pub type GX_TRANSFER_SCALE = ::libc::c_uint; -#[doc = "< Trigger the PPF event"] -pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1; -#[doc = "< Indicates if the memory fill is complete. You should not use it when requesting a transfer."] -pub const GX_FILL_FINISHED: GX_FILL_CONTROL = 2; -#[doc = "< The buffer has a 16 bit per pixel depth"] -pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0; -#[doc = "< The buffer has a 24 bit per pixel depth"] -pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256; -#[doc = "< The buffer has a 32 bit per pixel depth"] -pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512; -#[doc = " GX transfer control flags"] -pub type GX_FILL_CONTROL = ::libc::c_uint; -#[doc = "< Nearest-neighbor interpolation."] -pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0; -#[doc = "< Linear interpolation."] -pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1; -#[doc = " Texture filters."] -pub type GPU_TEXTURE_FILTER_PARAM = ::libc::c_uint; -#[doc = "< Clamps to edge."] -pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0; -#[doc = "< Clamps to border."] -pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1; -#[doc = "< Repeats texture."] -pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2; -#[doc = "< Repeats with mirrored texture."] -pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3; -#[doc = " Texture wrap modes."] -pub type GPU_TEXTURE_WRAP_PARAM = ::libc::c_uint; -#[doc = "< 2D texture"] -pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0; -#[doc = "< Cube map"] -pub const GPU_TEX_CUBE_MAP: GPU_TEXTURE_MODE_PARAM = 1; -#[doc = "< 2D Shadow texture"] -pub const GPU_TEX_SHADOW_2D: GPU_TEXTURE_MODE_PARAM = 2; -#[doc = "< Projection texture"] -pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3; -#[doc = "< Shadow cube map"] -pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4; -#[doc = "< Disabled"] -pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5; -#[doc = " Texture modes."] -pub type GPU_TEXTURE_MODE_PARAM = ::libc::c_uint; -#[doc = "< Texture unit 0."] -pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; -#[doc = "< Texture unit 1."] -pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2; -#[doc = "< Texture unit 2."] -pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4; -#[doc = " Supported texture units."] -pub type GPU_TEXUNIT = ::libc::c_uint; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -pub const GPU_RGBA8: GPU_TEXCOLOR = 0; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] -pub const GPU_RGB8: GPU_TEXCOLOR = 1; -#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -pub const GPU_RGBA5551: GPU_TEXCOLOR = 2; -#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] -pub const GPU_RGB565: GPU_TEXCOLOR = 3; -#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -pub const GPU_RGBA4: GPU_TEXCOLOR = 4; -#[doc = "< 8-bit Luminance + 8-bit Alpha"] -pub const GPU_LA8: GPU_TEXCOLOR = 5; -#[doc = "< 8-bit Hi + 8-bit Lo"] -pub const GPU_HILO8: GPU_TEXCOLOR = 6; -#[doc = "< 8-bit Luminance"] -pub const GPU_L8: GPU_TEXCOLOR = 7; -#[doc = "< 8-bit Alpha"] -pub const GPU_A8: GPU_TEXCOLOR = 8; -#[doc = "< 4-bit Luminance + 4-bit Alpha"] -pub const GPU_LA4: GPU_TEXCOLOR = 9; -#[doc = "< 4-bit Luminance"] -pub const GPU_L4: GPU_TEXCOLOR = 10; -#[doc = "< 4-bit Alpha"] -pub const GPU_A4: GPU_TEXCOLOR = 11; -#[doc = "< ETC1 texture compression"] -pub const GPU_ETC1: GPU_TEXCOLOR = 12; -#[doc = "< ETC1 texture compression + 4-bit Alpha"] -pub const GPU_ETC1A4: GPU_TEXCOLOR = 13; -#[doc = " Supported texture formats."] -pub type GPU_TEXCOLOR = ::libc::c_uint; -#[doc = "< 2D face"] -pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0; -#[doc = "< +X face"] -pub const GPU_POSITIVE_X: GPU_TEXFACE = 0; -#[doc = "< -X face"] -pub const GPU_NEGATIVE_X: GPU_TEXFACE = 1; -#[doc = "< +Y face"] -pub const GPU_POSITIVE_Y: GPU_TEXFACE = 2; -#[doc = "< -Y face"] -pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3; -#[doc = "< +Z face"] -pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4; -#[doc = "< -Z face"] -pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5; -#[doc = " Texture faces."] -pub type GPU_TEXFACE = ::libc::c_uint; -#[doc = "< Clamp to zero."] -pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0; -#[doc = "< Clamp to edge."] -pub const GPU_PT_CLAMP_TO_EDGE: GPU_PROCTEX_CLAMP = 1; -#[doc = "< Symmetrical repeat."] -pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2; -#[doc = "< Mirrored repeat."] -pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3; -#[doc = "< Pulse."] -pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4; -#[doc = " Procedural texture clamp modes."] -pub type GPU_PROCTEX_CLAMP = ::libc::c_uint; -#[doc = "< U"] -pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0; -#[doc = "< U2"] -pub const GPU_PT_U2: GPU_PROCTEX_MAPFUNC = 1; -#[doc = "< V"] -pub const GPU_PT_V: GPU_PROCTEX_MAPFUNC = 2; -#[doc = "< V2"] -pub const GPU_PT_V2: GPU_PROCTEX_MAPFUNC = 3; -#[doc = "< U+V"] -pub const GPU_PT_ADD: GPU_PROCTEX_MAPFUNC = 4; -#[doc = "< U2+V2"] -pub const GPU_PT_ADD2: GPU_PROCTEX_MAPFUNC = 5; -#[doc = "< sqrt(U2+V2)"] -pub const GPU_PT_SQRT2: GPU_PROCTEX_MAPFUNC = 6; -#[doc = "< min"] -pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7; -#[doc = "< max"] -pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8; -#[doc = "< rmax"] -pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9; -#[doc = " Procedural texture mapping functions."] -pub type GPU_PROCTEX_MAPFUNC = ::libc::c_uint; -#[doc = "< No shift."] -pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; -#[doc = "< Odd shift."] -pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1; -#[doc = "< Even shift."] -pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2; -#[doc = " Procedural texture shift values."] -pub type GPU_PROCTEX_SHIFT = ::libc::c_uint; -#[doc = "< Nearest-neighbor"] -pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0; -#[doc = "< Linear interpolation"] -pub const GPU_PT_LINEAR: GPU_PROCTEX_FILTER = 1; -#[doc = "< Nearest-neighbor with mipmap using nearest-neighbor"] -pub const GPU_PT_NEAREST_MIP_NEAREST: GPU_PROCTEX_FILTER = 2; -#[doc = "< Linear interpolation with mipmap using nearest-neighbor"] -pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3; -#[doc = "< Nearest-neighbor with mipmap using linear interpolation"] -pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4; -#[doc = "< Linear interpolation with mipmap using linear interpolation"] -pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5; -#[doc = " Procedural texture filter values."] -pub type GPU_PROCTEX_FILTER = ::libc::c_uint; -#[doc = "< Noise table"] -pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0; -#[doc = "< RGB mapping function table"] -pub const GPU_LUT_RGBMAP: GPU_PROCTEX_LUTID = 2; -#[doc = "< Alpha mapping function table"] -pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3; -#[doc = "< Color table"] -pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4; -#[doc = "< Color difference table"] -pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5; -#[doc = " Procedural texture LUT IDs."] -pub type GPU_PROCTEX_LUTID = ::libc::c_uint; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -pub const GPU_RB_RGBA8: GPU_COLORBUF = 0; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] -pub const GPU_RB_RGB8: GPU_COLORBUF = 1; -#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2; -#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] -pub const GPU_RB_RGB565: GPU_COLORBUF = 3; -#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -pub const GPU_RB_RGBA4: GPU_COLORBUF = 4; -#[doc = " Supported color buffer formats."] -pub type GPU_COLORBUF = ::libc::c_uint; -#[doc = "< 16-bit Depth"] -pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; -#[doc = "< 24-bit Depth"] -pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2; -#[doc = "< 24-bit Depth + 8-bit Stencil"] -pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3; -#[doc = " Supported depth buffer formats."] -pub type GPU_DEPTHBUF = ::libc::c_uint; -#[doc = "< Never pass."] -pub const GPU_NEVER: GPU_TESTFUNC = 0; -#[doc = "< Always pass."] -pub const GPU_ALWAYS: GPU_TESTFUNC = 1; -#[doc = "< Pass if equal."] -pub const GPU_EQUAL: GPU_TESTFUNC = 2; -#[doc = "< Pass if not equal."] -pub const GPU_NOTEQUAL: GPU_TESTFUNC = 3; -#[doc = "< Pass if less than."] -pub const GPU_LESS: GPU_TESTFUNC = 4; -#[doc = "< Pass if less than or equal."] -pub const GPU_LEQUAL: GPU_TESTFUNC = 5; -#[doc = "< Pass if greater than."] -pub const GPU_GREATER: GPU_TESTFUNC = 6; -#[doc = "< Pass if greater than or equal."] -pub const GPU_GEQUAL: GPU_TESTFUNC = 7; -#[doc = " Test functions."] -pub type GPU_TESTFUNC = ::libc::c_uint; -#[doc = "< Pass if greater than or equal."] -pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0; -#[doc = "< Pass if greater than."] -pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1; -#[doc = "< Pass if less than or equal."] -pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2; -#[doc = "< Pass if less than."] -pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3; -#[doc = " Early depth test functions."] -pub type GPU_EARLYDEPTHFUNC = ::libc::c_uint; -#[doc = "< Never pass (0)."] -pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0; -#[doc = "< Always pass (1)."] -pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1; -#[doc = "< Pass if greater than (1-X)."] -pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2; -#[doc = "< Pass if less than (X)."] -pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3; -#[doc = " Gas depth functions."] -pub type GPU_GASDEPTHFUNC = ::libc::c_uint; -#[doc = "< Disable."] -pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; -#[doc = "< Exclude pixels inside the scissor box."] -pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1; -#[doc = "< Exclude pixels outside of the scissor box."] -pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3; -#[doc = " Scissor test modes."] -pub type GPU_SCISSORMODE = ::libc::c_uint; -#[doc = "< Keep old value. (old_stencil)"] -pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0; -#[doc = "< Zero. (0)"] -pub const GPU_STENCIL_ZERO: GPU_STENCILOP = 1; -#[doc = "< Replace value. (ref)"] -pub const GPU_STENCIL_REPLACE: GPU_STENCILOP = 2; -#[doc = "< Increment value. (old_stencil + 1 saturated to [0, 255])"] -pub const GPU_STENCIL_INCR: GPU_STENCILOP = 3; -#[doc = "< Decrement value. (old_stencil - 1 saturated to [0, 255])"] -pub const GPU_STENCIL_DECR: GPU_STENCILOP = 4; -#[doc = "< Invert value. (~old_stencil)"] -pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5; -#[doc = "< Increment value. (old_stencil + 1)"] -pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6; -#[doc = "< Decrement value. (old_stencil - 1)"] -pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7; -#[doc = " Stencil operations."] -pub type GPU_STENCILOP = ::libc::c_uint; -#[doc = "< Write red."] -pub const GPU_WRITE_RED: GPU_WRITEMASK = 1; -#[doc = "< Write green."] -pub const GPU_WRITE_GREEN: GPU_WRITEMASK = 2; -#[doc = "< Write blue."] -pub const GPU_WRITE_BLUE: GPU_WRITEMASK = 4; -#[doc = "< Write alpha."] -pub const GPU_WRITE_ALPHA: GPU_WRITEMASK = 8; -#[doc = "< Write depth."] -pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16; -#[doc = "< Write all color components."] -pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15; -#[doc = "< Write all components."] -pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31; -#[doc = " Pixel write mask."] -pub type GPU_WRITEMASK = ::libc::c_uint; -#[doc = "< Add colors."] -pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0; -#[doc = "< Subtract colors."] -pub const GPU_BLEND_SUBTRACT: GPU_BLENDEQUATION = 1; -#[doc = "< Reverse-subtract colors."] -pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2; -#[doc = "< Use the minimum color."] -pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3; -#[doc = "< Use the maximum color."] -pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4; -#[doc = " Blend modes."] -pub type GPU_BLENDEQUATION = ::libc::c_uint; -#[doc = "< Zero."] -pub const GPU_ZERO: GPU_BLENDFACTOR = 0; -#[doc = "< One."] -pub const GPU_ONE: GPU_BLENDFACTOR = 1; -#[doc = "< Source color."] -pub const GPU_SRC_COLOR: GPU_BLENDFACTOR = 2; -#[doc = "< Source color - 1."] -pub const GPU_ONE_MINUS_SRC_COLOR: GPU_BLENDFACTOR = 3; -#[doc = "< Destination color."] -pub const GPU_DST_COLOR: GPU_BLENDFACTOR = 4; -#[doc = "< Destination color - 1."] -pub const GPU_ONE_MINUS_DST_COLOR: GPU_BLENDFACTOR = 5; -#[doc = "< Source alpha."] -pub const GPU_SRC_ALPHA: GPU_BLENDFACTOR = 6; -#[doc = "< Source alpha - 1."] -pub const GPU_ONE_MINUS_SRC_ALPHA: GPU_BLENDFACTOR = 7; -#[doc = "< Destination alpha."] -pub const GPU_DST_ALPHA: GPU_BLENDFACTOR = 8; -#[doc = "< Destination alpha - 1."] -pub const GPU_ONE_MINUS_DST_ALPHA: GPU_BLENDFACTOR = 9; -#[doc = "< Constant color."] -pub const GPU_CONSTANT_COLOR: GPU_BLENDFACTOR = 10; -#[doc = "< Constant color - 1."] -pub const GPU_ONE_MINUS_CONSTANT_COLOR: GPU_BLENDFACTOR = 11; -#[doc = "< Constant alpha."] -pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12; -#[doc = "< Constant alpha - 1."] -pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13; -#[doc = "< Saturated alpha."] -pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14; -#[doc = " Blend factors."] -pub type GPU_BLENDFACTOR = ::libc::c_uint; -#[doc = "< Clear."] -pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0; -#[doc = "< Bitwise AND."] -pub const GPU_LOGICOP_AND: GPU_LOGICOP = 1; -#[doc = "< Reverse bitwise AND."] -pub const GPU_LOGICOP_AND_REVERSE: GPU_LOGICOP = 2; -#[doc = "< Copy."] -pub const GPU_LOGICOP_COPY: GPU_LOGICOP = 3; -#[doc = "< Set."] -pub const GPU_LOGICOP_SET: GPU_LOGICOP = 4; -#[doc = "< Inverted copy."] -pub const GPU_LOGICOP_COPY_INVERTED: GPU_LOGICOP = 5; -#[doc = "< No operation."] -pub const GPU_LOGICOP_NOOP: GPU_LOGICOP = 6; -#[doc = "< Invert."] -pub const GPU_LOGICOP_INVERT: GPU_LOGICOP = 7; -#[doc = "< Bitwise NAND."] -pub const GPU_LOGICOP_NAND: GPU_LOGICOP = 8; -#[doc = "< Bitwise OR."] -pub const GPU_LOGICOP_OR: GPU_LOGICOP = 9; -#[doc = "< Bitwise NOR."] -pub const GPU_LOGICOP_NOR: GPU_LOGICOP = 10; -#[doc = "< Bitwise XOR."] -pub const GPU_LOGICOP_XOR: GPU_LOGICOP = 11; -#[doc = "< Equivalent."] -pub const GPU_LOGICOP_EQUIV: GPU_LOGICOP = 12; -#[doc = "< Inverted bitwise AND."] -pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13; -#[doc = "< Reverse bitwise OR."] -pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14; -#[doc = "< Inverted bitwize OR."] -pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15; -#[doc = " Logical operations."] -pub type GPU_LOGICOP = ::libc::c_uint; -#[doc = "< OpenGL mode."] -pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; -#[doc = "< Gas mode (?)."] -pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1; -#[doc = "< Shadow mode (?)."] -pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3; -#[doc = " Fragment operation modes."] -pub type GPU_FRAGOPMODE = ::libc::c_uint; -#[doc = "< 8-bit byte."] -pub const GPU_BYTE: GPU_FORMATS = 0; -#[doc = "< 8-bit unsigned byte."] -pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1; -#[doc = "< 16-bit short."] -pub const GPU_SHORT: GPU_FORMATS = 2; -#[doc = "< 32-bit float."] -pub const GPU_FLOAT: GPU_FORMATS = 3; -#[doc = " Supported component formats."] -pub type GPU_FORMATS = ::libc::c_uint; -#[doc = "< Disabled."] -pub const GPU_CULL_NONE: GPU_CULLMODE = 0; -#[doc = "< Front, counter-clockwise."] -pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1; -#[doc = "< Back, counter-clockwise."] -pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2; -#[doc = " Cull modes."] -pub type GPU_CULLMODE = ::libc::c_uint; -#[doc = "< Primary color."] -pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0; -#[doc = "< Primary fragment color."] -pub const GPU_FRAGMENT_PRIMARY_COLOR: GPU_TEVSRC = 1; -#[doc = "< Secondary fragment color."] -pub const GPU_FRAGMENT_SECONDARY_COLOR: GPU_TEVSRC = 2; -#[doc = "< Texture unit 0."] -pub const GPU_TEXTURE0: GPU_TEVSRC = 3; -#[doc = "< Texture unit 1."] -pub const GPU_TEXTURE1: GPU_TEVSRC = 4; -#[doc = "< Texture unit 2."] -pub const GPU_TEXTURE2: GPU_TEVSRC = 5; -#[doc = "< Texture unit 3."] -pub const GPU_TEXTURE3: GPU_TEVSRC = 6; -#[doc = "< Previous buffer."] -pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13; -#[doc = "< Constant value."] -pub const GPU_CONSTANT: GPU_TEVSRC = 14; -#[doc = "< Previous value."] -pub const GPU_PREVIOUS: GPU_TEVSRC = 15; -#[doc = " Texture combiner sources."] -pub type GPU_TEVSRC = ::libc::c_uint; -#[doc = "< Source color."] -pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0; -#[doc = "< Source color - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_COLOR: GPU_TEVOP_RGB = 1; -#[doc = "< Source alpha."] -pub const GPU_TEVOP_RGB_SRC_ALPHA: GPU_TEVOP_RGB = 2; -#[doc = "< Source alpha - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_RGB = 3; -#[doc = "< Source red."] -pub const GPU_TEVOP_RGB_SRC_R: GPU_TEVOP_RGB = 4; -#[doc = "< Source red - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_R: GPU_TEVOP_RGB = 5; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x06: GPU_TEVOP_RGB = 6; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x07: GPU_TEVOP_RGB = 7; -#[doc = "< Source green."] -pub const GPU_TEVOP_RGB_SRC_G: GPU_TEVOP_RGB = 8; -#[doc = "< Source green - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_G: GPU_TEVOP_RGB = 9; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0A: GPU_TEVOP_RGB = 10; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0B: GPU_TEVOP_RGB = 11; -#[doc = "< Source blue."] -pub const GPU_TEVOP_RGB_SRC_B: GPU_TEVOP_RGB = 12; -#[doc = "< Source blue - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15; -#[doc = " Texture RGB combiner operands."] -pub type GPU_TEVOP_RGB = ::libc::c_uint; -#[doc = "< Source alpha."] -pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0; -#[doc = "< Source alpha - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_A = 1; -#[doc = "< Source red."] -pub const GPU_TEVOP_A_SRC_R: GPU_TEVOP_A = 2; -#[doc = "< Source red - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_R: GPU_TEVOP_A = 3; -#[doc = "< Source green."] -pub const GPU_TEVOP_A_SRC_G: GPU_TEVOP_A = 4; -#[doc = "< Source green - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5; -#[doc = "< Source blue."] -pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6; -#[doc = "< Source blue - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7; -#[doc = " Texture Alpha combiner operands."] -pub type GPU_TEVOP_A = ::libc::c_uint; -#[doc = "< Replace."] -pub const GPU_REPLACE: GPU_COMBINEFUNC = 0; -#[doc = "< Modulate."] -pub const GPU_MODULATE: GPU_COMBINEFUNC = 1; -#[doc = "< Add."] -pub const GPU_ADD: GPU_COMBINEFUNC = 2; -#[doc = "< Signed add."] -pub const GPU_ADD_SIGNED: GPU_COMBINEFUNC = 3; -#[doc = "< Interpolate."] -pub const GPU_INTERPOLATE: GPU_COMBINEFUNC = 4; -#[doc = "< Subtract."] -pub const GPU_SUBTRACT: GPU_COMBINEFUNC = 5; -#[doc = "< Dot3. RGB only."] -pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6; -#[doc = "< Multiply then add."] -pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8; -#[doc = "< Add then multiply."] -pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9; -#[doc = " Texture combiner functions."] -pub type GPU_COMBINEFUNC = ::libc::c_uint; -#[doc = "< 1x"] -pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; -#[doc = "< 2x"] -pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1; -#[doc = "< 4x"] -pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2; -#[doc = " Texture scale factors."] -pub type GPU_TEVSCALE = ::libc::c_uint; -#[doc = "< None."] -pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0; -#[doc = "< Primary alpha."] -pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1; -#[doc = "< Secondary alpha."] -pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2; -#[doc = "< Primary and secondary alpha."] -pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3; -#[doc = " Fresnel options."] -pub type GPU_FRESNELSEL = ::libc::c_uint; -#[doc = "< Disabled."] -pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; -#[doc = "< Bump as bump mapping."] -pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1; -#[doc = "< Bump as tangent/normal mapping."] -pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2; -#[doc = " Bump map modes."] -pub type GPU_BUMPMODE = ::libc::c_uint; -#[doc = "< D0 LUT."] -pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0; -#[doc = "< D1 LUT."] -pub const GPU_LUT_D1: GPU_LIGHTLUTID = 1; -#[doc = "< Spotlight LUT."] -pub const GPU_LUT_SP: GPU_LIGHTLUTID = 2; -#[doc = "< Fresnel LUT."] -pub const GPU_LUT_FR: GPU_LIGHTLUTID = 3; -#[doc = "< Reflection-Blue LUT."] -pub const GPU_LUT_RB: GPU_LIGHTLUTID = 4; -#[doc = "< Reflection-Green LUT."] -pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5; -#[doc = "< Reflection-Red LUT."] -pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6; -#[doc = "< Distance attenuation LUT."] -pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7; -#[doc = " LUT IDs."] -pub type GPU_LIGHTLUTID = ::libc::c_uint; -#[doc = "< Normal*HalfVector"] -pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0; -#[doc = "< View*HalfVector"] -pub const GPU_LUTINPUT_VH: GPU_LIGHTLUTINPUT = 1; -#[doc = "< Normal*View"] -pub const GPU_LUTINPUT_NV: GPU_LIGHTLUTINPUT = 2; -#[doc = "< LightVector*Normal"] -pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3; -#[doc = "< -LightVector*SpotlightVector"] -pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4; -#[doc = "< cosine of phi"] -pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5; -#[doc = " LUT inputs."] -pub type GPU_LIGHTLUTINPUT = ::libc::c_uint; -#[doc = "< 1x scale."] -pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0; -#[doc = "< 2x scale."] -pub const GPU_LUTSCALER_2x: GPU_LIGHTLUTSCALER = 1; -#[doc = "< 4x scale."] -pub const GPU_LUTSCALER_4x: GPU_LIGHTLUTSCALER = 2; -#[doc = "< 8x scale."] -pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3; -#[doc = "< 0.25x scale."] -pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6; -#[doc = "< 0.5x scale."] -pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7; -#[doc = " LUT scalers."] -pub type GPU_LIGHTLUTSCALER = ::libc::c_uint; -#[doc = "< LUTs that are common to all lights."] -pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; -#[doc = "< Spotlight LUT."] -pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1; -#[doc = "< Distance attenuation LUT."] -pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2; -#[doc = " LUT selection."] -pub type GPU_LIGHTLUTSELECT = ::libc::c_uint; -#[doc = "< Fog/Gas unit disabled."] -pub const GPU_NO_FOG: GPU_FOGMODE = 0; -#[doc = "< Fog/Gas unit configured in Fog mode."] -pub const GPU_FOG: GPU_FOGMODE = 5; -#[doc = "< Fog/Gas unit configured in Gas mode."] -pub const GPU_GAS: GPU_FOGMODE = 7; -#[doc = " Fog modes."] -pub type GPU_FOGMODE = ::libc::c_uint; -#[doc = "< Plain density."] -pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0; -#[doc = "< Depth density."] -pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1; -#[doc = " Gas shading density source values."] -pub type GPU_GASMODE = ::libc::c_uint; -#[doc = "< Gas density used as input."] -pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0; -#[doc = "< Light factor used as input."] -pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1; -#[doc = " Gas color LUT inputs."] -pub type GPU_GASLUTINPUT = ::libc::c_uint; -#[doc = "< Triangles."] -pub const GPU_TRIANGLES: GPU_Primitive_t = 0; -#[doc = "< Triangle strip."] -pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256; -#[doc = "< Triangle fan."] -pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512; -#[doc = "< Geometry shader primitive."] -pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768; -#[doc = " Supported primitives."] -pub type GPU_Primitive_t = ::libc::c_uint; -#[doc = "< Vertex shader."] -pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0; -#[doc = "< Geometry shader."] -pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1; -#[doc = " Shader types."] -pub type GPU_SHADER_TYPE = ::libc::c_uint; +pub type _off_t = __int64_t; +pub type _fpos_t = __int64_t; +pub type wint_t = ::libc::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _mbstate_t { + pub __count: ::libc::c_int, + pub __value: _mbstate_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _mbstate_t__bindgen_ty_1 { + pub __wch: wint_t, + pub __wchb: [::libc::c_uchar; 4usize], +} +#[doc = " @brief Data callback"] +pub type decompressCallback = ::core::option::Option< + unsafe extern "C" fn( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize, +>; +pub type __ULong = ::libc::c_ulong; +pub type _flock_t = _LOCK_RECURSIVE_T; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __locale_t { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Bigint { + pub _next: *mut _Bigint, + pub _k: ::libc::c_int, + pub _maxwds: ::libc::c_int, + pub _sign: ::libc::c_int, + pub _wds: ::libc::c_int, + pub _x: [__ULong; 1usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __tm { + pub __tm_sec: ::libc::c_int, + pub __tm_min: ::libc::c_int, + pub __tm_hour: ::libc::c_int, + pub __tm_mday: ::libc::c_int, + pub __tm_mon: ::libc::c_int, + pub __tm_year: ::libc::c_int, + pub __tm_wday: ::libc::c_int, + pub __tm_yday: ::libc::c_int, + pub __tm_isdst: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _on_exit_args { + pub _fnargs: [*mut ::libc::c_void; 32usize], + pub _dso_handle: [*mut ::libc::c_void; 32usize], + pub _fntypes: __ULong, + pub _is_cxa: __ULong, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _atexit { + pub _next: *mut _atexit, + pub _ind: ::libc::c_int, + pub _fns: [::core::option::Option; 32usize], + pub _on_exit_args: _on_exit_args, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sbuf { + pub _base: *mut ::libc::c_uchar, + pub _size: ::libc::c_int, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __sFILE { + pub _p: *mut ::libc::c_uchar, + pub _r: ::libc::c_int, + pub _w: ::libc::c_int, + pub _flags: ::libc::c_short, + pub _file: ::libc::c_short, + pub _bf: __sbuf, + pub _lbfsize: ::libc::c_int, + pub _cookie: *mut ::libc::c_void, + pub _read: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: *mut ::libc::c_char, + arg4: ::libc::c_int, + ) -> ::libc::c_int, + >, + pub _write: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: *const ::libc::c_char, + arg4: ::libc::c_int, + ) -> ::libc::c_int, + >, + pub _seek: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: _fpos_t, + arg4: ::libc::c_int, + ) -> _fpos_t, + >, + pub _close: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut _reent, arg2: *mut ::libc::c_void) -> ::libc::c_int, + >, + pub _ub: __sbuf, + pub _up: *mut ::libc::c_uchar, + pub _ur: ::libc::c_int, + pub _ubuf: [::libc::c_uchar; 3usize], + pub _nbuf: [::libc::c_uchar; 1usize], + pub _lb: __sbuf, + pub _blksize: ::libc::c_int, + pub _offset: _off_t, + pub _data: *mut _reent, + pub _lock: _flock_t, + pub _mbstate: _mbstate_t, + pub _flags2: ::libc::c_int, +} +pub type __FILE = __sFILE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _glue { + pub _next: *mut _glue, + pub _niobs: ::libc::c_int, + pub _iobs: *mut __FILE, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _rand48 { + pub _seed: [::libc::c_ushort; 3usize], + pub _mult: [::libc::c_ushort; 3usize], + pub _add: ::libc::c_ushort, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _reent { + pub _errno: ::libc::c_int, + pub _stdin: *mut __FILE, + pub _stdout: *mut __FILE, + pub _stderr: *mut __FILE, + pub _inc: ::libc::c_int, + pub _emergency: [::libc::c_char; 25usize], + pub _unspecified_locale_info: ::libc::c_int, + pub _locale: *mut __locale_t, + pub __sdidinit: ::libc::c_int, + pub __cleanup: ::core::option::Option, + pub _result: *mut _Bigint, + pub _result_k: ::libc::c_int, + pub _p5s: *mut _Bigint, + pub _freelist: *mut *mut _Bigint, + pub _cvtlen: ::libc::c_int, + pub _cvtbuf: *mut ::libc::c_char, + pub _new: _reent__bindgen_ty_1, + pub _atexit: *mut _atexit, + pub _atexit0: _atexit, + pub _sig_func: *mut ::core::option::Option, + pub __sglue: _glue, + pub __sf: [__FILE; 3usize], + pub deviceData: *mut ::libc::c_void, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _reent__bindgen_ty_1 { + pub _reent: _reent__bindgen_ty_1__bindgen_ty_1, + pub _unused: _reent__bindgen_ty_1__bindgen_ty_2, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _reent__bindgen_ty_1__bindgen_ty_1 { + pub _unused_rand: ::libc::c_uint, + pub _strtok_last: *mut ::libc::c_char, + pub _asctime_buf: [::libc::c_char; 26usize], + pub _localtime_buf: __tm, + pub _gamma_signgam: ::libc::c_int, + pub _rand_next: ::libc::c_ulonglong, + pub _r48: _rand48, + pub _mblen_state: _mbstate_t, + pub _mbtowc_state: _mbstate_t, + pub _wctomb_state: _mbstate_t, + pub _l64a_buf: [::libc::c_char; 8usize], + pub _signal_buf: [::libc::c_char; 24usize], + pub _getdate_err: ::libc::c_int, + pub _mbrlen_state: _mbstate_t, + pub _mbrtowc_state: _mbstate_t, + pub _mbsrtowcs_state: _mbstate_t, + pub _wcrtomb_state: _mbstate_t, + pub _wcsrtombs_state: _mbstate_t, + pub _h_errno: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _reent__bindgen_ty_1__bindgen_ty_2 { + pub _nextf: [*mut ::libc::c_uchar; 30usize], + pub _nmalloc: [::libc::c_uint; 30usize], +} #[doc = "< Vertex shader."] pub const VERTEX_SHDR: DVLE_type = 0; #[doc = "< Geometry shader."] @@ -860,36 +430,6 @@ pub struct DVLE_s { #[doc = "< Output map attribute clock."] pub outmapClock: u32_, } -#[doc = " DVLB data."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DVLB_s { - #[doc = "< DVLE count."] - pub numDVLE: u32_, - #[doc = "< Primary DVLP."] - pub DVLP: DVLP_s, - #[doc = "< Contained DVLE."] - pub DVLE: *mut DVLE_s, -} -extern "C" { - #[doc = " @brief Parses a shader binary."] - #[doc = " @param shbinData Shader binary data."] - #[doc = " @param shbinSize Shader binary size."] - #[doc = " @return The parsed shader binary."] - pub fn DVLB_ParseFile(shbinData: *mut u32_, shbinSize: u32_) -> *mut DVLB_s; -} -extern "C" { - #[doc = " @brief Frees shader binary data."] - #[doc = " @param dvlb DVLB to free."] - pub fn DVLB_Free(dvlb: *mut DVLB_s); -} -#[doc = " 24-bit float uniforms."] -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Copy, Clone)] -pub struct float24Uniform_s { - pub _bindgen_opaque_blob: [u32; 4usize], -} #[doc = " Describes an instance of either a vertex or geometry shader."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -922,107 +462,6 @@ pub struct shaderProgram_s { #[doc = "< Geometry shader input stride."] pub geoShaderInputStride: u8_, } -extern "C" { - #[must_use] - #[doc = " @brief Initializes a shader instance."] - #[doc = " @param si Shader instance to initialize."] - #[doc = " @param dvle DVLE to initialize the shader instance with."] - pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Frees a shader instance."] - #[doc = " @param si Shader instance to free."] - pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Sets a bool uniform of a shader."] - #[doc = " @param si Shader instance to use."] - #[doc = " @param id ID of the bool uniform."] - #[doc = " @param value Value to set."] - pub fn shaderInstanceSetBool( - si: *mut shaderInstance_s, - id: ::libc::c_int, - value: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Gets a bool uniform of a shader."] - #[doc = " @param si Shader instance to use."] - #[doc = " @param id ID of the bool uniform."] - #[doc = " @param value Pointer to output the value to."] - pub fn shaderInstanceGetBool( - si: *mut shaderInstance_s, - id: ::libc::c_int, - value: *mut bool, - ) -> Result; -} -extern "C" { - #[doc = " @brief Gets the location of a shader's uniform."] - #[doc = " @param si Shader instance to use."] - #[doc = " @param name Name of the uniform."] - pub fn shaderInstanceGetUniformLocation( - si: *mut shaderInstance_s, - name: *const ::libc::c_char, - ) -> s8; -} -extern "C" { - #[must_use] - #[doc = " @brief Initializes a shader program."] - #[doc = " @param sp Shader program to initialize."] - pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Frees a shader program."] - #[doc = " @param sp Shader program to free."] - pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Sets the vertex shader of a shader program."] - #[doc = " @param sp Shader program to use."] - #[doc = " @param dvle Vertex shader to set."] - pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Sets the geometry shader of a shader program."] - #[doc = " @param sp Shader program to use."] - #[doc = " @param dvle Geometry shader to set."] - #[doc = " @param stride Input stride of the shader (pass 0 to match the number of outputs of the vertex shader)."] - pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Configures the permutation of the input attributes of the geometry shader of a shader program."] - #[doc = " @param sp Shader program to use."] - #[doc = " @param permutation Attribute permutation to use."] - pub fn shaderProgramSetGshInputPermutation( - sp: *mut shaderProgram_s, - permutation: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Configures the shader units to use the specified shader program."] - #[doc = " @param sp Shader program to use."] - #[doc = " @param sendVshCode When true, the vertex shader's code and operand descriptors are uploaded."] - #[doc = " @param sendGshCode When true, the geometry shader's code and operand descriptors are uploaded."] - pub fn shaderProgramConfigure( - sp: *mut shaderProgram_s, - sendVshCode: bool, - sendGshCode: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = " @brief Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards."] - #[doc = " @param sp Shader program to use."] - pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; -} pub type C3D_IVec = u32_; #[doc = " @struct C3D_FVec"] #[doc = " @brief Float vector"] @@ -1317,6 +756,99 @@ extern "C" { isLeftHanded: bool, ); } +extern "C" { + #[doc = " @brief Multiply two Quaternions"] + #[doc = " @param[in] lhs Multiplicand"] + #[doc = " @param[in] rhs Multiplier"] + #[doc = " @return lhs*rhs"] + pub fn Quat_Multiply(lhs: C3D_FQuat, rhs: C3D_FQuat) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief Raise Quaternion to a power"] + #[doc = " @note If p is 0, this returns the identity Quaternion."] + #[doc = " If p is 1, this returns q."] + #[doc = " @param[in] q Base Quaternion"] + #[doc = " @param[in] p Power"] + #[doc = " @return qp"] + pub fn Quat_Pow(q: C3D_FQuat, p: f32) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief Cross product of Quaternion and FVec3"] + #[doc = " @param[in] q Base Quaternion"] + #[doc = " @param[in] v Vector to cross"] + #[doc = " @return q×v"] + pub fn Quat_CrossFVec3(q: C3D_FQuat, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + #[doc = " @brief 3D Rotation"] + #[doc = " @param[in] q Quaternion to rotate"] + #[doc = " @param[in] axis Axis about which to rotate"] + #[doc = " @param[in] r Radians to rotate"] + #[doc = " @param[in] bRightSide Whether to transform from the right side"] + #[doc = " @return Rotated Quaternion"] + pub fn Quat_Rotate(q: C3D_FQuat, axis: C3D_FVec, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief 3D Rotation about the X axis"] + #[doc = " @param[in] q Quaternion to rotate"] + #[doc = " @param[in] r Radians to rotate"] + #[doc = " @param[in] bRightSide Whether to transform from the right side"] + #[doc = " @return Rotated Quaternion"] + pub fn Quat_RotateX(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief 3D Rotation about the Y axis"] + #[doc = " @param[in] q Quaternion to rotate"] + #[doc = " @param[in] r Radians to rotate"] + #[doc = " @param[in] bRightSide Whether to transform from the right side"] + #[doc = " @return Rotated Quaternion"] + pub fn Quat_RotateY(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief 3D Rotation about the Z axis"] + #[doc = " @param[in] q Quaternion to rotate"] + #[doc = " @param[in] r Radians to rotate"] + #[doc = " @param[in] bRightSide Whether to transform from the right side"] + #[doc = " @return Rotated Quaternion"] + pub fn Quat_RotateZ(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief Get Quaternion equivalent to 4x4 matrix"] + #[doc = " @note If the matrix is orthogonal or special orthogonal, where determinant(matrix) = +1.0f, then the matrix can be converted."] + #[doc = " @param[in] m Input Matrix"] + #[doc = " @return Generated Quaternion"] + pub fn Quat_FromMtx(m: *const C3D_Mtx) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief Converting Pitch, Yaw, and Roll to Quaternion equivalent"] + #[doc = " @param[in] pitch The pitch angle in radians."] + #[doc = " @param[in] yaw The yaw angle in radians."] + #[doc = " @param[in] roll The roll angle in radians."] + #[doc = " @param[in] bRightSide Whether to transform from the right side"] + #[doc = " @return C3D_FQuat The Quaternion equivalent with the pitch, yaw, and roll (in that order) orientations applied."] + pub fn Quat_FromPitchYawRoll(pitch: f32, yaw: f32, roll: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief Quaternion Look-At"] + #[doc = " @param[in] source C3D_FVec Starting position. Origin of rotation."] + #[doc = " @param[in] target C3D_FVec Target position to orient towards."] + #[doc = " @param[in] forwardVector C3D_FVec The Up vector."] + #[doc = " @param[in] upVector C3D_FVec The Up vector."] + #[doc = " @return Quaternion rotation."] + pub fn Quat_LookAt( + source: C3D_FVec, + target: C3D_FVec, + forwardVector: C3D_FVec, + upVector: C3D_FVec, + ) -> C3D_FQuat; +} +extern "C" { + #[doc = " @brief Quaternion, created from a given axis and angle in radians."] + #[doc = " @param[in] axis C3D_FVec The axis to rotate around at."] + #[doc = " @param[in] angle float The angle to rotate. Unit: Radians"] + #[doc = " @return Quaternion rotation based on the axis and angle. Axis doesn't have to be orthogonal."] + pub fn Quat_FromAxisAngle(axis: C3D_FVec, angle: f32) -> C3D_FQuat; +} #[repr(C)] #[derive(Copy, Clone)] pub struct C3D_MtxStack { @@ -1327,6 +859,26 @@ pub struct C3D_MtxStack { pub unifLen: u8_, pub isDirty: bool, } +extern "C" { + pub fn MtxStack_Init(stk: *mut C3D_MtxStack); +} +extern "C" { + pub fn MtxStack_Bind( + stk: *mut C3D_MtxStack, + unifType: GPU_SHADER_TYPE, + unifPos: ::libc::c_int, + unifLen: ::libc::c_int, + ); +} +extern "C" { + pub fn MtxStack_Push(stk: *mut C3D_MtxStack) -> *mut C3D_Mtx; +} +extern "C" { + pub fn MtxStack_Pop(stk: *mut C3D_MtxStack) -> *mut C3D_Mtx; +} +extern "C" { + pub fn MtxStack_Update(stk: *mut C3D_MtxStack); +} extern "C" { pub static mut C3D_FVUnif: [[C3D_FVec; 96usize]; 2usize]; } @@ -1410,7 +962,7 @@ pub const C3D_UNSIGNED_BYTE: _bindgen_ty_38 = 0; pub const C3D_UNSIGNED_SHORT: _bindgen_ty_38 = 1; pub type _bindgen_ty_38 = ::libc::c_uint; extern "C" { - pub fn C3D_Init(cmdBufSize: size_t) -> bool; + pub fn C3D_Init(cmdBufSize: usize) -> bool; } extern "C" { pub fn C3D_Fini(); @@ -1640,18 +1192,18 @@ impl C3D_Tex { } } #[inline] - pub fn size(&self) -> size_t { + pub fn size(&self) -> usize { unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u32) } } #[inline] - pub fn set_size(&mut self, val: size_t) { + pub fn set_size(&mut self, val: usize) { unsafe { let val: u32 = ::core::mem::transmute(val); self._bitfield_1.set(4usize, 28u8, val as u64) } } #[inline] - pub fn new_bitfield_1(fmt: GPU_TEXCOLOR, size: size_t) -> __BindgenBitfieldUnit<[u8; 4usize]> { + pub fn new_bitfield_1(fmt: GPU_TEXCOLOR, size: usize) -> __BindgenBitfieldUnit<[u8; 4usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 4u8, { let fmt: u32 = unsafe { ::core::mem::transmute(fmt) }; @@ -2154,9 +1706,20 @@ pub type C3D_ProcTexLut = [u32_; 128usize]; extern "C" { pub fn C3D_ProcTexLutBind(id: GPU_PROCTEX_LUTID, lut: *mut C3D_ProcTexLut); } +extern "C" { + pub fn ProcTexLut_FromArray(lut: *mut C3D_ProcTexLut, in_: *const f32); +} extern "C" { pub fn C3D_ProcTexColorLutBind(lut: *mut C3D_ProcTexColorLut); } +extern "C" { + pub fn ProcTexColorLut_Write( + out: *mut C3D_ProcTexColorLut, + in_: *const u32_, + offset: ::libc::c_int, + length: ::libc::c_int, + ); +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct C3D_LightLut { @@ -2172,6 +1735,27 @@ pub struct C3D_LightLutDA { pub type C3D_LightLutFunc = ::core::option::Option f32>; pub type C3D_LightLutFuncDA = ::core::option::Option f32>; +extern "C" { + pub fn LightLut_FromArray(lut: *mut C3D_LightLut, data: *mut f32); +} +extern "C" { + pub fn LightLut_FromFunc( + lut: *mut C3D_LightLut, + func: C3D_LightLutFunc, + param: f32, + negative: bool, + ); +} +extern "C" { + pub fn LightLutDA_Create( + lut: *mut C3D_LightLutDA, + func: C3D_LightLutFuncDA, + from: f32, + to: f32, + arg0: f32, + arg1: f32, + ); +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct C3D_Material { @@ -2199,6 +1783,10 @@ pub struct C3D_LightEnvConf { pub lutInput: C3D_LightLutInputConf, pub permutation: u32_, } +pub const C3DF_LightEnv_Dirty: _bindgen_ty_40 = 1; +pub const C3DF_LightEnv_MtlDirty: _bindgen_ty_40 = 2; +pub const C3DF_LightEnv_LCDirty: _bindgen_ty_40 = 4; +pub type _bindgen_ty_40 = ::libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct C3D_LightEnv_t { @@ -2230,6 +1818,11 @@ extern "C" { lut: *mut C3D_LightLut, ); } +pub const GPU_SHADOW_PRIMARY: _bindgen_ty_41 = 65536; +pub const GPU_SHADOW_SECONDARY: _bindgen_ty_41 = 131072; +pub const GPU_INVERT_SHADOW: _bindgen_ty_41 = 262144; +pub const GPU_SHADOW_ALPHA: _bindgen_ty_41 = 524288; +pub type _bindgen_ty_41 = ::libc::c_uint; extern "C" { pub fn C3D_LightEnvFresnel(env: *mut C3D_LightEnv, selector: GPU_FRESNELSEL); } @@ -2269,6 +1862,12 @@ pub struct C3D_LightConf { pub distAttnBias: u32_, pub distAttnScale: u32_, } +pub const C3DF_Light_Enabled: _bindgen_ty_42 = 1; +pub const C3DF_Light_Dirty: _bindgen_ty_42 = 2; +pub const C3DF_Light_MatDirty: _bindgen_ty_42 = 4; +pub const C3DF_Light_SPDirty: _bindgen_ty_42 = 16384; +pub const C3DF_Light_DADirty: _bindgen_ty_42 = 32768; +pub type _bindgen_ty_42 = ::libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct C3D_Light_t { @@ -2339,6 +1938,12 @@ pub struct C3D_GasLut { pub diff: [u32_; 8usize], pub color: [u32_; 8usize], } +extern "C" { + pub fn FogLut_FromArray(lut: *mut C3D_FogLut, data: *const f32); +} +extern "C" { + pub fn FogLut_Exp(lut: *mut C3D_FogLut, density: f32, gradient: f32, near: f32, far: f32); +} extern "C" { pub fn C3D_FogGasMode(fogMode: GPU_FOGMODE, gasMode: GPU_GASMODE, zFlip: bool); } @@ -2348,6 +1953,9 @@ extern "C" { extern "C" { pub fn C3D_FogLutBind(lut: *mut C3D_FogLut); } +extern "C" { + pub fn GasLut_FromArray(lut: *mut C3D_GasLut, data: *const u32_); +} extern "C" { pub fn C3D_GasBeginAcc(); } @@ -2581,3 +2189,122 @@ extern "C" { control1: u16_, ); } +pub type FILE = __FILE; +#[doc = " @brief Subtexture"] +#[doc = " @note If top > bottom, the subtexture is rotated 1/4 revolution counter-clockwise"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Tex3DS_SubTexture { + #[doc = "< Sub-texture width (pixels)"] + pub width: u16_, + #[doc = "< Sub-texture height (pixels)"] + pub height: u16_, + #[doc = "< Left u-coordinate"] + pub left: f32, + #[doc = "< Top v-coordinate"] + pub top: f32, + #[doc = "< Right u-coordinate"] + pub right: f32, + #[doc = "< Bottom v-coordinate"] + pub bottom: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Tex3DS_Texture_s { + _unused: [u8; 0], +} +#[doc = " @brief Texture"] +pub type Tex3DS_Texture = *mut Tex3DS_Texture_s; +extern "C" { + #[doc = " @brief Import Tex3DS texture"] + #[doc = " @param[in] input Input data"] + #[doc = " @param[in] insize Size of the input data"] + #[doc = " @param[out] tex citro3d texture"] + #[doc = " @param[out] texcube citro3d texcube"] + #[doc = " @param[in] vram Whether to store textures in VRAM"] + #[doc = " @returns Tex3DS texture"] + pub fn Tex3DS_TextureImport( + input: *const ::libc::c_void, + insize: usize, + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + ) -> Tex3DS_Texture; +} +extern "C" { + #[doc = " @brief Import Tex3DS texture"] + #[doc = ""] + #[doc = " @description"] + #[doc = " For example, use this if you want to import from a large file without"] + #[doc = " pulling the entire file into memory."] + #[doc = ""] + #[doc = " @param[out] tex citro3d texture"] + #[doc = " @param[out] texcube citro3d texcube"] + #[doc = " @param[in] vram Whether to store textures in VRAM"] + #[doc = " @param[in] callback Data callback"] + #[doc = " @param[in] userdata User data passed to callback"] + #[doc = " @returns Tex3DS texture"] + pub fn Tex3DS_TextureImportCallback( + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + ) -> Tex3DS_Texture; +} +extern "C" { + #[doc = " @brief Import Tex3DS texture"] + #[doc = ""] + #[doc = " Starts reading at the current file descriptor's offset. The file"] + #[doc = " descriptor's position is left at the end of the decoded data. On error, the"] + #[doc = " file descriptor's position is indeterminate."] + #[doc = ""] + #[doc = " @param[in] fd Open file descriptor"] + #[doc = " @param[out] tex citro3d texture"] + #[doc = " @param[out] texcube citro3d texcube"] + #[doc = " @param[in] vram Whether to store textures in VRAM"] + #[doc = " @returns Tex3DS texture"] + pub fn Tex3DS_TextureImportFD( + fd: ::libc::c_int, + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + ) -> Tex3DS_Texture; +} +extern "C" { + #[doc = " @brief Import Tex3DS texture"] + #[doc = ""] + #[doc = " Starts reading at the current file stream's offset. The file stream's"] + #[doc = " position is left at the end of the decoded data. On error, the file"] + #[doc = " stream's position is indeterminate."] + #[doc = ""] + #[doc = " @param[in] fp Open file stream"] + #[doc = " @param[out] tex citro3d texture"] + #[doc = " @param[out] texcube citro3d texcube"] + #[doc = " @param[in] vram Whether to store textures in VRAM"] + #[doc = " @returns Tex3DS texture"] + pub fn Tex3DS_TextureImportStdio( + fp: *mut FILE, + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + ) -> Tex3DS_Texture; +} +extern "C" { + #[doc = " @brief Get number of subtextures"] + #[doc = " @param[in] texture Tex3DS texture"] + #[doc = " @returns Number of subtextures"] + pub fn Tex3DS_GetNumSubTextures(texture: Tex3DS_Texture) -> usize; +} +extern "C" { + #[doc = " @brief Get subtexture"] + #[doc = " @param[in] texture Tex3DS texture"] + #[doc = " @param[in] index Subtexture index"] + #[doc = " @returns Subtexture info"] + pub fn Tex3DS_GetSubTexture(texture: Tex3DS_Texture, index: usize) -> *const Tex3DS_SubTexture; +} +extern "C" { + #[doc = " @brief Free Tex3DS texture"] + #[doc = " @param[in] texture Tex3DS texture to free"] + pub fn Tex3DS_TextureFree(texture: Tex3DS_Texture); +} diff --git a/citro3d-sys/src/gx.rs b/citro3d-sys/src/gx.rs index 9be28ed..2630208 100644 --- a/citro3d-sys/src/gx.rs +++ b/citro3d-sys/src/gx.rs @@ -1,6 +1,6 @@ //! Helper functions based on `<3ds/gpu/gx.h>`. -use crate::{GX_TRANSFER_FORMAT, GX_TRANSFER_SCALE}; +use ctru_sys::{GX_TRANSFER_FORMAT, GX_TRANSFER_SCALE}; #[inline] pub fn GX_TRANSFER_FLIP_VERT(flip: bool) -> u32 { diff --git a/citro3d-sys/src/texenv.rs b/citro3d-sys/src/texenv.rs index f52ffac..bcc599c 100644 --- a/citro3d-sys/src/texenv.rs +++ b/citro3d-sys/src/texenv.rs @@ -5,6 +5,7 @@ use core::ops::{BitOr, Shl}; +use ctru_sys::{GPU_COMBINEFUNC, GPU_PREVIOUS, GPU_REPLACE, GPU_TEVSCALE_1, GPU_TEVSRC}; use libc::c_int; use super::*; diff --git a/citro3d-sys/src/uniforms.rs b/citro3d-sys/src/uniforms.rs index b2df616..bfd6d83 100644 --- a/citro3d-sys/src/uniforms.rs +++ b/citro3d-sys/src/uniforms.rs @@ -1,6 +1,8 @@ //! Definitions from`` -use super::{C3D_FVUnif, C3D_FVUnifDirty, C3D_FVec, C3D_Mtx, GPU_SHADER_TYPE}; +use ctru_sys::GPU_SHADER_TYPE; + +use super::{C3D_FVUnif, C3D_FVUnifDirty, C3D_FVec, C3D_Mtx}; #[inline] pub unsafe fn C3D_FVUnifWritePtr(